/* Top, rules and bans pages */
.page { padding-top: clamp(32px, 6vh, 64px); padding-bottom: clamp(56px, 9vh, 96px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start; }
.page h1 { margin-bottom: 12px; }
.page-head .sub { margin-bottom: 0; }
.formula { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.formula span { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--soft); }
.formula b { font: italic 800 17px/1 var(--num); color: var(--text); margin-right: 4px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.controls .search { flex: 1 1 240px; max-width: 360px; }
.search { background: var(--well); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; color: var(--text); font: 400 15px var(--sans); }
.search:focus { outline: none; border-color: rgba(242, 183, 48, 0.6); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 9px 14px; font: 500 14px var(--sans); color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.muted { color: var(--muted); }
.empty-row { color: var(--muted); padding: 24px 0; }

/* Leaderboard */
.lb-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.lb { width: 100%; border-collapse: collapse; }
.lb th, .lb td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); font-size: 15px; white-space: nowrap; }
.lb th { color: var(--muted); font-weight: 500; font-size: 13px; }
.lb th:nth-child(-n+2), .lb td:nth-child(-n+2) { text-align: left; }
.lb tr:last-child td { border-bottom: 0; }
.lb .place { font: italic 800 22px/1 var(--num); color: var(--muted); width: 48px; }
.lb tr.top3 .place { color: var(--gold); }
.lb .player { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.lb .player img.rk { width: 84px; height: 33px; flex: none; }

/* Rank floors: the table is split where the rank tier changes, each floor opens with its mask.
   The mask box is as wide as rank icon + avatar + their gaps in a player row (84 + 12 + 32 + 12),
   so the mask stands over the rank icons and the tier name starts where the player names do. */
.lb tr.tier-row td { padding: 18px 14px 10px; background: var(--well); border-bottom-color: var(--line-strong); text-align: left; }
.lb tr.tier-row:first-child td { padding-top: 14px; }
.tier-floor { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 4px 12px; }
.tier-mask { flex: none; width: 128px; height: 46px; }
.tier-mask img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 0 100%; }
.tier-floor b { font: italic 800 20px/1.1 var(--wide); }
.tier-floor small { color: var(--muted); font-size: 13px; padding-bottom: 2px; font-variant-numeric: tabular-nums; }

/* Header of the top: title, how points count, and the podium to the right of them */
.top-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 28px 48px; }

/* Podium: the first three on steps with the large mask of their rank (same steps as the
   ranks ladder on the home page). Second on the left, first in the middle, third on the right. */
