﻿/* =========================================
   NEON ARCADE - CORE STYLE
   ========================================= */
:root {
    --bg-dark: #050812;
    --bg-card: #11182b;
    --bg-soft: #0a1020;
    --primary: #00f3ff;
    --secondary: #ff4b8d;
    --accent: #ffd369;
    --text-main: #f5f7ff;
    --text-dim: #9ca7cb;
    --danger: #ff285a;
    --success: #5fffa5;
    --nav-height: 72px;
    --header-height: 64px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background:
        radial-gradient(circle at 15% 15%, rgba(0, 243, 255, 0.12), transparent 32%),
        radial-gradient(circle at 85% 80%, rgba(255, 75, 141, 0.14), transparent 35%),
        linear-gradient(160deg, #04070f 0%, #060814 55%, #05060f 100%);
    min-height: 100vh;
    min-height: 100svh;
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: none;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    transition: background 0.45s ease;
}

body.lobby-theme-morpion {
    background:
        radial-gradient(circle at 16% 18%, rgba(0, 243, 255, 0.16), transparent 34%),
        radial-gradient(circle at 84% 82%, rgba(255, 75, 141, 0.16), transparent 36%),
        linear-gradient(160deg, #04070f 0%, #060914 56%, #05060f 100%);
}

body.lobby-theme-chess {
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 211, 105, 0.2), transparent 36%),
        radial-gradient(circle at 82% 78%, rgba(90, 160, 255, 0.18), transparent 38%),
        linear-gradient(160deg, #09060f 0%, #111023 58%, #06060d 100%);
}

body.lobby-theme-connect4 {
    background:
        radial-gradient(circle at 14% 20%, rgba(255, 95, 144, 0.18), transparent 35%),
        radial-gradient(circle at 82% 74%, rgba(255, 211, 105, 0.2), transparent 36%),
        linear-gradient(160deg, #070510 0%, #140d1e 58%, #06050d 100%);
}

.app-body {
    min-height: 100vh;
    min-height: 100svh;
}

.neon-bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.neon-bg-grid {
    background:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.23;
    mix-blend-mode: screen;
    animation: neon-grid-drift 18s linear infinite;
}

.neon-bg-glow {
    background:
        radial-gradient(circle at 20% 22%, rgba(0, 243, 255, 0.16), transparent 36%),
        radial-gradient(circle at 82% 75%, rgba(255, 75, 141, 0.14), transparent 35%),
        radial-gradient(circle at 50% 110%, rgba(255, 211, 105, 0.12), transparent 42%);
    filter: blur(2px);
    animation: neon-glow-shift 12s ease-in-out infinite alternate;
}

.neon-bg-scanline {
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.05) 0,
        rgba(255, 255, 255, 0.05) 1px,
        transparent 3px,
        transparent 6px
    );
    opacity: 0.07;
    animation: neon-scanline-shift 9s linear infinite;
}

/* =========================================
   Shared components
   ========================================= */
.blink {
    animation: blink-anim 2s infinite;
    color: var(--secondary);
}

.btn-neon {
    width: 100%;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #00f3ff 0%, #79fbff 100%);
    color: #00141a;
    padding: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 243, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-neon:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 243, 255, 0.28);
}

