/* ============================================
   POOL TRACKER — Modern Theme
   ============================================ */

:root {
    /* Surfaces */
    --bg-primary: #080b12;
    --bg-secondary: #0e1420;
    --bg-card: #131b2b;
    --bg-card-hover: #1a2438;
    --bg-elevated: #1b2537;
    --bg-felt: #123a26;
    --bg-felt-dark: #0d2c1d;

    /* Accents */
    --accent-green: #34d399;
    --accent-green-deep: #10b981;
    --accent-gold: #fbbf24;
    --accent-red: #f87171;
    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
    --accent-orange: #fb923c;
    --accent-teal: #2dd4bf;

    /* Text */
    --text-primary: #f1f5fb;
    --text-secondary: #9fb0c9;
    --text-muted: #64748b;

    /* Lines & effects */
    --border-color: rgba(148, 163, 184, 0.14);
    --border-light: rgba(148, 163, 184, 0.28);
    --glow-green: 0 0 24px rgba(52, 211, 153, 0.22);
    --glow-gold: 0 0 24px rgba(251, 191, 36, 0.22);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);

    /* Shape & motion */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% -10%, rgba(16, 185, 129, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 85% 0%, rgba(96, 165, 250, 0.12) 0%, transparent 42%),
        radial-gradient(circle at 50% 120%, rgba(251, 191, 36, 0.09) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 11, 18, 0.82);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    margin: 0 -24px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1440px;
    margin: 0 auto;
    height: 70px;
}

.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.logo-icon {
    font-size: 30px;
    filter: drop-shadow(0 0 12px rgba(52, 211, 153, 0.5));
}

.logo h1 {
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(120deg, #ffffff 10%, var(--accent-green) 55%, var(--accent-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header season switcher */
.header-season {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: 8px;
    min-width: 0;
}

.header-season-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.season-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.season-select {
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    padding: 9px 38px 9px 16px;
    max-width: 280px;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.season-select:hover {
    border-color: var(--accent-green);
    background: rgba(52, 211, 153, 0.08);
}

.season-select:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.season-select option { background: var(--bg-secondary); color: var(--text-primary); }

.season-select-caret {
    position: absolute;
    right: 14px;
    pointer-events: none;
    color: var(--text-secondary);
}

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

.btn-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(52, 211, 153, 0.1);
    color: var(--accent-green);
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: var(--glow-green);
    transform: translateY(-1px);
}

/* ============================================
   MAIN TABS
   ============================================ */
.main-tabs-container { margin-top: 30px; }

.main-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 26px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.main-tabs::-webkit-scrollbar { display: none; }

.main-tab {
    padding: 10px 22px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    border-radius: var(--radius-pill);
    transition: var(--transition);
    white-space: nowrap;
}

.main-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.main-tab.active {
    color: #06121b;
    background: linear-gradient(120deg, var(--accent-green), var(--accent-teal));
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.3);
}

.main-tab-pane { display: none; animation: fadeUp 0.35s ease; }
.main-tab-pane.active { display: block; }

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

/* ============================================
   SCOPE NOTE
   ============================================ */
.scope-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    min-height: 26px;
}

.scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
}

.scope-chip-season {
    color: var(--accent-green);
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.35);
}

.scope-chip-all {
    color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
}

.scope-detail {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   ACHIEVEMENTS GRID
   ============================================ */
.achievements-grid { margin: 0 -8px; }

.achievement-card {
    width: calc(25% - 16px);
    margin-bottom: 16px;
    background: linear-gradient(155deg, rgba(27, 37, 55, 0.9), rgba(15, 21, 34, 0.9));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.achievement-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(52, 211, 153, 0.09), transparent 60%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.achievement-card:hover {
    border-color: rgba(52, 211, 153, 0.45);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), var(--glow-green);
    z-index: 10;
}

.achievement-card:hover::before { opacity: 1; }

.achievement-label {
    font-family: var(--font-display);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}

.achievement-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.25));
}

.achievement-value {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.achievement-sub { font-size: 13px; color: var(--text-secondary); }

.achievement-card.highlight {
    border-color: rgba(251, 191, 36, 0.35);
    background: linear-gradient(155deg, rgba(37, 33, 20, 0.75), rgba(15, 21, 34, 0.92));
}

.achievement-card.highlight .achievement-value {
    color: var(--accent-gold);
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.35);
}

.achievement-card.highlight:hover {
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: var(--shadow-md), var(--glow-gold);
}

.achievement-card.achievement-empty {
    width: calc(100% - 16px);
    align-items: center;
    text-align: center;
    padding: 40px;
}

