/* KickStatz. Every value here comes from DESIGN.md (reference: kicklogz.com, studied 13 Oct 2026). */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/onest-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/onest-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}

/* ---------- Tokens: dark (default) ---------- */
:root {
  color-scheme: dark;
  --bg: #121212;
  --bg-deep: #0d0d0f;
  --surface-1: #18181b;
  --surface-2: #1f1f23;
  --raised: linear-gradient(165deg, #26262c 0%, #18181c 100%);
  --header-bg: linear-gradient(135deg, rgba(24, 24, 27, 0.96) 0%, rgba(18, 18, 18, 0.96) 100%);
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.1);
  --divider: rgba(255, 255, 255, 0.05);
  --hover: rgba(255, 255, 255, 0.025);
  --head-row: rgba(0, 0, 0, 0.28);
  --soft-fill: rgba(255, 255, 255, 0.05);
  --text: #efeff1;
  --text-2: #adadb8;
  --text-3: #9a9aa0;
  --accent: #4bf52b;
  --accent-text: #4bf52b;
  --accent-ink: #0e0e10;
  --accent-tint: rgba(75, 245, 43, 0.08);
  --accent-line: rgba(75, 245, 43, 0.35);
  --accent-edge: rgba(75, 245, 43, 0.1);
  --down: #ff4d4f;
  --down-tint: rgba(255, 77, 79, 0.12);
  --down-line: rgba(255, 77, 79, 0.35);
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --glow: 0 4px 20px rgba(75, 245, 43, 0.3);

  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --gutter: 24px;
  --font: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

/* ---------- Tokens: light ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f6f6f7;
    --bg-deep: #efeff1;
    --surface-1: #ffffff;
    --surface-2: #f0f0f2;
    --raised: linear-gradient(165deg, #ffffff 0%, #f8f8f9 100%);
    --header-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 246, 247, 0.96) 100%);
    --line: rgba(0, 0, 0, 0.08);
    --line-strong: rgba(0, 0, 0, 0.12);
    --divider: rgba(0, 0, 0, 0.11);
    --hover: rgba(0, 0, 0, 0.02);
    --head-row: rgba(0, 0, 0, 0.035);
    --soft-fill: rgba(0, 0, 0, 0.03);
    --text: #111113;
    --text-2: #55555e;
    --text-3: #6b6b74;
    --accent-text: #1f7a0c;
    --accent-tint: rgba(31, 122, 12, 0.08);
    --accent-line: rgba(31, 122, 12, 0.35);
    --accent-edge: rgba(31, 122, 12, 0.15);
    --down: #c62828;
    --down-tint: rgba(198, 40, 40, 0.08);
    --down-line: rgba(198, 40, 40, 0.3);
    --gold: #a67c00;
    --silver: #6e6e78;
    --bronze: #9a5b1e;
    --shadow-card: 0 4px 16px rgba(17, 17, 19, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --glow: 0 4px 16px rgba(75, 245, 43, 0.35);
  }
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f6f7;
  --bg-deep: #efeff1;
  --surface-1: #ffffff;
  --surface-2: #f0f0f2;
  --raised: linear-gradient(165deg, #ffffff 0%, #f8f8f9 100%);
  --header-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 246, 247, 0.96) 100%);
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.12);
  --divider: rgba(0, 0, 0, 0.11);
  --hover: rgba(0, 0, 0, 0.02);
  --head-row: rgba(0, 0, 0, 0.035);
  --soft-fill: rgba(0, 0, 0, 0.03);
  --text: #111113;
  --text-2: #55555e;
  --text-3: #6b6b74;
  --accent-text: #1f7a0c;
  --accent-tint: rgba(31, 122, 12, 0.08);
  --accent-line: rgba(31, 122, 12, 0.35);
  --accent-edge: rgba(31, 122, 12, 0.15);
  --down: #c62828;
  --down-tint: rgba(198, 40, 40, 0.08);
  --down-line: rgba(198, 40, 40, 0.3);
  --gold: #a67c00;
  --silver: #6e6e78;
  --bronze: #9a5b1e;
  --shadow-card: 0 4px 16px rgba(17, 17, 19, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --glow: 0 4px 16px rgba(75, 245, 43, 0.35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
img { display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.icon { flex: none; width: 20px; height: 20px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  padding: 10px 16px; border-radius: var(--r-md);
}
.skip:focus { top: 12px; color: var(--accent-ink); }

.wrap {
  width: 100%;
  max-width: 1248px;
  margin: 0 auto;
  padding: 24px var(--gutter) 0;
  flex: 1;
}

/* ---------- Black parts: dark in both themes (owner, 24 Oct 2026) ---------- */
/* The nav bar, footer and phone tab bar keep the dark tokens on the light theme too, so the
   white-and-green logo always sits on black; so do the stat cards, channel header and highlight card. */
.site-header, .site-footer, .tabbar, .stat, .channel-head, .highlight, .consent {
  color-scheme: dark;
  --raised: linear-gradient(165deg, #26262c 0%, #18181c 100%);
  --surface-1: #18181b;
  --surface-2: #1f1f23;
  --divider: rgba(255, 255, 255, 0.05);
  --hover: rgba(255, 255, 255, 0.025);
  --down: #ff4d4f;
  --down-tint: rgba(255, 77, 79, 0.12);
  --down-line: rgba(255, 77, 79, 0.35);
  --accent-edge: rgba(75, 245, 43, 0.18);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.1);
  --soft-fill: rgba(255, 255, 255, 0.05);
  --text: #efeff1;
  --text-2: #adadb8;
  --text-3: #9a9aa0;
  --accent-text: #4bf52b;
  --accent-tint: rgba(75, 245, 43, 0.08);
  --accent-line: rgba(75, 245, 43, 0.35);
  color: var(--text);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.97) 0%, rgba(18, 18, 18, 0.98) 100%);
  border-bottom: 1px solid rgba(75, 245, 43, 0.14);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(1.2);
}
.site-header::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(75, 245, 43, 0.45), transparent);
}
.site-header__inner {
  max-width: 1248px; margin: 0 auto; height: 70px;
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.wordmark { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); white-space: nowrap; }
.wordmark span { color: var(--accent-text); }
.wordmark:hover { color: var(--text); }
.wordmark { display: flex; align-items: center; }
.wordmark img { height: 26px; width: auto; }
@media (max-width: 760px) { .wordmark img { height: 22px; } }
.nav { display: flex; gap: 4px; }
.nav__link {
  font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap;
  padding: 8px 14px; border-radius: var(--r-md);
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
/* Nav hover (owner, 24 Oct 2026: "gamery sheen"): a green light sweeps across, a glowing bar grows from the centre. */
.nav__link { position: relative; overflow: hidden; isolation: isolate; }
.nav__link::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 25%, rgba(75, 245, 43, 0.28) 50%, transparent 75%);
  transform: translateX(-130%);
  transition: transform 0.55s var(--ease);
}
.nav__link::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 8px rgba(75, 245, 43, 0.9), 0 0 2px rgba(75, 245, 43, 1);
  transform: scaleX(0); transition: transform 0.3s var(--ease);
}
.nav__link:hover { color: #fff; background: rgba(75, 245, 43, 0.06); text-shadow: 0 0 12px rgba(75, 245, 43, 0.65); }
.nav__link:hover::before { transform: translateX(130%); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--accent-text); background: var(--accent-tint); }
.icon-btn:hover { box-shadow: 0 0 14px rgba(75, 245, 43, 0.35); }
.header-search { position: relative; margin-left: auto; width: 100%; max-width: 300px; }
.header-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.header-search input {
  width: 100%; height: 40px; padding: 0 12px 0 38px;
  background: var(--surface-1); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  font: inherit; font-size: 14px;
}
.header-search input::placeholder { color: var(--text-3); }
.header-search input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-tint); }
.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--soft-fill); border: 1px solid var(--line-strong);
  color: var(--text-2); cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.icon-btn:hover { color: var(--accent-text); border-color: var(--accent-line); }
