/* ========================================
   PREBORN CLASSIC LEADERBOARDS
   ======================================== */

:root {
    --background: #0b0e14;
    --surface: #151922;
    --surface-light: #1c2230;
    --border: #303644;

    --gold: #d6ad60;
    --gold-light: #f0cf8b;
    --gold-dark: #9b7740;

    --text: #f0f0f2;
    --text-muted: #9399a8;

    --silver: #bac4d3;
    --bronze: #c48c65;

    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(155, 119, 64, 0.12),
            transparent 55%
        ),
        var(--background);

    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.6;
}

button {
    font: inherit;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

/* ========================================
   HEADER
   ======================================== */

.site-header {
    background: rgba(12, 15, 22, 0.94);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 88px;
    gap: 20px;
}

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

.brand-icon {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 46px;
    height: 46px;

    border: 1px solid var(--gold-dark);
    border-radius: 8px;

    color: var(--gold-light);
    background: rgba(214, 173, 96, 0.08);

    font-family: Georgia, serif;
    font-size: 29px;
    font-weight: bold;
}

.brand-name {
    color: var(--gold-light);
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: bold;
    letter-spacing: 3px;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 2px;
}

.server-label {
    padding: 7px 12px;

    border: 1px solid var(--gold-dark);
    border-radius: 5px;

    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
}

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

.hero {
    padding: 65px 0 45px;
    text-align: center;
}

.eyebrow {
    color: var(--gold);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hero h1 {
    margin: 12px 0 15px;

    color: var(--gold-light);
    font-family: Georgia, serif;
    font-size: clamp(36px, 6vw, 58px);
    font-weight: normal;
}

.hero p {
    max-width: 620px;
    margin: 0 auto;

    color: var(--text-muted);
    font-size: 15px;
}

/* ========================================
   LEADERBOARD PANEL
   ======================================== */

.leaderboard-panel {
    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 30px;
    gap: 20px;

    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 5px 0;

    color: var(--text);
    font-family: Georgia, serif;
    font-size: 30px;
}

.panel-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    width: 60px;
    height: 60px;

    background: rgba(214, 173, 96, 0.08);
    border: 1px solid var(--gold-dark);
    border-radius: 12px;

    color: var(--gold);
    font-size: 30px;
}

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

.period-tabs {
    display: flex;
    gap: 8px;
    padding: 20px 30px;

    border-bottom: 1px solid var(--border);
}

.period-button {
    flex: 1;
    padding: 11px 18px;

    background: var(--surface-light);
    border: 1px solid transparent;
    border-radius: 7px;

    color: var(--text-muted);
    cursor: pointer;

    font-size: 13px;
    font-weight: 600;

    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
}

.period-button:hover {
    color: var(--gold-light);
    border-color: var(--gold-dark);
}

.period-button.active {
    color: #16130c;
    background: var(--gold);
    border-color: var(--gold);
}

.period-button:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

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

.leaderboard-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    padding: 18px 30px;

    color: var(--text-muted);
    font-size: 12px;
}

#periodLabel {
    color: var(--gold);
    font-weight: 600;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--surface-light);
}

th {
    padding: 16px 30px;

    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: left;
    text-transform: uppercase;
}

td {
    padding: 19px 30px;

    border-top: 1px solid var(--border);
    font-size: 15px;
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: rgba(214, 173, 96, 0.05);
}

th:first-child,
td:first-child {
    width: 110px;
}

.score-column,
td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

td:last-child {
    color: var(--gold-light);
    font-weight: bold;
}

/* Top-three rankings */

tbody tr:nth-child(1) td:first-child {
    color: var(--gold-light);
    font-weight: bold;
}

tbody tr:nth-child(2) td:first-child {
    color: var(--silver);
    font-weight: bold;
}

tbody tr:nth-child(3) td:first-child {
    color: var(--bronze);
    font-weight: bold;
}

tbody tr:first-child {
    background: rgba(214, 173, 96, 0.04);
}

/* Loading and error states */

.loading-message {
    padding: 35px;
    color: var(--text-muted);
    text-align: center;
}

.error-message {
    margin: 20px 30px;
    padding: 14px;

    background: rgba(180, 50, 50, 0.12);
    border: 1px solid rgba(220, 70, 70, 0.4);
    border-radius: 7px;

    color: #ff9999;
    font-size: 13px;
}

[hidden] {
    display: none !important;
}

/* ========================================
   RESET INFORMATION
   ======================================== */

