/* =============================================
   Haxball UI — Pixel-Perfect Replica
   Colors extracted from game.css + game-min.js
   ============================================= */

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #fff;
    background-color: #020617;
}

/* ═══ HqxBall Aurora Background — CSS-only, GPU-friendly ═══ */
/* Replaced by #react-aurora widget */


/* ═══════ React Widget Global Font Override ═══════ */
[id^="react-"],
[id^="react-"] *,
[id^="react-"] button,
[id^="react-"] input,
[id^="react-"] span,
[id^="react-"] h1,
[id^="react-"] h2,
[id^="react-"] h3,
[id^="react-"] h4,
[id^="react-"] p {
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}


/* ═══════════════ HqxBall PREMIUM HEADER ═══════════════ */
#react-header {
    position: fixed;
    top: 32px;
    left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    padding: 0 48px;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
}
#react-header > header {
    width: 100%;
    max-width: calc(1440px - 96px);
    pointer-events: auto;
}
#hqx-header {
    position: fixed;
    top: 48px; /* py-8 (32px) + mt-4 (16px) */
    left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 48px; /* px-12 = 48px */
    pointer-events: none;
}

#hqx-header-inner {
    width: 100%;
    max-width: calc(1440px - 96px); /* 1344px inner width */
    height: 72px; /* Approx header height without extra spacing */
    padding: 0 32px; /* px-8 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ─── Logo ─── */
#hqx-logo {
    flex: 1; /* Match React flex distribution */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}
.hqx-logo-img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
    transition: all 0.5s;
}
#hqx-logo:hover .hqx-logo-img {
    transform: scale(1.1) rotate(12deg);
}
.hqx-logo-text {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: #fff;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
    user-select: none;
}
.hqx-logo-dim {
    opacity: 0.5;
    font-weight: 500;
}
#hqx-logo:hover .hqx-logo-text {
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.2);
}

/* ─── Center Navigation Pill ─── */
#hqx-nav {
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 9999px;
    background-color: rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.6);
}

.hqx-nav-item {
    position: relative;
    padding: 8px 24px;
    border-radius: 9999px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 1);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hqx-nav-item:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}
.hqx-nav-item.active {
    color: #fff;
}

/* Active pill background */
.hqx-nav-item.active::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.10);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Cyan indicator dot under active tab */
.hqx-nav-indicator {
    display: none;
}
.hqx-nav-item.active .hqx-nav-indicator {
    display: block;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: #22d3ee;
    border-radius: 9999px;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.8);
}

.hqx-nav-label {
    position: relative;
    z-index: 1;
}

/* ─── Right Section ─── */
#hqx-right {
    flex: 1; /* Match React */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    position: relative;
}

/* ─── Server/Ping Selector ─── */
#hqx-server-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 9999px;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    transition: all 0.3s;
}
#hqx-server-btn:hover {
    border-color: rgba(255, 255, 255, 0.20);
    background-color: rgba(30, 41, 59, 0.60);
}
#hqx-server-btn.active {
    background-color: rgba(30, 41, 59, 0.80);
    border-color: rgba(255, 255, 255, 0.30);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.hqx-ping-dot-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 8px;
}
.hqx-ping-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #34d399;
    position: relative;
    z-index: 1;
}
.hqx-ping-dot-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: #34d399;
    opacity: 0.75;
    animation: pingPulse 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
    box-shadow: 0 0 8px #34d399;
}
@keyframes pingPulse {
    0% { transform: scale(1); opacity: 0.75; }
    75%, 100% { transform: scale(2.5); opacity: 0; }
}

.hqx-server-name {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 1);
}

.hqx-ping-value {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    color: #34d399;
    text-shadow: 0 0 4px rgba(52, 211, 153, 0.3);
    transition: color 0.3s;
}

/* ─── Globe Button ─── */
#hqx-globe-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(203, 213, 225, 1);
}
#hqx-globe-btn:hover {
    border-color: rgba(255, 255, 255, 0.20);
    background-color: rgba(30, 41, 59, 0.50);
    color: #fff;
}
#hqx-globe-btn.active {
    border-color: rgba(34, 211, 238, 0.50);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
    background-color: rgba(30, 41, 59, 0.60);
    color: #22d3ee;
}

/* ─── Profile Button ─── */
#hqx-profile {
    position: relative;
}
#hqx-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 20px 6px 6px;
    border-radius: 9999px;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    transition: all 0.3s;
}
#hqx-profile-btn:hover {
    border-color: rgba(255, 255, 255, 0.20);
    background-color: rgba(30, 41, 59, 0.50);
}
#hqx-profile-btn.active {
    border-color: rgba(255, 255, 255, 0.30);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    background-color: rgba(30, 41, 59, 0.60);
}

.hqx-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(2, 6, 23, 0.80);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

#hqx-nick-display {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

/* ═══════════════ DROPDOWN MENUS (shared) ═══════════════ */
.hqx-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 224px;
    background-color: rgba(15, 23, 42, 0.80);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 1.5rem;
    padding: 6px;
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.8);
    z-index: 200;
}

.hqx-dd-title {
    padding: 8px 12px 4px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 1);
}

.hqx-dd-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hqx-dd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: none;
    border: none;
    color: rgba(203, 213, 225, 1);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.hqx-dd-item:hover {
    background-color: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.hqx-dd-nick-btn {
    color: rgba(34, 211, 238, 0.70);
}
.hqx-dd-nick-btn:hover {
    background-color: rgba(6, 182, 212, 0.10);
    color: #22d3ee;
}

/* ─── Server Dropdown Items ─── */
.hqx-server-item {
    justify-content: space-between;
}
.hqx-server-item.active {
    background-color: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hqx-si-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hqx-si-left span:last-child {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hqx-si-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.hqx-dot-green { background-color: #34d399; }
.hqx-dot-amber { background-color: #fbbf24; }
.hqx-dot-orange { background-color: #fb923c; }
.hqx-dot-red { background-color: #f87171; }

.hqx-server-item.active .hqx-si-dot {
    box-shadow: 0 0 8px currentColor;
}

.hqx-si-ping {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.hqx-ping-green { color: #34d399; }
.hqx-ping-amber { color: #fbbf24; }
.hqx-ping-orange { color: #fb923c; }
.hqx-ping-red { color: #f87171; }

/* ─── Language Dropdown Items ─── */
.hqx-lang-item {
    justify-content: space-between;
}
.hqx-lang-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hqx-lang-left span:last-child {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(203, 213, 225, 1);
}
.hqx-lang-item:hover .hqx-lang-left span:last-child {
    color: #fff;
}

.hqx-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(30, 41, 59, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    overflow: hidden;
}

.hqx-lang-check {
    color: #22d3ee;
    font-size: 16px;
    font-weight: 700;
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.5));
}

/* ─── Profile Dropdown ─── */
.hqx-dd-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 4px;
}

.hqx-dd-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(2, 6, 23, 0.50);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(203, 213, 225, 1);
}

.hqx-dd-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.hqx-dd-nick-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.hqx-dd-nick-row span:first-child {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.hqx-dd-badge {
    color: #22d3ee;
    font-size: 14px;
    flex-shrink: 0;
}

.hqx-dd-sub {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 1);
    margin-top: 2px;
}

.hqx-dd-wrap {
    position: relative;
}

/* Dropdown styling overrides */
#hqx-server-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}
#hqx-lang-dropdown {
    min-width: 180px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}
#hqx-profile-dropdown {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ═══════════════ HOME SCREEN (Landing Page) ═══════════════ */
#home-screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}
#home-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 120px 48px 32px 48px; /* sm:pt-[120px] sm:px-12 sm:pb-8 */
    display: flex;
    flex-direction: column;
}
#react-homepage {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ─── Top Row: Hero + Sidebar ─── */
.home-top {
    flex: 3;
    min-height: 0;
    display: flex;
    gap: 24px;
}

/* ─── Hero Card ─── */
.home-hero {
    flex: 7;
    min-height: 0;
    position: relative;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 52px 64px 76px 64px; /* Shift content up by ~12px to center visually */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: background-color 0.5s;
}
.home-hero:hover {
    background-color: rgba(15, 23, 42, 0.50);
}
.hero-bg-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.60);
    z-index: 1;
    border-radius: 2rem;
}
.hero-bg-radial {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(8, 145, 178, 0.20) 0%, transparent 60%);
    opacity: 0.5;
    mix-blend-mode: screen;
    z-index: 1;
}
.hero-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.90) 0%, rgba(2, 6, 23, 0.30) 40%, transparent 100%);
    z-index: 2;
    border-radius: 2rem;
}
.hero-target-icon {
    position: absolute;
    top: 48px;
    right: 48px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    color: rgba(255, 255, 255, 1);
    transition: opacity 0.7s;
}
.home-hero:hover .hero-target-icon {
    opacity: 0.06;
}

.hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 9999px;
    background-color: rgba(2, 6, 23, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #22d3ee;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 24px;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.5);
}
.hero-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22d3ee;
    margin-right: 8px;
    animation: heroEyebrowPulse 2s ease-in-out infinite;
}
@keyframes heroEyebrowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero-title {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 5.2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 0.9;
    text-transform: uppercase;
    margin-bottom: 20px;
    background: linear-gradient(to bottom, #fff 0%, #fff 60%, rgba(148, 163, 184, 0.80) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 8px;
}

.hero-subtitle {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: rgba(148, 163, 184, 1);
    max-width: 560px;
    letter-spacing: -0.025em;
    line-height: 1.625;
}

.hero-cta-wrap {
    margin-top: 40px;
}
.hero-cta {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 48px;
    border-radius: 9999px;
    background-color: rgba(2, 6, 23, 0.40);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(34, 211, 238, 0.80);
    cursor: pointer;
    box-shadow: 0 16px 48px -12px rgba(6, 182, 212, 0.3);
    transition: all 0.3s;
    transform: translateY(0);
}
.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 64px -16px rgba(6, 182, 212, 0.5);
    background-color: rgba(15, 23, 42, 0.60);
    border-color: rgba(103, 232, 249, 1);
}
.hero-cta span {
    position: relative;
    z-index: 1;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.hero-cta-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent, rgba(34, 211, 238, 0.10), transparent);
    transform: translateX(-100%);
}
.hero-cta:hover .hero-cta-shimmer {
    animation: ctaShimmer 1.5s infinite;
}
@keyframes ctaShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ─── QuickInfo Sidebar ─── */
.home-sidebar {
    flex: 3;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
#react-quickinfo {
    height: 100%;
    font-family: 'Inter', sans-serif;
}
.qi-card {
    flex: 1;
    min-height: 0;
    background-color: rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s;
}
.qi-card:hover {
    background-color: rgba(15, 23, 42, 0.15);
}
.qi-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    opacity: 0.8;
}
.qi-card:hover .qi-header { opacity: 1; }
.qi-purple { color: #a855f7; }
.qi-cyan { color: #22d3ee; }
.qi-header h4 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.qi-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: flex-end;
}
.qi-title {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.85;
    margin-bottom: 24px;
    background: linear-gradient(to bottom, #fff, rgba(148, 163, 184, 0.80));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 4px;
}
.qi-progress-wrap { margin-top: auto; }
.qi-progress-bar {
    position: relative;
    height: 8px;
    background-color: rgba(2, 6, 23, 0.80);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}
.qi-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 9999px;
}
.qi-fill-purple {
    background: linear-gradient(to right, #9333ea, #a855f7);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}
.qi-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}
.qi-progress-count { color: rgba(203, 213, 225, 1); }
.qi-progress-reward { color: #a855f7; }

/* Engine rows */
.qi-rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    justify-content: flex-end;
}
.qi-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.qi-row-border {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}
.qi-label {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(100, 116, 139, 1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.qi-value {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(203, 213, 225, 1);
}
.qi-status {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qi-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.qi-dot-green {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}
.qi-status-text {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.qi-text-green { color: #22c55e; }
.qi-text-cyan { color: #22d3ee; }
.qi-text-white { color: #fff; }

/* ─── Bottom Row: Mode Cards ─── */
.home-bottom {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 24px;
}
.home-modes {
    flex: 1;
    display: flex;
    gap: 16px;
}
.mode-card {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.5s;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8);
}
.mode-card:hover {
    background-color: rgba(15, 23, 42, 0.20);
    border-color: rgba(255, 255, 255, 0.20);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.6);
}
.mode-active {
    background-color: rgba(15, 23, 42, 0.40);
    border-color: rgba(255, 255, 255, 0.20);
}
.mode-active:hover {
    border-color: rgba(34, 211, 238, 0.50);
    box-shadow: 0 20px 40px -15px rgba(6, 182, 212, 0.3);
}
.mc-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.10), transparent);
    pointer-events: none;
    transition: opacity 0.5s;
}
.mode-card:hover .mc-glow { opacity: 0.8; }

.mc-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    z-index: 2;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.mc-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.mc-dot-green { background-color: #34d399; box-shadow: 0 0 5px #34d399; animation: heroEyebrowPulse 2s ease-in-out infinite; }
.mc-dot-amber { background-color: #fbbf24; box-shadow: 0 0 5px #fbbf24; }
.mc-dot-cyan { background-color: #22d3ee; box-shadow: 0 0 5px #22d3ee; }
.mc-badge-dim { opacity: 0.5; margin-left: 2px; }

.mc-icon {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(148, 163, 184, 1);
    transition: all 0.3s;
}
.mode-card:hover .mc-icon {
    background-color: rgba(255, 255, 255, 0.10);
    color: #fff;
    transform: scale(1.05);
}
.mc-icon-active {
    background-color: rgba(6, 182, 212, 0.20);
    border-color: rgba(34, 211, 238, 0.50);
    color: rgba(103, 232, 249, 1);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}
.mode-active:hover .mc-icon-active {
    background-color: rgba(6, 182, 212, 0.30);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
}

.mc-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
}
.mc-text h3 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 16px;
    font-weight: 900;
    color: rgba(203, 213, 225, 1);
    letter-spacing: -0.025em;
    transition: color 0.3s;
}
.mode-card:hover .mc-text h3 { color: #fff; }
.mode-active .mc-text h3 { color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }
.mc-text p {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(100, 116, 139, 1);
    letter-spacing: 0.025em;
    transition: color 0.3s;
}
.mode-card:hover .mc-text p { color: rgba(148, 163, 184, 1); }
.mode-active .mc-text p { color: rgba(34, 211, 238, 0.80); }

/* ─── Custom Room Card ─── */
.home-custom {
    width: 288px;
    flex-shrink: 0;
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8);
    transition: all 0.5s;
}
.home-custom:hover {
    border-color: rgba(255, 255, 255, 0.20);
}

.hc-grid-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.15;
}
.hc-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 1) 0%, rgba(2, 6, 23, 0.80) 40%, rgba(15, 23, 42, 0.60) 100%);
}

.hc-content {
    position: relative;
    z-index: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
}
.hc-arrow-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s;
}
.home-custom:hover .hc-arrow-box {
    background-color: rgba(255, 255, 255, 0.20);
}
.home-custom:hover .hc-arrow-box svg {
    transform: rotate(-45deg);
}
.hc-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hc-label {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.3em;
    color: #22d3ee;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(6, 182, 212, 0.8);
}
.hc-text h3 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.05em;
    transition: text-shadow 0.3s;
}
.home-custom:hover .hc-text h3 {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.hc-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    z-index: 2;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* ---- NICKNAME SCREEN ---- */
#nick-screen {
    position: fixed;
    inset: 0;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.nick-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: nickFadeIn 0.3s ease;
}
@keyframes nickFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#nick-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    background-color: rgba(15, 23, 42, 0.80);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 80px -20px rgba(6, 182, 212, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: nickZoomIn 0.3s ease;
}
@keyframes nickZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.nick-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #22d3ee, #3b82f6, #6366f1);
    z-index: 1;
}

.nick-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 256px;
    height: 256px;
    background: rgba(6, 182, 212, 0.10);
    filter: blur(100px);
    border-radius: 50%;
    pointer-events: none;
}

.nick-body {
    padding: 40px 32px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.nick-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.nick-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background-color: rgba(6, 182, 212, 0.10);
    border: 1px solid rgba(6, 182, 212, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22d3ee;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
    flex-shrink: 0;
}
.nick-icon-box svg {
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.8));
}

.nick-titles h2 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0;
    padding: 0;
    border: none;
}

.nick-subtitle {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #22d3ee;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 4px;
}

.nick-desc {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    color: rgba(148, 163, 184, 1);
    line-height: 1.6;
    margin-bottom: 32px;
}

.nick-form-modern {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nick-input-wrap {
    position: relative;
}

#nick-input {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 16px 52px 16px 24px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.1em;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}
#nick-input::placeholder {
    color: rgba(71, 85, 105, 1);
    font-weight: 900;
}
#nick-input:focus {
    border-color: rgba(34, 211, 238, 0.50);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.50);
    background-color: rgba(0, 0, 0, 0.60);
}
#nick-input.error:focus {
    border-color: rgba(239, 68, 68, 0.50);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.50);
}

.nick-check {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #34d399;
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.8));
    animation: nickCheckIn 0.2s ease;
}
@keyframes nickCheckIn {
    from { opacity: 0; transform: translateY(-50%) scale(0.5); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}

.nick-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.20);
    border-radius: 12px;
    animation: nickFadeIn 0.2s ease;
}
.nick-error-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #f87171;
    box-shadow: 0 0 5px #f87171;
    flex-shrink: 0;
}
#nick-error-text {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #f87171;
}

#nick-ok {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(to right, #06b6d4, #2563eb);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    margin-top: 8px;
}
#nick-ok:hover {
    background: linear-gradient(to right, #22d3ee, #3b82f6);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.6);
    transform: scale(1.02);
}
#nick-ok:active {
    transform: scale(0.98);
}
#nick-ok:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
#nick-ok span {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
}
#nick-ok svg {
    color: #fff;
    transition: transform 0.2s;
}
#nick-ok:hover svg {
    transform: translateX(4px);
}

/* ═══════════════ LEADERBOARDS SCREEN ═══════════════ */
#leaderboards-screen {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 144px; /* match home screen vertical offset (header height) */
    height: 100vh;
    box-sizing: border-box;
}
#profile-screen {
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 1;
}
#profile-screen #react-profile {
    width: 100%;
    height: 100%;
}
#react-leaderboards {
    width: 100%;
    max-width: calc(1440px - 96px); /* 1344px — matches home container */
    display: flex;
    flex-direction: column;
    gap: 24px;
    font-family: 'Inter', sans-serif;
}
#leaderboards-container {
    width: 100%;
    max-width: calc(1440px - 96px); /* 1344px */
    padding-top: 144px; /* match home screen vertical offset */
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
}

/* 1. Header & Filters Row */
.lb-header-panel {
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 20;
}
.lb-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.lb-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}
.lb-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    background-color: rgba(6, 182, 212, 0.1);
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.3);
    padding: 4px;
    flex-shrink: 0;
}
.lb-icon-inner {
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
    background-color: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.lb-icon-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2) 0%, transparent 100%);
}
.lb-icon-inner svg {
    color: rgba(34, 211, 238, 1);
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.8));
    position: relative;
    z-index: 1;
}
.lb-title-text h1 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.05em;
    text-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.lb-title-text p {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(34, 211, 238, 1);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.lb-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lb-country-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    min-width: 140px;
    border-radius: 0.75rem;
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: rgba(148, 163, 184, 1);
    cursor: pointer;
    transition: all 0.3s;
}
.lb-country-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}
.lb-c-left, .lb-c-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lb-c-left span {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-search-box {
    position: relative;
    width: 240px;
}
.lb-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(100, 116, 139, 1);
}
.lb-search-box input {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 10px 16px 10px 40px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    outline: none;
    transition: all 0.3s;
}
.lb-search-box input:focus {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.5);
}

.lb-divider {
    height: 1px;
    width: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.10), transparent);
}

.lb-filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.lb-tab-group {
    display: flex;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}
.lb-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 0.75rem;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(100, 116, 139, 1);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}
.lb-tab:hover {
    color: rgba(203, 213, 225, 1);
    background-color: rgba(255, 255, 255, 0.05);
}
.lb-tab.active {
    background-color: rgba(6, 182, 212, 0.2);
    color: rgba(34, 211, 238, 1);
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.5), 0 0 15px rgba(6, 182, 212, 0.2);
}