.podium { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); align-items: end; gap: 12px; max-width: 860px; }
.pod { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.pod.p1 { order: 2; }
.pod.p2 { order: 1; }
.pod.p3 { order: 3; }
.pod-mask { display: block; width: 100%; height: 92px; margin-bottom: 10px; }
.pod.p1 .pod-mask { height: 124px; }
.pod-mask img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.pod-name { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; text-decoration: none; font-weight: 600; }
.pod-name img.av { width: 26px; height: 26px; border-radius: 7px; flex: none; background: var(--raised); }
.pod-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { a.pod-name:hover span { text-decoration: underline; } }
.pod-xp { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.pod-xp b { font: italic 800 22px/1 var(--num); font-variant-numeric: tabular-nums; }
.pod-xp small { color: var(--muted); font-size: 13px; }
.pod-step { display: flex; align-items: flex-start; justify-content: center; width: 100%; height: 54px; margin-top: 14px; padding-top: 10px; background: var(--raised); border-top: 1px solid var(--line-strong); border-radius: 3px 3px 0 0; font: italic 800 30px/1 var(--num); color: var(--gold); }
.pod.p1 .pod-step { height: 84px; font-size: 40px; }
.pod.p2 .pod-step { height: 66px; }
.pod.is-me .pod-step { box-shadow: inset 0 2px 0 var(--gold); }
/* a free place on the podium (the first days): the mask in shadow, the name and points muted */
.pod.is-free .pod-mask img { filter: grayscale(1) brightness(0.5); opacity: 0.35; }
.pod.is-free .pod-name, .pod.is-free .pod-xp b { color: var(--muted); }
.lb .player img.av { width: 32px; height: 32px; border-radius: 8px; flex: none; background: var(--raised); }
.lb .player span { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.lb .player:hover span { text-decoration: underline; }
.lb .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; }
.lb td.n { font: italic 800 22px/1 var(--num); font-variant-numeric: tabular-nums; }
.lb td.xp { color: var(--text); }
.lb tr.is-me td { background: rgba(242, 183, 48, 0.06); }

/* Rules */
.rules-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.rules-nav { position: sticky; top: 24px; display: grid; gap: 4px; }
.rules-nav a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 15px; transition: color 150ms ease, background-color 150ms ease; }
.rules-nav a small { font: italic 800 14px/1 var(--num); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .rules-nav a:hover { color: var(--text); background: var(--panel); } }
.rules-nav a[aria-current] { color: var(--text); background: var(--panel); border-radius: 2px 8px 8px 2px; box-shadow: inset 2px 0 0 var(--gold); }
.rules-nav a.is-empty { opacity: 0.45; pointer-events: none; }
.rules-section { scroll-margin-top: 24px; }
.rules-section + .rules-section { margin-top: 48px; }
.rules-section h2 { margin-bottom: 20px; }
.rules-group + .rules-group { margin-top: 28px; }
.rules-group h3 { font: 600 17px/1.3 var(--sans); color: var(--soft); margin: 0 0 12px; }
.rules-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.rules-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.rules-list li:last-child { border-bottom: 0; }
.rules-list li:target { background: rgba(242, 183, 48, 0.06); }
.rules-list .no { font: italic 800 20px/1.2 var(--num); color: var(--muted); text-decoration: none; }
.rules-list p { margin: 0; }
.penalty { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--soft); background: var(--raised); border-radius: 6px; padding: 4px 9px 4px 8px; }
/* how hard: three little rising steps like the scale in the header, lit up to the level, the permanent ones red */
.sev { flex: none; display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.sev i { width: 4px; height: 5px; border-radius: 1px; background: var(--line-strong); }
.sev i:nth-child(2) { height: 8px; }
.sev i:nth-child(3) { height: 11px; }
.sev-1 .sev i:nth-child(1), .sev-2 .sev i:nth-child(-n+2) { background: var(--soft); }
.sev-3 .sev i { background: var(--danger); }
mark { background: rgba(242, 183, 48, 0.3); color: inherit; border-radius: 2px; }

/* Bans */
.bans-note { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; color: var(--soft); font-size: 14px; }
.bans-note a { color: var(--text); }
.bans.is-empty thead { display: none; }
.bans .who-link { text-decoration: none; }
.bans td.d { white-space: nowrap; }
.bans .left { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
/* your own penalty: the row lit like your row in the top, a white tag, and the gold way to lift it */
.bans tr.is-me td { background: rgba(242, 183, 48, 0.06); }
.bans .you { display: inline-block; margin: 8px 0 0 42px; padding: 4px 6px; border-radius: 4px; background: var(--text); color: var(--bg); font: italic 800 10px/1 var(--wide); letter-spacing: 0.04em; text-transform: uppercase; }
.bans .lift { display: block; width: max-content; margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font: 700 12.5px/1.2 var(--sans); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .bans .lift:hover { background: var(--gold-hover); } }
/* nobody punished: a calm note instead of an empty table */
.bans-empty { display: grid; justify-items: start; gap: 6px; padding: 14px 4px; }
.bans-empty b { font: italic 800 22px/1.15 var(--wide); text-transform: uppercase; }
.bans-empty p { margin: 0; color: var(--soft); }
.bans-empty a { margin-top: 2px; padding: 6px 0; color: var(--gold); font-weight: 600; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .bans-empty a:hover { text-decoration: underline; } }
.bans { width: 100%; border-collapse: collapse; }
.bans th, .bans td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.bans th { color: var(--muted); font-weight: 500; font-size: 13px; }
.bans tr:last-child td { border-bottom: 0; }
.bans .who { display: flex; align-items: center; gap: 10px; }
.bans .who img, .bans .who .av { width: 32px; height: 32px; border-radius: 8px; background: var(--raised); flex: none; }
.bans .who b { font-weight: 600; display: block; }
.bans .who small { color: var(--muted); font-size: 12px; }
.kind { display: inline-block; font: italic 800 10px/1 var(--wide); border-radius: 4px; padding: 4px 6px; background: var(--raised); color: var(--soft); }
.kind.ban { color: var(--danger); }
.state { white-space: nowrap; }
.state.on { color: var(--danger); }
.state.off { color: var(--muted); }

/* Rules and bans (23.11.2026, «Маски»): the header like the top, the text on the left and the penalty scale on
   the right. Three rising steps like the podium: mute, ban for a time, permanent ban; on the rules page how many
   rules lead to each, on the bans page how many are in the list. A step is a filter: the chosen one gets the gold
   line, like a chosen tab. The steps keep their height while empty, so nothing below moves when they fill. */
.scale-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); align-items: end; gap: 24px 56px; }
.scale-box { display: grid; gap: 14px; min-width: 0; }
.scale-cap { margin: 0; color: var(--muted); font-size: 13px; }
.scale { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; min-height: 128px; }
.sc { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: center; cursor: pointer; }
.sc:disabled { cursor: default; }
.sc-label { max-width: 100%; font: italic 800 15px/1.15 var(--wide); text-transform: uppercase; color: var(--soft); overflow-wrap: anywhere; }
.sc.s3 .sc-label { color: var(--danger); }
.sc-step { display: flex; align-items: baseline; justify-content: center; gap: 6px; width: 100%; height: 58px; padding-top: 12px; background: var(--raised); border-top: 1px solid var(--line-strong); border-radius: 3px 3px 0 0; transition: background-color 150ms ease, box-shadow 150ms ease; }
.sc.s2 .sc-step { height: 78px; }
.sc.s3 .sc-step { height: 98px; }
.sc-step b { font: italic 800 34px/1 var(--num); font-variant-numeric: tabular-nums; }
.sc-step b.zero { color: var(--muted); }
.sc-step small { color: var(--muted); font-size: 13px; }
.sc[aria-pressed="true"] .sc-step { background: #292929; box-shadow: inset 0 2px 0 var(--gold); }
@media (hover: hover) and (pointer: fine) { .sc:not(:disabled):hover .sc-step { background: #262626; } }
.sc:focus-visible { outline: none; }
.sc:focus-visible .sc-step { outline: 2px solid rgba(242, 183, 48, 0.6); outline-offset: 2px; }
/* which step is chosen, and the way back to everything */
.flt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0; color: var(--soft); font-size: 14px; }
.flt:empty { display: none; }
.flt button { border: 0; background: none; padding: 8px 0; color: var(--gold); font: 600 14px var(--sans); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .flt button:hover { text-decoration: underline; } }

@media (min-width: 1081px) {
    /* the podium (288 px) arrives with the data: keep its height, so the title and the table do not jump down */
    .top-head { min-height: 288px; }
    /* Beside the podium the point chips go in two even rows instead of three and one;
       the right padding keeps the hidden maniac (fx.js, right of the first row) off the chips */
    .top-head .formula { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); width: max-content; max-width: 100%; padding-right: 48px; }
}
@media (max-width: 1080px) {
    .top-head { grid-template-columns: minmax(0, 1fr); }
    .scale-head { grid-template-columns: minmax(0, 1fr); }
    .scale-box { max-width: 500px; }
}
@media (max-width: 900px) {
    .rules-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    /* the menu is not sticky here: a short list of the three parts with their counts, nothing marked */
    .rules-nav { position: static; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
    .rules-nav a[aria-current] { color: var(--muted); background: none; box-shadow: none; }
}
@media (max-width: 720px) {
    .lb .hide-sm { display: none; }
    .lb th, .lb td { padding: 10px 8px; }
    .lb .player img.av { display: none; }
    .lb .player img.rk { width: 64px; height: 25px; }
    .lb .player span { max-width: 130px; }
    /* The player column takes what the place and points leave and cuts long names with an
       ellipsis; without max-width: 0 a long name plus six-digit points pushes the table out */
    .lb td.pl { width: 100%; max-width: 0; }
    .lb .place, .lb td.n { font-size: 19px; }
    .podium { gap: 6px; }
    .pod-mask { height: 52px; }
    .pod.p1 .pod-mask { height: 70px; }
    .pod-name { flex-direction: column; gap: 4px; font-size: 14px; }
    .pod-xp { flex-direction: column; align-items: center; gap: 2px; }
    .pod-xp b { font-size: 18px; }
    .pod-step { height: 40px; font-size: 24px; }
    .pod.p1 .pod-step { height: 60px; font-size: 30px; }
    .pod.p2 .pod-step { height: 50px; }
    .lb tr.tier-row td { padding: 14px 8px 8px; }
    /* Phones: mask and tier name on the first line, levels and starting points always on the second */
    .tier-floor { gap: 2px 10px; }
    .tier-floor::after { content: ""; order: 1; flex-basis: 100%; }
    .tier-floor small { order: 2; font-size: 12px; }
    .tier-mask { width: clamp(72px, 24vw, 92px); height: 36px; }
    .tier-floor b { font-size: 17px; }
    .rules-list li { grid-template-columns: 44px minmax(0, 1fr); padding: 12px 14px; }
    .scale { gap: 6px; min-height: 104px; }
    .sc { gap: 8px; }
    .sc-label { font-size: 12.5px; }
    .sc-step { height: 46px; padding-top: 10px; gap: 4px; }
    .sc.s2 .sc-step { height: 62px; }
    .sc.s3 .sc-step { height: 78px; }
    .sc-step b { font-size: 26px; }
    .sc-step small { font-size: 12px; }
    /* Bans become cards */
    .bans, .bans tbody, .bans tr, .bans td { display: block; }
    .bans thead { display: none; }
    .bans tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
    .bans td { border: 0; padding: 3px 0; }
    .bans td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
    /* your own card is lit whole, not cell by cell */
    .bans tr.is-me { background: rgba(242, 183, 48, 0.06); }
    .bans tr.is-me td { background: none; }
}
