@import url('style.css');

/* Fullscreen game body — override the flex-centered menu body from style.css
   so the 3D view fills the viewport edge-to-edge with no negative space. */
html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    display: block;
}

/* 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;
}

/* ============================================================
   Standard Seven Wonders side-menu format — overrides the
   game-specific styling so Library's menu matches the other games.
   ============================================================ */
.side-menu {
    background: linear-gradient(180deg, rgba(42, 37, 32, 0.97) 0%, rgba(20, 16, 12, 0.98) 100%);
    border-left: 2px solid #C5A059;
    padding: 74px 26px 30px;
}
.menu-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    overflow-y: auto;
}
.game-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    text-align: center;
    color: #C5A059;
    letter-spacing: 0.14em;
    margin: 0 0 2px;
    text-shadow: 0 2px 12px rgba(197, 160, 89, 0.3);
}
.game-subtitle {
    text-align: center;
    margin: -8px 0 0;
    opacity: 0.7;
    color: #d4cfc4;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
}
.player-info { text-align: center; }
.current-player-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 13px 18px;
    background: rgba(197, 160, 89, 0.1);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 8px;
}
.player-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #C5A059;
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    flex: 0 0 auto;
    transition: background-color 0.3s;
}
#player-name {
    font-family: 'Cinzel', serif;
    font-size: 1.02rem;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: #f5f1e8;
}
.menu-divider {
    height: 1px;
    border: 0;
    background: linear-gradient(90deg, transparent, #C5A059, transparent);
    opacity: 0.35;
    margin: 2px 0;
}
.menu-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    padding: 13px 20px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.2), rgba(197, 160, 89, 0.1));
    border: 1px solid #C5A059;
    color: #f5f1e8;
    cursor: pointer;
    transition: all 0.25s;
    border-radius: 8px;
    letter-spacing: 0.05em;
    font-weight: 700;
    text-transform: none;
    width: 100%;
    text-align: center;
    margin: 0;
}
.menu-btn:hover {
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.35), rgba(197, 160, 89, 0.2));
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(197, 160, 89, 0.2);
    border-color: #C5A059;
}
.menu-footer {
    margin-top: auto;
    padding-top: 14px;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 0.68rem;
    color: #a39e93;
    letter-spacing: 1.5px;
}
.menu-footer p { margin: 2px 0; }
