/* ==========================================================
   LEADERBOARD.CSS - Leaderboard Page Specific Styles
   ALL FONT SIZES INCREASED TO ≥13px FOR READABILITY
========================================================== */

/* ==========================================================
   HERO
========================================================== */

.leaderboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    padding: 55px 0 40px;
}
.leaderboard-hero h1 {
    margin: 6px 0 5px;
    font: 700 52px "Space Grotesk";
}
.leaderboard-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.hero-stats {
    display: flex;
    gap: 8px;
}
.hero-stats-grid {
    display: flex;
    gap: 8px;
}
.hero-stats-grid div {
    min-width: 130px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}
.hero-stats-grid strong {
    display: block;
    font: 700 25px "Space Grotesk";
}
.hero-stats-grid span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
}


/* ==========================================================
   PERIOD LABEL (above podium) - CENTERED
========================================================== */

.period-label-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}

.period-label {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 20px;
    border: 1px solid rgba(242,193,78,.15);
    border-radius: 20px;
    background: rgba(242,193,78,.05);
}


/* ==========================================================
   PERIOD TABS
========================================================== */

.period-section {
    padding: 12px 0 8px 0;
    border-bottom: none;
    margin-bottom: 4px;
}

.period-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.period-tab {
    position: relative;
    padding: 10px 17px;
    border: 0;
    border-radius: 7px 7px 0 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}
.period-tab:hover { color: white; }
.period-tab.active {
    color: var(--gold-light);
    background: rgba(242,193,78,.06);
}
.period-tab.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    background: var(--gold);
}
.period-tab:visited, .period-tab:active, .period-tab:focus {
    color: var(--muted);
    text-decoration: none;
    outline: none;
}
.period-tab.active:visited, .period-tab.active:active, .period-tab.active:focus {
    color: var(--gold-light);
}
.period-tab.active:hover { color: var(--gold-light); }

/* Period Description – Compact & Inline */
.period-description-compact {
    text-align: center;
    padding: 6px 0 0 0;
    font-size: 14px;
    color: var(--muted);
    font-weight: 400;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
}
.period-description-compact strong {
    color: var(--gold-light);
    font-weight: 700;
}
.period-description-compact .status-message {
    color: var(--gold);
    font-weight: 600;
}
.period-description-compact .status-message.warning {
    color: #f38ba8;
}


/* ==========================================================
   PODIUM
========================================================== */

.podium-section {
    margin-top: 30px;
    margin-bottom: 40px;
}
.podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    align-items: end;
    gap: 8px;
    min-height: 310px;
}
.podium-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 25px 20px 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), var(--panel));
    text-align: center;
    transition: transform .2s ease, border-color .2s ease;
}
.podium-card:hover {
    transform: translateY(-3px);
}
.podium-card.first {
    min-height: 300px;
    border-color: rgba(242,193,78,.3);
    background: radial-gradient(circle at 50% 15%, rgba(242,193,78,.13), transparent 45%), var(--panel);
}
.podium-card.second {
    min-height: 255px;
}
.podium-card.third {
    min-height: 225px;
}

.podium-position {
    margin-bottom: 15px;
    color: var(--gold);
    font: 700 13px "Space Grotesk";
    letter-spacing: 2px;
}
.podium-avatar {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: linear-gradient(135deg, #30343d, #111318);
    color: var(--gold-light);
    font: 700 25px "Space Grotesk";
}
.podium-card.second .podium-avatar {
    border-color: var(--silver);
}
.podium-card.third .podium-avatar {
    border-color: var(--bronze);
}

.podium-name {
    margin-top: 13px;
    font: 700 18px "Space Grotesk";
    text-decoration: none;
    transition: color .2s ease;
}
.podium-name:hover {
    color: var(--gold-light);
}
.podium-score {
    margin-top: 5px;
    color: var(--gold);
    font: 700 25px "Space Grotesk";
}
.podium-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}
.podium-medal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 21px;
}

