/* Base Styles and Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}


*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}


:root {
    --primary-color: #2b87da;
    --secondary-color: #1e5a8e;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --dark-bg: #1a1a2e;
    --card-bg: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --border-color: #2d3748;
}

html {
    overflow-y: scroll;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 100px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

main.container,
main {
    min-height: calc(100vh - 200px);
}

/* Pages with SEO content below don't need min-height pushing content down */
body.has-seo-content main.container,
body.has-seo-content main {
    min-height: auto;
    padding-bottom: 0;
}

/* Loading and Messages */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.message {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.message.success {
    background-color: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.message.error {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Cookie-script badge - hide until moved into footer by JS */
#cookiescript_badge,
#CookieScriptBadge {
    display: none !important;
}

.footer-bottom #cookiescript_badge,
.footer-bottom #CookieScriptBadge {
    display: inline-block !important;
    position: absolute !important;
    left: 2rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    float: none !important;
    margin: 0 !important;
}
/* Navigation */
.navbar {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    background-color: rgba(22, 33, 62, 0.95);
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo a {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
}

.username {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

/* Dropdown styles */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 1rem;
}

.dropdown-toggle:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    min-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 1002;
    overflow: hidden;
}

.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.dropdown-item-active {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    pointer-events: none;
    opacity: 0.7;
}

.dropdown-item-active .dropdown-title {
    color: var(--primary-color);
}

.dropdown-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
}

.dropdown-content {
    flex: 1;
}

.dropdown-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.dropdown-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Nav right section */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* Default avatar */
.default-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a6fbf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    user-select: none;
    position: relative;
}

.default-avatar:hover {
    box-shadow: 0 0 12px rgba(43, 135, 218, 0.5);
    transform: scale(1.05);
}

.default-avatar.avatar-large {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
    cursor: default;
}

.default-avatar.avatar-large:hover {
    transform: none;
    box-shadow: none;
}

/* Avatar dropdown */
.avatar-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.avatar-dropdown .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 220px;
}

.avatar-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-username {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.dropdown-icon-sm {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.08);
    margin: 0;
}

.dropdown-logout:hover {
    color: var(--danger-color);
}

/* Avatar status dot */
.avatar-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary, #0f1724);
    z-index: 1;
}

.avatar-status-dot.status-online,
.status-indicator.status-online {
    background: var(--success-color, #22c55e);
}

.avatar-status-dot.status-away,
.status-indicator.status-away {
    background: #f59e0b;
}

.avatar-status-dot.status-offline,
.status-indicator.status-offline {
    background: #666;
}

/* Status selector in dropdown */
.status-selector {
    display: flex;
    gap: 2px;
    padding: 0.5rem 0.75rem;
}

.status-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.status-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.status-option.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Burger menu button - hidden on desktop */
.nav-top-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Mobile: show sound toggle next to burger; Desktop: hide it (desktop one is in nav-right) */
.nav-top-right .sound-toggle-btn {
    display: none;
}

/* Desktop: show sound toggle in nav-right; hide on mobile */
.sound-toggle-desktop {
    display: flex;
}

@media (max-width: 1280px) {
    .nav-top-right .sound-toggle-btn {
        display: flex;
    }
    .sound-toggle-desktop {
        display: none !important;
    }
}

.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1003;
}