/* 2. Main Data Panel */
.lb-data-panel {
    flex: 1;
    min-height: 0;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
    overflow: hidden;
}
.lb-thead {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    padding: 16px 24px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}
.lb-th {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    color: rgba(100, 116, 139, 1);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.col-rank { grid-column: span 1 / span 1; text-align: center; }
.col-player { grid-column: span 3 / span 3; }
.col-nation { grid-column: span 2 / span 2; }
.col-winrate { grid-column: span 2 / span 2; text-align: center; }
.col-matches { grid-column: span 2 / span 2; text-align: right; }
.col-stat { grid-column: span 2 / span 2; display:flex; justify-content: flex-end; }

.lb-metric-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(6, 182, 212, 0.1);
    padding: 6px 12px;
    border-radius: 0.5rem;
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.2);
    color: rgba(34, 211, 238, 1);
}

.lb-tbody {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lb-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    padding: 12px 16px;
    align-items: center;
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: all 0.3s;
    cursor: pointer;
}
.lb-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Podium Styles */
.lb-p1 {
    background: linear-gradient(to right, rgba(245, 158, 11, 0.1), rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.4));
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}
.lb-p2 {
    background: linear-gradient(to right, rgba(203, 213, 225, 0.1), rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.4));
    border-color: rgba(203, 213, 225, 0.2);
}
.lb-p3 {
    background: linear-gradient(to right, rgba(234, 88, 12, 0.1), rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.4));
    border-color: rgba(234, 88, 12, 0.2);
}

.lb-cell {
    display: flex;
    align-items: center;
}
.lb-rank-num {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: rgba(71, 85, 105, 1);
    margin: 0 auto;
}
.gold-medal { color: rgba(250, 204, 21, 1); filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8)); margin: 0 auto; }
.silver-medal { color: rgba(203, 213, 225, 1); filter: drop-shadow(0 0 10px rgba(203, 213, 225, 0.5)); margin: 0 auto; }
.bronze-medal { color: rgba(234, 88, 12, 1); filter: drop-shadow(0 0 8px rgba(234, 88, 12, 0.5)); margin: 0 auto; }

.lb-cell.col-player { gap: 12px; }
.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: transparent;
    flex-shrink: 0;
}
.lb-p1 .lb-avatar, .lb-p2 .lb-avatar, .lb-p3 .lb-avatar {
    border: none;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-pinfo { display: flex; flex-direction: column; min-width: 0; }
.lb-name {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.025em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}
.lb-team {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: rgba(100, 116, 139, 1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-gold-text { color: rgba(251, 191, 36, 1) !important; }
.lb-silver-text { color: rgba(226, 232, 240, 1) !important; }
.lb-bronze-text { color: rgba(251, 146, 60, 1) !important; }
.lb-green-text { color: rgba(52, 211, 153, 1) !important; }
.lb-cyan-text { color: rgba(34, 211, 238, 1) !important; }
.lb-red-text { color: rgba(248, 113, 113, 1) !important; }
.lb-bg-green { background-color: rgba(52, 211, 153, 1) !important; box-shadow: 0 0 8px rgba(52, 211, 153, 1); }
.lb-bg-cyan { background-color: rgba(34, 211, 238, 1) !important; box-shadow: 0 0 8px rgba(34, 211, 238, 1); }

.lb-cell.col-nation { gap: 8px; }
.lb-flag { font-size: 18px; line-height: 1; }
.lb-cname {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(148, 163, 184, 1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-wr-box { width: 80px; display: flex; flex-direction: column; gap: 4px; margin: 0 auto; }
.lb-wr-val { font-family: 'Inter', Arial, sans-serif; font-size: 10px; font-weight: 900; }
.lb-wr-bar { width: 100%; height: 6px; border-radius: 9999px; background-color: rgba(0, 0, 0, 0.4); overflow: hidden; }
.lb-wr-fill { height: 100%; border-radius: 9999px; background-color: rgba(148, 163, 184, 1); }

.col-matches { flex-direction: column; justify-content: center; align-items: flex-end !important; }
.lb-m-val { font-family: 'Inter', Arial, sans-serif; font-size: 14px; font-weight: 700; color: rgba(203, 213, 225, 1); tabular-nums: normal; }
.lb-m-lbl { font-family: 'Inter', Arial, sans-serif; font-size: 8px; font-weight: 700; color: rgba(71, 85, 105, 1); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px;}

.col-stat.flex-end { justify-content: flex-end; gap: 8px; align-items: center; }
.col-stat { gap: 8px; }
.lb-stat-val { font-family: 'Inter', Arial, sans-serif; font-size: 24px; font-weight: 900; letter-spacing: -0.05em; text-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); tabular-nums: normal; line-height: 1; }
.lb-trend { width: 16px; display: flex; justify-content: center; }
.lb-trend-same { width: 6px; height: 2px; border-radius: 2px; background-color: rgba(71, 85, 105, 1); }

/* ═══════════════ MAPS SCREEN ═══════════════ */
.z-10 { position: relative; z-index: 10; }
.relative { position: relative; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

#maps-screen {
    width: 100%;
    display: flex;
    justify-content: center;
}
#react-maps {
    width: 100%;
    max-width: calc(1440px - 96px);
    padding-top: 144px;
    padding-bottom: 48px;
    height: 100vh;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}
#maps-container {
    width: 100%;
    max-width: calc(1440px - 96px); /* 1344px */
    padding-top: 144px;
    padding-bottom: 48px;
    display: flex;
    flex-direction: row;
    gap: 24px;
    height: 100vh;
}
.maps-gal-bg-grad {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent);
    pointer-events: none;
}
.maps-det-bg-grad {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(8, 145, 178, 0.05), transparent, transparent);
    pointer-events: none;
}
.maps-cat-gradient {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 32px;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.8), transparent);
    pointer-events: none;
    z-index: 10;
    border-radius: 2rem 2rem 0 0;
}

/* 1. Left Sidebar (20%) */
.maps-sidebar {
    width: 20%;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.maps-search-bar {
    height: 56px;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 16px 32px -12px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    transition: all 0.3s;
}
.maps-search-bar:focus-within {
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.3), 0 16px 32px -12px rgba(0,0,0,0.6);
}
.maps-icon { width: 20px; height: 20px; color: rgba(100, 116, 139, 1); transition: color 0.3s; flex-shrink: 0; }
.maps-search-bar:focus-within .maps-icon { color: rgba(34, 211, 238, 1); }
.maps-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
}
.maps-search-bar input::placeholder { color: rgba(71, 85, 105, 1); }

.maps-cat-list {
    flex: 1;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 32px 64px -12px rgba(0,0,0,0.6);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}
.maps-cat-header {
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: rgba(100, 116, 139, 1);
    text-transform: uppercase;
    margin-top: 8px;
}
.maps-cat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 1rem;
    transition: all 0.3s;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(148, 163, 184, 1);
}
.maps-cat-btn span { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 900; letter-spacing: 0.15em; }
.maps-cat-btn:hover { background-color: rgba(255, 255, 255, 0.05); color: rgba(226, 232, 240, 1); }
.maps-cat-btn.active {
    background-color: rgba(6, 182, 212, 0.1);
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.3), inset 0 0 20px rgba(6, 182, 212, 0.1);
    color: rgba(34, 211, 238, 1);
}
.maps-cat-btn.active .maps-icon { color: rgba(34, 211, 238, 1); }
.maps-cat-divider { height: 1px; width: 100%; background-color: rgba(255, 255, 255, 0.05); margin: 16px 0; }

.maps-cat-btn.fav.active {
    background-color: rgba(245, 158, 11, 0.1);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3), inset 0 0 20px rgba(245, 158, 11, 0.1);
    color: rgba(251, 191, 36, 1);
}

/* 2. Center Gallery (50%) */
.maps-gallery-panel {
    flex: 1;
    min-width: 400px;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 32px 64px -12px rgba(0,0,0,0.8);
    padding: 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.maps-gal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-shrink: 0; }
.maps-gal-title h2 { font-family: 'Inter', sans-serif; font-size: 32px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: -0.05em; line-height: 1; }
.maps-gal-title p { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; color: rgba(100, 116, 139, 1); text-transform: uppercase; letter-spacing: 0.15em; margin-top: 4px; }