/* Podium avatar border colours */
.podium-card.first .podium-avatar { border-color: #f2c14e; }
.podium-card.second .podium-avatar { border-color: #cbd0d9; }
.podium-card.third .podium-avatar { border-color: #c68a63; }
.podium-card .podium-name { color: var(--text); transition: color .2s ease; }
.podium-card .podium-name:hover { color: var(--gold-light); }


/* ==========================================================
   RANKING SECTION TABS
========================================================== */

.rankings-section {
    margin-top: 60px;
}
.heading-with-tabs {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}
.heading-with-tabs > div {
    flex-shrink: 0;
}
.heading-with-tabs h2 {
    margin: 5px 0 0;
    font: 700 26px "Space Grotesk";
}
.rank-tabs {
    display: flex;
    gap: 4px;
    background: var(--panel);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    margin-bottom: 2px;
}
.rank-tab {
    padding: 8px 16px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.rank-tab:hover { color: white; background: rgba(255,255,255,.05); }
.rank-tab.active { color: var(--gold-light); background: rgba(242,193,78,.12); box-shadow: 0 0 12px rgba(242,193,78,.05); }

.rank-view { display: none; }
.rank-view.active { display: block; }

.ranking-note {
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    align-self: flex-end;
    padding-bottom: 2px;
    font-weight: 600;
}


/* ==========================================================
   LEADERBOARD TABLE
========================================================== */

.leaderboard-table {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}
.table-header,
.rank-row {
    display: grid;
    grid-template-columns: 80px minmax(220px, 1fr) 130px 100px 90px 80px;
    align-items: center;
}
.table-header {
    min-height: 43px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
}
.rank-row {
    min-height: 72px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    transition: background .15s ease;
}
.rank-row:last-child {
    border-bottom: 0;
}
.rank-row:hover {
    background: rgba(255,255,255,.025);
}
.rank-row.current-player {
    background: linear-gradient(90deg, rgba(242,193,78,.07), transparent);
    box-shadow: inset 3px 0 0 var(--gold);
}
.rank-row.current-player .player-name { color: var(--gold-light); }

.rank-number {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font: 700 14px "Space Grotesk";
}
.player-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.table-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #30343d, #15171d);
    color: #e9ebef;
    font: 700 14px "Space Grotesk";
}
.player-name {
    display: block;
    color: #f0f1f4;
    font: 600 16px "Space Grotesk";
    text-decoration: none;
    transition: color .2s ease;
}
.player-name:hover {
    color: var(--gold-light);
}
.player-status {
    display: none;
}

.score {
    color: var(--gold);
    font: 700 16px "Space Grotesk";
}
.table-value {
    color: #c4c8d1;
    font-size: 13px;
    font-weight: 500;
}
.fastest-value {
    color: var(--green);
    font-weight: 700;
    font-size: 13px;
}
.streak-value {
    color: var(--gold-light);
    font-weight: 700;
    font-size: 13px;
}

/* ---- COMPARE LINK (replaces movement) ---- */
.compare-cell {
    text-align: center;
}
.compare-link {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid rgba(242,193,78,.25);
    border-radius: 20px;
    color: var(--gold);
    font-size: 16px;
    text-decoration: none;
    transition: all .2s ease;
}
.compare-link:hover {
    background: rgba(242,193,78,.1);
    border-color: var(--gold);
    color: var(--gold-light);
    transform: scale(1.05);
}
.rank-row.current-player .compare-link {
    border-color: var(--gold);
    background: rgba(242,193,78,.08);
}

/* ---- End compare ---- */

/* ==========================================================
   ACHIEVEMENT CHIPS
========================================================== */

.player-achievements {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ach-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 20px;
    background: rgba(255,255,255,.04);
    color: var(--muted);
    border: 1px solid var(--border);
    transition: all .25s ease;
    cursor: default;
    font-family: "Space Grotesk", "Inter", sans-serif;
}

.ach-chip.ach-fastest {
    border-color: rgba(89,212,138,.25);
    color: var(--green);
    background: rgba(89,212,138,.08);
}
.ach-chip.ach-fastest .ach-icon { font-size: 14px; }
.ach-chip.ach-fastest .ach-value { color: #7de0a0; font-weight: 800; }

.ach-chip.ach-streak {
    border-color: rgba(242,193,78,.25);
    color: var(--gold-light);
    background: rgba(242,193,78,.08);
}
.ach-chip.ach-streak .ach-icon { font-size: 14px; }
.ach-chip.ach-streak .ach-value { color: var(--gold-light); font-weight: 800; }

.ach-chip.ach-crown {
    border-color: rgba(242,193,78,.4);
    color: var(--gold);
    background: rgba(242,193,78,.12);
    box-shadow: 0 0 15px rgba(242,193,78,.08);
}
.ach-chip.ach-crown .ach-icon { font-size: 16px; }
.ach-chip.ach-crown .ach-value { color: var(--gold); font-weight: 800; font-size: 14px; }

.ach-chip.ach-placeholder {
    opacity: 0.5;
    border-style: dashed;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--muted);
    border-color: rgba(255,255,255,.08);
    background: transparent;
}
.ach-chip.ach-placeholder .ach-icon { font-size: 13px; opacity: 0.7; }

.rank-row:hover .ach-chip { transform: translateY(-1px); border-color: rgba(255,255,255,.15); }
.rank-row:hover .ach-chip.ach-fastest { border-color: var(--green); background: rgba(89,212,138,.15); box-shadow: 0 0 20px rgba(89,212,138,.08); }
.rank-row:hover .ach-chip.ach-streak { border-color: var(--gold); background: rgba(242,193,78,.15); box-shadow: 0 0 20px rgba(242,193,78,.08); }
.rank-row:hover .ach-chip.ach-crown { border-color: var(--gold); background: rgba(242,193,78,.2); box-shadow: 0 0 30px rgba(242,193,78,.15); }

/* Responsive chips – maintain readability */
@media (max-width: 700px) {
    .ach-chip { padding: 4px 12px; font-size: 13px; line-height: 18px; border-radius: 16px; }
    .ach-chip .ach-icon { font-size: 13px !important; }
    .ach-chip.ach-crown .ach-value { font-size: 13px; }
    .player-achievements { gap: 5px; }
}
@media (max-width: 450px) {
    .ach-chip { padding: 3px 10px; font-size: 13px; line-height: 16px; border-radius: 12px; }
    .ach-chip .ach-icon { font-size: 12px !important; }
    .ach-chip.ach-crown .ach-value { font-size: 12px; }
}


/* ==========================================================
   PAGINATION CONTROLS
========================================================== */

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.pagination-controls .page-btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s ease;
    font-family: inherit;
}
.pagination-controls .page-btn:hover:not(:disabled) {
    color: white;
    border-color: rgba(242,193,78,.3);
    background: rgba(242,193,78,.05);
    transform: translateY(-1px);
}
.pagination-controls .page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}
.pagination-controls .page-info {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}
.pagination-controls .page-btn .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin: 0 auto;
}
.pagination-controls .page-btn.loading .spinner {
    display: block;
}
.pagination-controls .page-btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ==========================================================
   ACTIVITY (Leaderboard Recent)