.burger-line {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: var(--text-primary, #fff);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.burger-btn.active .burger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.burger-btn.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-btn.active .burger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

.nav-overlay {
    display: none;
}

body.nav-open {
    overflow: hidden;
    touch-action: none;
}
html.nav-open {
    overflow: hidden;
}

@media (max-width: 1280px) {
    .burger-btn {
        display: flex;
    }

    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background-color: var(--card-bg);
        border-left: 2px solid var(--border-color);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        flex: none;
        padding: 5rem 1.5rem 2rem;
        gap: 0.25rem;
        z-index: 1002;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
        will-change: transform;
    }

    .nav-links.mobile-open {
        transform: translateX(0);
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1.05rem;
        border-radius: 8px;
        width: 100%;
    }

    .nav-right {
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: transparent;
        z-index: 1001;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-overlay.active {
        display: block;
    }

    .avatar-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 1px solid var(--border-color);
        margin-top: 0.5rem;
        min-width: auto;
        display: block;
    }

    .avatar-dropdown .avatar-toggle {
        display: none;
    }

    .nav-dropdown .dropdown-menu {
        position: static;
        min-width: auto;
        box-shadow: none;
        border: 1px solid var(--border-color);
        margin-top: 0.5rem;
    }
}

/* ===== Play Dropdown ===== */
/* Desktop nav links: centered between logo and nav-right */
.desktop-nav-links-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.desktop-nav-link {
    display: inline-flex;
    align-items: center;
}

/* Mobile nav links: show individual links on mobile */
.mobile-nav-link {
    display: none;
}

.mobile-nav-icon {
    vertical-align: -3px;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

@media (max-width: 1280px) {
    .desktop-nav-links-center {
        display: none !important;
    }

    .mobile-nav-link {
        display: flex;
        align-items: center;
    }
}

/* ===== Daily Quests (navbar) ===== */
.quest-nav-wrap {
    position: relative;
}

.sound-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.sound-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.quest-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-color, #e2e8f0);
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: 500;
}

.quest-nav-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.quest-btn-label {
    font-weight: 500;
    white-space: nowrap;
}

.quest-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    padding: 0.15rem 0.5rem;
    line-height: 1.3;
}

.quest-badge-all-done {
    background: var(--primary-color);
}

/* Quest dropdown */
.quest-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 320px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 1002;
    overflow: hidden;
}

.quest-nav-wrap.quest-open .quest-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quest-dd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quest-dd-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.quest-dd-timer {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.quest-dd-item {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.quest-dd-item:last-child {
    border-bottom: none;
}

.quest-dd-item.quest-done {
    opacity: 0.6;
}

.quest-dd-cat {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.quest-dd-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.quest-dd-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quest-dd-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.quest-dd-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.5s ease;
}

.quest-dd-bar-fill.quest-bar-done {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.quest-dd-progress {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quest-dd-xp {
    font-size: 0.65rem;
    font-weight: 700;
    color: #a78bfa;
    white-space: nowrap;
}

.quest-dd-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.quest-dd-info {
    flex: 1;
    min-width: 0;
}

.quest-dd-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    font-size: 0.7rem;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.quest-dd-play:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    transform: scale(1.1);
}

/* Quest toast animation */
@keyframes questToastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Mobile quest adjustments */
@media (max-width: 1280px) {
    .quest-dropdown {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        transform: none;
        box-shadow: none;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.3s ease, max-height 0.3s ease, visibility 0.3s;
    }

    .quest-nav-wrap.quest-open .quest-dropdown {
        opacity: 1;
        visibility: visible;
        max-height: 340px;
        overflow-y: auto;
        transform: none;
    }

    .quest-nav-btn {
        justify-content: center;
    }
}
/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn-primary {
    background-color: #1e6bb8;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #444;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0 1rem;
    margin-bottom: 1rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Mode Panels */
.mode-panels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.mode-panel {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.mode-panel:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.mode-panel-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.mode-panel h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.mode-panel p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Split panel (Unranked + Practice in one column) */
.mode-panel-split {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mode-panel-half {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.mode-panel-half:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.mode-panel-half .mode-panel-icon {
    font-size: 2rem;
    margin-bottom: 0.4rem;
}

.mode-panel-half h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.mode-panel-half p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.unranked-half:hover {
    border-color: #f59e0b;
}

.practice-half:hover {
    border-color: var(--primary-color);
}

.practice-panel:hover {
    border-color: var(--primary-color);
    box-shadow: 0 12px 40px rgba(43, 135, 218, 0.25);
}

.ranked-panel:hover {
    border-color: #f59e0b;
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.25);
}

.party-panel:hover {
    border-color: #a855f7;
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.25);
}

.tournament-panel:hover {
    border-color: #22c55e;
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.25);
}

/* Games Grid Header */
.games-grid-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.games-grid-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
}

.games-grid-cards {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(43, 135, 218, 0.3);
    text-decoration: none;
    color: inherit;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.game-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
}

.game-stats {
    margin-top: auto;
    padding: 0.5rem;
    background-color: rgba(43, 135, 218, 0.1);
    border-radius: 6px;
}

.best-score {
    color: var(--primary-color);
    font-weight: bold;
}

/* Forms */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input {
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.error-message {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--danger-color);
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Practice/Ranked Header */
.practice-header {
    text-align: center;
    margin-bottom: 2rem;
}

.practice-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.practice-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Tournament Mini Overlay (bottom-left) */
#tournament-mini-overlay {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    min-width: 240px;
    max-width: 300px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: tmo-slide-in 0.3s ease;
}

@keyframes tmo-slide-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#tournament-mini-overlay .tmo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#tournament-mini-overlay .tmo-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#tournament-mini-overlay .tmo-status {
    font-size: 0.75rem;
    font-weight: 600;
}

#tournament-mini-overlay .tmo-status.waiting {
    color: #f59e0b;
}

#tournament-mini-overlay .tmo-status.in_progress {
    color: var(--success-color);
}