.app-header {
    height: var(--header-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 10, 22, 0.86);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 20;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

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

.notif-btn {
    border: 1px solid rgba(0, 243, 255, 0.35);
    background: rgba(0, 243, 255, 0.1);
    color: #a8faff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
}

.sound-toggle-float {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 95;
}

.notif-count {
    position: absolute;
    right: -6px;
    top: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ff285a;
    color: #fff;
    font-size: 0.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.notif-panel {
    position: fixed;
    top: 68px;
    right: 12px;
    width: min(90vw, 340px);
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(6, 10, 22, 0.96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    z-index: 70;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.notif-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.account-panel {
    position: fixed;
    top: 68px;
    right: 58px;
    width: min(92vw, 350px);
    border-radius: 13px;
    z-index: 70;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.account-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.moderation-panel {
    width: min(96vw, 620px);
    right: 10px;
}

.notif-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 1px;
}

.notif-head button {
    border: 1px solid rgba(255, 211, 105, 0.4);
    border-radius: 999px;
    background: rgba(255, 211, 105, 0.12);
    color: #ffe7ab;
    font-size: 0.66rem;
    padding: 4px 8px;
    cursor: pointer;
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-item {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.notif-item.unread {
    border-color: rgba(0, 243, 255, 0.4);
    background: rgba(0, 243, 255, 0.12);
}

.notif-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.67rem;
    color: #a9efff;
}

.notif-body {
    font-size: 0.83rem;
    margin-top: 3px;
    color: #edf3ff;
}

.notif-empty {
    color: var(--text-dim);
    font-size: 0.82rem;
    text-align: center;
    padding: 14px 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(0, 243, 255, 0.55);
    background: rgba(0, 243, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.86rem;
    overflow: hidden;
    position: relative;
    animation: avatar-soft-halo 4s ease-in-out infinite;
}

.avatar-frame {
    position: relative;
}

.avatar-frame::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    pointer-events: none;
}

.frame-neon::after {
    border: 2px solid rgba(0, 243, 255, 0.9);
    box-shadow: 0 0 16px rgba(0, 243, 255, 0.55);
}

.frame-gold::after {
    border: 2px solid rgba(255, 211, 105, 0.95);
    box-shadow: 0 0 14px rgba(255, 211, 105, 0.5);
}

.frame-plasma::after {
    border: 2px solid rgba(255, 75, 141, 0.95);
    box-shadow: 0 0 14px rgba(255, 75, 141, 0.55);
    animation: avatar-pulse 2.2s ease-in-out infinite;
}

.frame-aurora::after {
    border: 2px solid rgba(130, 255, 200, 0.9);
    box-shadow: 0 0 14px rgba(130, 255, 200, 0.45);
    animation: avatar-spin 6s linear infinite;
}

.avatar-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-text {
    display: grid;
    line-height: 1.1;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 700;
}

.user-status {
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.6px;
}

.dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    margin-right: 4px;
}

.admin-badge,
.chat-admin-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.8px;
    color: #ffe39b;
    border: 1px solid rgba(255, 211, 105, 0.6);
    background: rgba(255, 211, 105, 0.16);
    border-radius: 999px;
    padding: 3px 7px;
    text-transform: uppercase;
}

.logout-link {
    color: var(--danger);
    font-size: 1.05rem;
    text-decoration: none;
}

/* =========================================
   Tabs + navigation
   ========================================= */
.app-content {
    flex: 1;
    position: relative;
    padding-bottom: var(--nav-height);
}

.tab-section {
    position: absolute;
    inset: 0;
    padding: 18px;
    padding-bottom: 104px;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.tab-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.tab-section.tab-enter {
    animation: tab-enter 0.3s ease;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: #d9edff;
    border-left: 3px solid rgba(0, 243, 255, 0.7);
    padding-left: 10px;
}

.bottom-nav {
    position: fixed !important;
    inset: auto 0 0 0;
    top: auto;
    bottom: 0 !important;
    height: var(--nav-height);
    padding-bottom: 0;
    margin: 0;
    background: rgba(4, 6, 15, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 120;
    transform: none;
    border-radius: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-dim);
    font-size: 0.68rem;
    cursor: pointer;
    letter-spacing: 0.6px;
    transition: color 0.25s ease;
}

.nav-item i {
    font-size: 1.28rem;
}

.nav-item.active {
    color: var(--primary);
    text-shadow: 0 0 11px rgba(0, 243, 255, 0.5);
}

/* =========================================
   Games cards
   ========================================= */
.game-card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(150deg, rgba(18, 27, 48, 0.9) 0%, rgba(7, 10, 20, 0.92) 100%);
    overflow: hidden;
    position: relative;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
    animation: lobby-card-in 0.42s ease both;
}

.game-card.featured {
    box-shadow: 0 22px 36px rgba(0, 0, 0, 0.35);
}

.games-grid .game-card:nth-child(2) {
    animation-delay: 0.06s;
}

.games-grid .game-card:nth-child(3) {
    animation-delay: 0.12s;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 243, 255, 0.35);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.42), 0 0 22px rgba(0, 243, 255, 0.12);
}

.game-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.66rem;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    background: rgba(255, 211, 105, 0.18);
    color: #ffd369;
    border: 1px solid rgba(255, 211, 105, 0.4);
    animation: badge-pulse 2.4s ease-in-out infinite;
}