.maps-gal-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    overflow-y: auto;
    padding-bottom: 16px;
    align-content: start;
}
.maps-gal-item {
    background-color: rgba(15, 23, 42, 0.6);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
}
.maps-gal-item:hover {
    background-color: rgba(30, 41, 59, 0.4);
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.5), 0 0 20px rgba(6, 182, 212, 0.1);
}
.maps-gal-item.active {
    background-color: rgba(30, 41, 59, 0.6);
    box-shadow: inset 0 0 0 2px rgba(34, 211, 238, 1), 0 0 30px rgba(6, 182, 212, 0.15);
}
.maps-item-info { padding: 4px; }
.maps-item-name { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 900; letter-spacing: -0.025em; color: rgba(226, 232, 240, 1); transition: color 0.3s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maps-gal-item:hover .maps-item-name { color: #fff; }
.maps-item-name.active { color: #fff; }
.maps-item-stats { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.maps-item-plays { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700; color: rgba(100, 116, 139, 1); text-transform: uppercase; letter-spacing: 0.1em; }
.maps-item-dot { width: 6px; height: 6px; border-radius: 100%; background-color: rgba(51, 65, 85, 1); }
.maps-item-dot.active { background-color: rgba(34, 211, 238, 1); box-shadow: 0 0 5px rgba(6, 182, 212, 0.8); }

/* Pitch Blueprint Drawing */
.maps-blueprint {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 1rem;
    background-color: rgba(2, 6, 23, 0.8);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.maps-bp-bg {
    position: absolute; inset: 0;
    opacity: 0.03;
    background-image: linear-gradient(to right, rgba(255,255,255,1) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,1) 1px, transparent 1px);
    background-size: 12px 12px;
}
.maps-bp-pitch {
    width: 100%; height: 100%;
    border: 1.5px solid rgba(71, 85, 105, 0.5);
    border-radius: 2px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.maps-bp-pitch.active { border-color: rgba(34, 211, 238, 0.8); box-shadow: 0 0 15px rgba(6, 182, 212, 0.2); }
.maps-bp-center-line { width: 1.5px; height: 100%; background-color: rgba(71, 85, 105, 0.5); transition: all 0.3s; }
.maps-bp-center-line.active { background-color: rgba(34, 211, 238, 0.8); box-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }
.maps-bp-center-circle { width: 32px; height: 32px; border: 1.5px solid rgba(71, 85, 105, 0.5); border-radius: 100%; position: absolute; transition: all 0.3s;}
.maps-bp-center-circle.active { border-color: rgba(34, 211, 238, 0.8); }
.maps-bp-center-dot { width: 4px; height: 4px; background-color: rgba(71, 85, 105, 0.5); border-radius: 100%; position: absolute; transition: all 0.3s;}
.maps-bp-center-dot.active { background-color: rgba(34, 211, 238, 1); }
.maps-bp-box-left { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 15%; height: 50%; border-top: 1.5px solid rgba(71, 85, 105, 0.5); border-bottom: 1.5px solid rgba(71, 85, 105, 0.5); border-right: 1.5px solid rgba(71, 85, 105, 0.5); transition: all 0.3s;}
.maps-bp-box-left.active { border-color: rgba(34, 211, 238, 0.8); }
.maps-bp-box-right { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 15%; height: 50%; border-top: 1.5px solid rgba(71, 85, 105, 0.5); border-bottom: 1.5px solid rgba(71, 85, 105, 0.5); border-left: 1.5px solid rgba(71, 85, 105, 0.5); transition: all 0.3s;}
.maps-bp-box-right.active { border-color: rgba(34, 211, 238, 0.8); }

/* 3. Right Detail Panel (30%) */
.maps-detail-panel {
    width: 30%;
    min-width: 320px;
    background-color: rgba(15, 23, 42, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 32px 64px -12px rgba(0,0,0,0.8);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
}
.maps-det-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: rgba(100, 116, 139, 1);
    text-transform: uppercase;
}
.maps-det-pulse { width: 6px; height: 6px; border-radius: 100%; background-color: rgba(34, 211, 238, 1); opacity: 0.8; }
.maps-det-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 1.5rem;
    background-color: rgba(2, 6, 23, 0.8);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 8px;
    position: relative;
    flex-shrink: 0;
}
.maps-det-preview .maps-blueprint { height: 100%; aspect-ratio: unset; background-color: rgba(2, 6, 23, 0.5); }
.maps-det-live-badge {
    position: absolute; top: 16px; left: 16px;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: 4px; padding: 4px 8px;
    font-family: 'Inter', sans-serif; font-size: 9px; font-weight: 900; color: rgba(34, 211, 238, 1); letter-spacing: 0.1em; text-transform: uppercase;
}

.mdi-header h2 { font-family: 'Inter', sans-serif; font-size: 32px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: -0.05em; line-height: 1; margin-bottom: 4px;}
.mdi-tags { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.mdi-cat { background-color: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.2); border-radius: 4px; padding: 2px 8px; font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700; color: rgba(34, 211, 238, 1); letter-spacing: 0.1em; text-transform: uppercase; line-height: 1; }
.mdi-author { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700; color: rgba(148, 163, 184, 1); letter-spacing: 0.1em; text-transform: uppercase; line-height: 1; }

.mdi-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.mdi-stat-box { background-color: rgba(2, 6, 23, 0.5); border-radius: 0.75rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.mds-lbl { font-family: 'Inter', sans-serif; font-size: 9px; font-weight: 900; color: rgba(100, 116, 139, 1); text-transform: uppercase; letter-spacing: 0.15em; }
.mds-val { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700; color: rgba(226, 232, 240, 1); }

.maps-det-actions { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
.md-btn { width: 100%; height: 56px; flex-shrink: 0; border-radius: 1rem; border: none; display: flex; align-items: center; justify-content: center; gap: 12px; font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 900; letter-spacing: 0.15em; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden; }
.md-play { background-color: rgba(6, 182, 212, 1); color: rgba(2, 6, 23, 1); box-shadow: 0 0 20px rgba(6, 182, 212, 0.4); }
.md-play:hover { background-color: rgba(34, 211, 238, 1); box-shadow: 0 0 30px rgba(6, 182, 212, 0.6); }
.md-play-hover-layer { position: absolute; inset: 0; background-color: rgba(255,255,255,0.2); transform: translateY(100%); transition: transform 0.3s ease-out; }
.md-play.group:hover .md-play-hover-layer { transform: translateY(0); }
.md-play svg { transition: transform 0.3s; position: relative; z-index: 10; fill: rgba(2, 6, 23, 1); }
.md-play.group:hover svg { transform: scale(1.1); }
.md-play span { position: relative; z-index: 10; }

.md-fav { background-color: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); color: rgba(203, 213, 225, 1); }
.md-fav:hover { background-color: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); color: #fff; }

.md-download { background-color: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); color: rgba(148, 163, 184, 1); }
.md-download:hover { background-color: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); color: #fff; }
.md-download svg { transition: transform 0.3s; }
.md-download.group2:hover svg { transform: translateY(2px); }

/* ═══════════════ REPLAYS SCREEN ═══════════════ */
#replays-screen { width: 100%; display: flex; justify-content: center; }
#react-replays {
    width: 100%;
    max-width: calc(1440px - 96px);
    padding-top: 144px;
    padding-bottom: 48px;
    height: 100vh;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}
#replays-container {
    width: 100%; max-width: calc(1440px - 96px);
    padding-top: 144px; padding-bottom: 48px;
    display: flex; flex-direction: row; gap: 24px; height: 100vh;
}

/* LEFT: Theater Card (65%) */
.rp-theater {
    flex: 65; min-width: 0;
    background-color: rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 25px 50px -12px rgba(0,0,0,0.5);
    padding: 32px; display: flex; flex-direction: column; gap: 32px;
    position: relative; overflow: hidden; transition: background-color 0.3s;
}
.rp-theater:hover { background-color: rgba(15, 23, 42, 0.25); }
.rp-theater-bg-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(255,255,255,0.02), transparent); pointer-events: none; border-radius: 2rem; }

/* 16:9 Thumbnail */
.rp-thumbnail {
    width: 100%; flex-shrink: 0; aspect-ratio: 16 / 9;
    border-radius: 1rem; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 16px 32px -12px rgba(0,0,0,0.6);
    background: linear-gradient(135deg, #0c1222 0%, #0a1628 50%, #0d1a30 100%);
    display: flex; align-items: center; justify-content: center;
    position: relative; cursor: pointer;
}
.rp-thumb-grid {
    position: absolute; inset: 0; opacity: 0.10;
    background-image: linear-gradient(to right, rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 40px 40px;
}
.rp-thumb-play-btn {
    width: 80px; height: 80px; border-radius: 100%;
    background-color: rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 0 30px rgba(0,0,0,0.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 20; transition: all 0.3s; position: relative;
}
.rp-thumb-play-btn svg { color: #fff; margin-left: 4px; transition: all 0.3s; }
.rp-thumbnail:hover .rp-thumb-play-btn {
    background-color: rgba(6, 182, 212, 0.2);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.5), 0 0 40px rgba(6, 182, 212, 0.4);
    transform: scale(1.1);
}
.rp-thumbnail:hover .rp-thumb-play-btn svg { color: rgba(165, 243, 252, 1); }

/* Scoreboard Overlay */
.rp-scoreboard {
    position: absolute; top: 16px; left: 16px; z-index: 20;
    padding: 8px 16px;
    background-color: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 4px 16px rgba(0,0,0,0.4);
    display: flex; align-items: center; gap: 16px;
}
.rp-sb-team { display: flex; align-items: center; gap: 8px; }
.rp-sb-name { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.1em; }
.rp-sb-name.rp-dim { color: rgba(203, 213, 225, 1); }
.rp-sb-score { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rp-sb-score.rp-cyan { color: rgba(34, 211, 238, 1); }
.rp-sb-score.rp-red { color: rgba(248, 113, 113, 1); }
.rp-sb-divider { width: 1px; height: 16px; background-color: rgba(255,255,255,0.2); }

/* Analytics */
.rp-analytics { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rp-analytics-title {
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700;
    letter-spacing: 0.2em; color: rgba(100, 116, 139, 1); text-transform: uppercase;
    margin-bottom: 24px; flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
}
.rp-pulse-dot { width: 6px; height: 6px; border-radius: 100%; background-color: rgba(34, 211, 238, 1); opacity: 0.8; }
.rp-stats-grid { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 0 16px; overflow: hidden; }

/* Possession */
.rp-stat-row-poss { display: flex; flex-direction: column; gap: 8px; }
.rp-poss-labels { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 4px; }
.rp-poss-val { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; }
.rp-poss-val.rp-cyan { color: rgba(34, 211, 238, 1); filter: drop-shadow(0 0 8px rgba(6,182,212,0.4)); }
.rp-poss-val.rp-red { color: rgba(248, 113, 113, 1); }
.rp-poss-lbl { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0.2em; color: rgba(100, 116, 139, 1); text-transform: uppercase; }
.rp-poss-bar { height: 8px; width: 100%; background-color: rgba(2, 6, 23, 1); border-radius: 9999px; display: flex; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.rp-poss-fill-cyan { height: 100%; background: linear-gradient(to right, rgba(8, 145, 178, 1), rgba(34, 211, 238, 1)); box-shadow: inset 0 0 10px rgba(255,255,255,0.2); }
.rp-poss-fill-red { height: 100%; background: linear-gradient(to right, rgba(239, 68, 68, 1), rgba(220, 38, 38, 1)); box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }

/* Dual Stat Rows */
.rp-stat-row-dual { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; margin-top: 8px; }
.rp-dual-left { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.rp-dual-right { display: flex; align-items: center; gap: 12px; }
.rp-dual-bar-wrap { height: 8px; border-radius: 9999px; background-color: rgba(2, 6, 23, 0.8); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); flex: 1; }
.rp-dual-bar { height: 100%; border-radius: 9999px; }
.rp-bar-cyan { background-color: rgba(34, 211, 238, 1); box-shadow: 0 0 8px rgba(6, 182, 212, 0.6); }
.rp-bar-red { background-color: rgba(239, 68, 68, 0.6); }
.rp-dual-val { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; width: 32px; text-align: right; }
.rp-dual-left .rp-dual-val { text-align: right; }
.rp-dual-right .rp-dual-val { text-align: left; }
.rp-dual-val.rp-dim { color: rgba(203, 213, 225, 1); }
.rp-dual-label { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700; color: rgba(100, 116, 139, 1); text-transform: uppercase; letter-spacing: 0.15em; width: 96px; text-align: center; line-height: 1.4; }

/* RIGHT: Vault Card (35%) */
.rp-vault { flex: 35; min-width: 0; display: flex; flex-direction: column; gap: 32px; }

/* Upload Button */
.rp-upload-btn {
    position: relative; width: 100%; padding: 20px;
    border-radius: 1rem; border: none;
    background-color: rgba(6, 182, 212, 0.1);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.5), 0 0 20px rgba(6, 182, 212, 0.15);
    display: flex; align-items: center; justify-content: center; gap: 12px;
    cursor: pointer; overflow: hidden; flex-shrink: 0; transition: all 0.3s;
}
.rp-upload-btn:hover {
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 1), 0 0 30px rgba(6, 182, 212, 0.3);
    background-color: rgba(6, 182, 212, 0.2);
}
.rp-upload-icon { color: rgba(34, 211, 238, 1); z-index: 10; transition: transform 0.3s; }
.rp-upload-btn:hover .rp-upload-icon { transform: translateY(-2px); }
.rp-upload-btn span {
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 900;
    letter-spacing: 0.2em; color: rgba(34, 211, 238, 1); text-transform: uppercase;
    z-index: 10; filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.5));
}
.rp-shimmer {
    position: absolute; inset: 0;
    background: linear-gradient(to right, transparent, rgba(34, 211, 238, 0.2), transparent);
    transform: translateX(-100%);
}
.rp-upload-btn:hover .rp-shimmer { animation: rp-shimmer-anim 1.5s infinite; }
@keyframes rp-shimmer-anim { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* List Panel */
.rp-list-panel {
    flex: 1; min-height: 0;
    background-color: rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 25px 50px -12px rgba(0,0,0,0.5);
    padding: 24px; display: flex; flex-direction: column;
    position: relative; overflow: hidden; transition: background-color 0.3s;
}
.rp-list-panel:hover { background-color: rgba(15, 23, 42, 0.25); }

.rp-list-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; margin-bottom: 24px; }
.rp-list-title {
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700;
    letter-spacing: 0.2em; color: rgba(148, 163, 184, 1); text-transform: uppercase;
    display: flex; align-items: center; gap: 8px;
}
.rp-cyan-icon { color: rgba(34, 211, 238, 1); }

/* Tabs */
.rp-tabs {
    display: flex; background-color: rgba(0,0,0,0.4);
    padding: 4px; border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.rp-tab {
    padding: 6px 12px; border-radius: 6px; border: 1px solid transparent;
    font-family: 'Inter', sans-serif; font-size: 9px; font-weight: 900;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(100, 116, 139, 1); background: transparent;
    cursor: pointer; transition: all 0.3s;
}
.rp-tab:hover { color: rgba(203, 213, 225, 1); }
.rp-tab.active {
    background-color: rgba(6, 182, 212, 0.2);
    color: rgba(34, 211, 238, 1);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

/* Scrollable List */
.rp-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }

/* Replay Item */
.rp-item {
    width: 100%; text-align: left;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-radius: 0.75rem;
    border: 1px solid transparent; background: transparent;
    cursor: pointer; transition: all 0.3s;
}
.rp-item:hover { background-color: rgba(255,255,255,0.04); }
.rp-item.active {
    background-color: rgba(255,255,255,0.10);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 4px 16px rgba(0,0,0,0.2);
}

.rp-item-left { display: flex; align-items: center; gap: 14px; }
.rp-result {
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 900;
    font-variant-numeric: tabular-nums; transition: background-color 0.3s;
}
.rp-result-w { background-color: rgba(16, 185, 129, 0.1); color: rgba(52, 211, 153, 1); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.3), inset 0 0 8px rgba(16, 185, 129, 0.1); }
.rp-item:hover .rp-result-w { background-color: rgba(16, 185, 129, 0.2); }
.rp-result-l { background-color: rgba(239, 68, 68, 0.1); color: rgba(248, 113, 113, 1); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.3), inset 0 0 8px rgba(239, 68, 68, 0.1); }
.rp-item:hover .rp-result-l { background-color: rgba(239, 68, 68, 0.2); }
.rp-result-d { background-color: rgba(100, 116, 139, 0.1); color: rgba(148, 163, 184, 1); box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.3); }
.rp-item:hover .rp-result-d { background-color: rgba(100, 116, 139, 0.2); }

