/* Server Ranking page. Builds on site.css tokens; classes come from rankings.html and assets/js/rankings.js. */

.masthead .masthead-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.masthead-row > div:first-child { display: grid; gap: 0.9rem; }
.realm-status {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    border-radius: 99px;
    font-weight: 800;
    color: var(--night-ink);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(185, 194, 234, 0.3);
}
.realm-status small { display: block; font-size: 0.65rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--night-soft); }
.realm-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(79, 211, 154, 0.22); }

.ranking-main { padding-top: 2.4rem; }
.ranking-board { padding: clamp(1rem, 2.5vw, 1.6rem); }

.ranking-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.4rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.scope-tabs { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--panel-soft); border: 1px solid var(--line); }
.scope-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font: 800 0.9rem/1 var(--body);
    color: var(--ink-soft);
    background: none;
    border: 0;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    cursor: pointer;
}
.scope-tab svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scope-tab:hover { color: var(--ink); }
.scope-tab.is-active { color: #fff; background: linear-gradient(180deg, #3c6fe6, #1f45b3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 0 #13307f; }

.filter-field { display: grid; gap: 0.35rem; }
.filter-field label, .period-filter legend { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap > svg { position: absolute; left: 0.8rem; width: 1rem; height: 1rem; fill: none; stroke: var(--tide); stroke-width: 1.8; stroke-linejoin: round; pointer-events: none; }
.select-wrap::after { content: ""; position: absolute; right: 0.9rem; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: translateY(-25%) rotate(45deg); pointer-events: none; }
.select-wrap select {
    appearance: none;
    min-width: 13rem;
    font: 700 0.95rem var(--body);
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem 2.4rem 0.7rem 2.3rem;
    cursor: pointer;
}
.select-wrap select:focus { outline: none; border-color: var(--tide); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tide) 25%, transparent); }

.period-filter { margin: 0 0 0 auto; padding: 0; border: 0; display: grid; gap: 0.35rem; min-width: 0; }
.period-filter legend { padding: 0; margin-bottom: 0.35rem; }
.period-options { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: var(--panel-soft); border: 1px solid var(--line); }
.period-options button { font: 800 0.82rem/1 var(--body); color: var(--ink-soft); background: none; border: 0; border-radius: 9px; padding: 0.6rem 0.75rem; cursor: pointer; }
.period-options button:hover { color: var(--ink); }
.period-options button.is-active { color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 0 var(--gold-lip); }
@media (max-width: 760px) { .period-filter { margin-left: 0; } }

.ranking-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 0.8rem 1.4rem; padding: 1.1rem 0.2rem 1rem; }
.summary-label { display: block; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.ranking-summary strong { font-family: var(--display); font-weight: 400; font-size: 1.35rem; }
.summary-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.summary-divider { width: 1px; height: 1rem; background: var(--line); }
.preview-badge { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.25rem 0.55rem; border-radius: 99px; color: var(--gold-ink); background: var(--gold-hi); }

.table-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.table-frame .table-scroll { overflow-x: auto; }
.table-frame .table-scroll:focus-visible { outline-offset: -3px; }
.table-frame table { min-width: 46rem; }
.table-frame th { background: var(--panel-soft); white-space: nowrap; }
.table-frame td { font-variant-numeric: tabular-nums; }
.table-frame td:first-child, .table-frame th:first-child { width: 4rem; text-align: center; }
.table-frame tbody tr:nth-child(even) { background: color-mix(in srgb, var(--panel-soft) 55%, transparent); }
.table-frame tbody tr:hover { background: color-mix(in srgb, var(--tide) 8%, var(--panel)); }
.table-frame tbody tr.is-podium td { font-weight: 800; }

.sort-button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; }
.sort-button:hover { color: var(--tide); }
.sort-button::after { content: ""; width: 0.4rem; height: 0.4rem; border-right: 2px solid transparent; border-bottom: 2px solid transparent; transform: translateY(-20%) rotate(45deg); }
th[aria-sort="descending"] .sort-button { color: var(--tide); }
th[aria-sort="descending"] .sort-button::after { border-color: currentColor; }

.rank-mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-family: var(--display); background: var(--panel-soft); border: 1px solid var(--line); }
.rank-mark.rank-1 { background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: var(--gold-ink); border-color: #b48a3e; box-shadow: 0 0 14px rgba(248, 230, 180, 0.5); }
.rank-mark.rank-2 { background: linear-gradient(180deg, #f4f7fb, #b9c6d8); color: #24324f; border-color: #98a8c0; }
.rank-mark.rank-3 { background: linear-gradient(180deg, #f3d2b4, #c08657); color: #3d1f08; border-color: #a06c42; }

.identity-cell { display: flex; align-items: center; gap: 0.75rem; }
.identity-seal {
    flex: none;
    width: 2.3rem;
    height: 2.3rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 900;
    color: #fff;
    background: radial-gradient(circle at 35% 30%, #6d93ff, #1f45b3 70%);
    border: 2px solid var(--frame-hi);
}
.identity-cell strong { display: block; font-weight: 900; }
.identity-cell small { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.guild-name { color: var(--ink-soft); font-weight: 700; }
.metric-highlight { color: var(--tide); font-weight: 900; }
.positive-ratio { color: #2fa877; font-weight: 900; }

.ranking-state { display: grid; justify-items: center; gap: 0.6rem; text-align: center; padding: 3.5rem 1.5rem; }
.ranking-state svg { width: 3rem; height: 3rem; fill: none; stroke: var(--tide); stroke-width: 2; stroke-linecap: round; }
.ranking-state h2 { font-family: var(--display); font-size: 1.5rem; }
.ranking-state p { color: var(--ink-soft); max-width: 28rem; }

.board-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem 1.4rem; padding: 1.1rem 0.2rem 0.2rem; font-size: 0.85rem; color: var(--ink-soft); }
.board-footer a { color: var(--tide); font-weight: 800; }
.board-footer span { font-size: 0.72rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.3rem 0.65rem; border-radius: 99px; border: 1px solid var(--line); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