.game-preview {
    font-size: 2.9rem;
    text-align: center;
    padding: 20px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.connect4-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 86px;
}

.connect4-logo .p4-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.25);
    margin-right: 0;
}

.connect4-logo .p4-dot.r {
    background: radial-gradient(circle at 35% 30%, #ffd8e3 0%, #ff5b90 52%, #a90043 100%);
}

.connect4-logo .p4-dot.y {
    background: radial-gradient(circle at 35% 30%, #fff8d4 0%, #ffd369 52%, #aa6f00 100%);
}

.game-details {
    padding: 16px;
}

.game-details h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
}

.game-details p {
    margin-top: 5px;
    margin-bottom: 12px;
    color: var(--text-dim);
    font-size: 0.84rem;
}

.action-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-mode {
    flex: 1;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: #f0f2ff;
    padding: 10px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    transition: all 0.22s ease;
}

.btn-solo {
    border-color: rgba(255, 75, 141, 0.5);
    color: #ff8cb3;
}

.btn-solo:hover {
    background: rgba(255, 75, 141, 0.16);
    box-shadow: 0 0 18px rgba(255, 75, 141, 0.18);
}

.btn-multi {
    border-color: rgba(0, 243, 255, 0.55);
    color: #8cf7ff;
}

.btn-multi:hover {
    background: rgba(0, 243, 255, 0.16);
    box-shadow: 0 0 18px rgba(0, 243, 255, 0.18);
}

.status-msg {
    margin-top: 10px;
    font-size: 0.76rem;
    color: var(--text-dim);
    min-height: 18px;
}

.matchmaking-skeleton {
    margin-top: 10px;
    display: none;
    gap: 7px;
}

.matchmaking-skeleton.active {
    display: grid;
}

.skel-line {
    border-radius: 999px;
    height: 8px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.08) 100%
    );
    background-size: 260% 100%;
    animation: skeleton-move 1.2s linear infinite;
}

.skel-line.lg { width: 100%; }
.skel-line.md { width: 76%; }
.skel-line.sm { width: 52%; }

@keyframes lobby-card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes badge-pulse {
    0%,
    100% {
        transform: translateY(0);
        box-shadow: 0 0 0 rgba(255, 211, 105, 0);
    }
    50% {
        transform: translateY(-1px);
        box-shadow: 0 0 14px rgba(255, 211, 105, 0.22);
    }
}

.resume-block,
.live-block {
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 12, 24, 0.72);
    padding: 10px;
}

.live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.resume-list,
.live-match-list {
    display: grid;
    gap: 8px;
}

.resume-card,
.live-match-card {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    display: grid;
    gap: 5px;
}

.resume-title,
.live-title {
    color: #eaf3ff;
    font-weight: 700;
    font-size: 0.86rem;
}

.resume-meta,
.live-meta {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.resume-actions,
.live-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tiny-btn {
    min-height: 34px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 243, 255, 0.5);
    background: rgba(0, 243, 255, 0.12);
    color: #9ef6ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
}

.tiny-btn.alt {
    border-color: rgba(255, 211, 105, 0.45);
    background: rgba(255, 211, 105, 0.1);
    color: #ffe6a4;
}

.config-box {
    margin-top: 12px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    gap: 8px;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.config-box label {
    font-size: 0.71rem;
    color: #cad4ff;
    letter-spacing: 0.5px;
}

.select-neon,
.admin-input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(147, 162, 224, 0.55);
    background: rgba(6, 8, 18, 0.9);
    color: #f2f5ff;
    padding: 8px 9px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    outline: none;
}