.reset-info {
    margin: 30px 0 65px;
    padding: 24px 28px;

    background: rgba(214, 173, 96, 0.035);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.reset-info h3 {
    margin: 0 0 8px;

    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: normal;
}

.reset-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    padding: 25px 0;

    border-top: 1px solid var(--border);

    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

@media (max-width: 600px) {
    .header-content {
        min-height: 75px;
    }

    .brand-name {
        font-size: 17px;
        letter-spacing: 2px;
    }

    .brand-subtitle {
        font-size: 9px;
    }

    .server-label {
        display: none;
    }

    .hero {
        padding: 45px 0 30px;
    }

    .panel-header {
        padding: 22px 18px;
    }

    .panel-header h2 {
        font-size: 25px;
    }

    .category-icon {
        width: 46px;
        height: 46px;
        font-size: 24px;
    }

    .period-tabs {
        padding: 15px;
        gap: 5px;
    }

    .period-button {
        padding: 10px 6px;
        font-size: 12px;
    }

    .leaderboard-info {
        padding: 15px;
        flex-wrap: wrap;
    }

    th,
    td {
        padding: 15px;
    }

    th:first-child,
    td:first-child {
        width: 65px;
    }

    .reset-info {
        padding: 20px;
    }
}

/* ========================================
   LEADERBOARD CATEGORY TABS
   ======================================== */

.category-tabs {
    display: flex;
    gap: 10px;
    padding: 20px 30px 0;
}

.category-button {
    flex: 1;
    padding: 14px 20px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;

    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
}

.category-button:hover {
    border-color: var(--gold-dark);
    color: var(--gold-light);
}

.category-button.active {
    background: rgba(214, 173, 96, 0.12);
    border-color: var(--gold);
    color: var(--gold-light);
}

.category-button:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

/* ========================================
   BOSS SELECTION
   ======================================== */

.boss-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 20px 30px 0;
}

.boss-filter label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.boss-filter select {
    width: 100%;
    padding: 12px 15px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 7px;

    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.boss-filter select:hover {
    border-color: var(--gold-dark);
}

.boss-filter select:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.boss-filter select option {
    background: var(--surface);
    color: var(--text);
}

/* ========================================
   CLICKABLE PLAYER NAMES
   ======================================== */

.player-breakdown-button {
    padding: 0;

    background: transparent;
    border: none;

    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;

    transition: color 0.2s;
}

.player-breakdown-button:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

.player-breakdown-button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
    border-radius: 2px;
}

/* ========================================
   PLAYER BOSS KILL BREAKDOWN
   ======================================== */

.boss-breakdown {
    margin: 25px 30px 30px;
    padding: 25px;

    background: var(--surface-light);
    border: 1px solid var(--gold-dark);
    border-radius: 10px;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;

    padding-bottom: 15px;
    margin-bottom: 18px;

    border-bottom: 1px solid var(--border);
}

.breakdown-header h3 {
    margin: 0;

    color: var(--gold-light);
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: normal;
}

#closeBreakdown {
    padding: 7px 14px;

    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;

    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

#closeBreakdown:hover {
    color: var(--gold-light);
    border-color: var(--gold);
}

#closeBreakdown:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

.breakdown-total {
    margin: 0 0 18px;

    color: var(--gold);
    font-size: 15px;
    font-weight: 600;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    padding: 12px 0;

    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
}

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

.breakdown-row strong {
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
}

/* ========================================
   MOBILE ADJUSTMENTS
   ======================================== */

@media (max-width: 600px) {
    .category-tabs {
        padding: 15px 15px 0;
        gap: 6px;
    }

    .category-button {
        padding: 11px 8px;
        font-size: 12px;
    }

    .boss-filter {
        padding: 15px 15px 0;
    }

    .boss-breakdown {
        margin: 15px;
        padding: 18px;
    }

    .breakdown-header h3 {
        font-size: 17px;
    }

    .player-breakdown-button {
        font-size: 14px;
    }
}

/* ========================================
   THREE-CATEGORY LEADERBOARD LAYOUT
   ======================================== */

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

.category-button {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 54px;

    text-align: center;
    line-height: 1.3;
    white-space: normal;
}

/* ========================================
   MOBILE CATEGORY LAYOUT
   ======================================== */

@media (max-width: 600px) {
    .category-tabs {
        gap: 6px;
        padding: 15px 15px 0;
    }

    .category-button {
        min-height: 52px;
        padding: 10px 5px;
        font-size: 11px;
    }
}