#tournament-mini-overlay .tmo-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tournament-mini-overlay .tmo-players {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

#tournament-mini-overlay .tmo-actions {
    display: flex;
    gap: 0.5rem;
}

#tournament-mini-overlay .tmo-view-btn {
    flex: 1;
    padding: 0.4rem 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#tournament-mini-overlay .tmo-view-btn:hover {
    opacity: 0.85;
}

#tournament-mini-overlay .tmo-leave-btn {
    flex: 1;
    padding: 0.4rem 0;
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#tournament-mini-overlay .tmo-leave-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Lockdown mode - disable all interactive elements except avatar dropdown and logout */
body.tournament-lockdown a,
body.tournament-lockdown button,
body.tournament-lockdown input,
body.tournament-lockdown select,
body.tournament-lockdown textarea {
    pointer-events: none !important;
    opacity: 0.4 !important;
    user-select: none !important;
}

/* Keep avatar dropdown and logout clickable */
body.tournament-lockdown .avatar-dropdown,
body.tournament-lockdown .avatar-dropdown *,
body.tournament-lockdown #nav-logout,
body.tournament-lockdown #nav-logout * {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Cross-platform badge */
.cross-platform-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    margin-left: 12px;
    vertical-align: middle;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: opacity 0.15s;
}
.cross-platform-badge:hover {
    opacity: 0.8;
}
.cross-platform-badge.cp-on {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.cross-platform-badge.cp-off {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Platform Stats */
.platform-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Site Footer */
.site-footer {
    background: #111827;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 0 0;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.footer-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Legal Pages (Privacy, Terms) */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
}

.legal-page h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.legal-updated {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.legal-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-section ul {
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-section li {
    margin-bottom: 0.4rem;
}

.legal-section a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-section a:hover {
    text-decoration: underline;
}

.legal-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    overflow-x: auto;
    display: block;
}

.legal-table thead th {
    background: var(--bg-secondary, rgba(255,255,255,0.05));
    color: var(--text-primary);
    font-weight: 700;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border-color, rgba(255,255,255,0.1));
    white-space: nowrap;
}

.legal-table tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.07));
    vertical-align: top;
    line-height: 1.5;
}

.legal-table tbody tr:last-child td {
    border-bottom: none;
}

.legal-table code {
    background: var(--bg-secondary, rgba(255,255,255,0.08));
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-family: monospace;
}

/* About Page */
.about-page {
    max-width: 900px;
    margin: 0 auto;
}

.about-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.about-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.about-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.about-feature {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.about-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.about-feature h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.about-feature p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0;
}

.about-cta {
    text-align: center;
    padding: 2.5rem 0;
}

.about-cta h2 {
    font-size: 1.8rem;
    margin-bottom: 1.25rem;
}

.about-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Contact Page */
.contact-page {
    max-width: 900px;
    margin: 0 auto;
}

.contact-page h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.contact-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.contact-card:hover {
    border-color: var(--primary-color);
}

.contact-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.contact-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.contact-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.contact-link:hover {
    text-decoration: underline;
}

.contact-faq {
    margin-top: 2rem;
}

.contact-faq h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.faq-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.faq-item a:hover {
    text-decoration: underline;
}