.rp-item-info { display: flex; flex-direction: column; gap: 2px; }
.rp-item-opponent { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: -0.025em; color: rgba(203, 213, 225, 1); transition: color 0.3s; }
.rp-item:hover .rp-item-opponent { color: #fff; }
.rp-item-opponent.active { color: #fff; filter: drop-shadow(0 0 4px rgba(255,255,255,0.3)); }
.rp-item-meta { display: flex; align-items: center; gap: 8px; }
.rp-item-date { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700; color: rgba(100, 116, 139, 1); letter-spacing: 0.1em; }
.rp-item-dot-sep { width: 4px; height: 4px; border-radius: 100%; background-color: rgba(255,255,255,0.1); }
.rp-item-score { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 900; color: rgba(148, 163, 184, 1); font-variant-numeric: tabular-nums; }

.rp-item-type { padding: 4px 8px; border-radius: 6px; font-family: 'Inter', sans-serif; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.rp-type-league { background-color: rgba(6, 182, 212, 0.1); color: rgba(34, 211, 238, 1); box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.3); }
.rp-type-casual { background-color: rgba(30, 41, 59, 0.8); color: rgba(148, 163, 184, 1); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }

.rp-list-fade {
    position: absolute; bottom: 0; left: 0; right: 0; height: 48px;
    background: linear-gradient(to top, rgba(9, 17, 34, 1), transparent);
    pointer-events: none; border-radius: 0 0 2rem 2rem;
}

/* ═══════════════ HBR2 REPLAY OVERLAY ═══════════════ */
#hbr2-replay-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column;
    background: #0a0e1a;
}
#hbr2-replay-topbar {
    height: 48px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
#hbr2-replay-title {
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
    color: rgba(148, 163, 184, 1); letter-spacing: 0.05em;
}
#hbr2-replay-close {
    padding: 8px 16px; border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: rgba(248, 113, 113, 1);
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700;
    letter-spacing: 0.1em; cursor: pointer; transition: all 0.3s;
}
#hbr2-replay-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(248, 113, 113, 0.5);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}
#hbr2-replay-frame {
    flex: 1; width: 100%; border: none;
    background: #0a0e1a;
}

/* Responsive break for grids and layout */
@media (max-width: 1200px) {
    .maps-gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- LOBBY SCREEN (Room List) ---- */
#lobby-screen {
    width: 100vw; height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 144px 48px 32px; /* 48px top + 72px header + 24px gap */
    box-sizing: border-box;
}

#lobby-wrapper {
    width: 100%;
    max-width: calc(1440px - 96px); /* 1344px */
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 144px - 32px);
    max-height: 820px;
}

/* ─── Breadcrumb Bar ─── */
#lobby-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: rgba(15, 23, 42, 0.30);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.lb-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lb-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 1);
    transition: color 0.15s;
    padding: 0;
}
.lb-back:hover {
    color: #22d3ee;
}

.lb-chevron {
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    transition: transform 0.15s;
}
.lb-back:hover .lb-chevron {
    transform: translateX(-3px);
}

.lb-divider {
    width: 1px;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.10);
}

.lb-title {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.lb-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lb-nick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: rgba(15, 23, 42, 0.50);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    transition: all 0.15s;
}
.lb-nick-btn:hover {
    background-color: rgba(30, 41, 59, 0.80);
    border-color: rgba(255, 255, 255, 0.30);
}

.lb-nick-icon {
    font-size: 11px;
}

.lb-nick-name {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 1);
    transition: color 0.15s;
}
.lb-nick-btn:hover .lb-nick-name {
    color: #fff;
}

.lb-create-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}
.lb-create-btn:hover {
    background: linear-gradient(135deg, #22d3ee, #3b82f6);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.5);
    transform: scale(1.05);
}

.lb-create-btn span {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lb-plus-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.20);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    transition: all 0.15s;
}
.lb-create-btn:hover .lb-plus-icon {
    background-color: #fff;
    color: #0891b2;
}

#lobby-container {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    flex: 1;
    min-height: 0;
}

/* ─── Left Filter Panel (HqxBall LobbyFilters) ─── */
#lobby-filters-panel {
    width: 240px;
    flex-shrink: 0;
    background-color: rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.lf-glow {
    position: absolute;
    top: 0; left: 0; right: 0; height: 100px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.02), transparent);
    border-radius: 2rem 2rem 0 0;
    pointer-events: none;
}

.lf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.lf-header h2 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.lf-badge {
    padding: 2px 8px;
    border-radius: 4px;
    background-color: rgba(6, 182, 212, 0.10);
    color: #22d3ee;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    border: 1px solid rgba(6, 182, 212, 0.30);
}

.lf-search {
    position: relative;
    z-index: 1;
}

.lf-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.5;
}

.lf-search input {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 10px 14px 10px 32px;
    color: #fff;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    outline: none;
    transition: all 0.15s;
}
.lf-search input::placeholder {
    color: rgba(100, 116, 139, 0.60);
}
.lf-search input:focus {
    border-color: rgba(34, 211, 238, 0.50);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.50);
}

.lf-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.10), transparent);
}

.lf-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.lf-section h3 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 1);
}

.lf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lf-chip {
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(148, 163, 184, 1);
}
.lf-chip:hover {
    background-color: rgba(255, 255, 255, 0.10);
    color: #fff;
}
.lf-chip.active {
    background-color: rgba(6, 182, 212, 0.20);
    color: rgba(165, 243, 252, 1);
    border-color: rgba(34, 211, 238, 0.50);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.lf-modes {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.lf-mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 4px;
    color: rgba(148, 163, 184, 1);
}
.lf-mode:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(226, 232, 240, 1);
    border-color: rgba(255, 255, 255, 0.10);
}
.lf-mode.active {
    background-color: rgba(255, 255, 255, 0.10);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.20);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lf-mode-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lf-mode-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background-color: rgba(30, 41, 59, 1);
    font-size: 12px;
    transition: all 0.15s;
}
.lf-mode.active .lf-mode-icon {
    background-color: rgba(6, 182, 212, 0.20);
}

.lf-mode-left span:last-child {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.lf-mode-count {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: rgba(100, 116, 139, 0.60);
}
.lf-mode.active .lf-mode-count {
    color: #22d3ee;
}

/* ─── Center: Room List Main ─── */
#lobby-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}



/* ─── Right: Global Activity Panel ─── */
#lobby-activity-panel {
    width: 260px;
    flex-shrink: 0;
    background-color: rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.ga-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom left, rgba(255, 255, 255, 0.02), transparent);
    pointer-events: none;
    border-radius: 2rem;
}

.ga-header h3 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 1);
    position: relative;
    z-index: 1;
}

.ga-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    position: relative;
    z-index: 1;
}