.start-chess-btn {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 9px;
    padding: 9px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background: linear-gradient(140deg, #ffd369 0%, #ffe8aa 100%);
    color: #211600;
    cursor: pointer;
}

/* =========================================
   Leaderboard
   ========================================= */
.rank-layout {
    display: grid;
    grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.rank-spotlight-card,
.rank-board-card {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at top right, rgba(0, 243, 255, 0.08), transparent 32%),
        linear-gradient(165deg, rgba(18, 27, 48, 0.92) 0%, rgba(7, 10, 22, 0.94) 100%);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
}

.rank-spotlight-card {
    padding: 14px;
    display: grid;
    gap: 14px;
    position: sticky;
    top: 0;
}

.rank-spotlight-head,
.rank-board-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.rank-eyebrow {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.64rem;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: #92f7ff;
}

.rank-spotlight-name,
.rank-board-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.02rem;
    letter-spacing: 0.8px;
    color: #f3f7ff;
}

.rank-spotlight-sub {
    color: var(--text-dim);
    font-size: 0.84rem;
    line-height: 1.25;
    margin-top: -4px;
}

.rank-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rank-stat-box {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    padding: 11px;
    display: grid;
    gap: 5px;
}

.rank-stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #9eb3dd;
}

.rank-stat-box strong {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #fff3c4;
}

.rank-note {
    border-radius: 14px;
    border: 1px solid rgba(255, 211, 105, 0.22);
    background: rgba(255, 211, 105, 0.08);
    color: #ffe6a3;
    padding: 10px 11px;
    font-size: 0.79rem;
    line-height: 1.2;
}

.podium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.podium-card {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(160deg, rgba(22, 31, 58, 0.82) 0%, rgba(8, 12, 24, 0.92) 100%);
    padding: 12px 10px;
    text-align: center;
}

.rank-podium-grid {
    grid-template-columns: 1fr;
}

.podium-rank {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: #ffe5a1;
    text-transform: uppercase;
}

.podium-user {
    margin-top: 5px;
    font-weight: 700;
    font-size: 0.92rem;
}

.podium-score {
    margin-top: 2px;
    color: var(--primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.78rem;
}

.podium-gold {
    border-color: rgba(255, 211, 105, 0.28);
    background: linear-gradient(165deg, rgba(63, 45, 12, 0.32), rgba(10, 12, 22, 0.92));
}

.podium-silver {
    border-color: rgba(214, 228, 255, 0.2);
}

.podium-bronze {
    border-color: rgba(255, 163, 102, 0.22);
}

.podium-card.is-me {
    border-color: rgba(0, 243, 255, 0.65);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.18);
}

.rank-board-card {
    padding: 14px;
    display: grid;
    gap: 12px;
}

.rank-board-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rank-meta-chip {
    min-height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #d9e6ff;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.63rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.rank-meta-chip.is-active {
    border-color: rgba(0, 243, 255, 0.36);
    background: rgba(0, 243, 255, 0.12);
    color: #9df7ff;
}

.rank-table-shell {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    background: linear-gradient(170deg, rgba(8, 12, 24, 0.88), rgba(5, 8, 18, 0.86));
    max-height: min(72vh, 840px);
    overflow-y: auto;
}

.rank-header,
.rank-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 2fr) 1fr 0.9fr 0.9fr;
    gap: 8px;
    align-items: center;
    padding: 11px 12px;
}

.rank-header {
    background: rgba(255, 255, 255, 0.04);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.7px;
    font-size: 0.66rem;
    color: #c9d3ff;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 2;
}

.rank-row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.86rem;
    transition: background 0.18s ease, transform 0.18s ease;
}

.rank-row:hover {
    background: rgba(255, 255, 255, 0.035);
}

.rank-row.is-me {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: inset 3px 0 0 rgba(0, 243, 255, 0.9);
}

.rank-num {
    font-family: 'Orbitron', sans-serif;
    color: #ffdf8f;
}

.rank-user {
    font-weight: 700;
}

.rank-pts {
    color: #8ff4ff;
    font-family: 'Orbitron', sans-serif;
}

.rank-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-dim);
}

/* =========================================
   Social / messages
   ========================================= */