========================================================== */

.activity-section {
    margin-top: 60px;
}
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.activity-row {
    display: grid;
    grid-template-columns: 85px 1fr 130px;
    gap: 20px;
    align-items: center;
    padding: 19px 22px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel);
    transition: transform .15s ease, border-color .15s ease;
}
.activity-row:hover {
    transform: translateY(-1px);
    border-color: rgba(242,193,78,.15);
}
.activity-row:nth-child(even) { background: rgba(255,255,255,.02); }
.activity-row .activity-category { color: var(--gold); }
.activity-row .activity-answer a { color: var(--player); font-weight: 700; text-decoration: none; }
.activity-row .activity-answer a:hover { color: var(--gold-light); }

.activity-time {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.activity-category {
    margin-bottom: 7px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
}
.activity-question {
    color: #d8dae0;
    font-size: 14px;
    line-height: 1.5;
}
.activity-answer {
    text-align: right;
}
.activity-answer span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.activity-answer a {
    color: #e7e9ed;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}
.activity-answer a:hover {
    color: var(--gold-light);
}
.activity-answer b {
    margin-left: 5px;
    color: var(--green);
}


/* ==========================================================
   BRAIN CIRCUS PANEL
========================================================== */

.brain-panel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    margin-top: 60px;
    padding: 28px;
    border: 1px solid rgba(155,124,255,.18);
    border-radius: 14px;
    background: radial-gradient(circle at 20% 50%, rgba(155,124,255,.09), transparent 35%), var(--panel);
}
.brain-panel-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(155,124,255,.1);
    font-size: 29px;
}
.brain-panel h2 {
    margin: 5px 0 8px;
    font: 700 21px "Space Grotesk";
}
.brain-panel p {
    max-width: 720px;
    margin: 0;
    color: #c7cad3;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 400;
}
.brain-stat {
    text-align: right;
}
.brain-stat strong {
    display: block;
    color: var(--gold);
    font: 700 30px "Space Grotesk";
}
.brain-stat span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.8px;
}