.achievement-card.rivals-card { width: calc(50% - 16px); }

/* Player link */
.player-link {
    cursor: pointer;
    transition: color 0.2s ease;
    border-bottom: 1px dashed transparent;
    font-weight: 600;
}

.player-link:hover {
    color: var(--accent-green);
    border-bottom-color: rgba(52, 211, 153, 0.6);
}

/* Matchup card */
.matchup-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0 4px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.28);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.matchup-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.matchup-wins {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1;
}

.matchup-vs {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 12px;
}

.matchup-recent {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.def-text { color: var(--text-muted); font-weight: 500; font-size: 0.8em; }

/* Rivals / standings list */
.rivals-list { list-style: none; margin-top: 10px; }

.rivals-list li {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 13px;
}

.rivals-list li:last-child { border-bottom: none; }

.rivals-pair { display: flex; align-items: center; gap: 6px; color: var(--text-primary); flex-wrap: wrap; }

.rivals-vs { color: var(--accent-red); font-weight: 700; font-size: 10px; margin: 0 4px; letter-spacing: 0.5px; }

.rivals-pct {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
}

.rivals-count {
    color: var(--text-secondary);
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 13px;
    white-space: nowrap;
}

.rivals-gp { color: var(--text-muted); font-weight: 500; }

/* ============================================
   PLAYERS
   ============================================ */
.players-section { margin-bottom: 40px; }

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.player-card {
    background: linear-gradient(155deg, rgba(27, 37, 55, 0.9), rgba(15, 21, 34, 0.92));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.player-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--player-color, var(--accent-green));
    opacity: 0.5;
    transition: var(--transition);
}

.player-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.player-card:hover::after { opacity: 1; height: 5px; }

.player-card-header {
    display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}

.player-avatar {
    width: 54px; height: 54px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 20px; font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.player-card-info { flex: 1; min-width: 0; }

.player-card-name {
    font-family: var(--font-display);
    font-size: 19px; font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.player-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.stat-item {
    text-align: center;
    padding: 10px 4px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 21px; font-weight: 700;
    display: block;
    line-height: 1.15;
}

.stat-value.wins { color: var(--accent-green); }
.stat-value.losses { color: var(--accent-red); }
.stat-value.ratio { color: var(--accent-gold); }

.stat-label {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 600;
}

.player-card-history {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.history-title {
    font-family: var(--font-display);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 700;
}

.history-list { list-style: none; }

.history-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item .result-badge {
    font-size: 10px; font-weight: 700;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-badge.win { background: rgba(52, 211, 153, 0.14); color: var(--accent-green); }
.result-badge.loss { background: rgba(248, 113, 113, 0.14); color: var(--accent-red); }

.history-opponent {
    flex: 1; margin: 0 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.history-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.no-history {
    font-size: 12.5px; color: var(--text-muted);
    font-style: italic; text-align: center; padding: 12px;
}

.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-state.hidden { display: none; }
.empty-icon { font-size: 60px; display: block; margin-bottom: 16px; opacity: 0.45; }
.empty-state p { font-size: 15px; }

/* ============================================
   FAB
   ============================================ */
.fab-add-player {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 60px; height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-green-deep));
    color: #04140d;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px rgba(52, 211, 153, 0.45);
    transition: var(--transition);
    z-index: 90;
}

.fab-add-player:hover {
    transform: translateY(-3px) rotate(90deg);
    box-shadow: 0 14px 40px rgba(52, 211, 153, 0.55);
}

.fab-add-player:active { transform: scale(0.94) rotate(90deg); }

/* ============================================
   GAME LOG
   ============================================ */
.game-log-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.game-log-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-card)
        url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239fb0c9' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
        no-repeat right 12px center;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 9px 34px 9px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-family: var(--font-body);
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    min-width: 130px;
}

.filter-select:hover { border-color: var(--border-light); }

.filter-select:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.filter-select option { background: var(--bg-secondary); }

.game-log-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.game-log-count {
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.game-log-sort { display: flex; align-items: center; gap: 8px; }

.game-log-sort label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    white-space: nowrap;
}

.game-log-sort select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-card)
        url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239fb0c9' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
        no-repeat right 12px center;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 9px 34px 9px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.game-log-sort select:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.game-log-sort select option { background: var(--bg-secondary); }

.game-log-table {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(19, 27, 43, 0.75);
    box-shadow: var(--shadow-sm);
}

.game-log-header {
    display: grid;
    grid-template-columns: 180px 1fr 1fr 1fr;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
    gap: 14px;
}

