@import url('style.css');

/* Ensure 3D canvas fills the background */
#canvas3d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    display: block;
}

body.view-3d {
    background: #111; /* Darker background to look like a courtyard night/dusk or library */
}
body.view-3d::before {
    display: none;
}

#hud {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

/* Base styles for Seven Wonders UI integration */
.hidden {
    display: none !important;
}

#main-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
}

#main-header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    margin: 0;
}

.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.message-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 20px 40px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    z-index: 100;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Modals */
.message-overlay, .rules-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-content, .rules-content {
    background: #2a2520;
    color: #f5f1e8;
    padding: 30px;
    border-radius: 8px;
    border: 2px solid #a39e93;
    max-width: 500px;
    width: 90%;
    text-align: center;
    font-family: 'Cinzel', serif;
    position: relative;
    z-index: 201;
}

.rules-content h2, .message-content h2 {
    color: #d4cfc4;
    margin-bottom: 20px;
    font-size: 2rem;
    letter-spacing: 2px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn, .action-btn {
    background: transparent;
    color: #d4cfc4;
    border: 1px solid #a39e93;
    padding: 10px 20px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn:hover, .action-btn:hover {
    background: #a39e93;
    color: #2a2520;
}

.action-btn.active {
    background: rgba(6, 182, 212, 0.4);
    color: #fff;
    border-color: #06b6d4;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.game-footer {
    position: fixed;
    bottom: 10px;
    width: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Side Menu Content */
.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background: rgba(10, 20, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid rgba(122, 156, 111, 0.2);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    padding: 40px 30px;
    color: #f5f1e8;
}

.side-menu.open {
    right: 0;
}

.menu-btn {
    background: transparent;
    border: 1px solid rgba(122, 156, 111, 0.3);
    color: #f5f1e8;
    padding: 12px;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
}

.menu-btn:hover {
    background: rgba(122, 156, 111, 0.15);
    border-color: #a39e93;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 1999;
    transition: all 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1500;
    pointer-events: none;
}

.top-bar-btn {
    pointer-events: auto;
    background: rgba(10, 20, 10, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(122, 156, 111, 0.2);
    color: #f5f1e8;
    padding: 8px 15px;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.menu-toggle-btn {
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.menu-toggle-btn span {
    width: 24px;
    height: 2px;
    background: #f5f1e8;
    transition: all 0.3s;
}

/* Dropdown styling */
.players-dropdown, .opp-dropdown {
    position: relative;
}

.players-menu, .opp-menu {
    display: none;
    position: absolute;
    right: calc(100% + 10px);
    top: 0;
    width: 200px;
    background: rgba(10, 20, 10, 0.95);
    border: 1px solid rgba(122, 156, 111, 0.3);
    border-radius: 4px;
    box-shadow: -5px 5px 15px rgba(0,0,0,0.5);
    z-index: 2001;
}

.players-menu.show-flyout, .opp-menu.show-flyout {
    display: flex !important;
    flex-direction: column;
}

.menu-btn-sub {
    background: transparent;
    color: #d4cfc4;
    border: none;
    border-bottom: 1px solid rgba(122, 156, 111, 0.3);
    padding: 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.menu-btn-sub:last-child {
    border-bottom: none;
}

.menu-btn-sub:hover {
    background: rgba(122, 156, 111, 0.2);
    color: white;
}

.menu-btn-sub.active {
    background: rgba(122, 156, 111, 0.4);
    color: white;
}