.ga-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: rgba(0, 0, 0, 0.20);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.15s;
}
.ga-item:hover {
    background-color: rgba(0, 0, 0, 0.30);
}

.ga-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ga-user {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: -0.01em;
}
.ga-user-cyan {
    color: #22d3ee;
    text-shadow: 0 0 2px rgba(6, 182, 212, 0.4);
}
.ga-user-amber {
    color: #fbbf24;
}
.ga-user-slate {
    color: rgba(100, 116, 139, 1);
}

.ga-time {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 8px;
    font-weight: 700;
    color: rgba(100, 116, 139, 0.60);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

.ga-text {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: rgba(203, 213, 225, 1);
    word-break: break-word;
}
.ga-text-system {
    color: rgba(100, 116, 139, 1);
    font-style: italic;
}
.ga-text-amber {
    color: rgba(251, 191, 36, 0.80);
}

.ga-input {
    position: relative;
    flex-shrink: 0;
    margin-top: auto;
    z-index: 1;
}

.ga-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
}

.ga-input input {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 8px 12px 8px 32px;
    color: #fff;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    outline: none;
    transition: all 0.15s;
}
.ga-input input::placeholder {
    color: rgba(100, 116, 139, 0.60);
}
.ga-input input:focus {
    border-color: rgba(34, 211, 238, 0.50);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.50);
}


/* ─── Lobby Body / Table / Filters ─── */
#lobby-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

#lobby-table-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Top bar with room count */
.lg-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 10px 8px;
}

.lg-count {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(148, 163, 184, 1);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Grid Container */
.lg-grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background-color: rgba(15, 23, 42, 0.30);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* Grid Header */
.lg-header {
    display: grid;
    grid-template-columns: 4fr 1fr 1fr 1.5fr 1.5fr;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(2, 6, 23, 0.40);
}

.lg-header span {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.60);
}
.lg-h-name { padding-left: 8px; }
.lg-h-players, .lg-h-pass { text-align: center; }
.lg-h-map { text-align: right; }
.lg-h-action { text-align: right; padding-right: 8px; }

/* Grid Body (scrollable) */
.lg-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Grid Row */
.lg-row {
    display: grid;
    grid-template-columns: 4fr 1fr 1fr 1.5fr 1.5fr;
    gap: 8px;
    padding: 12px 16px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: background-color 0.15s;
}
.lg-row-alt {
    background-color: rgba(15, 23, 42, 0.20);
}
.lg-row:hover {
    background-color: rgba(30, 41, 59, 0.40);
}
.lg-row.selected {
    background-color: rgba(6, 182, 212, 0.10);
}

/* Cells */
.lg-cell {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(203, 213, 225, 1);
}

/* Name cell with ping dot */
.lg-name {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    overflow: hidden;
}

.lg-ping {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.lg-ping-green {
    background-color: #10b981;
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
}
.lg-ping-amber {
    background-color: #f59e0b;
}
.lg-ping-red {
    background-color: #ef4444;
}

.lg-name-text {
    font-size: 13px;
    font-weight: 700;
    color: rgba(226, 232, 240, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}
.lg-row:hover .lg-name-text {
    color: #22d3ee;
}

/* Players */
.lg-players {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
}
.lg-full {
    color: #f87171 !important;
}

/* Pass */
.lg-pass {
    text-align: center;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.60);
}

/* Map */
.lg-map {
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.80);
}

/* Action cell */
.lg-action {
    display: flex;
    justify-content: flex-end;
    padding-right: 8px;
}

.lg-join-btn {
    padding: 5px 14px;
    border-radius: 8px;
    background-color: rgba(30, 41, 59, 0.80);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(203, 213, 225, 1);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}
.lg-join-btn:hover {
    background-color: rgba(6, 182, 212, 0.20);
    border-color: rgba(34, 211, 238, 0.50);
    color: #22d3ee;
}

/* Filters */
#lobby-filters {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#lobby-filters .filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 10px;
    color: rgba(203, 213, 225, 1);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    user-select: none;
    transition: all 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#lobby-filters .filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.10);
}

/* Hide native checkbox */
#lobby-filters .filter-btn input[type="checkbox"] {
    display: none;
}

/* Handle checkmark visibility */
#lobby-filters .filter-btn .icon-ok {
    font-size: 10px;
    visibility: hidden;
    color: #22d3ee;
}

/* When checked, show the icon */
#lobby-filters .filter-btn input[type="checkbox"]:checked ~ .icon-ok {
    visibility: visible;
}

/* Create Room Dialog */
#create-room-dialog {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
#create-room-box {
    background-color: #1a2125;
    border-radius: 5px;
    padding: 10px 15px;
    width: 320px;
}
#create-room-box h2 {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #793333;
}
.cr-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.cr-row label {
    width: 100px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}
.cr-row input, .cr-row select {
    flex: 1;
    background-color: #1a2125;
    border: 1px solid #3a4952;
    border-radius: 3px;
    color: #fff;
    padding: 5px 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
}
.cr-row input:focus, .cr-row select:focus {
    border-color: #389cdb;
    outline: none;
}
.cr-toggle {
    cursor: pointer;
    justify-content: center;
    text-align: center;
    user-select: none;
}
.cr-toggle:hover {
    background-color: #2f4050;
}
.cr-buttons {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.cr-buttons .lobby-btn {
    flex: 1;
}


/* ---- GAME VIEW (Full Screen) ---- */
#game-view {
    width: 100vw; height: 100vh;
    position: relative;
    overflow: hidden;
    background: #020617;
    z-index: 1;
}

/* ---- TOP BAR (HqxBall Premium Scoreboard) ---- */
#top-bar {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

#scoreboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    padding: 0 40px;
    height: 64px;
    border-radius: 2rem;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.sb-team {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sb-label {
    font-family: 'Inter', 'Arial', sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 1px;
}
.sb-label.red {
    color: rgba(239, 68, 68, 0.9);
}
.sb-label.blue {
    color: rgba(59, 130, 246, 0.9);
}

.sb-score {
    font-family: 'Inter', 'Arial Black', sans-serif;
    font-weight: 900;
    font-size: 40px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.sb-score.red {
    color: #f87171;
    text-shadow: 0 0 15px rgba(248, 113, 113, 0.6);
}
.sb-score.blue {
    color: #60a5fa;
    text-shadow: 0 0 15px rgba(96, 165, 250, 0.6);
}

.sb-timer {
    font-family: 'Inter', 'Arial Black', sans-serif;
    font-weight: 900;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* ---- TOP RIGHT BUTTONS — HqxBall Premium ---- */
#top-buttons {
    position: absolute;
    top: 16px; right: 16px;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    padding: 6px;
    z-index: 10;
    display: flex;
    gap: 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.5);
}

#top-buttons button {
    background-color: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.50);
    padding: 8px 14px;
    border-radius: 9999px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
#top-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.80);
    border-color: rgba(255, 255, 255, 0.08);
}
#top-buttons button:active {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Menu button — primary action, cyan accent */
#btn-menu {
    background-color: rgba(6, 182, 212, 0.10) !important;
    border-color: rgba(6, 182, 212, 0.20) !important;
    color: #22d3ee !important;
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.08);
}
#btn-menu:hover {
    background-color: rgba(6, 182, 212, 0.20) !important;
}

/* Sound button icon */
#btn-sound {
    padding: 8px 10px !important;
    font-size: 14px !important;
}

/* Settings button icon */
#btn-settings {
    padding: 8px 10px !important;
    font-size: 14px !important;
}

/* Volume Bar — vertical slider under sound button */
#sound-btn-wrap {
    position: relative;
}
#volume-bar {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px 10px;
    display: flex;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#volume-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    width: 14px;
    height: 120px;
    background: transparent;
    cursor: pointer;
}
#volume-slider::-webkit-slider-runnable-track {
    width: 4px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 9999px;
}
#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22d3ee;
    cursor: pointer;
    margin-left: -5px;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
}
#volume-slider::-moz-range-track {
    width: 4px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 9999px;
}
#volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22d3ee;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
}

/* ---- CANVAS (full screen) ---- */
#canvas-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---- BOTTOM SECTION — HqxBall Premium Chat (bottom-left) ---- */
#bottom-section {
    position: absolute;
    bottom: 32px;
    left: 32px;
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
    pointer-events: none;
}

/* ---- STATS VIEW — Modernized, original position ---- */
#stats-view {
    position: absolute;
    left: 0;
    bottom: -40px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    pointer-events: none;
}

#stats-view div {
    display: flex;
    align-items: center;
    gap: 4px;
}

#stats-view span {
    color: #34d399;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    font-size: 12px;
    text-shadow: 0 0 6px rgba(52, 211, 153, 0.3);
}

/* ---- CHATBOX (Messages Panel + Input Capsule) ---- */
#chatbox {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

#chat-log {
    padding: 16px;
    max-height: 150px;
    overflow-y: auto;
    border-radius: 24px;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

#chat-log .log-contents {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-msg {
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.625;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06));
    margin: 0;
    overflow: hidden;
    flex-shrink: 0;
}

/* Author name (bold tag from chat.js) */
.chat-msg strong {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    margin-right: 8px;
}

.chat-msg.system {
    color: rgba(255, 255, 255, 0.9);
}

.chat-msg.system strong {
    color: rgba(34, 211, 238, 0.8);
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.5));
}

.chat-msg.announcement {
    border-left: 3px solid rgba(239, 68, 68, 0.6);
    padding-left: 12px;
    border-radius: 2px;
}

/* Chat Input Capsule */
#chat-input-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-radius: 9999px;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.5);
    height: auto;
    margin-top: 0;
}

#chat-input {
    color: rgba(255, 255, 255, 0.9);
    background-color: transparent;
    border: none;
    padding: 0;
    flex-grow: 1;
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    outline: none;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.30);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

#chat-input:focus {
    border: none;
    padding: 0;
    outline: none;
}

/* Scrollbar (Haxball style) */
.thin-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) rgba(0,0,0,0.2);
}
.thin-scrollbar::-webkit-scrollbar { width: 5px; background-color: rgba(0,0,0,0.2); }
.thin-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

/* -----------------------------
   ESC Menu Overlay — HqxBall Premium
----------------------------- */
#room-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    background-color: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

#room-container {
    background-color: rgba(15, 23, 42, 0.60);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 2rem;
    padding: 0;
    width: 85vw;
    max-width: 900px;
    color: #fff;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

#room-container h1 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.01em;
    margin: 0;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