.game-log-header-cell {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-muted);
}

.game-log-row {
    display: grid;
    grid-template-columns: 180px 1fr 1fr 1fr;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    gap: 14px;
    transition: var(--transition);
    align-items: center;
}

.game-log-row:last-child { border-bottom: none; }

.game-log-row:hover { background: rgba(52, 211, 153, 0.06); }

.gl-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.gl-player { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.gl-winner {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-gold);
}

.gl-winner .player-link:hover { color: var(--accent-gold); border-bottom-color: var(--accent-gold); }

.game-log-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    font-style: italic;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not([disabled]):not(.active) {
    border-color: var(--accent-green);
    color: var(--text-primary);
    background: rgba(52, 211, 153, 0.08);
}

.page-btn.active {
    background: linear-gradient(120deg, var(--accent-green), var(--accent-teal));
    border-color: transparent;
    color: #06121b;
    box-shadow: 0 6px 18px rgba(52, 211, 153, 0.3);
}

.page-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

.page-ellipsis { color: var(--text-muted); padding: 0 4px; font-weight: 700; }

/* ============================================
   QUEUE
   ============================================ */
.queue-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.queue-status {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 56px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.queue-item.on-table {
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: var(--glow-green);
    background: rgba(52, 211, 153, 0.07);
}

.queue-item.next-up {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.05);
}

.queue-pos {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 22px;
    text-align: center;
}

.queue-avatar {
    width: 40px; height: 40px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 15px; font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.queue-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.queue-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    border: 1px solid transparent;
}

.queue-badge.on-table {
    background: rgba(52, 211, 153, 0.14);
    color: var(--accent-green);
    border-color: rgba(52, 211, 153, 0.35);
}

.queue-badge.next-up {
    background: rgba(251, 191, 36, 0.14);
    color: var(--accent-gold);
    border-color: rgba(251, 191, 36, 0.35);
}

.queue-badge.waiting {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border-color: rgba(148, 163, 184, 0.2);
}

.queue-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
}

.queue-remove:hover { color: var(--accent-red); background: rgba(248, 113, 113, 0.12); }

.queue-empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    font-style: italic;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-md);
}

.queue-add-row { display: flex; gap: 10px; align-items: center; }

.queue-add-row select {
    flex: 1;
    padding: 11px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.queue-add-row select:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.queue-add-row select option { background: var(--bg-secondary); }

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 12, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: linear-gradient(165deg, #16203280, #0b101bE6), var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(24px) scale(0.96);
    transition: var(--transition);
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-large { max-width: 720px; }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(14, 20, 32, 0.92);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 2;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 19px; font-weight: 700; letter-spacing: 0.4px;
}

.btn-close {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-close:hover { background: rgba(248, 113, 113, 0.12); color: var(--accent-red); }

.modal-body { padding: 24px; }

.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background: rgba(14, 20, 32, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-family: var(--font-display);
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-body);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.form-group input::placeholder { color: var(--text-muted); }
.form-group small { display: block; margin-top: 5px; font-size: 11px; color: var(--text-muted); }
.form-group select option { background: var(--bg-secondary); color: var(--text-primary); }

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }

.color-option {
    width: 38px; height: 38px;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
    position: relative;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.color-option:hover { transform: scale(1.12) translateY(-2px); }

.color-option.selected {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15), 0 0 14px rgba(255, 255, 255, 0.3);
}

.color-option.selected::after {
    content: '\2713';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px; font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 11px 22px;
    border-radius: var(--radius-md);
    border: none;
    font-family: var(--font-display);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent-green), var(--accent-green-deep));
    color: #04140d;
    box-shadow: 0 6px 18px rgba(52, 211, 153, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 26px rgba(52, 211, 153, 0.42);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.09); color: var(--text-primary); }

.btn-danger {
    background: linear-gradient(120deg, var(--accent-red), #dc2626);
    color: #fff;
    box-shadow: 0 6px 18px rgba(248, 113, 113, 0.3);
}

.btn-danger:hover { box-shadow: 0 8px 26px rgba(248, 113, 113, 0.42); transform: translateY(-1px); }

.btn-sm { padding: 8px 15px; font-size: 12.5px; }
.btn-xs { padding: 5px 11px; font-size: 11.5px; }

.btn-delete {
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: var(--accent-red);
    padding: 6px 13px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-family: var(--font-display);
    font-weight: 600;
    flex-shrink: 0;
}

.btn-delete:hover { background: var(--accent-red); border-color: var(--accent-red); color: #1a0505; }

.load-more-btn { width: 100%; margin-top: 12px; }

/* ============================================
   PIN MODAL
   ============================================ */
.pin-modal { max-width: 340px; text-align: center; }

.pin-display {
    display: flex; justify-content: center; gap: 16px;
    padding: 26px 0 8px;
}

.pin-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    background: transparent;
    transition: var(--transition);
}

.pin-dot.filled {
    background: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}

.pin-dot.error {
    border-color: var(--accent-red);
    background: var(--accent-red);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.6);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.pin-error { color: var(--accent-red); font-size: 13px; min-height: 20px; padding: 4px 0; }

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px 20px 26px;
    max-width: 280px;
    margin: 0 auto;
}