/* ==========================================================
   SEO
========================================================== */

.seo-section {
    max-width: 850px;
    margin: 75px auto 20px;
    padding-top: 45px;
    border-top: 1px solid var(--border);
}
.seo-section h2 {
    margin: 5px 0 18px;
    font: 700 24px "Space Grotesk";
}
.seo-section p {
    color: #bfc3cc;
    font-size: 14px;
    line-height: 1.85;
    font-weight: 400;
}


/* ==========================================================
   SEARCH FORM
========================================================== */

.player-search-form {
    margin-bottom: 8px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: inline-block;
}

.player-search-form input[type="text"] {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
    width: 220px;
    max-width: 100%;
    transition: border-color .2s ease;
}
.player-search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--gold);
}

.player-search-form button {
    padding: 8px 18px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--gold);
    color: #111;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
    font-family: inherit;
}
.player-search-form button:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
}

.clear-search {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: all .2s ease;
}
.clear-search:hover {
    color: white;
    border-color: rgba(255,255,255,.15);
}


/* ==========================================================
   AUTOCOMPLETE DROPDOWN
========================================================== */

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    box-shadow: 0 8px 25px rgba(0,0,0,.5);
    min-width: 200px;
}
.autocomplete-dropdown.visible {
    display: block !important;
}
.autocomplete-dropdown .dropdown-item {
    padding: 8px 14px;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    transition: background .15s ease;
    border-bottom: 1px solid rgba(255,255,255,.03);
}
.autocomplete-dropdown .dropdown-item:last-child {
    border-bottom: none;
}
.autocomplete-dropdown .dropdown-item:hover,
.autocomplete-dropdown .dropdown-item.active {
    background: rgba(242,193,78,.1);
    color: var(--gold-light);
}
.autocomplete-dropdown .no-results {
    padding: 10px 14px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.autocomplete-dropdown::-webkit-scrollbar {
    width: 4px;
}
.autocomplete-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}


/* ==========================================================
   LOADING STATES
========================================================== */

.podium-section,
.rankings-section .leaderboard-table {
    transition: opacity .2s ease;
}
.podium-section.loading,
.rankings-section .leaderboard-table.loading {
    opacity: 0.5;
}


/* ==========================================================
   LIGHT THEME OVERRIDES FOR LEADERBOARD
========================================================== */