.icon--moon { display: none; }
:root[data-theme='light'] .icon--sun { display: none; }
:root[data-theme='light'] .icon--moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .icon--sun { display: none; }
  :root:not([data-theme='dark']) .icon--moon { display: block; }
}

/* ---------- Phone tab bar ---------- */
.tabbar { display: none; }

/* ---------- Page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-head__text { max-width: 720px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-text);
}
.eyebrow .icon { width: 16px; height: 16px; }
h1 { font-size: 35px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; margin: 8px 0 8px; }
h1::after {
  content: ''; display: block; width: min(100%, 180px); height: 3px; margin-top: 12px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.lede { font-size: 15px; color: var(--text-2); max-width: 62ch; }
.key-figure {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 22px; border: 1px solid; border-radius: var(--r-lg); min-width: 140px;
}
.key-figure strong { font-size: 26px; font-weight: 800; line-height: 1.2; }
.key-figure span { font-size: 12px; font-weight: 600; color: rgba(14, 14, 16, 0.72); }

.freshness {
  display: inline-flex; align-items: flex-start; gap: 8px; margin-top: 16px;
  font-size: 13px; color: var(--text-3);
}
.freshness .icon { width: 16px; height: 16px; margin-top: 2px; }
.freshness time { font-family: var(--mono); font-size: 12px; }
.freshness.is-stale {
  color: var(--text-2); background: var(--surface-1);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: var(--r-md);
  font: 600 15px/1 var(--font); white-space: nowrap; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.btn .icon { width: 18px; height: 18px; }
.btn--primary, .key-figure {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.08) 48%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(135deg, #6dff4f 0%, var(--accent) 45%, #36c418 100%);
  border-color: #6dff4f;
  color: var(--accent-ink);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.btn--primary::after, .key-figure::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.btn--primary:hover::after, .key-figure:hover::after { transform: translateX(120%); }
.btn--primary:hover { color: var(--accent-ink); filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 28px rgba(75, 245, 43, 0.45); }
.btn--secondary { background: var(--accent-tint); border-color: var(--accent-line); color: var(--text); }
.btn--secondary:hover { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px var(--accent-tint); }
.btn--ghost {
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: var(--accent-text);
  border-color: var(--accent-line); background: var(--accent-tint);
}
.btn--ghost:hover { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-tint); }
.btn.is-disabled { opacity: 0.4; pointer-events: none; }

/* ---------- Forms ---------- */
.search-panel, .filters {
  margin-top: 20px; padding: 20px;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.search-row { display: flex; gap: 12px; }
.input-wrap { position: relative; flex: 1; min-width: 0; }
.input-wrap .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-wrap .input { padding-left: 44px; }
.field-label {
  display: block; margin-bottom: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-3);
}
.input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--surface-1); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  font: inherit; font-size: 15px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-tint); }
.input[aria-invalid='true'] { border-color: var(--down-line); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9aa0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field-error { margin-top: 8px; font-size: 13px; color: var(--down); }
.filters {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px 16px; align-items: end;
  padding: 16px 20px;
}
.filters__actions { display: flex; gap: 8px; }

/* ---------- Card edge: a thin green highlight along the top of every card ---------- */
.panel, .stat, .search-panel, .filters, .channel-head, .highlight, .post-card a { position: relative; }
.panel::before, .stat::before, .search-panel::before, .filters::before, .channel-head::before, .highlight::before, .post-card a::before {
  content: ''; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.stats--channel { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px 12px; text-align: center; min-width: 0;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.stat:hover { transform: translateY(-2px); border-color: var(--accent-edge); }
.stat__icon { width: 46px; height: 46px; padding: 10px; overflow: visible; border-radius: 50%; color: var(--accent-text); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.stat__label { font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; color: var(--text-3); line-height: 1.3; }
.stat__value { font-size: 22px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
[data-stat='top-category'] .stat__value { font-size: 16px; font-weight: 700; }
.stat__note { font-size: 12px; color: var(--text-3); }

/* ---------- Panels ---------- */
.panel {
  margin-top: 20px; padding: 20px 24px;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  min-width: 0;
}
.panel--flush { padding: 0; overflow: hidden; }
.panel--flush > .panel__head { padding: 20px 24px 0; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel__head h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.panel__head h2 .icon { color: var(--accent-text); }
.panel__note { font-size: 13px; color: var(--text-3); }
.panel__foot { margin-top: 12px; font-size: 12px; color: var(--text-3); }
.panel--flush .panel__foot { padding: 0 24px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.grid-2 > .panel { margin-top: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 12px 16px; text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text-2); background: var(--head-row);
}
.table td { padding: 12px 16px; border-top: 1px solid var(--divider); vertical-align: middle; }
.table tbody tr { transition: background-color 0.3s var(--ease); }
.table tbody tr:hover { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.col-rank { width: 52px; font-weight: 800; }
.col-num { text-align: right !important; white-space: nowrap; }
.cell-strong { font-weight: 600; }
.cell-viewers { font-weight: 700; }
.table--ranked tbody tr:nth-child(1) .col-rank { color: var(--gold); }
.table--ranked tbody tr:nth-child(2) .col-rank { color: var(--silver); }
.table--ranked tbody tr:nth-child(3) .col-rank { color: var(--bronze); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text); }
th[aria-sort='ascending']::after { content: ' \2191'; color: var(--accent-text); }
th[aria-sort='descending']::after { content: ' \2193'; color: var(--accent-text); }

.channel-link { display: flex; align-items: center; gap: 12px; min-width: 0; }
.channel-link__text { display: flex; flex-direction: column; min-width: 0; }
.channel-link__name { font-weight: 700; color: var(--text); }
.channel-link:hover .channel-link__name { color: var(--accent-text); }
.channel-link__title { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover;
  background: var(--surface-2); box-shadow: 0 0 0 2px var(--accent-line);
}
.avatar--blank { display: grid; place-items: center; font-weight: 700; color: var(--text-2); }
.cell-cat { color: var(--text-2); }
.cell-cat a:hover { color: var(--accent-text); }
.cell-cat .rating { margin-left: 6px; }
.cell-lang, .cell-uptime { color: var(--text-2); }
.cell-date { color: var(--text-2); white-space: nowrap; }
.cell-stream { min-width: 220px; }
.cell-stream__title { display: block; font-weight: 600; }
.cell-stream__cat { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- Badges, chips, ratings ---------- */
.badge {
  display: inline-block; padding: 2px 7px; border-radius: var(--r-xs);
  font-size: 10px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; line-height: 1.4;
}
.badge--live { background: var(--accent); color: var(--accent-ink); }
.badge--offline { background: var(--down-tint); color: var(--down); }
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; color: var(--text-2); background: var(--surface-1); border: 1px solid var(--line);
}
.rating {
  display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px; line-height: 1.5; white-space: nowrap;
}
.rating--easy { background: var(--accent-tint); color: var(--accent-text); border-color: var(--accent-line); }
.rating--medium { background: var(--soft-fill); color: var(--text); border-color: var(--line-strong); }
.rating--hard { color: var(--text-2); border-color: var(--line-strong); }
.rating--saturated { background: var(--down-tint); color: var(--down); border-color: var(--down-line); }
.rating--none { color: var(--text-3); font-weight: 500; padding-left: 0; padding-right: 0; }

/* ---------- Highlight card (category competition) ---------- */
.highlight {
  margin-top: 20px; padding: 16px 20px;
  border: 1px solid var(--accent-line); border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-tint) 0%, transparent 70%), var(--surface-1);
}
.highlight__row { display: flex; align-items: center; gap: 12px 36px; flex-wrap: wrap; margin-top: 10px; }
.highlight__value { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.highlight__label { display: block; font-size: 12px; color: var(--text-3); }

/* ---------- Channel page ---------- */
.channel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 24px; background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.channel-head__main { display: flex; align-items: center; gap: 24px; min-width: 0; }
.channel-head__avatar { flex: none; border-radius: 50%; padding: 4px; }
.channel-head__avatar .avatar { width: 112px; height: 112px; box-shadow: none; font-size: 40px; }
.channel-head__avatar.is-live { box-shadow: 0 0 0 3px var(--accent); }
.channel-head__avatar.is-offline { box-shadow: 0 0 0 3px var(--down); }
.channel-head__info { min-width: 0; }
.channel-head__name { font-size: 30px; font-weight: 800; color: var(--accent-text); margin: 0 0 8px; overflow-wrap: anywhere; }
.channel-head__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.channel-head__desc { margin-top: 10px; font-size: 14px; color: var(--text-2); max-width: 60ch; }
.channel-head__actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.channel-head__spark { text-align: right; }
.spark-label { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.sparkline { max-width: 100%; height: auto; }
.sparkline rect { fill: var(--accent); }
.sparkline .spark--empty { fill: var(--line-strong); }

.tabs { display: flex; gap: 8px; margin-top: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 12px 20px; border-radius: var(--r-md) var(--r-md) 0 0;
  font-size: 15px; font-weight: 600; color: var(--text-2); white-space: nowrap;
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.tab:hover { color: var(--text); background: var(--soft-fill); }
.tab.is-active { color: var(--accent-text); background: var(--accent-tint); box-shadow: inset 0 -2px 0 var(--accent); }

.chart { position: relative; height: 280px; }
.chart canvas { position: relative; z-index: 1; }
.chart__skeleton { position: absolute; inset: 0; }
.chart.is-ready .chart__skeleton { display: none; }
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-1) 0%, var(--surface-2) 50%, var(--surface-1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.bars { list-style: none; margin: 0; padding: 0; }
.bars__row { display: grid; grid-template-columns: minmax(0, 150px) 1fr 52px; gap: 12px; align-items: center; margin: 10px 0; }
.bars__label { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars__track { height: 10px; border-radius: 999px; background: var(--surface-1); overflow: hidden; }
.bars__fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bars__value { font-size: 13px; text-align: right; }

/* ---------- Empty states, notes, pager ---------- */
.empty { text-align: center; padding: 36px 16px; }
.empty__icon { width: 32px; height: 32px; color: var(--text-3); margin: 0 auto; }
.empty__title { margin-top: 12px; font-size: 16px; font-weight: 700; }
.empty__text { margin: 4px auto 0; font-size: 14px; color: var(--text-3); max-width: 46ch; }
.data-note { display: flex; gap: 8px; margin-top: 20px; font-size: 12px; color: var(--text-3); }
.data-note .icon { width: 16px; height: 16px; }
.table-sort { display: none; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--divider); }
.pager__info { font-size: 13px; color: var(--text-3); }
.center-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Best time heatmap ---------- */
.heatmap { min-width: 980px; }
.heatmap th, .heatmap td { padding: 6px 4px; text-align: center; font-size: 12px; }
.heatmap th[scope="row"] { text-align: left; padding-left: 16px; }
.heatmap__cell { background: color-mix(in srgb, var(--accent) var(--shade), transparent); color: var(--text); }
.heatmap__cell.is-strong { color: var(--accent-ink); }
.heatmap__cell.is-best { outline: 2px solid var(--text); outline-offset: -2px; font-weight: 600; }
.heatmap__cell.is-empty { color: var(--text-3); }
.best-times { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; font-size: 14px; color: var(--text-2); }
.best-times .icon { flex: none; width: 18px; height: 18px; color: var(--accent-text); }

/* ---------- Text pages (about, how it works, policies) ---------- */
.prose { max-width: 72ch; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.prose h2 { margin: 32px 0 8px; font-size: 18px; line-height: 1.3; color: var(--text); }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.prose code { font-family: var(--mono); font-size: 13px; }
.prose .table-wrap { margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.prose .table td { vertical-align: top; }

/* ---------- Guides (blog) ---------- */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.post-card a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-1); color: var(--text-2); text-decoration: none; }
.post-card a:hover { border-color: var(--accent-line); }
.post-card__tag { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.post-card__title { color: var(--text); font-size: 17px; line-height: 1.35; }
.post-card__hook { font-size: 14px; line-height: 1.5; }
.post-card__meta { margin-top: auto; font-size: 12px; color: var(--text-3); }
.post { max-width: 72ch; }
.post h1 { margin: 8px 0 8px; }
.post .post-date { margin: 0 0 24px; font-size: 13px; color: var(--text-3); }
.post { font-size: 16px; line-height: 1.7; color: var(--text-2); }
.post h2 { margin: 36px 0 10px; font-size: 21px; line-height: 1.3; color: var(--text); }
.post h3 { margin: 24px 0 8px; font-size: 17px; color: var(--text); }
.post p, .post ul, .post ol, .post table { margin: 0 0 16px; }
.post ul, .post ol { padding-left: 22px; }
.post li { margin-bottom: 6px; }
.post strong { color: var(--text); }
.post a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }

.faq__item { padding: 14px 0; border-top: 1px solid var(--divider); }
.faq__item:first-of-type { border-top: 0; padding-top: 4px; }
.faq__q { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.faq__a { margin: 0; max-width: 80ch; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.faq__a a { color: var(--accent-text); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 28px 16px; background: #121212; border-top: 1px solid rgba(75, 245, 43, 0.14); text-align: center; font-size: 12px; color: var(--text-3); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-bottom: 12px; font-size: 13px; }
.footer-links a { color: var(--text-2); text-decoration: none; padding: 6px 0; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

.link-btn { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.link-btn:hover { color: var(--text); text-decoration: underline; }

/* ---------- Cookie banner ---------- */
/* Not a modal: the page stays usable. Reject and Accept look the same (ICO: refusing is as easy as accepting). */
.consent {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; width: min(400px, calc(100vw - 32px));
  padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--raised); border: 1px solid var(--line-strong); border-top: 2px solid var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.consent[hidden] { display: none; }
.consent__title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.consent__text { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.consent__text a { color: var(--accent-text); }
.consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .stats--channel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav__link { padding: 8px 10px; }
  .site-header__inner { gap: 16px; }
  .header-search { max-width: 220px; }
}
@media (max-width: 900px) {
  .nav__link { padding: 8px 7px; font-size: 13px; }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .site-header__inner { height: 60px; gap: 12px; }
  .nav, .header-search { display: none; }
  .icon-btn { margin-left: auto; }
  .wrap { padding-top: 20px; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: #121212; border-top: 1px solid rgba(75, 245, 43, 0.14);
  }
  .tabbar__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; font-weight: 600; color: var(--text-3); min-height: 44px;
  }
  .tabbar__item .icon { width: 22px; height: 22px; }
  .tabbar__item.is-active { color: var(--accent-text); }
  .consent { left: 16px; right: 16px; width: auto; bottom: calc(64px + env(safe-area-inset-bottom) + 12px); padding: 16px; }

  h1 { font-size: 28px; }
  .page-head { align-items: stretch; gap: 16px; }
  .key-figure { flex-direction: row; gap: 10px; align-items: baseline; padding: 10px 16px; min-width: 0; }
  .key-figure strong { font-size: 22px; }

  .search-panel, .filters { padding: 16px; }
  .search-row { flex-direction: column; }
  .search-row .btn { width: 100%; }
  .filters { grid-template-columns: 1fr; }
  .filters__actions .btn { flex: 1; }

  .stats, .stats--channel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--channel .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .panel { padding: 16px; }
  .panel--flush > .panel__head { padding: 16px 16px 0; }
  .panel--flush .panel__foot { padding: 0 16px 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .pager { padding: 14px 16px; }
  .pager .btn { padding: 0 14px; }

  .channel-head { padding: 16px; gap: 16px; }
  .channel-head__main { gap: 16px; align-items: flex-start; }
  .channel-head__avatar .avatar { width: 72px; height: 72px; font-size: 28px; }
  .channel-head__name { font-size: 24px; }
  .channel-head__spark { width: 100%; text-align: left; }
  .tab { padding: 10px 14px; font-size: 14px; }

  /* Tables become compact rows: no sideways scrolling on a phone (PRD §6.1). */
  .table, .table tbody, .table tr, .table td { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .table-wrap { overflow: visible; }
  .table tr { padding: 12px 16px; border-top: 1px solid var(--divider); }
  .table td { padding: 0; border: 0; }
  .col-num { text-align: left !important; }

  .table--live tr {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas: 'rank ch viewers' 'rank cat up';
    gap: 6px 10px; align-items: center;
  }
  .table--live .col-rank { grid-area: rank; width: auto; align-self: start; padding-top: 10px; }
  .table--live .cell-channel { grid-area: ch; min-width: 0; }
  .table--live .cell-viewers { grid-area: viewers; font-size: 16px; text-align: right !important; }
  .table--live .cell-cat { grid-area: cat; display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; padding-left: 52px; }
  .table--live .cell-cat a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table--live .cell-cat .rating { margin-left: 0; flex: none; }
  .table--live .cell-uptime { grid-area: up; font-size: 12px; text-align: right !important; }
  .table--live .cell-lang { display: none; }
  .channel-link__title { max-width: 100%; }

  .table--cats tr, .table--streams tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
  .table--streams tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table--cats .col-rank { display: none; }
  .table--cats .cell-strong, .table--streams .cell-stream { grid-column: 1 / -1; min-width: 0; }
  .table--cats td:last-child { grid-column: 1 / -1; }
  .table--streams .cell-date { grid-column: 1 / -1; font-size: 12px; }
  [data-label]::before {
    content: attr(data-label); display: block;
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-3);
  }
  .table--live [data-label]::before, .table--cats td:last-child::before { display: none; }
  .bars__row { grid-template-columns: minmax(0, 110px) 1fr 48px; }
  .table-sort:not([hidden]) { display: block; padding: 0 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .stat:hover, .btn--primary:hover { transform: none; }
}