.key {
    width: 72px; height: 56px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 23px; font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
}

.key:hover { background: var(--bg-card-hover); border-color: var(--accent-green); }
.key:active { transform: scale(0.92); background: var(--bg-felt-dark); }
.key-empty { visibility: hidden; }
.key-action { color: var(--accent-red); }

/* ============================================
   PLAYER DETAIL
   ============================================ */
.player-detail-header { display: flex; align-items: center; gap: 14px; min-width: 0; }

.detail-avatar {
    width: 48px; height: 48px;
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 19px; font-weight: 700; color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.detail-info h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; }

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.detail-stat {
    text-align: center;
    padding: 16px 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.detail-stat-value {
    font-family: var(--font-display);
    font-size: 26px; font-weight: 800; display: block;
    line-height: 1.15;
}

.detail-stat-label {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 600;
}

.detail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}

.detail-section h4 {
    font-family: var(--font-display);
    font-size: 15px; font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
}

.sort-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-card)
        url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239fb0c9' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
        no-repeat right 10px center;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 7px 30px 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
}

.sort-select:focus { border-color: var(--accent-green); }

.game-history-table { max-height: 340px; overflow-y: auto; padding-right: 4px; }

.game-history-row {
    display: flex; align-items: center;
    padding: 11px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    transition: var(--transition);
    gap: 12px;
    border-radius: var(--radius-sm);
}

.game-history-row:hover { background: rgba(52, 211, 153, 0.06); }

.game-history-row .gh-date { font-size: 12px; color: var(--text-muted); min-width: 90px; }
.game-history-row .gh-opponent { flex: 1; font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.game-history-row .gh-result {
    font-size: 10.5px; font-weight: 700;
    padding: 3px 11px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.gh-result.win { background: rgba(52, 211, 153, 0.14); color: var(--accent-green); }
.gh-result.loss { background: rgba(248, 113, 113, 0.14); color: var(--accent-red); }

/* Opponent breakdown */
.opponent-stats-list { display: flex; flex-direction: column; gap: 10px; }

.opponent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.opponent-row:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--border-light); }

.opp-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.opp-name { font-weight: 600; color: var(--text-primary); }
.opp-last-date { font-size: 11px; color: var(--text-muted); }

.opp-stats { display: flex; align-items: center; gap: 14px; }

.opp-stat-box {
    display: flex; gap: 8px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
}

.opp-stat-val { color: var(--text-secondary); }