/* Blog */
.blog-page { max-width: 900px; margin: 0 auto; padding: 2rem 0 3rem; }
.blog-hero { text-align: center; margin-bottom: 2.5rem; }
.blog-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.blog-hero-sub { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.6; max-width: 600px; margin: 0 auto; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.blog-card { display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; padding: 1.5rem; text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,0.15); }
.blog-card-category { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-color); margin-bottom: 0.5rem; }
.blog-card-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.5rem; line-height: 1.35; }
.blog-card-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; flex: 1; margin: 0 0 0.75rem; }
.blog-card-meta { display: flex; gap: 0.4rem; font-size: 0.8rem; color: var(--text-secondary); }

/* Blog Post */
.blog-post { max-width: 780px; margin: 0 auto; padding: 2rem 0 1rem; }
.blog-post-header { margin-bottom: 2rem; }
.blog-back { display: inline-block; color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; transition: color 0.2s; }
.blog-back:hover { color: var(--text-primary); }
.blog-post-header h1 { font-size: 2rem; font-weight: 800; line-height: 1.25; margin: 0.5rem 0 0.75rem; }
.blog-post-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.85rem; color: var(--text-secondary); }
.blog-post-body { line-height: 1.8; font-size: 1rem; color: var(--text-secondary); }
.blog-post-body h2 { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin: 2rem 0 0.75rem; }
.blog-post-body h3 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin: 1.5rem 0 0.5rem; }
.blog-post-body p { margin-bottom: 1rem; }
.blog-post-body a { color: var(--primary-color); text-decoration: none; }
.blog-post-body a:hover { text-decoration: underline; }
.blog-post-body ul, .blog-post-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.blog-post-body li { margin-bottom: 0.35rem; }
.blog-faq { margin-top: 2.5rem; }
.blog-faq h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; }
.blog-cta { margin-top: 2rem; padding: 1.5rem; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; }
.blog-cta h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.5rem; }
.blog-cta p { color: var(--text-secondary); margin: 0; }
.blog-cta a { color: var(--primary-color); font-weight: 600; text-decoration: none; }
.blog-cta a:hover { text-decoration: underline; }
.blog-related { max-width: 900px; margin: 2.5rem auto 3rem; }
.blog-related h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; }

@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-post-header h1 { font-size: 1.5rem; }
}
/* Friends Panel - Bottom Right */
.friends-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a6fbf 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2000;
    box-shadow: 0 4px 16px rgba(43, 135, 218, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.friends-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(43, 135, 218, 0.6);
}

.friends-toggle-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Friends Panel */
.friends-panel {
    position: fixed;
    bottom: 86px;
    right: 20px;
    width: 340px;
    max-height: 520px;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.friends-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.friends-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.03);
}

.friends-panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.friends-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.friends-panel-close:hover {
    color: var(--text-primary);
}

/* Panel Tabs */
.friends-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.friends-panel-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.friends-panel-tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
}

.friends-panel-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.friends-panel-tab .tab-badge {
    background: var(--danger-color);
    color: white;
    border-radius: 8px;
    padding: 1px 6px;
    font-size: 0.7rem;
    margin-left: 4px;
    font-weight: 700;
}

/* Panel Body */
.friends-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
    max-height: 280px;
}

/* Add Friend Section */
.friends-add-section {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.friends-add-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.friends-add-input:focus {
    border-color: var(--primary-color);
}

.friends-add-input::placeholder {
    color: var(--text-secondary);
}

.friends-add-btn {
    padding: 8px 14px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.friends-add-btn:hover {
    background: #2478c5;
}

/* Friend Item */
.friend-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s ease;
}

.friend-item:hover {
    background: rgba(255,255,255,0.05);
}

.friend-item:active {
    background: rgba(255,255,255,0.08);
}

.friend-actions {
    -webkit-tap-highlight-color: transparent;
}

.friend-action-btn:active ~ .friend-item,
.friend-actions:active {
    background: none;
}

.friend-item:last-child {
    border-bottom: none;
}

.friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a6fbf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    position: relative;
}

.friend-avatar .online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success-color);
    border: 2px solid var(--card-bg);
}

.friend-avatar .offline-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    border: 2px solid var(--card-bg);
}

.friend-avatar .away-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    border: 2px solid var(--card-bg);
}

