:root {
    --bg-color: #080b12;
    --card-bg: #161f30;
    --primary: #6366f1;
    --accent: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: radial-gradient(circle at top, #1e1b4b, var(--bg-color));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5.5rem !important;
    padding-bottom: 7.5rem !important;
    padding-left: 1rem;
    padding-right: 1rem;
    overflow-x: hidden;
}

/* Floating Frosted Centered Header */
.floating-header {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 960px;
    height: 64px;
    background: rgba(22, 31, 48, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 0 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Responsive Dropdown Menu Styles */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #38bdf8;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: transform 0.2s ease;
}

.menu-toggle:active {
    transform: scale(0.9);
}

/* Activate Dropdown on screens smaller than 850px */
@media (max-width: 850px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 110%;
        right: 1rem;
        background: rgba(15, 23, 42, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.2rem;
        border-radius: 14px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
        gap: 1rem;
        z-index: 100;
        min-width: 180px;
    }

    .nav-links.show {
        display: flex !important;
        animation: dropDownAnim 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .nav-links a, .nav-links button {
        width: 100%;
        text-align: left;
    }

    @keyframes dropDownAnim {
        from { opacity: 0; transform: translateY(-15px) scale(0.95); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
}

/* Floating Frosted Footer */
.floating-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 64px;
    background: rgba(8, 11, 18, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #94a3b8;
    padding: 0.5rem 1.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-logo-img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #38bdf8;
}

/* Games Grid & Cards */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 960px;
    margin-top: 1.5rem;
}

.game-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3);
}

.game-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    transition: transform 0.4s ease;
}

.game-card:hover .game-icon {
    transform: scale(1.15) rotate(5deg);
}

.game-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.game-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.badge-play {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.game-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.7);
}

.game-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.08);
}

.badge-locked {
    background: #334155;
    color: var(--text-muted);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
}

/* Modal for Player Names / Roster */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
}

.modal-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 1.5rem 1.8rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: zoomIn 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
}

.btn-secondary {
    background: #334155;
    color: #cbd5e1;
}

/* Setup Card */
.setup-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 2rem 1.8rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    margin: 1rem auto;
    width: 100%;
}

.setup-card.hidden {
    display: none !important;
}

/* Action Buttons */
.btn-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-action:active {
    transform: translateY(0);
}

/* Most Likely To Custom Card Scaffolding */
.mostlikely-container {
    width: 100%;
    max-width: 680px;
    margin: 1rem auto;
    animation: zoomIn 0.3s ease;
}

.mostlikely-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    margin: 1.5rem 0;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(245, 158, 11, 0.08);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.mostlikely-card:hover {
    border-color: rgba(245, 158, 11, 0.7);
}

.mostlikely-card::before {
    content: '👑';
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 5rem;
    opacity: 0.06;
    pointer-events: none;
}

.mostlikely-cue {
    font-size: 0.85rem;
    color: #fbbf24;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.mostlikely-text {
    font-size: 1.75rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Trivia Arena Scaffolding */
.trivia-container {
    width: 100%;
    max-width: 680px;
    margin: 1rem auto;
    animation: zoomIn 0.3s ease;
}

.trivia-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid rgba(56, 189, 248, 0.4);
    border-radius: 24px;
    padding: 2.2rem 1.8rem;
    margin: 1.2rem 0;
    min-height: 220px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(56, 189, 248, 0.05);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
    .mostlikely-text {
        font-size: 1.35rem;
    }
}

.opt-btn {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.opt-btn:hover:not(:disabled) {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    transform: translateY(-2px);
}

.opt-btn:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.opt-btn.correct {
    background: #16a34a !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.opt-btn.wrong {
    background: #dc2626 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

#scores-strip {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* =========================================================
   GLOBAL PAGE TRANSITION OVERLAY
   ========================================================= */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 11, 18, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    pointer-events: auto;
}

.transition-logo {
    width: min(320px, 75vw);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.8));
}

/* 1. When entering new page: starts in center, glides down off-screen */
.page-transition-overlay.anim-enter {
    animation: fadeOverlayOut 0.8s 0.3s forwards ease-in-out;
}

.page-transition-overlay.anim-enter .transition-logo {
    animation: pullDownExit 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* 2. When leaving page: pulls up from bottom to center */
.page-transition-overlay.anim-leave {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.page-transition-overlay.anim-leave .transition-logo {
    animation: pullUpToCenter 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Keyframes */
@keyframes pullUpToCenter {
    0% {
        transform: translateY(110vh) scale(0.9);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes pullDownExit {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    30% {
        transform: translateY(-20px) scale(1.04);
        opacity: 1;
    }
    100% {
        transform: translateY(115vh) scale(0.9);
        opacity: 0;
    }
}

@keyframes fadeOverlayOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}