.social-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
    gap: 14px;
    align-items: start;
}

.social-sidebar {
    display: grid;
    gap: 12px;
}

.social-panel {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at top right, rgba(255, 211, 105, 0.08), transparent 32%),
        linear-gradient(160deg, rgba(14, 22, 42, 0.9) 0%, rgba(7, 10, 20, 0.93) 100%);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.25);
}

.social-card {
    padding: 13px;
}

.social-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.social-card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #f5f8ff;
}

.social-card-sub {
    color: var(--text-dim);
    font-size: 0.76rem;
    margin-top: 3px;
}

.users-panel {
    display: flex;
    flex-direction: column;
}

.online-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffe4a1;
    margin-bottom: 10px;
}

.challenge-head {
    margin-bottom: 8px;
}

.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 210px;
    overflow-y: auto;
}

.challenge-item {
    border-radius: 12px;
    border: 1px solid rgba(255, 211, 105, 0.26);
    background: linear-gradient(160deg, rgba(255, 211, 105, 0.1), rgba(255, 211, 105, 0.04));
    padding: 10px;
    display: grid;
    gap: 6px;
}

.challenge-text {
    font-size: 0.8rem;
    color: #ffe8b7;
}

.challenge-actions {
    display: flex;
    gap: 6px;
}

.challenge-actions button {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.68rem;
    padding: 4px 8px;
    min-height: 32px;
    cursor: pointer;
}