body.light-theme .leaderboard-hero p {
    color: #555;
}
body.light-theme .period-label {
    color: #c49b1f;
    border-color: rgba(196,155,31,.15);
    background: rgba(196,155,31,.05);
}
body.light-theme .hero-stats-grid div {
    background: #f7f8fa;
    border-color: rgba(0,0,0,.08);
}
body.light-theme .hero-stats-grid span {
    color: #555;
}
body.light-theme .hero-stats-grid strong {
    color: #1a1a2e;
}
body.light-theme .period-tab {
    color: #777;
}
body.light-theme .period-tab:hover {
    color: #1a1a2e;
}
body.light-theme .period-tab.active {
    color: #c49b1f;
    background: rgba(196,155,31,.06);
}
body.light-theme .period-tab.active::after {
    background: #c49b1f;
}
body.light-theme .period-description-compact {
    color: #555;
}
body.light-theme .period-description-compact strong {
    color: #c49b1f;
}
body.light-theme .leaderboard-table {
    border-color: rgba(0,0,0,.1);
    background: #fff;
}
body.light-theme .table-header {
    color: #444;
    border-bottom-color: rgba(0,0,0,.08);
}
body.light-theme .rank-row {
    border-bottom-color: rgba(0,0,0,.06);
}
body.light-theme .rank-row:hover {
    background: rgba(0,0,0,.02);
}
body.light-theme .rank-row.current-player {
    background: linear-gradient(90deg, rgba(196,155,31,.07), transparent);
    box-shadow: inset 3px 0 0 #c49b1f;
}
body.light-theme .rank-row .player-name {
    color: #1a5fc7 !important;
}
body.light-theme .rank-row .player-name:hover {
    color: #c49b1f !important;
}
body.light-theme .rank-number {
    color: #555;
}
body.light-theme .score {
    color: #c49b1f;
}
body.light-theme .podium-card {
    background: linear-gradient(180deg, rgba(0,0,0,.02), #fff);
    border-color: rgba(0,0,0,.1);
}
body.light-theme .podium-card.first {
    border-color: rgba(196,155,31,.3);
    background: radial-gradient(circle at 50% 15%, rgba(196,155,31,.1), transparent 45%), #fff;
}
body.light-theme .podium-card .podium-name {
    color: #1a5fc7 !important;
}
body.light-theme .podium-card .podium-name:hover {
    color: #c49b1f !important;
}
body.light-theme .podium-meta {
    color: #555;
}
body.light-theme .podium-avatar {
    background: linear-gradient(135deg, #e0e2e8, #f0f2f5);
    color: #1a1a2e;
}
body.light-theme .player-search-form input[type="text"] {
    background: #fff;
    border-color: rgba(0,0,0,.12);
    color: #1a1a2e;
}
body.light-theme .player-search-form input[type="text"]:focus {
    border-color: #c49b1f;
}
body.light-theme .player-search-form button {
    background: #c49b1f;
    color: #fff;
}
body.light-theme .player-search-form button:hover {
    background: #d4a017;
}
body.light-theme .clear-search {
    color: #555;
    border-color: rgba(0,0,0,.1);
}
body.light-theme .clear-search:hover {
    color: #1a1a2e;
    border-color: rgba(0,0,0,.2);
}
body.light-theme .autocomplete-dropdown {
    background: #fff;
    border-color: rgba(0,0,0,.12);
}
body.light-theme .autocomplete-dropdown .dropdown-item {
    color: #1a1a2e;
    border-bottom: 1px solid rgba(0,0,0,.04);
}
body.light-theme .autocomplete-dropdown .dropdown-item:hover,
body.light-theme .autocomplete-dropdown .dropdown-item.active {
    background: rgba(196,155,31,.08);
    color: #c49b1f;
}
body.light-theme .autocomplete-dropdown .no-results {
    color: #555;
}
body.light-theme .pagination-controls .page-btn {
    background: #fff;
    border-color: rgba(0,0,0,.12);
    color: #555;
}
body.light-theme .pagination-controls .page-btn:hover:not(:disabled) {
    color: #1a1a2e;
    border-color: rgba(196,155,31,.3);
    background: rgba(196,155,31,.05);
}
body.light-theme .pagination-controls .page-info {
    color: #555;
}
body.light-theme .activity-row {
    background: #fff;
    border-color: rgba(0,0,0,.08);
}
body.light-theme .activity-row:nth-child(even) {
    background: #f7f8fa;
}
body.light-theme .activity-question {
    color: #1a1a2e;
}
body.light-theme .activity-category {
    color: #c49b1f;
}
body.light-theme .activity-answer a {
    color: #1a5fc7;
}
body.light-theme .activity-answer a:hover {
    color: #c49b1f;
}
body.light-theme .activity-time {
    color: #555;
}
body.light-theme .rank-tab {
    color: #777;
}
body.light-theme .rank-tab:hover {
    color: #1a1a2e;
}
body.light-theme .rank-tab.active {
    color: #c49b1f;
    background: rgba(196,155,31,.1);
}
body.light-theme .brain-panel {
    background: #fff;
    border-color: rgba(106,78,167,.15);
}
body.light-theme .brain-panel p {
    color: #1a1a2e;
}
body.light-theme .brain-stat span {
    color: #555;
}
body.light-theme .brain-stat strong {
    color: #c49b1f;
}
body.light-theme .seo-section {
    border-top-color: rgba(0,0,0,.08);
}
body.light-theme .seo-section p {
    color: #1a1a2e;
}

/* ---- Light theme compare link ---- */
body.light-theme .compare-link {
    border-color: rgba(196,155,31,.25);
    color: #c49b1f;
}
body.light-theme .compare-link:hover {
    background: rgba(196,155,31,.1);
    border-color: #c49b1f;
    color: #d4a017;
}
body.light-theme .rank-row.current-player .compare-link {
    border-color: #c49b1f;
    background: rgba(196,155,31,.08);
}


/* ==========================================================
   RESPONSIVE (Leaderboard Specific)
========================================================== */

@media (max-width: 900px) {
    .table-header,
    .rank-row {
        grid-template-columns: 60px 1fr 100px 80px 70px 60px;
    }
    .table-header span:nth-child(4),
    .rank-row > div:nth-child(4) {
        display: none;
    }
    .table-header span:nth-child(5),
    .rank-row > div:nth-child(5) {
        display: none;
    }
    .brain-panel {
        grid-template-columns: auto 1fr;
    }
    .brain-stat {
        display: none;
    }
    .heading-with-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .rank-tabs {
        align-self: flex-start;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 4px;
    }
    .rank-tabs::-webkit-scrollbar {
        display: none;
    }
    .rank-tab {
        flex: 1 0 auto;
        text-align: center;
        padding: 8px 12px;
        font-size: 13px;
    }
    .ranking-note {
        align-self: flex-start;
        padding-bottom: 0;
        margin-top: 4px;
    }
    .player-name {
        font-size: 14px !important;
    }
}

@media (max-width: 700px) {
    .leaderboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .leaderboard-hero h1 {
        font-size: 40px;
    }
    .hero-stats {
        width: 100%;
    }
    .hero-stats-grid {
        flex-direction: column;
    }
    .hero-stats-grid div {
        flex: 1;
        min-width: auto;
    }
    .period-label-wrap {
        margin-bottom: 4px;
    }
    .period-label {
        font-size: 13px;
        padding: 4px 14px;
    }
    .podium-section {
        margin-top: 20px;
    }
    .period-tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }
    .period-tabs::-webkit-scrollbar {
        display: none;
    }
    .period-tab {
        flex-shrink: 0;
        padding-left: 11px;
        padding-right: 11px;
        font-size: 13px;
    }
    .podium {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .podium-card.first,
    .podium-card.second,
    .podium-card.third {
        min-height: 210px;
    }
    .podium-card.first {
        order: 1;
    }
    .podium-card.second {
        order: 2;
    }
    .podium-card.third {
        order: 3;
    }
    .table-header {
        display: none;
    }
    .rank-row {
        grid-template-columns: 42px 1fr 70px 50px 50px;
    }
    .rank-row > div:nth-child(4),
    .rank-row > div:nth-child(5) {
        display: none;
    }
    .activity-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .activity-answer {
        padding-top: 10px;
        text-align: left;
        border-top: 1px solid var(--border);
    }
    .brain-panel {
        grid-template-columns: 1fr;
    }
    .brain-panel-icon {
        width: 48px;
        height: 48px;
    }
    .heading-with-tabs {
        gap: 8px;
    }
    .heading-with-tabs h2 {
        font-size: 22px;
    }
    .rank-tab {
        font-size: 13px;
        padding: 6px 10px;
    }
    .player-name {
        font-size: 14px !important;
    }
    .ach-chip {
        font-size: 13px;
        padding: 2px 8px;
        line-height: 16px;
    }
    .player-achievements {
        gap: 3px;
    }
}

@media (max-width: 450px) {
    .leaderboard-hero h1 {
        font-size: 34px;
    }
    .hero-stats-grid {
        flex-direction: column;
    }
    .rank-row {
        grid-template-columns: 35px 1fr 60px 40px;
    }
    .movement {
        display: none;
    }
}