.opp-ratio-badge {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    min-width: 60px;
    text-align: center;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-tabs {
    display: flex; gap: 4px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 13px; font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    border-radius: var(--radius-pill);
    transition: var(--transition);
    white-space: nowrap;
}

.admin-tab.active {
    background: linear-gradient(120deg, var(--accent-green), var(--accent-teal));
    color: #06121b;
    box-shadow: 0 4px 14px rgba(52, 211, 153, 0.28);
}

.admin-tab:hover:not(.active) { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }

.admin-pane { display: none; }
.admin-pane.active { display: block; animation: fadeUp 0.3s ease; }

.admin-list { max-height: 400px; overflow-y: auto; }

.admin-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.admin-item:hover { background: rgba(255, 255, 255, 0.025); }
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.admin-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.admin-sub-note { opacity: 0.7; }

/* Seasons admin */
.season-create {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.season-create-fields { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }

.season-create-fields input {
    flex: 1;
    min-width: 150px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.season-create-fields input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.seasons-list { display: flex; flex-direction: column; gap: 10px; }

.season-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.season-item.active {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(52, 211, 153, 0.06);
    box-shadow: var(--glow-green);
}

.season-item-info { flex: 1; min-width: 0; }

.season-item-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 10px;
}

.season-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.season-status {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
}

.season-status.active {
    color: var(--accent-green);
    background: rgba(52, 211, 153, 0.14);
    border-color: rgba(52, 211, 153, 0.35);
}

.season-status.archived {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
}

.season-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.season-active-badge {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

/* ============================================
   PLAYER SETTINGS
   ============================================ */
.player-settings-info {
    display: flex; align-items: center; gap: 14px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.player-settings-avatar {
    width: 48px; height: 48px;
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 19px; font-weight: 700; color: white;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.player-settings-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.player-settings-sub { font-size: 12px; color: var(--text-muted); }

/* ============================================
   TOASTS
   ============================================ */
.toast-container {
    position: fixed;
    top: 86px; right: 20px;
    z-index: 2000;
    display: flex; flex-direction: column; gap: 10px;
}

.toast {
    padding: 13px 20px;
    border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 360px;
    border: 1px solid var(--border-color);
    border-left: 4px solid;
    background: rgba(14, 20, 32, 0.96);
    backdrop-filter: blur(12px);
}

.toast.success { color: var(--accent-green); border-left-color: var(--accent-green); }
.toast.error { color: var(--accent-red); border-left-color: var(--accent-red); }
.toast.info { color: var(--accent-blue); border-left-color: var(--accent-blue); }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ============================================
   NEXT GAME MODAL
   ============================================ */
.next-game-result { text-align: center; padding: 16px 0 6px; }

.next-game-winner-label {
    font-family: var(--font-display);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.next-game-winner-name {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    color: var(--accent-gold);
    text-shadow: 0 0 24px rgba(251, 191, 36, 0.35);
}

.next-game-divider {
    width: 44px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-gold));
    border-radius: 2px;
    margin: 14px auto;
}

.next-game-label {
    font-family: var(--font-display);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 12px;
}

.next-game-matchup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 22px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.next-game-player { display: flex; flex-direction: column; align-items: center; gap: 9px; }

.next-game-avatar {
    width: 56px; height: 56px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 21px; font-weight: 700;
    color: white;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.next-game-player-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.next-game-vs {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-red);
    flex-shrink: 0;
}

/* ============================================
   SCROLLBARS
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .achievement-card { width: calc(33.333% - 16px); }
}

@media (max-width: 900px) {
    .header-season { order: 3; width: 100%; margin: 0 0 10px; }
    .header-content { height: auto; flex-wrap: wrap; padding: 12px 0; gap: 12px; }
    .season-select { max-width: 100%; width: 100%; }
    .header-season { flex: 1; }
}

@media (max-width: 768px) {
    #app { padding: 0 16px 110px; }
    .app-header { padding: 0 16px; margin: 0 -16px; }
    .achievement-card { width: calc(50% - 16px); }
    .achievement-card.rivals-card { width: calc(100% - 16px); }
    .players-grid { grid-template-columns: 1fr; }
    .detail-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .modal { max-width: 100%; border-radius: var(--radius-lg); }
    .modal-large { max-width: 100%; }
    .modal-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal-footer { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
    .logo h1 { font-size: 17px; letter-spacing: 2px; }
    .logo-icon { font-size: 26px; }
    .game-log-header,
    .game-log-row { grid-template-columns: 110px 1fr 1fr 1fr; padding: 10px 12px; gap: 8px; }
    .gl-date { font-size: 11px; }
    .gl-player { font-size: 12px; }
    .gl-winner { font-size: 12.5px; }
    .game-log-filters { width: 100%; }
    .filter-group { flex: 1; min-width: 120px; }
    .filter-select { width: 100%; min-width: 0; }
    .game-log-meta { width: 100%; justify-content: space-between; }
    .season-create { flex-direction: column; align-items: stretch; }
    .season-create-fields { flex-direction: column; }
}

@media (max-width: 520px) {
    .achievement-card { width: calc(100% - 16px); }
    .achievement-card.rivals-card { width: calc(100% - 16px); }
    .achievement-card.achievement-empty { width: calc(100% - 16px); }
    .main-tab { padding: 9px 15px; font-size: 13px; }
    .key { width: 64px; height: 50px; font-size: 20px; }
    .pin-display { gap: 12px; }
    .game-log-header { display: none; }
    .game-log-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "date winner"
            "p1 p2";
        gap: 6px 10px;
        padding: 12px 14px;
    }
    .gl-date { grid-area: date; }
    .gl-winner { grid-area: winner; text-align: right; }
    .game-log-row .gl-player:nth-of-type(1) { grid-area: p1; }
    .game-log-row .gl-player:nth-of-type(2) { grid-area: p2; }
    .season-item { flex-direction: column; align-items: stretch; }
    .season-item-actions { justify-content: flex-end; }
    .detail-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