.friend-status.away {
    color: #f59e0b;
}

.friend-info {
    flex: 1;
    margin-left: 10px;
    min-width: 0;
}

.friend-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.friend-status.online {
    color: var(--success-color);
}

.friend-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.friend-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.friend-action-btn:hover {
    background: rgba(255,255,255,0.15);
    color: var(--text-primary);
}

.friend-action-btn.danger:hover {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

.friend-action-btn.accept {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success-color);
}

.friend-action-btn.accept:hover {
    background: rgba(40, 167, 69, 0.3);
}

.friend-unread-badge {
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 2px 7px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 6px;
}

/* Empty state */
.friends-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.friends-empty span {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

/* Chat Window */
.friends-chat {
    position: fixed;
    bottom: 86px;
    right: 370px;
    width: 320px;
    max-height: 420px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    z-index: 2001;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.friends-chat.open {
    display: flex;
}

.friends-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.03);
}

.friends-chat-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.friends-chat-header-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.friends-chat-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}

.friends-chat-close:hover {
    color: var(--text-primary);
}

.friends-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 250px;
    max-height: 320px;
}

.chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-bubble .chat-time {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 2px;
    display: block;
}

.friends-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
}

.friends-chat-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.friends-chat-input:focus {
    border-color: var(--primary-color);
}

.friends-chat-input::placeholder {
    color: var(--text-secondary);
}

.friends-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.friends-chat-send:hover {
    background: #2478c5;
}

/* Friend context menu */
.friend-context-menu {
    position: fixed;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    min-width: 160px;
    z-index: 3000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
}

.friend-context-menu.show {
    display: block;
}

