* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000000;
    color: white;
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
}

#nexus-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    display: block;
}

.content {
    margin: 100px auto;
    max-width: 600px;
}

/* --- Glassmorphism Navbar --- */
.glass-nav {
    position: fixed;
    top: 2.5vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    opacity: 0;
    animation: navFadeIn 1s ease 0.5s forwards;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

@keyframes navFadeIn {
    to {
        opacity: 1;
    }
}

.glass-nav .nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 40px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition:
        color 0.3s ease,
        background 0.35s ease,
        padding 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.35s ease;
    cursor: pointer;
    position: relative;
}

.glass-nav .nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: filter 0.3s ease;
}

.glass-nav .nav-label {
    font-family: 'Figma Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85em;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0.7;
    transition:
        opacity 0.25s ease;
}

/* Active state — green pill highlight */
.glass-nav .nav-item.active {
    color: rgba(0, 255, 80, 0.9);
    background: rgba(0, 255, 80, 0.08);
    border: 1px solid rgba(0, 255, 80, 0.15);
    box-shadow:
        0 0 12px rgba(0, 255, 80, 0.1),
        inset 0 0 8px rgba(0, 255, 80, 0.04);
}

.glass-nav .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 4px rgba(0, 255, 80, 0.4));
}

.glass-nav .nav-item.active .nav-label {
    font-weight: 700;
    opacity: 1;
}

/* Hover for inactive items */
.glass-nav .nav-item:not(.active):hover {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.06);
}

.glass-nav .nav-item:not(.active):hover .nav-icon {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.15));
}

/* Responsive — mobile: Apple Liquid Glass style bottom tab bar */
@media (max-width: 768px) {
    .glass-nav {
        top: auto;
        bottom: 1.5vh;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 24px);
        max-width: 480px;
        justify-content: space-around;
        padding: 8px 6px 6px;
        gap: 0;
    }

    /* Tab-bar items: vertical icon + label, 44pt+ touch targets */
    .glass-nav .nav-item {
        flex-direction: column;
        align-items: center;
        gap: 3px !important;
        padding: 8px 10px 6px !important;
        border-radius: 16px;
        flex: 1;
        min-width: 0;
    }

    .glass-nav .nav-item.active {
        padding: 8px 10px 6px !important;
    }

    .glass-nav .nav-icon {
        width: 26px;
        height: 26px;
    }

    /* Labels always visible on mobile — 10px minimum for legibility */
    .glass-nav .nav-label:not(.score-label) {
        display: block !important;
        max-width: none !important;
        opacity: 0.55 !important;
        font-size: 10px !important;
        font-weight: 500;
        letter-spacing: 0.01em;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Active label is brighter */
    .glass-nav .nav-item.active .nav-label {
        opacity: 1 !important;
    }
}

/* --- Games Nav Item & Dropdown --- */
.nav-games {
    position: relative;
    cursor: pointer;
}

.nav-games .stop-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 60, 60, 0.15);
    color: rgba(255, 60, 60, 0.8);
    margin-left: 4px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-games .stop-btn:hover {
    background: rgba(255, 60, 60, 0.3);
    color: rgba(255, 100, 100, 1);
}

.game-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.25s ease,
        transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 30;
    min-width: 120px;
}

.nav-games.dropdown-open .game-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.game-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-family: 'Figma Sans', sans-serif;
    font-weight: 700;
    font-size: 0.85em;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.game-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.game-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Playing State: Games nav item morphs to show score --- */
.nav-games.playing .game-label {
    display: none !important;
}

.nav-games.playing .score-label {
    display: inline !important;
    max-width: 80px !important;
    opacity: 1 !important;
    font-family: 'Figma Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.nav-games.playing .stop-btn {
    display: flex !important;
}

.nav-games.playing .game-dropdown {
    display: none;
}

/* Playing state green glow on the Games item */
.nav-games.playing {
    color: rgba(0, 255, 80, 0.9) !important;
    background: rgba(0, 255, 80, 0.08) !important;
    border: 1px solid rgba(0, 255, 80, 0.15) !important;
    gap: 8px !important;
    padding: 10px 14px !important;
}

/* Tron playing state — cyan glow */
.nav-games.playing.tron-playing {
    color: rgba(0, 255, 255, 0.9) !important;
    background: rgba(0, 255, 255, 0.08) !important;
    border: 1px solid rgba(0, 255, 255, 0.15) !important;
}

/* Hidden game-hud (legacy, kept for JS compatibility) */
#game-hud {
    display: none;
}

/* --- Author Credit (Bottom Right, standalone) --- */
.author-credit {
    position: fixed;
    bottom: 4.5vh;
    right: 4vw;
    z-index: 10;
    font-family: 'Figma Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(14px, 1.5vw, 18px);
    letter-spacing: 0.1em;
    color: rgba(203, 212, 206, 0.8);
    text-shadow: 0 0 8px rgba(198, 209, 202, 0.3);
    pointer-events: none;
    opacity: 0;
    animation: navFadeIn 1s ease 0.5s forwards;
}

@media (max-width: 768px) {
    .author-credit {
        display: none;
    }
}

/* --- Mobile: game dropdown opens upward (must be after base .game-dropdown rules) --- */
@media (max-width: 768px) {
    .game-dropdown {
        top: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%) translateY(-8px);
    }

    .nav-games.dropdown-open .game-dropdown {
        transform: translateX(-50%) translateY(0);
    }
}