#room-container h1::after {
    content: '';
    display: block;
    width: 200px;
    max-width: 100%;
    height: 2px;
    background: linear-gradient(to right, #ef4444, transparent);
    border-radius: 9999px;
    opacity: 0.8;
    position: absolute;
    bottom: 0;
    left: 24px;
}

/* Header row with room name + buttons */
#room-header-btns {
    position: absolute;
    top: 20px; right: 24px;
    display: flex;
    gap: 12px;
}

/* HqxBall Header Buttons: Rec / Link / Leave */
.hdr-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid;
}

/* Rec Button — Default (not recording) */
#rec-btn {
    background-color: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.20);
    color: #ef4444;
    box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.1);
}
#rec-btn:hover {
    background-color: rgba(239, 68, 68, 0.20);
}

/* Rec Button — Recording state (toggled via JS) */
#rec-btn.recording {
    background-color: rgba(34, 197, 94, 0.10);
    border-color: rgba(34, 197, 94, 0.30);
    color: #4ade80;
    box-shadow: inset 0 0 15px rgba(34, 197, 94, 0.1);
}
#rec-btn.recording:hover {
    background-color: rgba(34, 197, 94, 0.20);
}

/* Rec Dot */
.rec-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ef4444;
}
#rec-btn.recording .rec-dot {
    background-color: #4ade80;
    animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Link Button — Cyan */
#link-btn {
    background-color: rgba(6, 182, 212, 0.10);
    border-color: rgba(6, 182, 212, 0.20);
    color: #22d3ee;
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.1);
}
#link-btn:hover {
    background-color: rgba(6, 182, 212, 0.20);
}

/* Leave Button — Red */
#leave-btn {
    background-color: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.20);
    color: #ef4444;
}
#leave-btn:hover {
    background-color: rgba(239, 68, 68, 0.20);
    color: #f87171;
}

/* Teams Area */
#teams-row {
    display: flex;
    gap: 20px;
    padding: 24px;
    margin-bottom: 0;
}

#room-side-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 44px;
    width: 70px;
    flex-shrink: 0;
}

#teams-area {
    display: flex;
    flex: 1;
    gap: 4px;
    height: 260px;
}

.team-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-header {
    display: flex;
    justify-content: center;
    gap: 4px;
}

/* Joint buttons for Red and Blue */
.team-header .join-btn { margin: 0; }
.team-header .btn-left { border-radius: 12px 0 0 12px; }
.team-header .btn-right { border-radius: 0 12px 12px 0; }

.team-header.joint .join-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.team-header.joint .join-btn:hover { background-color: rgba(255, 255, 255, 0.10); }
.team-header.joint .join-btn:active { background-color: rgba(255, 255, 255, 0.03); }

/* Team join buttons (Red / Spectators / Blue) */
.join-btn, .room-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}
.join-btn:hover, .room-btn:hover {
    background-color: rgba(255, 255, 255, 0.10);
}
.join-btn:active, .room-btn:active {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Red team button */
.team-col:first-child .team-header .join-btn:first-child {
    background-color: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.20);
    color: #ef4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    box-shadow: inset 0 0 15px rgba(239, 68, 68, 0.1);
}
.team-col:first-child .team-header .join-btn:first-child:hover {
    background-color: rgba(239, 68, 68, 0.20);
}

/* Blue team button */
.team-col:last-child .team-header .join-btn:first-child {
    background-color: rgba(59, 130, 246, 0.10);
    border-color: rgba(59, 130, 246, 0.20);
    color: #60a5fa;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    box-shadow: inset 0 0 15px rgba(59, 130, 246, 0.1);
}
.team-col:last-child .team-header .join-btn:first-child:hover {
    background-color: rgba(59, 130, 246, 0.20);
}

.team-header .join-btn { min-width: 0; flex: 1; }
.arrow-btn { 
    min-width: 38px !important; 
    padding: 10px 8px !important; 
    flex: 0 !important;
}

/* Player list */
.player-list {
    flex: 1;
    min-height: 0;
    background-color: rgba(0, 0, 0, 0.40);
    overflow-y: auto;
    border-radius: 16px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.player-list-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    border-radius: 12px;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.player-list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
}
.player-list-item .flagico { margin-right: 8px; flex-shrink: 0; position: relative; top: 0; }
.player-list-item .name {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-right: 10px;
    color: rgba(255, 255, 255, 0.90);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.player-list-item.admin .name { color: #ffdb72; }
.player-list-item .ping {
    min-width: 30px;
    text-align: right;
    font-family: 'Inter', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #34d399;
}

/* Admin action buttons */
.admin-actions { display: none; gap: 4px; margin-left: auto; margin-right: 4px; }
.player-list-item:hover .admin-actions { display: flex; }
.admin-btn {
    background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer;
    font-size: 12px; padding: 2px 6px; border-radius: 8px; line-height: 1;
    transition: all 0.15s;
}
.admin-btn:hover { background-color: rgba(255,255,255,0.10); color: #fff; }
.admin-btn.kick-btn:hover { color: #f87171; }
.admin-btn.team-btn:hover { color: #60a5fa; }

.small-btn {
    min-width: 65px !important;
    font-size: 9px !important;
    padding: 8px 10px !important;
    letter-spacing: 0.2em !important;
}

.lock-btn { color: #f87171; }

/* Room Settings (Time, Score, Stadium) */
#room-settings {
    width: 380px;
    margin: 0 auto;
    margin-bottom: 28px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#room-settings-inner {
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 10px 16px;
    margin-bottom: 0;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    transition: background-color 0.15s;
}
.setting-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
}
.setting-row .lbl {
    flex: 0 0 auto;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 1);
}
.setting-row .val {
    flex: 0 0 auto;
    width: 56px;
    background-color: rgba(0, 0, 0, 0.40);
    padding: 4px 12px;
    border-radius: 8px;
    text-align: center;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Inter', monospace;
    font-size: 14px;
    font-weight: 900;
    color: #22d3ee;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}
.setting-row .val.no-bg {
    background-color: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    width: auto;
}

/* Number inputs in settings */
.setting-input {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
    outline: none;
    font-family: 'Inter', monospace;
    font-size: 14px;
    font-weight: 900;
    color: #22d3ee !important;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.40) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
    padding: 4px 12px !important;
    width: 56px !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}
.setting-input::-webkit-outer-spin-button,
.setting-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.setting-input:focus {
    border-color: rgba(6, 182, 212, 0.30) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 8px rgba(6, 182, 212, 0.2) !important;
}

/* Stadium name display */
.stadium-val {
    font-family: 'Inter', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: #fff !important;
}

.pick-btn {
    margin-left: auto;
    background-color: rgba(6, 182, 212, 0.10);
    border: 1px solid rgba(6, 182, 212, 0.20);
    color: #22d3ee;
    min-width: 60px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 8px;
    transition: all 0.15s;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}
.pick-btn:hover {
    background-color: rgba(6, 182, 212, 0.20);
}

/* ─── Stadium Picker Dialog — HqxBall Premium ─── */
#stadium-picker {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
}

#stadium-picker-container {
    background-color: rgba(15, 23, 42, 0.80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 2rem;
    padding: 0;
    width: 500px;
    height: 600px;
    max-height: 85vh;
    color: #fff;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
#stadium-picker-container h1 {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin: 0;
    padding: 20px 32px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent);
    position: relative;
}
#stadium-picker-container h1::after {
    content: '';
    display: block;
    width: 200px;
    height: 2px;
    background: linear-gradient(to right, #ef4444, transparent);
    border-radius: 9999px;
    opacity: 0.8;
    position: absolute;
    bottom: 0;
    left: 32px;
}

/* Body: list + buttons side by side */
.stadium-picker-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Stadium List (left column) */
.stadium-list {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    user-select: none;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.20);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stadium-item {
    line-height: 1;
    padding: 12px 16px;
    cursor: pointer;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: rgba(148, 163, 184, 1);
    border-radius: 12px;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.stadium-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}
.stadium-item.selected {
    background-color: rgba(6, 182, 212, 0.20);
    border-color: rgba(6, 182, 212, 0.30);
    color: #22d3ee;
    box-shadow: inset 0 0 15px rgba(6, 182, 212, 0.1);
}

/* Right Column: Action Buttons */
.stadium-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 160px;
    padding: 24px;
    background-color: rgba(0, 0, 0, 0.40);
    flex-shrink: 0;
}

.stadium-buttons .room-btn {
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: all 0.15s;
}

/* Pick button — Cyan primary */
.stadium-buttons .room-btn:first-child {
    background-color: rgba(6, 182, 212, 0.10);
    border: 1px solid rgba(6, 182, 212, 0.30);
    color: #22d3ee;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}
.stadium-buttons .room-btn:first-child:hover {
    background-color: rgba(6, 182, 212, 0.20);
}

/* Delete button */
.stadium-buttons .room-btn.delete-btn {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(148, 163, 184, 1);
}
.stadium-buttons .room-btn.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.30);
    color: #f87171;
}

/* Load button — Blue */
.stadium-buttons .room-btn.load-btn {
    background-color: rgba(59, 130, 246, 0.10);
    border: 1px solid rgba(59, 130, 246, 0.30);
    color: #60a5fa;
}
.stadium-buttons .room-btn.load-btn:hover {
    background-color: rgba(59, 130, 246, 0.20);
}

/* Export button */
.stadium-buttons .room-btn.export-btn {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(203, 213, 225, 1);
}
.stadium-buttons .room-btn.export-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
}

/* Room Controls — HqxBall Premium */
#room-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px 0 32px;
    background-color: rgba(0, 0, 0, 0.20);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#start-btn {
    background-color: rgba(34, 197, 94, 0.10);
    border: 1px solid rgba(34, 197, 94, 0.30);
    color: #4ade80;
    padding: 14px 32px;
    border-radius: 9999px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    min-width: 0;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
    transition: all 0.15s;
}
#start-btn:hover {
    background-color: rgba(34, 197, 94, 0.20);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}
#start-btn:active { background-color: rgba(34, 197, 94, 0.30); }

#start-btn.stop {
    background-color: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.30);
    color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}
#start-btn.stop:hover {
    background-color: rgba(239, 68, 68, 0.20);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}
#start-btn.stop:active { background-color: rgba(239, 68, 68, 0.30); }

.pause-btn {
    background-color: rgba(6, 182, 212, 0.10);
    border: 1px solid rgba(6, 182, 212, 0.30);
    color: #22d3ee;
    padding: 14px 32px;
    border-radius: 9999px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
    transition: all 0.15s;
}
.pause-btn:hover {
    background-color: rgba(6, 182, 212, 0.20);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
}