.ctx-icon {
    display: inline-flex;
    width: 20px;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.friend-context-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.friend-context-item:hover {
    background: rgba(255,255,255,0.08);
}

.friend-context-item.danger {
    color: var(--danger-color);
}

.friend-context-item.danger:hover {
    background: rgba(220, 53, 69, 0.15);
}

.friend-context-item.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Request item styling */
.request-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.request-item .friend-info {
    flex: 1;
    margin-left: 10px;
}

.request-actions {
    display: flex;
    gap: 4px;
}

/* Toast notification for friends */
.friend-toast {
    position: fixed;
    bottom: 90px;
    left: 20px;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 12px 18px;
    color: var(--text-primary);
    z-index: 3000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: friendToastIn 0.3s ease;
    font-size: 0.9rem;
}

@keyframes friendToastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Chat body wrapper for collapse */
.friends-chat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Chat header cursor hint */
.friends-chat-header {
    cursor: pointer;
}

.friends-chat-header:hover {
    background: rgba(255,255,255,0.05);
}

/* Mini chat bubble animation */
.chat-mini-bubble {
    animation: bubbleIn 0.2s ease;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a6fbf 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-mini-bubble,
.chat-mini-bubble:hover,
.chat-mini-bubble:active,
.chat-mini-bubble:focus {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    border-radius: 50% !important;
    padding: 0 !important;
}

.chat-mini-bubble:hover {
    transform: translateX(-10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.chat-mini-bubble .mini-bubble-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.chat-mini-bubble .mini-bubble-close {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    background: #dc2626;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
    border: 2px solid var(--bg-primary, #1a1a2e);
    text-align: center;
}

.chat-mini-bubble:hover .mini-bubble-close {
    display: flex;
}

@keyframes bubbleIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Party Invite Notification */
.party-invite-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    animation: slideInLeft 0.3s ease;
}

.party-invite-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 14px 18px 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
    max-width: 360px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.party-invite-timer-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 4px;
}

.party-invite-timer-fill {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
}

.party-invite-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.party-invite-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.party-invite-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.party-invite-accept {
    padding: 6px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.party-invite-accept:hover {
    background: var(--primary-hover);
}

.party-invite-decline {
    padding: 6px 10px;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

.party-invite-decline:hover {
    background: rgba(255,255,255,0.15);
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .friends-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        z-index: 2000;
    }

    .friends-panel-body {
        max-height: none;
        flex: 1;
    }

    .friends-toggle-btn {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        bottom: 15px;
        right: 15px;
    }

    .friends-chat {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        z-index: 2001;
    }

    .friends-chat-messages {
        min-height: 0;
        max-height: none;
        flex: 1;
    }

    .party-invite-content {
        max-width: 90%;
    }

    .party-invite-notification {
        left: 10px;
        right: 10px;
    }

    .friend-toast {
        left: 10px;
        right: 10px;
        bottom: 76px;
    }

    /* Chat mini bubbles */
    .chat-mini-bubble,
    .chat-mini-bubble:hover,
    .chat-mini-bubble:active,
    .chat-mini-bubble:focus {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }
}

@media (max-width: 480px) {
    .friends-toggle-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        bottom: 12px;
        right: 12px;
    }

    .friends-panel-tab {
        font-size: 0.75rem;
        padding: 8px 6px;
    }

    .friend-item {
        padding: 8px 10px;
    }

    .friend-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}
/* Responsive Design */

@media (max-width: 1024px) {
    .mode-panels {
        grid-template-columns: repeat(2, 1fr);
    }

    .platform-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1280px) {
    .navbar {
        padding: 0.75rem 1rem;
    }
    .logo {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .mode-panels {
        grid-template-columns: 1fr;
    }

    .platform-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.75rem;
    }

    .footer-bottom #cookiescript_badge,
    .footer-bottom #CookieScriptBadge {
        position: static !important;
        transform: none !important;
        margin: 0 auto !important;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .about-hero h1 {
        font-size: 1.8rem;
    }

    .about-buttons {
        flex-direction: column;
        align-items: center;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .legal-page h1,
    .contact-page h1 {
        font-size: 1.8rem;
    }

    /* Base adjustments */
    body {
        padding-top: 100px; /* Navbar + breathing room with burger menu */
    }

    .container {
        padding: 1rem;
    }

    /* Navigation */
    .navbar {
        padding: 0.75rem 1rem;
    }

    /* Nav container and links handled by burger menu in navbar.css */

    .logo {
        font-size: 1.3rem;
    }

    /* Hero Section */
    .hero {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Game Cards Grid */
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .game-card {
        padding: 1.5rem;
    }

    .game-icon {
        font-size: 2.5rem;
    }

    .game-card h3 {
        font-size: 1.3rem;
    }

    /* Buttons */
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }

    .btn-large {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
    }

    /* Leaderboard */
    .leaderboard-section {
        padding: 1.5rem;
    }

    .leaderboard-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab-btn {
        width: 100%;
        padding: 0.8rem;
    }

    /* Team mode + device filter: stay horizontal */
    .leaderboard-tabs.device-filter-tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .device-filter-tabs .tab-btn {
        width: auto;
        flex: 1;
        padding: 0.6rem 0.5rem;
        justify-content: center;
    }

    /* Device tabs: hide text on mobile, show only icons */
    #device-tabs .tab-btn .device-label,
    #practice-device-tabs .tab-btn .device-label {
        display: none;
    }

    #device-tabs .tab-btn .gi svg,
    #practice-device-tabs .tab-btn .gi svg {
        width: 22px;
        height: 22px;
    }

    .leaderboard-table {
        font-size: 0.9rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.75rem 0.5rem;
    }

    /* Game Container */
    .game-container {
        padding-top: 65px;
    }

    .game-content {
        padding: 1rem;
        margin: 0.5rem auto;
    }

    .game-area {
        padding: 1.5rem;
        min-height: 350px;
    }

    .game-instruction {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .result-display {
        font-size: 2.5rem;
        margin: 1.5rem 0;
    }

    .score-display {
        padding: 1rem;
        font-size: 0.95rem;
    }

    /* Reaction Time Game */
    .reaction-area {
        height: 350px;
        font-size: 1.3rem;
    }

    /* Typing Speed Test */
    .typing-text {
        font-size: 1rem;
        line-height: 1.8;
        padding: 1.5rem;
    }

    .typing-input {
        font-size: 1rem;
        padding: 0.8rem;
    }

    /* Number Memory */
    .number-display {
        font-size: 2.5rem;
        letter-spacing: 0.3rem;
        margin: 2rem 0;
    }

    .number-input {
        font-size: 1.5rem;
        padding: 0.8rem;
        width: 90%;
    }

    /* Sequence Memory */
    .sequence-grid {
        max-width: 320px;
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .sequence-cell {
        min-height: 90px;
        border-width: 2px;
    }

    .level-display {
        font-size: 1.5rem;
    }

    /* Aim Trainer */
    .aim-area {
        height: 350px;
    }

    .aim-target {
        width: 55px;
        height: 55px;
    }

    .aim-target::before {
        width: 18px;
        height: 18px;
    }

    .aim-stats {
        flex-direction: row;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .aim-stat {
        flex: 1;
    }

    .aim-stat-label {
        font-size: 0.75rem;
    }

    .aim-stat-value {
        font-size: 1.5rem;
    }

    /* Math Test */
    .math-test-question {
        font-size: 2rem;
        margin: 1.5rem 0;
        min-height: 80px;
    }

    .math-test-answers {
        max-width: 100%;
        gap: 0.75rem;
    }

    .math-test-answers .btn {
        font-size: 1.4rem;
        padding: 0;
        aspect-ratio: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: auto;
    }

    /* Color Test */
    .color-test-word {
        font-size: 3rem;
        margin: 2rem 0;
        min-height: 90px;
    }

    .color-test-buttons {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        gap: 0.75rem;
    }

    .color-test-buttons .btn {
        font-size: 1rem;
        padding: 1rem;
        min-height: 60px;
    }

    /* Click Speed */
    .click-speed-display {
        flex-direction: row;
        gap: 1rem;
        padding: 0.75rem;
    }

    .click-speed-click-btn {
        font-size: 1.5rem;
        padding: 2rem 3rem;
    }

    /* Multitasking */
    .multitask-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .multitask-color-word {
        font-size: 2.5rem;
        min-height: 50px;
    }

    .multitask-color-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .multitask-target-word {
        font-size: 2rem;
    }

    .multitask-typed-text {
        font-size: 1.5rem;
        min-height: 50px;
    }

    .multitask-input {
        font-size: 1.1rem;
        padding: 0.8rem;
    }

    .multitask-target-area {
        height: 120px;
        max-width: 100%;
    }

    .multitask-target {
        width: 45px;
        height: 45px;
    }

    /* Pattern Recognition */
    .pattern-display {
        gap: 0.75rem;
        min-height: 100px;
    }

    .pattern-item {
        font-size: 3rem;
        width: 65px;
        height: 65px;
    }

    .pattern-options {
        max-width: 100%;
        gap: 0.75rem;
    }

    .pattern-option-btn {
        font-size: 2.5rem;
        padding: 1.5rem;
        min-height: 100px;
    }

    /* Forms */
    .auth-container {
        margin: 2rem auto;
        padding: 1.5rem;
        max-width: 90%;
    }

    .form-group input {
        padding: 0.7rem;
        font-size: 0.95rem;
    }

    /* Navbar - prevent overflow */
    .nav-right {
        margin-left: 0;
    }

    .dropdown-menu {
        min-width: 240px;
    }

    /* Chimp Test */
    .chimp-grid {
        width: 100%;
        height: 400px;
    }

    .chimp-number {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    /* Visual Memory */
    .visual-grid {
        max-width: 350px;
    }

    /* Verbal Memory */
    .verbal-word {
        font-size: 2rem;
        margin: 2rem 0;
        min-height: 60px;
    }

    .verbal-buttons {
        gap: 1rem;
        width: 100%;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .verbal-buttons .btn {
        flex: 1;
        font-size: 1.1rem;
        padding: 0.8rem 1.5rem;
    }

    /* Practice/Ranked Header */
    .practice-header h1 {
        font-size: 1.8rem;
    }

    .practice-header p {
        font-size: 0.95rem;
    }

    /* Mode panels split — make halves full-size on mobile */
    .mode-panel-split {
        gap: 2rem;
    }

    .mode-panel-half {
        padding: 2rem 1.5rem;
    }

    .mode-panel-half .mode-panel-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .mode-panel-half h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .mode-panel-half p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .mode-panel {
        padding: 2rem 1.5rem;
    }

    .mode-panel h2 {
        font-size: 1.5rem;
    }

    .mode-panel-icon {
        font-size: 2.5rem;
    }
}

/* Extra small devices (phones in portrait, less than 480px) */
@media (max-width: 480px) {
    body {
        padding-top: 95px;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .game-card {
        padding: 1.25rem;
    }

    .game-icon {
        font-size: 2rem;
    }

    .reaction-area {
        height: 300px;
        font-size: 1.1rem;
    }

    .aim-area {
        height: 300px;
    }

    .aim-target {
        width: 50px;
        height: 50px;
    }

    .sequence-grid {
        max-width: 280px;
    }

    .sequence-cell {
        min-height: 80px;
    }

    .result-display {
        font-size: 2rem;
    }

    .leaderboard-table {
        font-size: 0.8rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.5rem 0.25rem;
    }

    /* Math Test */
    .math-test-question {
        font-size: 1.8rem;
        min-height: 70px;
    }

    .math-test-answers .btn {
        font-size: 1.3rem;
        padding: 0;
        aspect-ratio: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: auto;
    }

    /* Color Test */
    .color-test-word {
        font-size: 2.5rem;
        min-height: 80px;
    }

    .color-test-buttons .btn {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    /* Click Speed */
    .click-speed-click-btn {
        font-size: 1.3rem;
        padding: 1.5rem 2rem;
    }

    /* Multitasking */
    .multitask-color-word {
        font-size: 2rem;
        min-height: 40px;
    }

    .multitask-color-btn {
        padding: 0.6rem;
        font-size: 0.75rem;
    }

    .multitask-target-word {
        font-size: 1.5rem;
    }

    .multitask-typed-text {
        font-size: 1.2rem;
        min-height: 40px;
    }

    .multitask-input {
        font-size: 1rem;
        padding: 0.7rem;
    }

    .multitask-target-area {
        height: 100px;
    }

    .multitask-target {
        width: 40px;
        height: 40px;
    }

    /* Pattern Recognition */
    .pattern-display {
        gap: 0.5rem;
        min-height: 80px;
    }

    .pattern-item {
        font-size: 2.5rem;
        width: 55px;
        height: 55px;
    }

    .pattern-options {
        gap: 0.5rem;
    }

    .pattern-option-btn {
        font-size: 2rem;
        padding: 1rem;
        min-height: 80px;
    }

    /* Chimp Test */
    .chimp-grid {
        width: 100%;
        height: 350px;
    }

    .chimp-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    /* Visual Memory */
    .visual-grid {
        max-width: 300px;
    }

    /* Verbal Memory */
    .verbal-word {
        font-size: 1.8rem;
        margin: 1.5rem 0;
    }

    .verbal-buttons {
        flex-direction: row;
        gap: 0.75rem;
    }

    .verbal-buttons .btn {
        min-width: auto;
        flex: 1;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    /* Game area extra small */
    .game-area {
        padding: 1rem;
        min-height: 300px;
    }

    .game-area h2 {
        font-size: 1.8rem;
    }
}

/* Portrait orientation: circular click speed button */
@media (orientation: portrait) {
    .click-speed-click-btn {
        width: 99px;
        height: 99px;
        border-radius: 50%;
        padding: 0;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 1.5rem auto;
    }
    .click-speed-click-btn .cs-click-icon {
        display: block;
    }
    .click-speed-click-btn .cs-btn-text {
        display: none;
    }
    /* During countdown, show number instead of icon */
    .click-speed-click-btn.cs-countdown .cs-click-icon {
        display: none;
    }
    .click-speed-click-btn.cs-countdown .cs-countdown-num {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        font-weight: 700;
        color: #fff;
    }
}

/* Desktop/landscape: hide click icon, show text */
@media (orientation: landscape) {
    .click-speed-click-btn .cs-click-icon {
        display: none;
    }
    .click-speed-click-btn .cs-countdown-num {
        display: none;
    }
}

/* Hide countdown number when not in countdown state */
.click-speed-click-btn .cs-countdown-num {
    display: none;
}

/* Portrait lock: show overlay when phone/tablet is in landscape */
@media screen and (orientation: landscape) and (max-height: 500px) and (hover: none) {
    #portrait-lock-overlay {
        display: flex !important;
    }
}