.challenge-empty {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.solo-level-modal {
    position: fixed;
    inset: 0;
    background: rgba(1, 2, 8, 0.9);
    display: grid;
    place-items: center;
    z-index: 120;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.solo-level-modal.open {
    opacity: 1;
    visibility: visible;
}

.solo-level-card {
    width: min(92vw, 360px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(165deg, rgba(12, 18, 36, 0.96), rgba(5, 8, 16, 0.96));
    padding: 14px;
    display: grid;
    gap: 10px;
}

.solo-level-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #d6ebff;
}

.solo-level-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.solo-level-btn {
    min-height: 40px;
    border-radius: 9px;
    border: 1px solid rgba(0, 243, 255, 0.35);
    background: rgba(0, 243, 255, 0.1);
    color: #9af7ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
}

.solo-level-cancel {
    min-height: 40px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #f0f3ff;
    cursor: pointer;
}

.quest-widget {
    border-radius: 16px;
    border: 1px solid rgba(95, 255, 165, 0.28);
    background: linear-gradient(160deg, rgba(95, 255, 165, 0.09), rgba(95, 255, 165, 0.04));
    padding: 13px;
    display: grid;
    gap: 7px;
}

.account-widget {
    border-radius: 10px;
    border: 1px solid rgba(0, 243, 255, 0.28);
    background: rgba(0, 243, 255, 0.08);
    padding: 8px;
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.account-photo-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.account-photo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.account-photo-inputs {
    display: grid;
    gap: 6px;
    width: 100%;
}

.account-photo-inputs input[type="file"] {
    font-size: 0.72rem;
    color: #c8d8ff;
}

.account-pass-grid {
    display: grid;
    gap: 6px;
}

.quest-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.67rem;
    letter-spacing: 0.8px;
    color: #c5ffd6;
    text-transform: uppercase;
}

.online-users-scroll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.user-challenge-btn {
    margin-left: auto;
    border: 1px solid rgba(0, 243, 255, 0.34);
    border-radius: 7px;
    background: rgba(0, 243, 255, 0.1);
    color: #9cefff;
    font-size: 0.64rem;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.online-user-name {
    font-size: 0.9rem;
    font-weight: 700;
}

.chat-container {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at top left, rgba(0, 243, 255, 0.09), transparent 30%),
        linear-gradient(170deg, rgba(8, 13, 26, 0.95) 0%, rgba(5, 7, 14, 0.94) 100%);
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    min-height: 560px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

.chat-head {
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.chat-head-copy {
    display: grid;
    gap: 5px;
}

.chat-head-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.chat-head h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.82rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c9f6ff;
}

.chat-hint {
    color: var(--text-dim);
    font-size: 0.8rem;
    max-width: 440px;
}

.chat-status-pill {
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(0, 243, 255, 0.28);
    background: rgba(0, 243, 255, 0.08);
    color: #9af5ff;
    padding: 6px 11px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.chat-status-pill.alt {
    border-color: rgba(255, 211, 105, 0.24);
    background: rgba(255, 211, 105, 0.08);
    color: #ffe3a1;
}

.chat-surface {
    position: relative;
    overflow: hidden;
}

.chat-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
}

.chat-box {
    position: relative;
    z-index: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    padding: 10px 11px;
    animation: fade-in 0.2s ease;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

.chat-msg.chat-msg-system {
    border-color: rgba(255, 211, 105, 0.24);
    background: linear-gradient(160deg, rgba(255, 211, 105, 0.12), rgba(255, 211, 105, 0.05));
}

.chat-msg.chat-msg-admin {
    border-color: rgba(0, 243, 255, 0.26);
}

.chat-msg.chat-msg-pending {
    opacity: 0.62;
    border-style: dashed;
}

.chat-msg-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.chat-msg-user {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: #9be6ff;
}

.chat-msg-time {
    color: #7f8cae;
    font-size: 0.7rem;
    margin-left: auto;
}

.chat-msg-text {
    color: #eff3ff;
    font-size: 0.94rem;
    line-height: 1.28;
    word-break: break-word;
}

.chat-emote {
    font-size: 1.1rem;
    margin-left: 6px;
    vertical-align: middle;
}

.chat-delete-btn {
    margin-left: auto;
    border: 1px solid rgba(255, 40, 90, 0.45);
    border-radius: 7px;
    background: rgba(255, 40, 90, 0.12);
    color: #ff9dbb;
    font-size: 0.64rem;
    padding: 4px 6px;
    cursor: pointer;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 12px 10px;
}

.chat-quick-row {
    padding: 0 16px 12px;
}

.quick-chip {
    min-height: 34px;
    border: 1px solid rgba(255, 211, 105, 0.35);
    background: rgba(255, 211, 105, 0.12);
    color: #ffe4a1;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    cursor: pointer;
}

.chat-input-area {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 0 16px 16px;
}

.chat-input-area input {
    border-radius: 12px;
    border: 1px solid rgba(145, 159, 228, 0.42);
    background: rgba(5, 9, 19, 0.98);
    color: #f5f7ff;
    padding: 12px 14px;
    font-size: 0.92rem;
    outline: none;
}

.chat-input-area input:focus {
    border-color: rgba(0, 243, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(0, 243, 255, 0.15);
}

.chat-input-area button {
    border: none;
    border-radius: 12px;
    background: linear-gradient(140deg, #00f3ff 0%, #77fbff 100%);
    color: #001118;
    width: 52px;
    min-height: 48px;
    cursor: pointer;
    box-shadow: 0 12px 20px rgba(0, 243, 255, 0.18);
}

/* =========================================
   Admin panel
   ========================================= */
.admin-panel {
    margin-top: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 211, 105, 0.28);
    background: rgba(255, 211, 105, 0.08);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.admin-panel h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.9px;
    color: #ffe3a0;
    text-transform: uppercase;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.admin-grid label {
    font-size: 0.75rem;
    color: #ffeec2;
    display: grid;
    gap: 5px;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.admin-delete-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.admin-log {
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(5, 7, 14, 0.4);
    padding: 8px;
    font-size: 0.8rem;
    color: #ffeec8;
}

.admin-log-line {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.admin-log-line:last-child {
    border-bottom: none;
}

/* =========================================
   Helpers
   ========================================= */
.neon-note {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 900px) {
    .rank-layout,
    .social-layout {
        grid-template-columns: 1fr;
    }

    .rank-spotlight-card {
        position: static;
    }

    .rank-podium-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .social-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-panel {
        max-height: none;
    }

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

    .admin-grid,
    .admin-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    :root {
        --header-height: 58px;
        --nav-height: 66px;
    }

    .app-header {
        padding: 0 12px;
    }

    .logo {
        font-size: 0.95rem;
        letter-spacing: 1.4px;
    }

    .user-info {
        gap: 8px;
    }

    .avatar-circle {
        width: 30px;
        height: 30px;
        font-size: 0.76rem;
    }

    .user-name {
        font-size: 0.84rem;
    }

    .user-status {
        display: none;
    }

    .tab-section {
        padding: 12px;
        padding-bottom: 88px;
    }

    .section-title {
        font-size: 0.88rem;
        margin-bottom: 10px;
    }

    .game-preview {
        font-size: 2.2rem;
        padding: 14px 10px;
    }

    .game-details {
        padding: 12px;
    }

    .action-row {
        flex-direction: column;
        gap: 8px;
    }

    .config-row {
        grid-template-columns: 1fr;
    }

    .rank-table-shell {
        max-height: none;
    }

    .rank-header,
    .rank-row {
        min-width: 0;
    }

    .chat-container {
        min-height: 460px;
    }

    .chat-box {
        max-height: 42vh;
    }

    .notif-panel {
        top: 62px;
        right: 8px;
        width: min(94vw, 340px);
    }

    .sound-toggle-float {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }

    .account-panel {
        top: 62px;
        right: 52px;
        width: min(94vw, 340px);
    }

    .moderation-panel {
        left: 8px;
        right: 8px;
        width: auto;
    }

    .bottom-nav span {
        font-size: 0.62rem;
    }

    .tiny-btn {
        min-height: 36px;
        font-size: 0.6rem;
        padding: 6px 9px;
    }

    .resume-actions .tiny-btn,
    .live-actions .tiny-btn {
        flex: 1;
    }

    .chat-head {
        flex-direction: column;
    }

    .chat-head-badges {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .admin-panel {
        padding: 10px;
    }

    .chat-input-area {
        grid-template-columns: 1fr 46px;
    }

    .chat-input-area input {
        font-size: 16px;
    }

    .online-users-scroll {
        max-height: 200px;
    }

    .challenge-list {
        max-height: 170px;
    }

    .podium-user {
        font-size: 0.86rem;
    }

    .notif-panel {
        left: 8px;
        right: 8px;
        width: auto;
    }

    .account-panel {
        left: 8px;
        right: 8px;
        width: auto;
        top: 112px;
    }

    .moderation-panel {
        top: 112px;
    }

    .live-head {
        flex-direction: column;
        align-items: stretch;
    }

    .resume-title,
    .live-title {
        font-size: 0.8rem;
    }

    .rank-stats-grid,
    .social-sidebar {
        grid-template-columns: 1fr;
    }

    .rank-podium-grid {
        grid-template-columns: 1fr;
    }

    .rank-header {
        display: none;
    }

    .rank-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px 12px;
        align-items: start;
        padding: 12px;
    }

    .rank-row > span {
        display: grid;
        gap: 3px;
        font-size: 0.86rem;
    }

    .rank-row > span::before {
        content: attr(data-label);
        font-family: 'Orbitron', sans-serif;
        font-size: 0.58rem;
        letter-spacing: 0.7px;
        color: #8f9fca;
        text-transform: uppercase;
    }

    .rank-num {
        grid-column: 1 / -1;
    }

    .chat-container {
        min-height: 420px;
    }

    .chat-box {
        max-height: 46vh;
        padding: 12px;
    }

    .chat-quick-row,
    .chat-input-area {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* =========================================
   Animations
   ========================================= */
@keyframes blink-anim {
    0%,
    100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tab-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes skeleton-move {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

@keyframes avatar-soft-halo {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(0, 243, 255, 0);
    }
    50% {
        box-shadow: 0 0 14px rgba(0, 243, 255, 0.18);
    }
}

@keyframes avatar-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.8; }
}

@keyframes avatar-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes neon-grid-drift {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(26px);
    }
}

@keyframes neon-glow-shift {
    0% {
        transform: scale(1) translate3d(0, 0, 0);
        opacity: 0.82;
    }
    100% {
        transform: scale(1.04) translate3d(0, -6px, 0);
        opacity: 1;
    }
}

@keyframes neon-scanline-shift {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
