/* ==========================================================================
   Clan Rankings — design system
   Dark by default; [data-theme="light"] flips the tokens. Everything downstream
   references the variables, so both themes stay in sync and charts can read the
   accent straight off the CSS.
   ========================================================================== */

:root,
:root[data-theme="dark"] {
  --bg:        #0a0c12;
  --bg-2:      #0e1119;
  --surface:   #141824;
  --surface-2: #1b2130;
  --surface-3: #232c40;
  --border:    #263049;
  --border-2:  #33405e;
  --text:      #eef2fb;
  --text-dim:  #9aa6c2;
  --text-mut:  #66738f;
  --accent:    #ffc23c;   /* trophy gold */
  --accent-2:  #ffd873;
  --up:        #37e19b;   /* gains */
  --up-soft:   rgba(55,225,155,.14);
  --down:      #ff6b81;
  --down-soft: rgba(255,107,129,.14);
  --info:      #6aa8ff;
  --gold:      #ffd24a;
  --silver:    #c9d4e6;
  --bronze:    #e39a5a;
  --shadow:    0 12px 40px -12px rgba(0,0,0,.65);
  --shadow-sm: 0 4px 16px -8px rgba(0,0,0,.6);
  --glow:      0 0 0 1px rgba(255,194,60,.18), 0 8px 30px -10px rgba(255,194,60,.25);
  --grid:      rgba(255,255,255,.06);
  --scrim:     rgba(6,8,13,.72);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:        #eef1f7;
  --bg-2:      #e7ebf4;
  --surface:   #ffffff;
  --surface-2: #f4f6fb;
  --surface-3: #eaeef7;
  --border:    #dbe1ee;
  --border-2:  #c7d0e2;
  --text:      #131722;
  --text-dim:  #4a5670;
  --text-mut:  #8793ab;
  --accent:    #d98a00;
  --accent-2:  #b56f00;
  --up:        #12a06a;
  --up-soft:   rgba(18,160,106,.12);
  --down:      #d33a52;
  --down-soft: rgba(211,58,82,.10);
  --info:      #2f6fe0;
  --gold:      #e3a615;
  --silver:    #8a97ac;
  --bronze:    #c07434;
  --shadow:    0 14px 40px -16px rgba(31,45,80,.28);
  --shadow-sm: 0 4px 14px -8px rgba(31,45,80,.25);
  --glow:      0 0 0 1px rgba(217,138,0,.25), 0 10px 30px -12px rgba(217,138,0,.22);
  --grid:      rgba(20,30,60,.08);
  --scrim:     rgba(255,255,255,.7);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the hidden attribute must beat display:inline-flex etc. */
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 620px at 82% -8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(900px 520px at 6% 0%, color-mix(in srgb, var(--info) 12%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "tnum" 1, "cv05" 1;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.num { font-variant-numeric: tabular-nums; }

a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace; font-size: .86em; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(14px, 3vw, 30px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; font-size: 17px; }
.brand-logo { font-size: 20px; filter: drop-shadow(0 2px 8px rgba(255,194,60,.5)); }
.brand-text { background: linear-gradient(92deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topbar-spacer { flex: 1 1 auto; }

.nav { display: flex; gap: 3px; }
.nav a { padding: 7px 12px; border-radius: 10px; color: var(--text-dim); font-weight: 650; font-size: 13.5px; white-space: nowrap; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.on { color: var(--text); background: var(--surface-3); box-shadow: var(--shadow-sm); }

.search { position: relative; flex: 0 1 340px; min-width: 0; display: flex; align-items: center; }
.search-ic { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--text-mut); pointer-events: none; }
#search {
  width: 100%; padding: 9px 12px 9px 34px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#search::placeholder { color: var(--text-mut); }
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.sr-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.sr-row:hover, .sr-row.active { background: var(--surface-2); }
.sr-row .num { margin-left: auto; color: var(--text-dim); }

.account { display: inline-flex; align-items: center; gap: 8px; }
.account-name { font-size: 12.5px; font-weight: 700; color: var(--text-dim); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name::before { content: "👤 "; }
.account-name.has-av::before { content: none; }
.account-name.is-link { cursor: pointer; }
.account-name.is-link:hover { color: var(--text); }
.account-av { width: 20px; height: 20px; border-radius: 50%; vertical-align: -5px; margin-right: 6px; }

.live { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pulse 2.4s infinite; }
.live.stale .live-dot { background: var(--down); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 9px;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 11px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700;
  transition: color .15s, border-color .15s, background .15s, transform .1s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 19px; height: 19px; }
.ic-sun { display: none; }
:root[data-theme="light"] .ic-moon { display: none; }
:root[data-theme="light"] .ic-sun { display: block; }

/* ------------------------------------------------------------------ layout */
.app { max-width: 1180px; margin: 0 auto; padding: clamp(16px, 3vw, 30px) clamp(14px, 3vw, 30px) 60px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.section-head h2 { font-size: 15px; letter-spacing: .10em; text-transform: uppercase; color: var(--text-dim); margin: 0; font-weight: 700; }
.section-head .sub { color: var(--text-mut); font-size: 12.5px; }
.section-head .spacer { flex: 1; }

/* cards ------------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--accent) 2%), var(--surface));
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.card.pad { padding: 18px; }

/* hero stat tiles --------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { position: relative; overflow: hidden; padding: 16px 16px 14px; }
.stat .k { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mut); font-weight: 700; }
.stat .v { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.stat .d { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.stat .spark { position: absolute; right: 12px; bottom: 10px; width: 96px; height: 34px; opacity: .9; }
.stat.accent .v { color: var(--accent); }

/* segmented control (window tabs / ranges) -------------------------------- */
.seg { display: inline-flex; padding: 4px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.seg button {
  border: 0; background: transparent; color: var(--text-dim); cursor: pointer;
  font: inherit; font-weight: 650; font-size: 13px; padding: 6px 13px; border-radius: 9px;
  transition: color .15s, background .15s; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.mini button { padding: 4px 10px; font-size: 12px; }

/* leaderboard table ------------------------------------------------------- */
.board { overflow: hidden; }
.board table { width: 100%; border-collapse: collapse; }
.board thead th {
  text-align: right; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-mut); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.board thead th.l { text-align: left; }
.board thead th.sortable:hover { color: var(--text); }
.board thead th .arrow { opacity: 0; font-size: 9px; }
.board thead th.sorted .arrow { opacity: 1; }
.board tbody tr { border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); cursor: pointer; transition: background .12s; }
.board tbody tr:last-child { border-bottom: 0; }
.board tbody tr:hover { background: var(--surface-2); }
.board tbody tr.is-me { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.board tbody tr.is-me:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.you { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 6px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
.board td { padding: 11px 14px; text-align: right; white-space: nowrap; }
.board td.l { text-align: left; }
.rankcell { width: 54px; text-align: center; }
.rankbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 8px; font-weight: 800; font-size: 13px; background: var(--surface-3); color: var(--text-dim); }
.rankbadge.g1 { background: linear-gradient(160deg, #ffe07a, var(--gold)); color: #3a2c00; box-shadow: 0 4px 14px -6px var(--gold); }
.rankbadge.g2 { background: linear-gradient(160deg, #eef2fb, var(--silver)); color: #2a3140; }
.rankbadge.g3 { background: linear-gradient(160deg, #f0b98a, var(--bronze)); color: #3a2411; }
.pname { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #0c0f16; flex: none; }
.pname .flag { color: var(--down); font-size: 12px; }
.pname .muted { color: var(--text-mut); font-weight: 500; font-size: 12px; }
.trophy { color: var(--accent); font-weight: 750; }
.rowspark { width: 88px; height: 26px; vertical-align: middle; }

/* gain pill --------------------------------------------------------------- */
.delta { font-weight: 700; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.zero, .delta.na { color: var(--text-mut); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.pill.up { background: var(--up-soft); color: var(--up); }
.pill.down { background: var(--down-soft); color: var(--down); }
.pill.zero { background: var(--surface-3); color: var(--text-mut); }

/* charts ------------------------------------------------------------------ */
.chart-wrap { position: relative; }
.chart { width: 100%; display: block; overflow: visible; touch-action: pan-y; }
.chart .grid line { stroke: var(--grid); }
.chart .axis text { fill: var(--text-mut); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { stroke: none; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .crossline { stroke: var(--border-2); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .bar { fill: var(--accent); }
.chart .bar.muted { fill: var(--surface-3); }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -115%);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 7px 10px; box-shadow: var(--shadow); white-space: nowrap; font-size: 12.5px;
  opacity: 0; transition: opacity .1s;
}
.chart-tip .tt-v { font-weight: 800; font-size: 14px; }
.chart-tip .tt-t { color: var(--text-mut); font-size: 11.5px; }
.chart-empty { display: grid; place-items: center; height: 180px; color: var(--text-mut); font-size: 13px; }

/* player detail ----------------------------------------------------------- */
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); font-weight: 600; font-size: 13.5px; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.phead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; }
.phead .bigav { width: 74px; height: 74px; border-radius: 20px; display: grid; place-items: center; font-size: 27px; font-weight: 800; color: #0c0f16; flex: none; box-shadow: var(--shadow-sm); }
.phead .who { min-width: 0; }
.phead h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phead .meta { color: var(--text-dim); font-size: 13.5px; margin-top: 5px; display: flex; gap: 8px 16px; flex-wrap: wrap; }
.phead .grand { margin-left: auto; text-align: right; }
.phead .grand .v { font-size: clamp(26px, 5vw, 38px); font-weight: 850; color: var(--accent); letter-spacing: -.02em; line-height: 1; }
.phead .grand .k { font-size: 12px; color: var(--text-mut); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border); }
.chip.gold { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.chip.warn { background: var(--down-soft); color: var(--down); border-color: color-mix(in srgb, var(--down) 30%, transparent); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.tile { padding: 14px; }
.tile .k { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-mut); font-weight: 700; }
.tile .v { font-size: 21px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.tile .d { font-size: 12px; color: var(--text-dim); margin-top: 1px; }

/* scrubber ("trophies at a time") ---------------------------------------- */
.scrub { padding: 16px 18px 18px; margin-top: 16px; }
.scrub .rowline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.scrub .at-when { color: var(--text-dim); font-weight: 600; }
.scrub .at-val { font-size: 26px; font-weight: 850; color: var(--accent); letter-spacing: -.02em; }
.scrub .at-sub { color: var(--text-mut); font-size: 12.5px; }
.scrub input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin-top: 16px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, var(--surface-3))); outline: none; }
.scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: var(--shadow-sm); cursor: grab; }
.scrub input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 3px solid var(--surface); border-radius: 50%; background: var(--accent); cursor: grab; }
.scrub .ends { display: flex; justify-content: space-between; color: var(--text-mut); font-size: 11.5px; margin-top: 8px; }

/* small readings table ---------------------------------------------------- */
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mut); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.mini-table th.l { text-align: left; }
.mini-table td { padding: 8px 12px; text-align: right; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.mini-table td.l { text-align: left; color: var(--text-dim); }
.mini-table tr:last-child td { border-bottom: 0; }

/* grid helpers ------------------------------------------------------------ */
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

/* skeleton / loading ------------------------------------------------------ */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 8%, transparent), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.flash { animation: flash 1.1s ease; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }

/* toast ------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow); font-size: 13.5px; }

/* footer ------------------------------------------------------------------ */
.foot { max-width: 1180px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 30px) 40px; color: var(--text-mut); font-size: 12px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--border); }

/* callouts (copy-paste Discord text) -------------------------------------- */
.callout { padding: 16px 18px 18px; }
.callout + .callout { margin-top: 16px; }
.callout-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.callout-head h3 { margin: 0; font-size: 15.5px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.callout-head .sub { color: var(--text-mut); font-size: 12.5px; }
.callout-head .spacer { flex: 1; }
.copybtn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-3); color: var(--text); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.copybtn:hover { border-color: var(--accent); }
.copybtn:active { transform: scale(.96); }
.copybtn.done { background: var(--up-soft); border-color: color-mix(in srgb, var(--up) 40%, transparent); color: var(--up); }
.copybtn svg { width: 15px; height: 15px; }
pre.copytext {
  margin: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7; color: var(--text);
  white-space: pre; max-height: 360px; overflow: auto;  /* no wrap → table columns stay aligned */
}
pre.copytext .mono-dim { color: var(--text-mut); }
.callout-note { color: var(--text-mut); font-size: 12px; margin-top: 10px; }
.callout-note code { color: var(--text-dim); }

/* shortage board ---------------------------------------------------------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; width: 110px; display: inline-block; vertical-align: middle; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--up), var(--accent)); }
.progress.behind > span { background: linear-gradient(90deg, var(--down), #ff9d6b); }
.sum-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sum-pill { padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.sum-pill .v { font-size: 20px; font-weight: 800; }
.sum-pill .k { font-size: 11.5px; color: var(--text-mut); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.sum-pill.bad .v { color: var(--down); }
.sum-pill.good .v { color: var(--up); }

/* empty / error ----------------------------------------------------------- */
.empty { text-align: center; color: var(--text-mut); padding: 50px 20px; }

/* season countdown (top bar + home tile) ---------------------------------- */
.season { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-variant-numeric: tabular-nums; }
.season.soon { color: var(--down); background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.season-ic { font-size: 13px; }
.season-lbl { color: var(--text-dim); font-weight: 650; }

/* requirement bar under every board + the member page card ---------------- */
.req-bar { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 6%, transparent); color: var(--text-dim); font-size: 13px; line-height: 1.45; }
.req-bar b { color: var(--text); }
.req-ic { font-size: 15px; line-height: 1.3; }
.req-card { display: grid; gap: 18px; }
.req-block { display: grid; gap: 8px; }
.req-title { font-weight: 750; font-size: 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.req-title .sub { color: var(--text-mut); font-size: 12px; font-weight: 600; }
.req-nums { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.req-nums .k { display: block; color: var(--text-mut); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.req-nums .v { display: block; font-size: 20px; font-weight: 800; }
.progress.wide { width: 100%; display: block; }
.req-note { margin: 0; color: var(--text-mut); font-size: 12.5px; }

/* flags page (one tab per member) ----------------------------------------- */
.tabstrip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 14px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); font-weight: 650; font-size: 13px; white-space: nowrap; flex: none; transition: color .15s, border-color .15s, background .15s; }
.tab:hover { color: var(--text); border-color: var(--border-2); }
.tab.on { color: var(--text); background: var(--surface-3); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.tab.zero { opacity: .55; }
.tab .n { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--down-soft); color: var(--down); font-size: 11.5px; font-weight: 800; text-align: center; }
.tab.zero .n { background: var(--surface-3); color: var(--text-mut); }
.avatar.sm { width: 22px; height: 22px; border-radius: 7px; font-size: 10px; }
.mini-table.flags td, .mini-table.flags th { white-space: nowrap; }
.flink { font-weight: 650; }
.flink:hover { color: var(--accent); }
.reason { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid transparent; }
.rs-blank { background: var(--surface-3); color: var(--text-dim); border-color: var(--border); }
.rs-spike { background: var(--down-soft); color: var(--down); }
.rs-decrease { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.rs-name { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.rs-other { background: var(--surface-3); color: var(--text-mut); }
a.chip:hover { color: var(--text); border-color: var(--accent); }

/* admin page (corrections + unflag) ---------------------------------------- */
.muted, .mono-dim { color: var(--text-mut); }
.chip.mini { padding: 1px 7px; font-size: 11px; vertical-align: 1px; }
.notice { padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid var(--border); background: var(--surface); }
.notice.warn { background: var(--down-soft); color: var(--down); border-color: color-mix(in srgb, var(--down) 30%, transparent); }
.admin-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-members { position: sticky; top: 78px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; overflow: hidden; }
.admin-filter { padding: 10px; border-bottom: 1px solid var(--border); }
.admin-filter input, .fld input, .fld textarea {
  width: 100%; padding: 9px 12px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; font: inherit; font-size: 14.5px; font-weight: 500; letter-spacing: 0; text-transform: none; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.admin-filter input:focus, .fld input:focus, .fld textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.fld textarea { resize: vertical; min-height: 58px; }
.admin-list { overflow-y: auto; padding: 6px; }
.adm-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; color: var(--text-dim); font-weight: 600; font-size: 13.5px; }
.adm-row:hover { background: var(--surface-2); color: var(--text); }
.adm-row.on { background: var(--surface-3); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.adm-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row .flag { color: var(--down); font-size: 12px; }
.adm-row .n { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--down-soft); color: var(--down); font-size: 11.5px; font-weight: 800; text-align: center; }
.adm-row .tr { color: var(--text-mut); font-size: 12px; min-width: 42px; text-align: right; }
.adm-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.adm-head h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.adm-head .meta { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.adm-head .meta b { color: var(--accent); }
.adm-head .spacer { flex: 1; }
.adm-help { color: var(--text-mut); font-size: 12.5px; margin: 12px 2px; line-height: 1.5; }
.adm-help b { color: var(--text-dim); }
.table-scroll { overflow-x: auto; }
.adm-reads td, .adm-reads th, .admin-log td, .admin-log th { white-space: nowrap; }
.mini-table tr.is-flagged td { background: color-mix(in srgb, var(--down) 5%, transparent); }
.mini-table td.acts { text-align: right; }
.mini-table td.acts .btn + .btn { margin-left: 6px; }
.admin-log td.note { white-space: normal; min-width: 160px; color: var(--text-dim); }
.rs-ok { background: var(--up-soft); color: var(--up); }
.rs-admin { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.proof-thumb { width: 56px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; margin-left: auto; background: var(--surface-2); }
.proof-thumb:hover { border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-3); color: var(--text); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; transition: border-color .15s, filter .15s, transform .1s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.sm { padding: 4px 11px; font-size: 12px; border-radius: 8px; }
.btn.primary { border: 0; background: linear-gradient(160deg, var(--accent-2), var(--accent)); color: #241a00; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ok { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); background: var(--up-soft); }
.btn.ghost { background: transparent; }
.dlg { border: 1px solid var(--border-2); border-radius: 18px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.dlg::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.dlg-form { display: grid; gap: 13px; padding: 20px; }
.dlg-form h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.dlg-form p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.dlg-sub { color: var(--text-mut); font-size: 13px; margin-top: -9px; }
.dlg-facts { display: flex; gap: 24px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.dlg-facts .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mut); font-weight: 700; }
.dlg-facts b { font-size: 17px; }
.fld { display: grid; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-mut); }
.fld em, .fld-hint { font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-mut); }
.fld-hint { color: var(--accent); margin-left: 4px; }
.fld input[type=file] { padding: 8px; font-size: 13px; }
.dlg-preview { max-height: 190px; width: 100%; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.dlg-err { background: var(--down-soft); color: var(--down); border: 1px solid color-mix(in srgb, var(--down) 30%, transparent); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.dlg-warn { background: var(--down-soft); color: var(--text-dim); border: 1px solid color-mix(in srgb, var(--down) 30%, transparent); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.dlg-warn b { color: var(--down); }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .brand-text { display: none; }
  .col-hide { display: none; }
  .phead .grand { margin-left: 0; text-align: left; width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-members { position: static; max-height: 280px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .live { display: none; }
  .season { padding: 6px 9px; font-size: 11.5px; }
  .season-lbl { display: none; }
  .col-hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