/* FPS display bottom-left like Haxball */
#fps-display {
    position: fixed;
    bottom: 0; left: 0;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    padding: 2px 6px;
}

/* ============================================= */
/* SETTINGS OVERLAY                              */
/* ============================================= */
/* ═══════════ SETTINGS OVERLAY — HqxBall Premium ═══════════ */
#settings-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    font-family: 'Inter', Arial, sans-serif;
}

#settings-container {
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    padding: 0;
    width: 520px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9);
}

/* Header */
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.04), transparent);
    margin-bottom: 0;
    position: relative;
}
.settings-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 28px;
    width: 160px; height: 2px;
    background: linear-gradient(to right, #ef4444, transparent);
    border-radius: 9999px;
    opacity: 0.8;
}

.settings-header h2 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.settings-header .room-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(203, 213, 225, 1);
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
}
.settings-header .room-btn:hover {
    background-color: rgba(255, 255, 255, 0.10);
    color: #fff;
}

/* Tabs — Segmented Pills */
.settings-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    justify-content: center;
    margin-bottom: 0;
}

.tab-btn {
    background-color: transparent;
    border: 1px solid transparent;
    color: rgba(100, 116, 139, 1);
    padding: 8px 18px;
    border-radius: 10px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}
.tab-btn:hover {
    color: rgba(203, 213, 225, 1);
    background-color: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
    background-color: rgba(15, 23, 42, 0.80);
    color: #22d3ee;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    border-color: rgba(34, 211, 238, 0.30);
}

/* Tab content */
.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px 24px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Setting rows */
.s-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    padding: 4px 0;
}

.s-label {
    white-space: nowrap;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 1);
}

.s-val {
    font-size: 11px;
    font-weight: 900;
    color: #22d3ee;
    min-width: 30px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
}

/* Selects — Modern Pill */
.s-row select {
    background-color: rgba(0, 0, 0, 0.40);
    color: #22d3ee;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 8px 14px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.15s;
}
.s-row select:hover {
    border-color: rgba(34, 211, 238, 0.20);
}
.s-row select:focus {
    border-color: rgba(34, 211, 238, 0.30);
}

/* Segmented Pill — HqxBall SegmentedPill */
.seg-pill {
    display: flex;
    background-color: rgba(0, 0, 0, 0.50);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.seg-opt {
    padding: 8px 16px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 1);
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-variant-numeric: tabular-nums;
}
.seg-opt:hover {
    color: rgba(203, 213, 225, 1);
    background-color: rgba(255, 255, 255, 0.03);
}
.seg-opt.active {
    background-color: rgba(15, 23, 42, 0.80);
    color: #22d3ee;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(34, 211, 238, 0.30);
}

/* Checkboxes — Cyan Check / X */
.s-check {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(148, 163, 184, 1);
    cursor: pointer;
    transition: color 0.15s;
    letter-spacing: 0.03em;
}
.s-check:hover { color: rgba(203, 213, 225, 1); }

.s-check input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: rgba(30, 41, 59, 0.40);
    border: 1px solid rgba(100, 116, 139, 0.50);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.s-check input[type="checkbox"]:checked {
    background-color: rgba(6, 182, 212, 0.20);
    border-color: rgba(34, 211, 238, 0.50);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.s-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #22d3ee;
    font-size: 12px;
    font-weight: 900;
    top: 0; left: 3px;
}

.s-check input[type="checkbox"]:not(:checked)::after {
    content: 'X';
    position: absolute;
    color: rgba(100, 116, 139, 0.50);
    font-size: 10px;
    font-weight: 900;
    top: 1px; left: 4px;
}

/* Sliders — Glowing Cyan */
.slider-row { flex-wrap: wrap; gap: 8px; }

.slider-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.50);
    border-radius: 9999px;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.7), 0 2px 6px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(34, 211, 238, 0.50);
}

.slider-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    border: 1px solid rgba(34, 211, 238, 0.50);
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.7);
}

/* ─── Keybinding Rows (Input Tab) — HqxBall Premium ─── */
.keybind-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 16px;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    transition: all 0.15s;
}
.keybind-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.keybind-label {
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 900;
    font-size: 13px;
    min-width: 90px;
    color: #fff;
    letter-spacing: 0.05em;
    text-transform: capitalize;
}

.keybind-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
}

.key-tag {
    display: inline-flex;
    align-items: center;
    background-color: rgba(100, 116, 139, 0.40);
    color: rgba(241, 245, 249, 1);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 700;
    gap: 8px;
    border: 1px solid rgba(100, 116, 139, 0.50);
    letter-spacing: 0.05em;
    transition: all 0.15s;
    cursor: pointer;
}
.key-tag:hover {
    background-color: rgba(100, 116, 139, 0.60);
}

.key-remove {
    cursor: pointer;
    color: rgba(148, 163, 184, 1);
    font-weight: 900;
    font-size: 12px;
    line-height: 1;
    transition: color 0.15s;
}
.key-remove:hover {
    color: #f87171;
}

.key-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    background-color: rgba(100, 116, 139, 0.40);
    color: rgba(241, 245, 249, 1);
    border: 1px solid rgba(100, 116, 139, 0.50);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s;
}
.key-add-btn:hover {
    background-color: rgba(100, 116, 139, 0.60);
}
.key-add-btn.listening {
    background-color: rgba(6, 182, 212, 0.20);
    border-color: rgba(34, 211, 238, 0.50);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* Press a key overlay */
#presskey-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.presskey-box {
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 32px 56px;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9);
}

/* ═══════════════════ REPLAY SYSTEM ═══════════════════ */

/* Replays button in lobby sidebar */
.lobby-btn.replay-btn {
    background-color: #3a5a8a;
    border-color: #4a6a9a;
}
.lobby-btn.replay-btn:hover {
    background-color: #4a6a9a;
}

/* Rec button recording state */
#rec-btn.recording {
    /* No background change — just the dot turns red */
}
#rec-btn.recording #rec-dot {
    color: #e74c3c !important;
}

/* Replay Controls Bar */
#replay-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0,0,0,0.85);
    border-top: 1px solid #333;
    font-family: Arial, Helvetica, sans-serif;
    color: #ddd;
    font-size: 13px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}
#replay-controls button {
    background: #2d3b44;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 14px;
}
#replay-controls button:hover {
    background: #3d4b54;
}
#replay-speed {
    min-width: 32px;
    text-align: center;
    font-weight: bold;
    color: #8bc34a;
}
#replay-time {
    min-width: 110px;
    text-align: center;
    color: #aaa;
    font-variant-numeric: tabular-nums;
}
#replay-progress {
    flex: 1;
    height: 10px;
    background: #1a1a1a;
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden;
    min-width: 100px;
}
#replay-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 5px;
    width: 0%;
    transition: width 0.05s linear;
}

/* Replay Menu Overlay */
.replay-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    font-family: Arial, Helvetica, sans-serif;
}
.replay-menu-box {
    background: #2d3b44;
    padding: 30px 40px;
    border-radius: 8px;
    text-align: center;
    min-width: 350px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.replay-menu-box h2 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 22px;
}
.replay-menu-box p {
    color: #aaa;
    margin: 0 0 20px 0;
    font-size: 13px;
}
.replay-menu-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.replay-menu-btn {
    padding: 12px 20px !important;
    font-size: 14px !important;
    text-align: left !important;
    border-radius: 6px !important;
}
.replay-menu-btn.hbr2-btn {
    background-color: #3a5a8a !important;
    border-color: #4a6a9a !important;
}
.replay-menu-btn.hbr2-btn:hover {
    background-color: #4a6a9a !important;
}

/* ═══════════════════ ROOM LINK DIALOG — HqxBall Premium ═══════════════════ */
.room-link-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    font-family: 'Inter', Arial, sans-serif;
}

.room-link-box {
    width: 400px;
    background-color: rgba(15, 23, 42, 0.80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 2rem;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9);
}

/* Icon circle */
.room-link-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: rgba(6, 182, 212, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 28px;
    box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.2);
}

.room-link-box h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin: 0 0 8px;
    text-align: center;
}

.room-link-box p {
    color: rgba(148, 163, 184, 1);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 32px;
    padding: 0 16px;
    line-height: 1.5;
}

/* URL row pill */
.room-link-url-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 8px 8px 8px 16px;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.room-link-url {
    flex: 1;
    font-family: 'Inter', monospace;
    font-size: 11px;
    font-weight: 700;
    color: rgba(203, 213, 225, 1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
    cursor: text;
}

/* Copy button — cyan default */
.room-link-copy-btn {
    padding: 8px 20px;
    border-radius: 12px;
    background-color: rgba(6, 182, 212, 0.10);
    border: 1px solid rgba(6, 182, 212, 0.30);
    color: #22d3ee;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.room-link-copy-btn:hover {
    background-color: rgba(6, 182, 212, 0.20);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

/* Copy button — green copied state */
.room-link-copy-btn.copied {
    background-color: rgba(34, 197, 94, 0.20);
    border-color: rgba(34, 197, 94, 0.30);
    color: #4ade80;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

/* Close link */
.room-link-close {
    margin-top: 8px;
    background: none;
    border: none;
    color: rgba(100, 116, 139, 1);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s;
    padding: 4px 8px;
}
.room-link-close:hover {
    color: #fff;
}

/* ═══════════════════ LEAVE ROOM DIALOG — HqxBall Premium ═══════════════════ */
.leave-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    font-family: 'Inter', Arial, sans-serif;
}

.leave-box {
    width: 340px;
    background-color: rgba(15, 23, 42, 0.80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 2rem;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9);
}

/* Red icon circle */
.leave-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 24px;
    color: #f87171;
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.2);
}

.leave-box h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin: 0 0 8px;
    text-align: center;
}

.leave-box p {
    color: rgba(148, 163, 184, 1);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 24px;
    padding: 0 8px;
    line-height: 1.5;
}

/* Button row */
.leave-btns {
    width: 100%;
    display: flex;
    gap: 12px;
}

/* Stay button — ghost */
.leave-stay-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(203, 213, 225, 1);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
}
.leave-stay-btn:hover {
    background-color: rgba(255, 255, 255, 0.10);
}

/* Leave button — red neon */
.leave-go-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 12px;
    background-color: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.30);
    color: #ef4444;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}
.leave-go-btn:hover {
    background-color: rgba(239, 68, 68, 0.20);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}
