/* ---------- шрифты: свои файлы, без сторонних CDN ---------- */
@font-face {
  font-family: "Martian Mono"; font-weight: 100 800; font-display: swap;
  src: url("fonts/martian-mono-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: "Martian Mono"; font-weight: 100 800; font-display: swap;
  src: url("fonts/martian-mono-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: "Geologica"; font-weight: 100 900; font-display: swap;
  src: url("fonts/geologica-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: "Geologica"; font-weight: 100 900; font-display: swap;
  src: url("fonts/geologica-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: "JetBrains Mono"; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-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-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-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;
}

/* ---------- токены: палитра от земли, две темы (docs/design) ----------
   Земля и луна - основа: фон, плиты, текст; серый всегда с тёплым отливом. Солнце (--accent) - бренд, «после», действия,
   события на графиках. Василёк и мак (--up, --down) - только направление в данных. Жара и прочих цветов силы нет:
   силу показывают магнитуда, волна индикатора и мигание разлома.
   Тема - системная или выбранная кнопкой (атрибут data-theme ставит скрипт в <head>). Полупрозрачные слои считаются от
   --fg-rgb: в тёмной теме это светлые блики, в светлой - тени. Светлая тема - песок и глина, не белая: не слепит */
:root {
  color-scheme: dark;
  --bg: #13100d;
  --paper: #1b1612;
  --surface: #221c16;
  --surface-2: #2c241c;
  --surface-3: #372d23;
  --fg-rgb: 236 230 214;
  --bg-rgb: 19 16 13;
  --shadow-rgb: 0 0 0;
  --line: rgb(var(--fg-rgb) / 0.07);
  --line-2: rgb(var(--fg-rgb) / 0.14);
  --moon: #efe8d8;
  --text: #e8e1d2;
  --text-2: #b3a792;
  --muted: #968c7f;
  /* фон-самописец и обложки: в тёмной теме приглушаются прозрачностью, в светлой прозрачность их выбеливает -
     там обложки полные, но чуть темнее, а линии фона плотнее */
  --bg-line-alpha: 0.025;
  --cover-alpha: 0.85;
  --cover-filter: brightness(1);
  --cover-veil: 0.1;     /* дымка поверх обложки и откуда начинается её переход в плиту */
  --cover-fade: 20%;

  --accent: #f0b44c;
  --accent-rgb: 240 180 76;
  --accent-ink: #1b1206;
  --accent-text: var(--accent);   /* текст цветом бренда; в светлой теме темнее - 4,5:1 на плитах */
  --up: #7f9ff0;
  --up-rgb: 127 159 240;
  --down: #e8604a;
  --down-rgb: 232 96 74;
  --green: #7fae6a;
  --sky: var(--up);

  /* скос из значка: каждая плита теряет верхний левый и нижний правый угол на одном и том же скосе */
  --cut: 14px;
  --gap: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --display: "Martian Mono", "JetBrains Mono", ui-monospace, monospace;
  --body: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #d8d0c2; --paper: #e0d9cc; --surface: #d0c6b5; --surface-2: #c5b9a5; --surface-3: #b9ab95;
    --fg-rgb: 35 27 20; --bg-rgb: 216 208 194; --shadow-rgb: 70 50 30;
    --moon: #221a13; --text: #231b14; --text-2: #4f4337; --muted: #594d40;
  --bg-line-alpha: 0.06; --cover-alpha: 1; --cover-filter: brightness(0.9) saturate(0.95); --cover-veil: 0; --cover-fade: 45%;
    --accent: #985b08; --accent-rgb: 152 91 8; --accent-ink: #ffffff; --accent-text: #734506;
    --up: #2f4c99; --up-rgb: 47 76 153; --down: #932e1c; --down-rgb: 147 46 28; --green: #4b7a3a;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #d8d0c2; --paper: #e0d9cc; --surface: #d0c6b5; --surface-2: #c5b9a5; --surface-3: #b9ab95;
  --fg-rgb: 35 27 20; --bg-rgb: 216 208 194; --shadow-rgb: 70 50 30;
  --moon: #221a13; --text: #231b14; --text-2: #4f4337; --muted: #594d40;
  --bg-line-alpha: 0.06; --cover-alpha: 1; --cover-filter: brightness(0.9) saturate(0.95); --cover-veil: 0; --cover-fade: 45%;
  --accent: #985b08; --accent-rgb: 152 91 8; --accent-ink: #ffffff; --accent-text: #734506;
  --up: #2f4c99; --up-rgb: 47 76 153; --down: #932e1c; --down-rgb: 147 46 28; --green: #4b7a3a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
main, .topbar, .footer { position: relative; z-index: 1; }
/* фон: бегущие линии самописца (static/js/shell.js) */
.bg-trace { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* min-height: пока скрипт не нарисовал страницу, подвал не стоит посреди экрана, чтобы потом прыгнуть вниз (CLS) */
main { max-width: 1240px; margin: 0 auto; padding: 8px 20px 48px; min-height: 100vh; min-height: 100svh; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; }
kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); padding: 0 5px; }

select, input, button {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 7px 11px;
}
input::placeholder { color: var(--muted); }
select:focus-visible, input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.25s var(--ease); }
button:hover:not(:disabled) { border-color: rgb(var(--fg-rgb) / 0.28); }
:disabled { opacity: 0.45; cursor: not-allowed; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
.ghost { background: transparent; }
.link { background: none; border: none; padding: 0; color: var(--text-2); font: 500 12px var(--mono); letter-spacing: 0.04em;
  text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover:not(:disabled) { color: var(--accent-text); text-decoration-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- плита: единственный мотив карточек ---------- */
.plate {
  background: var(--surface);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.plate:focus-visible { outline-offset: -3px; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgb(var(--bg-rgb) / 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.plate-before { fill: var(--moon); }
.plate-after { fill: var(--accent); }
/* название: afterpatch. Раз в цикл нарастает дрожь, слово сдвигает по разлому - «afterpat» вверх-влево, «ch» вниз-вправо,
   в щели появляется точка (адрес afterpat.ch), и всё садится обратно. Ширина места - с запасом на точку: соседи не двигаются */
.wordmark { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.03em; color: var(--moon);
  display: inline-flex; align-items: baseline; white-space: nowrap; width: 11.2ch; animation: wm-rattle 16s linear 3s infinite; }
.wm-base, .wm-ch { display: inline-block; animation-duration: 16s; animation-delay: 3s; animation-iteration-count: infinite; animation-timing-function: cubic-bezier(.3, .7, .3, 1); }
.wm-base { animation-name: wm-shear-base; } .wm-ch { animation-name: wm-shear-ch; }
.wm-dot { color: var(--accent-text); display: inline-block; width: 0; opacity: 0; overflow: hidden; animation: wm-gap 16s cubic-bezier(.3, .7, .3, 1) 3s infinite; }
@keyframes wm-rattle { 0%, 62%, 71%, 100% { transform: none; } 63% { transform: translate(-0.4px, 0.2px); } 64% { transform: translate(0.6px, -0.3px); }
  65% { transform: translate(-0.9px, 0.5px); } 66% { transform: translate(1.2px, -0.6px); } 67% { transform: translate(-1.5px, 0.8px); }
  68% { transform: translate(1.6px, -0.7px); } 69% { transform: translate(-1px, 0.4px); } 70% { transform: translate(0.4px, 0); } }
@keyframes wm-gap { 0%, 70%, 93%, 100% { width: 0; opacity: 0; } 74%, 88% { width: 0.62em; opacity: 1; } }
@keyframes wm-shear-base { 0%, 70%, 93%, 100% { transform: none; } 74%, 88% { transform: translate(-0.04em, -0.13em); } }
@keyframes wm-shear-ch { 0%, 70%, 93%, 100% { transform: none; } 74%, 88% { transform: translate(0.08em, 0.17em); } }
@media (prefers-reduced-motion: reduce) { .wordmark, .wm-base, .wm-dot, .wm-ch { animation: none; } }

/* живая лента: самописец и бегущая строка «кого трясёт» */
.live-strip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; height: 34px; padding-left: 16px; border-left: 1px solid var(--line-2); overflow: hidden; }
#live-trace { width: 120px; height: 26px; flex: none; }
.live-ticker { min-width: 0; overflow: hidden; }
.live-item { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 12px/1.3 var(--mono); color: var(--text-2);
  background: none; border: 0; padding: 0; text-align: left; transition: opacity 0.4s, transform 0.4s var(--ease); }
button.live-item:hover { color: var(--moon); }
.live-item b { color: var(--moon); font-weight: 600; margin-right: 4px; }
.live-item.in { animation: ticker-in 0.45s var(--ease) both; }
@keyframes ticker-in { from { opacity: 0; transform: translateY(8px); } }

.switcher-btn { display: flex; align-items: center; gap: 10px; min-width: 240px; color: var(--text-2); background: var(--paper); }
.switcher-btn #switcher-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.switcher-icon { color: var(--muted); font-size: 15px; line-height: 1; }
.theme-switch { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; background: transparent; border-color: transparent; color: var(--text-2); }
.theme-switch:hover:not(:disabled) { color: var(--text); background: var(--surface-2); border-color: transparent; }
.theme-switch svg { width: 17px; height: 17px; }
/* min-height - под кнопку «Войти», которая приходит после /api/me: шапка не подрастает на глазах */
.account { display: flex; align-items: center; gap: 8px; white-space: nowrap; min-height: 38px; }
.lang-menu { position: relative; }
.lang-current { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px;
                color: var(--text-2); padding: 6px 8px; user-select: none; }
.lang-current::-webkit-details-marker { display: none; }
.lang-current:hover, .lang-menu[open] .lang-current { color: var(--moon); background: var(--surface-2); }
.lang-caret { font-size: 9px; transition: transform 0.2s var(--ease); }
.lang-menu[open] .lang-caret { transform: rotate(180deg); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none; min-width: 168px;
             background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgb(var(--shadow-rgb) / 0.35); }
.lang-list a { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.lang-list a b { font: 600 11px var(--mono); color: var(--muted); min-width: 20px; }
.lang-list a:hover, .lang-list a:focus-visible { background: var(--surface-2); }
.lang-list a[aria-current] { color: var(--accent-text); }
.account .who { color: var(--muted); font-size: 13px; }

/* ---------- анимации ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--ring); } 100% { box-shadow: 0 0 0 10px transparent; } }
.view { animation: fade 0.35s ease both; }
.panel { animation: rise 0.35s var(--ease) both; }

/* ---------- общие блоки ---------- */
.card { position: relative; padding: 22px 24px; margin-bottom: var(--gap); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.card h2 { font-size: 17px; color: var(--moon); }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 780px; }
.card > h2 + .card-sub { margin-bottom: 14px; }
.note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.eyebrow { font: 500 11px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.error { background: var(--surface); border: 1px solid var(--down); padding: 16px; margin: 16px 0; color: var(--down); }
.split-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--gap); }
.split-2 > .card { margin-bottom: var(--gap); }
.loading { opacity: 0.45; pointer-events: none; transition: opacity 0.2s; }
.chip { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); background: rgb(var(--fg-rgb) / 0.06);
  padding: 6px 8px; text-decoration: none; }
a.chip:hover { color: var(--text); }
.chip.ai { color: var(--accent-text); background: rgb(var(--accent-rgb) / 0.12); }
.chip.warn { color: var(--down); background: rgb(var(--down-rgb) / 0.1); }
.badge { font-size: 11px; color: var(--text-2); border: 1px solid var(--line-2); padding: 0 8px; }
/* ссылка в Steam: знак одним цветом темы (static/steam-mono.svg маской), без рамки - не спорит с заголовком */
.steam { display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--text-2); transition: color 0.2s; }
.steam:hover, .steam:focus-visible { color: var(--moon); }
.steam i { display: block; width: 26px; height: 26px; background: currentColor;
           -webkit-mask: url("steam-mono.svg") center / contain no-repeat; mask: url("steam-mono.svg") center / contain no-repeat; }
/* hidden сильнее любого display: иначе .hero-picks { display: flex } показывает пустой блок */
[hidden] { display: none !important; }

/* ---------- индикатор толчка (static/js/stamp.js) ----------
   треугольник вверх, солнечный разлом, треугольник вниз. Закрашен светлым треугольник направления, второй - контуром */
.ind { display: inline-flex; align-items: center; gap: 10px; line-height: 1; vertical-align: middle; }
.ind-tri { width: 20px; height: 28px; flex: none; }
.ind .t-up, .ind .t-dn { fill: none; stroke: var(--muted); stroke-width: 1.4; transition: fill 0.3s; }
.ind.up .t-up, .ind.down .t-dn { fill: var(--moon); stroke: var(--moon); }
.ind .fault { stroke: var(--accent); stroke-width: 2; }
.ind.hot .fault { animation: fault-blink 1.6s steps(2, jump-none) infinite; }
@keyframes fault-blink { 50% { opacity: 0.2; } }
.ind-m { display: grid; gap: 3px; }
.ind-m b { font: 700 19px/1 var(--display); color: var(--moon); letter-spacing: -0.02em; }
.ind.m0 .ind-m b { color: var(--muted); }
.ind-m small { font: 500 9.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ind-wave { width: 64px; height: 18px; overflow: hidden; }
.ind-wave path { fill: none; stroke: var(--moon); stroke-width: 1.6; stroke-linejoin: round; animation: wave-run 3.2s linear infinite; }
/* тихая игра не дрожит: движение на странице - только там, где правда трясёт */
.ind.m0 .ind-wave path { stroke: var(--muted); animation: none; }
@media (prefers-reduced-motion: reduce) { .ind-wave path, .ind.hot .fault { animation: none; } }
@keyframes wave-run { to { transform: translateX(-64px); } }
.mood-scale { display: flex; align-items: center; margin: 4px 0; }
.mood-scale:empty { display: none; }

/* ---------- лента самописца на карточках (util.tape) ---------- */
.tape { width: 100%; height: 44px; display: block; overflow: visible; }
.tape-tick { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tape-mid { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.tape-line { fill: none; stroke: var(--moon); stroke-width: 1.4; stroke-linejoin: bevel; vector-effect: non-scaling-stroke; opacity: 0.85;
  animation: reveal 1.4s var(--ease) both 0.15s; }
.tape-end { fill: var(--moon); }
.tape-end.up { fill: var(--up); } .tape-end.down { fill: var(--down); }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- обрывки отзывов ---------- */
.fragments { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.fragments li { padding-left: 12px; border-left: 2px solid var(--line-2); font-size: 13.5px; line-height: 1.45; color: var(--text-2); font-style: italic; }
.fragments li.up { border-left-color: rgb(var(--up-rgb) / 0.75); }
.fragments li.down { border-left-color: rgb(var(--down-rgb) / 0.75); }

/* ---------- главная ---------- */
.hero { padding: 56px 0 36px; display: grid; gap: 24px; }
.hero h1, .hero .hero-title { font: 600 clamp(34px, 6vw, 64px)/1.02 var(--display); letter-spacing: -0.04em; color: var(--moon); }
.hero .hero-title .after { color: var(--accent-text); }
.hero-search { display: flex; max-width: 640px; }
.hero-search input { flex: 1; min-width: 0; font-size: 17px; padding: 15px 18px; border-right: 0; }
.hero-search button { font: 600 13px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 0 22px; }

.pulse-card { margin: 0 0 40px; }
.section-title { font: 600 20px/1.2 var(--display); letter-spacing: -0.02em; color: var(--moon); margin-top: 4px; }
.pulse { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--gap); }
.story { display: flex; flex-direction: column; align-items: stretch; text-align: left; padding: 0; border: 0; color: inherit;
  animation: rise 0.45s var(--ease) both; transition: transform 0.35s var(--ease); }
.story:hover:not(:disabled) { transform: translateY(-3px); }
.story-cover { position: relative; display: flex; align-items: flex-end; aspect-ratio: 16 / 7; overflow: hidden; padding: 12px 16px; }
.story-cover .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 6s linear, opacity 0.4s; }
.story:hover .story-cover .cover { transform: scale(1.06); }
.story-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(var(--bg-rgb) / var(--cover-veil)) var(--cover-fade), var(--surface) 100%); }
.story-game { position: relative; z-index: 1; font: 600 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--moon); }
.story-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 4px 16px 16px; min-width: 0; width: 100%; }
.story-body > * { max-width: 100%; }
.story-title { color: var(--moon); font-size: 16px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story .fragments li { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story .tape { margin-top: auto; }
.story.skeleton { pointer-events: none; min-height: 320px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.pulse-ahead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 16px 0 0; font-size: 13px; }
.pulse-ahead[hidden] { display: none; }
#pulse-ahead-list { display: contents; }
.ahead-item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 12px; border: 1px solid var(--line); background: var(--paper);
  color: var(--text-2); text-align: left; line-height: 1.3; }
.ahead-item:hover { border-color: var(--line-2); }
.ahead-item::before { content: ''; flex: none; width: 6px; height: 6px; background: var(--accent); }
.ahead-item b { color: var(--moon); font-weight: 500; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 14px; }
.toolbar .search { flex: 1 1 260px; }
.toolbar label.toggle { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.toolbar input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; padding: 0; }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line); padding: 3px; gap: 2px; }
.seg button { border: none; background: none; font: 500 12px var(--mono); padding: 6px 10px; color: var(--muted); }
.seg button.active, .seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--moon); }
.seg button small { color: var(--muted); font-size: 11px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.small-seg button { font-size: 11.5px; padding: 4px 9px; }
.seg button[hidden] { display: none; }
.games-count { color: var(--muted); font: 12px var(--mono); margin-bottom: 12px; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.game-card { position: relative; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 0 16px 14px; overflow: hidden;
  animation: rise 0.45s var(--ease) both; transition: transform 0.3s var(--ease); }
.game-card:hover { transform: translateY(-3px); }
/* обложка - полосой сверху и уходит в плиту; всё остальное - на тёмной плите, как у карты толчков */
.card-cover { position: relative; margin: 0 -16px 4px; aspect-ratio: 460 / 150; overflow: hidden; background: var(--surface-2); }
.card-cover .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 6s linear, opacity 0.4s; }
.card-cover .cover.loaded { opacity: var(--cover-alpha); filter: var(--cover-filter); }
.game-card:hover .card-cover .cover { transform: scale(1.06); }
.card-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, var(--surface) 100%); }
.game-card h3 { font-size: 15px; line-height: 1.3; padding-right: 36px; }
.game-card h3 a { text-decoration: none; }
.game-card .steam { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; z-index: 2; border-radius: 50%; background: rgb(var(--bg-rgb) / 0.7); opacity: 0; }
/* значок Steam на каждой карточке - лишний шум: появляется при наведении и с клавиатуры, на касаниях - всегда */
.game-card:hover .steam, .game-card:focus-within .steam { opacity: 0.85; }
@media (hover: none) { .game-card .steam { opacity: 0.6; } }
.game-card .steam i { width: 20px; height: 20px; }
.game-card .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.big { font: 600 38px/1 var(--display); letter-spacing: -0.04em; color: var(--moon); font-variant-numeric: tabular-nums; }
.big small { font-size: 16px; color: var(--muted); margin-left: 2px; }
.rating { color: var(--muted); font: 11.5px/1.3 var(--mono); }
.delta { font: 600 12px var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--muted); }
.game-card .tape { margin-top: 4px; }
.game-card .tags { margin-top: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 500 10.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 7px; color: var(--text-2); background: rgb(var(--fg-rgb) / 0.06); }
.tag.quake { color: var(--moon); background: rgb(var(--fg-rgb) / 0.12); }
/* ИИ-разбор - справка о карточке, а не повод на неё смотреть: без солнечного цвета, он у событий и бренда */
.tag.ai { color: var(--muted); background: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.tag.warn { color: var(--down); background: rgb(var(--down-rgb) / 0.1); }
.tag.up { color: var(--up); background: rgb(var(--up-rgb) / 0.12); }
.tag.down { color: var(--down); background: rgb(var(--down-rgb) / 0.12); }
.wish-line { color: var(--muted); font-size: 13px; margin-top: 20px; }
/* список вместо карточек: для тех, кто сравнивает много игр */
.games.list { display: block; }
.games.list .game-card { flex-direction: row; align-items: center; gap: 16px; min-height: 0; padding: 10px 8px; clip-path: none; background: none;
  border-bottom: 1px solid var(--line); animation-duration: 0.3s; }
.games.list .game-card:hover { transform: none; background: var(--surface); }
.games.list .card-cover { display: none; }
.games.list .game-card h3 { flex: 1 1 200px; padding: 0; }
.games.list .row { flex: 0 0 150px; }
.games.list .big { font-size: 20px; }
.games.list .rating { flex: 0 0 170px; }
.games.list .tape { flex: 0 0 160px; width: 160px; height: 28px; margin: 0; }
.games.list .tags { flex: 0 0 170px; margin: 0; justify-content: flex-end; }
.games.list .steam { position: static; order: -1; flex: none; }

/* ---------- страница игры ---------- */
.game-hero { display: grid; grid-template-columns: 300px minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 28px 0 8px; }
.poster { position: relative; aspect-ratio: 460 / 215; overflow: hidden; background: var(--surface-2); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s; }
.poster img.loaded { opacity: 1; }
.poster-name { position: absolute; left: 14px; right: 14px; bottom: 14px; font: 700 16px/1.15 var(--display); color: var(--moon); letter-spacing: -0.02em; }
.poster:has(img.loaded) .poster-name { display: none; }
.game-hero-text { display: grid; gap: 10px; align-content: start; min-width: 0; }
.back { color: var(--muted); text-decoration: none; font: 12px var(--mono); }
.back:hover { color: var(--accent-text); }
.title-row { display: flex; align-items: center; gap: 14px; }
#game-title { font: 600 clamp(28px, 4.4vw, 50px)/1.04 var(--display); letter-spacing: -0.04em; color: var(--moon); }
.game-meta { color: var(--text-2); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* табло оценки (util.readout): две плиты по разлому, как значок - «за всё время» тусклая слева, «за 30 дней» солнечная
   справа и ниже. Это главный блок шапки - контрастный */
.gauge { flex: none; }
.readout { display: grid; grid-template-columns: auto auto; align-items: start; }
.readout-plate { display: grid; gap: 4px; align-content: start; min-width: 124px; min-height: 92px; padding: 14px 26px 14px 16px; }
.readout-plate.before { background: var(--surface-2); clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - 18px) 100%, 0 100%, 0 var(--cut)); }
.readout-plate.after { margin-left: -14px; padding-left: 30px; transform: translateY(12px); background: var(--accent); color: var(--accent-ink);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%); }
.readout-value { font: 700 40px/1 var(--display); letter-spacing: -0.04em; color: var(--accent-ink); }
.readout-plate.before .readout-value { font-size: 28px; color: var(--text-2); }
.readout-label { font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
/* подписи плит - без полупрозрачности: на солнце она роняла контраст ниже 4,5:1 */
.readout-plate.before .readout-label { color: var(--text-2); }
.readout-plate.after .readout-label { color: var(--accent-ink); }
.readout-delta { font: 700 12px var(--mono); color: var(--accent-ink); }
.gauge-caption { color: var(--muted); font: 12px var(--mono); margin-top: 24px; text-align: right; }

/* эта неделя: один блок со всем главным */
.week-game { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 32px; margin: 26px 0 0; padding: 26px 28px; }
.week-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.week-game .eyebrow { margin: 0; }
.week-game-headline { font: 600 clamp(22px, 2.8vw, 30px)/1.15 var(--display); color: var(--moon); letter-spacing: -0.03em; }
.week-game-summary { color: var(--text-2); font-size: 16px; line-height: 1.6; max-width: 62ch; }
.week-game-clip { display: flex; flex-direction: column; gap: 10px; }
.week-game-clip:empty, .week-game-moments:empty, .week-game-words:empty { display: none; }
.week-quake { font-size: 13.5px; color: var(--muted); }
.week-quake b { color: var(--moon); font-weight: 500; }
.week-game-moments { display: flex; flex-wrap: wrap; gap: 6px; }
.week-chip { display: inline-flex; gap: 6px; align-items: baseline; font-size: 13px; padding: 4px 12px; background: var(--paper); border: 1px solid var(--line-2); color: var(--text); }
.week-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* фон - у каждого факта, не у сетки: иначе пустая ячейка (фактов меньше, чем колонок) рисуется серой плашкой */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.facts:has(> :only-child) { grid-template-columns: 1fr; }
.fact { background: var(--surface); padding: 11px 12px; display: grid; gap: 3px; align-content: start; }
.fact b { font-size: 15px; font-weight: 600; color: var(--moon); line-height: 1.2; }
.fact span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.week-game-words { color: var(--muted); font: 11.5px/1.5 var(--mono); letter-spacing: 0.04em; }
.week-game-words b { color: var(--text-2); font-weight: 500; }

/* вкладки: крупные плитки с подсказкой, что внутри; горящая подсказка - солнцем */
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 36px 0 16px; }
.tabs button { display: grid; gap: 4px; text-align: left; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line-2); color: var(--text-2); }
.tabs button:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--muted); }
.tabs button b { font: 600 14px/1.2 var(--body); color: var(--moon); }
.tabs button small { font: 11.5px/1.3 var(--mono); color: var(--muted); min-height: 1.3em; }
.tabs button small.hot { color: var(--accent-text); }
.tabs button.active { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); background: var(--surface); }

.chart { min-height: 500px; }

/* ---------- «Как игра себя чувствует»: настроение и лента недель (static/js/looks.js) ---------- */
.look { position: relative; min-height: 180px; }
.viz-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 6px; }
.viz-now { color: var(--text-2); font: 12px var(--mono); }
.mood-chart { position: relative; }
.mood-chart svg { display: block; width: 100%; height: auto; }
.mood-chart .grid { stroke: var(--line); stroke-width: 1; }
.mood-chart .grid.dash { stroke-dasharray: 1 5; }
.mood-chart .axis { fill: var(--muted); font: 11px var(--mono); }
.mood-band { fill: rgb(var(--fg-rgb) / 0.08); }
.mood-out.up { fill: rgb(var(--up-rgb) / 0.38); }
.mood-out.down { fill: rgb(var(--down-rgb) / 0.38); }
.mood-line { fill: none; stroke: var(--moon); stroke-width: 2; stroke-linejoin: bevel; }
.mood-now { fill: var(--accent); }
.mood-hit { position: absolute; inset: 0; }
/* флажок события: солнечная плашка сверху и пунктир до линии времени; толчок без события - короткая засечка внизу */
.mood-flag { position: absolute; top: var(--top); height: var(--h); width: 14px; padding: 0; border: 0; background: none; transform: translateX(-50%); z-index: 1; cursor: pointer; }
.mood-flag::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 0; border-left: 1.5px dashed var(--accent); opacity: 0.75; }
.mood-flag::after { content: ""; position: absolute; left: 1px; top: 0; width: 12px; height: 12px; background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }
.mood-flag.turn::before { top: 0; border-left: 2px solid var(--c, var(--muted)); opacity: 1; }
.mood-flag.turn::after { display: none; }
.mood-flag:hover::before { opacity: 1; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { display: inline-block; width: 14px; height: 8px; }
.key-band { background: rgb(var(--fg-rgb) / 0.12); }
.key-up { background: rgb(var(--up-rgb) / 0.5); }
.key-down { background: rgb(var(--down-rgb) / 0.5); }
.key-event { height: 0 !important; border-top: 2px dashed var(--accent); }
.drum { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); display: grid; gap: 2px; }
.drum-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.drum-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 26px; }
.drum-days { min-height: 16px; }
.drum-names { display: grid; grid-template-columns: repeat(7, 1fr); font: 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.drum-names span { border-left: 1px solid var(--line); padding-left: 5px; }
.drum-date { font: 11px var(--mono); color: var(--muted); white-space: nowrap; }
.drum-date b { color: var(--accent-text); font-weight: 600; }
.drum-trace { position: relative; height: 26px;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / 7)); }
.drum-trace svg { width: 100%; height: 100%; display: block; }
.drum-trace path { fill: none; stroke: var(--text-2); stroke-width: 1; stroke-linejoin: bevel; vector-effect: non-scaling-stroke; opacity: 0.8; }
.drum-row.quake path { stroke: var(--moon); stroke-width: 1.5; opacity: 1; }
/* неполная неделя - бледная линия; дата остаётся читаемой */
.drum-row.partial > :not(.drum-date) { opacity: 0.6; }
.drum-event { position: absolute; top: -3px; bottom: -3px; width: 12px; padding: 0; border: 0; background: none; transform: translateX(-50%); cursor: pointer; }
.drum-event::before { content: ""; position: absolute; left: 50%; top: 6px; bottom: 0; border-left: 1.5px dashed var(--accent); }
.drum-event::after { content: ""; position: absolute; left: 1px; top: 0; width: 10px; height: 9px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
.viz-tip { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line-2); padding: 7px 10px; font-size: 12px; color: var(--text-2); max-width: 280px;
  box-shadow: 0 10px 24px rgb(var(--shadow-rgb) / 0.4); }
.viz-tip b { color: var(--moon); font-weight: 500; }
.viz-tip[hidden] { display: none; }

/* ---------- журнал толчков на «Сейчас»: компактные строки ---------- */
.reactions { display: flex; flex-direction: column; }
.reaction { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 48px; align-items: center; gap: 12px;
  padding: 7px 4px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; width: 100%; }
.reaction:hover { background: var(--paper); }
.reaction-label { display: flex; flex-direction: column; min-width: 0; }
.reaction-label b { font-weight: 500; color: var(--moon); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reaction-label small { color: var(--muted); font: 11px var(--mono); }
.reaction-track { position: relative; height: 12px; }
.reaction-zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.reaction-bar { position: absolute; top: 1px; height: 10px; background: var(--c); }
.reaction.flat .reaction-bar, .reaction.unknown .reaction-bar { opacity: 0.35; }
.reaction-ci { position: absolute; top: 5px; height: 2px; background: var(--c); opacity: 0.4; }
.reaction-value { text-align: right; font: 600 12px var(--mono); color: var(--c); }
.reactions-axis { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 48px; gap: 12px; padding: 6px 4px 0; color: var(--muted); font-size: 11px; }
.reactions-scale { display: flex; justify-content: space-between; }
.turn-title { color: var(--text-2) !important; }

/* ---------- причина тряски: крупное число и одна строка ---------- */
.highlights { display: flex; flex-direction: column; gap: 8px; }
.highlight { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; background: var(--paper);
  animation: rise 0.45s var(--ease) both; transition: transform 0.3s var(--ease); }
.highlight:hover { transform: translateX(4px); }
.highlight-big { font: 700 21px/1 var(--display); letter-spacing: -0.03em; color: var(--moon); text-align: center; font-variant-numeric: tabular-nums; }
.highlight b { display: block; font-size: 13.5px; font-weight: 500; color: var(--moon); }
.highlight span { color: var(--muted); font-size: 12.5px; }
.highlight-mark { flex: none; width: 32px; height: 32px; display: grid; place-items: center; font-size: 14px; background: var(--surface-2); color: var(--text-2); }

/* ---------- кто трясёт: языки недели ---------- */
.langs { display: grid; gap: 8px; }
.lang-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 76px; gap: 10px; align-items: center; font-size: 13px; }
.lang-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-track { position: relative; height: 8px; background: rgb(var(--fg-rgb) / 0.07); }
.lang-track i { position: absolute; left: 0; top: 0; bottom: 0; background: rgb(var(--fg-rgb) / 0.35); transform-origin: left; animation: grow 0.8s var(--ease) both; }
.lang-row.up .lang-track i { background: var(--up); }
.lang-row.down .lang-track i { background: var(--down); }
.lang-base { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--moon); opacity: 0.6; }
.lang-value { text-align: right; font: 600 12px var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.lang-row.up .lang-value { color: var(--up); } .lang-row.down .lang-value { color: var(--down); }
.lang-note { margin-top: 8px; font-size: 13.5px; color: var(--text-2); }
.lang-note.alert { padding: 12px 14px; border: 1px dashed rgb(var(--accent-rgb) / 0.7); }
.lang-note.alert b { color: var(--accent-text); }

.picks { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pick { background: var(--paper); padding: 14px 16px; font-size: 14px; }
.pick p { color: var(--text-2); margin-top: 6px; }

/* сводки: две колонки - недели и месяцы, у каждой - период в заголовке */
.digests { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.digest-col { display: grid; gap: 10px; align-content: start; }
.digest-col h3 { font: 600 13px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.digest-item { background: var(--paper); padding: 14px 16px; display: grid; gap: 6px; }
.digest-item h4 { font-size: 15px; line-height: 1.35; color: var(--moon); }
.digest-item p { color: var(--text-2); font-size: 14px; }
.digest-item .eyebrow { color: var(--accent-text); }

.cover { display: block; object-fit: cover; opacity: 0; transition: opacity 0.4s ease; }
.cover.loaded { opacity: 1; }
.story-cover .cover.loaded { opacity: calc(var(--cover-alpha) - 0.05); filter: var(--cover-filter); }

@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* поддержка проекта - одна ссылка в подвале, если задан SUPPORT_URL */
.support { align-self: flex-start; color: var(--text-2); font-size: 12px; text-decoration: none; border: 1px solid var(--line-2); padding: 3px 12px; margin-bottom: 6px; }
.support:hover { color: var(--moon); border-color: rgb(var(--fg-rgb) / 0.35); }
.footer { max-width: 1240px; margin: 0 auto; padding: 8px 20px 28px; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.footer .link { align-self: flex-start; font-size: 11px; color: var(--muted); }

/* Plotly: линии без скруглений, как всё остальное - рубленые стыки и концы */
.js-plotly-plot .scatterlayer .js-line { stroke-linejoin: bevel; stroke-linecap: butt; }

/* ---------- разделы без изменений: слова, темы, аудитория, отзывы, окна, меню графика, журнал ---------- */
/* ---------- реакция на патчи ---------- */

.dot { width: 8px; height: 8px; flex: none; transform: translateY(0) rotate(45deg); display: inline-block; }
td .dot { margin-right: 8px; }
.excerpts summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
blockquote { margin: 8px 0; padding: 2px 12px; border-left: 2px solid var(--line-2); color: var(--text-2); font-size: 14px; }


/* ---------- слова ---------- */
.words-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.words-col h3 { margin-bottom: 4px; }
.words-col .card-sub { margin: 0 0 10px; }
.words { display: flex; flex-wrap: wrap; gap: 6px; }
.word {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  padding: 4px 10px;
  
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  animation: rise 0.35s var(--ease) both;
}
.word small { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.word:hover:not(:disabled) { border-color: var(--word-color, var(--line-2)); }
.word.rising { border-color: color-mix(in oklab, var(--word-color) 40%, transparent); }
.words-title { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }


/* ---------- темы ---------- */
.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.callout { background: var(--paper); padding: 14px 16px; }
.tile-label { font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tile-note { color: var(--text-2); font-size: 13px; }
.callout-name { font-size: 20px; font-weight: 500; margin: 4px 0; color: var(--moon); }
.aspect-legend, .aspect { display: grid; grid-template-columns: 1fr 180px 1fr; align-items: center; gap: 12px; }
.aspect-legend { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.aspect-legend div:first-child { text-align: right; }
.aspect { width: 100%; padding: 4px 0; background: none; border: none; font-size: 14px; color: inherit; text-align: inherit; }
.aspect:hover:not(:disabled) { background: var(--surface-2); }
.aspect-name { text-align: center; }
.aspect-side { display: flex; align-items: center; gap: 8px; }
.aspect-side.left { justify-content: flex-end; }
.aspect-num { color: var(--text-2); font-family: var(--mono); font-size: 12px; min-width: 44px; }
.aspect-side.left .aspect-num { text-align: right; }
.bar { height: 8px; min-width: 2px; transform-origin: left; animation: grow 0.7s var(--ease) both; }
.aspect-side.left .bar { transform-origin: right; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar.up { background: var(--up); }
.bar.down { background: var(--down); }

.llm-note { display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); }
.llm-note .highlight-mark { color: var(--sky); }

/* ---------- аудитория ---------- */
.audience { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 28px 44px; }
.segment h3 { margin-bottom: 4px; }
.segment-insight { color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
.segment-row { display: grid; grid-template-columns: 170px 1fr 44px 92px; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.segment-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segment-num { text-align: right; font-family: var(--mono); font-size: 12px; }
.segment-share { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.meter { position: relative; height: 8px; background: color-mix(in oklab, var(--down) 38%, var(--surface)); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--up); transform-origin: left; animation: grow 0.8s var(--ease) both; }


/* ---------- обновления ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 400; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; cursor: pointer; user-select: none; }
.table th[data-sorted]::after { content: " ↓"; color: var(--text-2); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr { cursor: pointer; transition: background 0.15s; }
.table tbody tr:hover { background: var(--surface-2); }
.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

/* ---------- лаборатория ---------- */
a.button { display: inline-flex; align-items: center; font-size: 14px; color: var(--text); text-decoration: none; border: 1px solid var(--line-2); padding: 7px 11px; }
a.button:hover { border-color: rgb(var(--fg-rgb) / 0.22); }
.table.static tbody tr { cursor: default; }
.how { display: grid; grid-template-columns: 180px 1fr; gap: 10px 20px; margin: 12px 0 0; font-size: 14px; }
.how dt { color: var(--moon); font-weight: 500; }
.how dd { margin: 0; color: var(--text-2); }
.game-story { color: var(--text); font-size: 16px; line-height: 1.5; max-width: 760px; margin-top: 14px; }
.game-story b { color: var(--moon); font-weight: 600; }

/* ---------- отзывы ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 10px 0 16px; }
.filters label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.filters input, .filters select { height: 36px; padding-top: 0; padding-bottom: 0; }
.filters input[name="q"] { width: 180px; }
.reviews { display: flex; flex-direction: column; gap: 10px; }
.review { background: var(--paper); border: 1px solid var(--line); padding: 12px 16px; animation: rise 0.3s var(--ease) both; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.vote { font-weight: 600; font-size: 13px; }
.vote.up { color: var(--up); }
.vote.down { color: var(--down); }
.review-text { white-space: pre-line; font-size: 14px; color: var(--text); overflow-wrap: anywhere; cursor: pointer; }
.review-text.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.review-text mark { background: rgb(var(--fg-rgb) / 0.16); color: var(--moon); padding: 0 2px; }
#reviews-more { margin-top: 14px; }

/* ---------- модальные окна ---------- */
.modal {
  width: min(460px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-2);
  
  padding: 22px;
  box-shadow: 0 30px 80px rgb(var(--shadow-rgb) / 0.6);
}
.modal[open] { animation: rise 0.25s var(--ease) both; }
.modal::backdrop { background: rgb(var(--bg-rgb) / 0.72); backdrop-filter: blur(3px); }
.modal-wide { width: min(880px, calc(100vw - 32px)); }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.form-error { color: var(--down); font-size: 13px; min-height: 18px; }
#topics-empty [data-llm], #wish-llm { margin-top: 14px; }
.wish-line { color: var(--muted); font-size: 13px; margin-top: 18px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wish-top { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.wish-top h3 { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.wish-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.wish-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.wish-list .num { color: var(--muted); }
.stats-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-summary.stats-facts { grid-template-columns: repeat(5, 1fr); margin: 14px 0; }
.stats-bars { display: flex; align-items: flex-end; gap: 2px; height: 70px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.stats-bars span { flex: 1; min-width: 1px; background: var(--moon); opacity: .55; transition: height .3s; }
.stats-bars span:hover { opacity: 1; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stats-list h3 { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.stats-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; border-bottom: 1px solid var(--line);
             background: linear-gradient(90deg, var(--surface-3) var(--share, 0%), transparent var(--share, 0%)) bottom / 100% 2px no-repeat; }
.stats-row .num { color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: 1fr; } .admin-summary.stats-facts { grid-template-columns: 1fr 1fr; } }
.collect-status { font-size: 13px; color: var(--muted); min-height: 18px; }
.collect-status.ok { color: var(--up); }
.collect-status.error { color: var(--down); }
.switcher { padding: 10px; top: 12vh; margin-top: 0; width: min(560px, calc(100vw - 32px)); }
.switcher input { width: 100%; font-size: 16px; padding: 11px 14px; background: var(--surface-2); }
.switcher-hint { color: var(--muted); font-size: 11px; padding: 8px 12px 2px; }
.switcher-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.switcher-list li { display: grid; grid-template-columns: 1fr 90px 52px; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer; }
.switcher-list li small { display: block; color: var(--muted); font-size: 11px; }
.switcher-list li[aria-selected="true"] { background: var(--surface-3); }
.switcher-list .spark { height: 22px; }
.switcher-list .num { text-align: right; }
.aspect-quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.aspect-quotes h3 { margin-bottom: 6px; }
.quote { background: var(--surface-2); padding: 10px 12px; margin-bottom: 8px; font-size: 14px; color: var(--text-2); }
.quote small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }
.months-chart { width: 100%; height: 160px; display: block; margin-top: 12px; }
.months-labels { display: flex; color: var(--muted); font-size: 11px; font-family: var(--mono); }
.months-labels span { flex: 1; text-align: center; }

/* ---------- меню графика (popover) ---------- */
.card-tools { display: flex; align-items: center; gap: 14px; }
.small { font-size: 13px; padding: 5px 11px; }
a.button { display: inline-flex; align-items: center; text-decoration: none; border: 1px solid var(--line-2); color: var(--text); }
.menu {
  inset: auto; margin: 0; position-area: bottom span-left; position-try-fallbacks: flip-block;
  width: min(340px, calc(100vw - 32px)); padding: 16px; 
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgb(var(--shadow-rgb) / 0.45);
}
/* где якорное позиционирование ещё не поддерживается, меню встаёт по центру экрана - тоже удобно */
@supports not (position-area: bottom) { .menu { inset: 0; margin: auto; height: fit-content; } }
.menu:popover-open { display: flex; flex-direction: column; gap: 12px; animation: rise 0.2s var(--ease) both; }
.menu label { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.menu label[hidden] { display: none; }
.menu select { max-width: 190px; font-size: 13px; padding: 5px 9px; }
.menu-title { color: var(--muted); font-size: 12px; margin-top: 4px; }
.menu-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- хроника: моменты жизни игры ---------- */
.kinds { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; margin: 2px 0 16px; font-size: 13px; }
.kinds[hidden] { display: none; }
.kinds-title { color: var(--muted); margin-right: 4px; }
.kind-chip { border: 1px solid var(--line-2); padding: 2px 10px; color: var(--text-2); cursor: help; }
.kind-chip b { font-weight: 500; color: var(--text); }
.kind-chip .up { color: var(--up); }
.kind-chip .down { color: var(--down); }

.moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.moment {
  --accent: var(--line-2);
  --ring: color-mix(in oklab, var(--accent) 45%, transparent);
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--paper); border: 1px solid var(--line); padding: 14px 16px 12px;
  animation: rise 0.4s var(--ease) both; transition: border-color 0.3s;
  container-type: inline-size;
}
/* полоса цвета исхода слева: у события - как встретили, у перелома - куда повернуло */
.moment::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 2px; background: var(--accent); }
.moment.focus { border-color: var(--accent); animation: ping 1s ease-out 2; }
.moment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.moment-head time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.moment-kind { text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.badge.milestone { color: var(--moon); border-color: rgb(var(--fg-rgb) / 0.35); }
.moment-title { font-size: 16px; font-weight: 600; color: var(--moon); line-height: 1.3; text-wrap: balance; }
.moment-reaction { display: flex; align-items: center; gap: 12px; }
.slope { flex: none; width: 96px; height: 40px; overflow: visible; }
.slope-line { stroke-width: 2; }
.slope-ci { stroke-width: 1.5; stroke-opacity: 0.5; }
.slope-before { fill: var(--surface-2); stroke: var(--text-2); stroke-width: 1.5; }
.slope-after { stroke: var(--surface-2); stroke-width: 2; }
.slope-none { stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 2 5; }
.moment-outcome { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.moment-outcome b { font-weight: 600; color: var(--text); }
.moment-outcome .wave { color: var(--text-2); font-size: 12px; }
.moment-context { font-size: 13px; color: var(--muted); }
.moment-topics { display: flex; flex-direction: column; gap: 2px; font-size: 13px; cursor: help; }
.moment-topics .more { color: color-mix(in oklab, var(--down) 80%, var(--text)); }
.moment-topics .less { color: color-mix(in oklab, var(--up) 80%, var(--text)); }
.moment-what, .moment-say { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.moment-what { color: var(--text); }
.moment-words { font-size: 13px; color: var(--muted); min-height: 20px; }
.moment-words b { color: var(--text-2); font-weight: 500; }
.moment-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-top: auto; padding-top: 4px; }
.moment-numbers { flex-basis: 100%; order: 2; font-size: 12px; color: var(--muted); }
.moment-numbers summary { cursor: pointer; display: inline; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.moment-numbers p { margin-top: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
/* узкая карточка: форма реакции над словом, а не рядом */
@container (max-width: 300px) { .moment-reaction { flex-direction: column; align-items: flex-start; } }


.all-news > summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.all-news > summary::-webkit-details-marker { display: none; }
.all-news > summary h2::after { content: " ▾"; color: var(--muted); font-size: 13px; }
.all-news[open] > summary h2::after { content: " ▴"; }
.all-news > summary small { color: var(--muted); font-weight: 400; font-size: 13px; }
.all-news[open] > summary { margin-bottom: 12px; }
.footer .link { align-self: flex-start; font-size: 11px; color: var(--muted); }
.quote p { margin: 0; }

/* ---------- слои графика ---------- */
.layers { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.layers label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer;
  border: 1px solid var(--line-2); padding: 3px 11px; }
.layers label:has(input:checked) { color: var(--moon); border-color: rgb(var(--fg-rgb) / 0.35); background: var(--surface-2); }
.layers input { accent-color: var(--moon); margin: 0; }

/* ---------- узкие экраны ---------- */
@media (max-width: 980px) {
  .live-strip { display: none; }
  .switcher-btn { margin-left: auto; }
  .split-2, .words-grid { grid-template-columns: 1fr; }
  .week-game { grid-template-columns: 1fr; gap: 20px; }
  .game-hero { grid-template-columns: 220px minmax(0, 1fr); }
  .gauge { grid-column: 1 / -1; justify-self: start; }
  .gauge-caption { text-align: left; }
  .aspect-quotes { grid-template-columns: 1fr; }
  .games.list .tape, .games.list .tags, .games.list .rating { display: none; }
}
@media (max-width: 640px) {
  main { padding: 4px 16px 36px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .wordmark { font-size: 19px; }
  .brand-mark { width: 26px; height: 26px; }
  .switcher-btn { min-width: 0; flex: 1; }
  .switcher-btn kbd, .switcher-btn #switcher-label { display: none; }
  .hero { padding: 32px 0 24px; }
  .hero-search input { font-size: 15px; padding: 12px 14px; }
  .game-hero { grid-template-columns: 1fr; gap: 16px; }
  .poster { max-width: 320px; }
  .card { padding: 16px; }
  .week-game { padding: 18px; }
  .readout-value { font-size: 32px; }
  .tabs { grid-template-columns: repeat(2, 1fr); }
  .aspect-legend, .aspect { grid-template-columns: 1fr 110px 1fr; font-size: 13px; }
  .audience { grid-template-columns: 1fr; }
  .segment-row { grid-template-columns: 116px 1fr 40px; }
  .segment-share { display: none; }
  .how { grid-template-columns: 1fr; gap: 2px; }
  .how dd { margin-bottom: 10px; }
  .switcher-list li { grid-template-columns: 1fr 52px; }
  .switcher-list .spark { display: none; }
  .reaction { grid-template-columns: minmax(0, 1fr) 80px 44px; gap: 8px; }
  .reactions-axis { display: none; }
  .lang-row { grid-template-columns: 84px minmax(0, 1fr) 66px; }
  .drum-row { grid-template-columns: 54px minmax(0, 1fr); gap: 8px; }
  /* на телефоне карта толчков - лента, листается пальцем */
  .pulse { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px; padding: 0 16px 6px; scroll-padding: 0 16px; scrollbar-width: none; }
  .pulse::-webkit-scrollbar { display: none; }
  .pulse > .story { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- админка (templates/admin.html) ---------- */
.admin-badge { font: 600 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 5px 8px; }
.admin-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 28px 0 14px; }
.admin-head h1 { font: 600 clamp(24px, 3.4vw, 36px)/1.1 var(--display); letter-spacing: -0.03em; color: var(--moon); }
.admin-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px; margin-bottom: var(--gap); }
.admin-summary .fact { background: var(--surface); padding: 14px 16px; }
.admin-summary .fact b { font: 600 18px/1.2 var(--display); letter-spacing: -0.02em; }
.fact.bad b, span.bad { color: var(--down); }
.fact.busy b, span.busy { color: var(--accent-text); }
span.ok { color: var(--green); }
.admin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.admin-form input { flex: 1 1 280px; }
.admin-table td, .admin-table th { white-space: nowrap; }
.admin-table td:first-child { white-space: normal; }
.admin-table a { text-decoration: none; color: var(--moon); }
.admin-table a:hover { color: var(--accent-text); }
.admin-table input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; padding: 0; }
.admin-actions { display: inline-flex; gap: 6px; }
.admin-log { margin: 0; max-height: 420px; overflow: auto; padding: 14px; background: var(--paper); color: var(--text-2); font: 12px/1.5 var(--mono); white-space: pre-wrap; }
.admin-bar { height: 10px; background: rgb(var(--fg-rgb) / 0.08); margin: 4px 0 18px; }
.admin-bar i { display: block; height: 100%; background: var(--accent); }
.admin-sub { font: 600 13px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 8px; }
.login-box { max-width: 460px; margin: 60px auto; }
.login-box code { font-family: var(--mono); font-size: 12px; }
a.primary { display: inline-flex; align-items: center; padding: 7px 12px; text-decoration: none; font-size: 14px; }

/* ---------- сейсмограф всех игр на главной (static/js/seismo.js) ---------- */
.seismo-card { margin: 0 0 40px; }
.seismo-sub { max-width: 420px; text-align: right; }
.seismo { padding: 10px 16px 12px; display: grid; gap: 0; }
.seismo-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 72px; align-items: center; gap: 14px; width: 100%; padding: 2px 0;
  background: none; border: 0; border-top: 1px solid var(--line); text-align: left; color: inherit; }
.seismo-row:hover:not(:disabled) { background: rgb(var(--fg-rgb) / 0.03); }
.seismo-head { border-top: 0; padding-bottom: 4px; }
.seismo-name { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seismo-row.quake .seismo-name, .seismo-row:hover .seismo-name { color: var(--moon); }
.seismo-ticks { display: grid; grid-template-columns: repeat(3, 1fr) auto; font: 10.5px var(--mono); color: var(--muted); }
.seismo-ticks span { border-left: 1px solid var(--line-2); padding-left: 5px; }
.seismo-ticks .now { border: 0; color: var(--accent-text); }
.seismo-line { position: relative; height: 34px; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / 3)); }
.seismo-line svg { width: 100%; height: 100%; display: block; }
.seismo-line path { fill: none; stroke: var(--muted); stroke-width: 1; stroke-linejoin: bevel; vector-effect: non-scaling-stroke;
  animation: reveal 1.8s var(--ease) both; }
.seismo-row.tremor path { stroke: var(--text-2); }
.seismo-row.quake path { stroke: var(--moon); stroke-width: 1.6; }
/* перо самописца на правом краю: лента пишется сейчас */
.seismo-pen { position: absolute; right: -3px; top: 50%; width: 6px; height: 6px; background: var(--accent); transform: translateY(-50%); }
/* перо солнечное и дрожит только у трясущихся строк: шесть мигающих точек разом - шум, а не сигнал. Ход задаёт seismo.js */
.seismo-row:not(.quake):not(.tremor) .seismo-pen { background: var(--muted); animation: none; }
@media (prefers-reduced-motion: reduce) { .seismo-pen { animation: none !important; } }
/* три рисунка дрожи с неровным шагом: размах - --pen-amp, вверх и вниз по-разному, как у пера на бумаге */
@keyframes pen-1 { 0%, 100% { transform: translateY(-50%); } 18% { transform: translateY(calc(-50% - var(--pen-amp))); }
  31% { transform: translateY(calc(-50% + var(--pen-amp) * 0.4)); } 52% { transform: translateY(calc(-50% - var(--pen-amp) * 0.6)); }
  70% { transform: translateY(calc(-50% + var(--pen-amp))); } 86% { transform: translateY(calc(-50% - var(--pen-amp) * 0.2)); } }
@keyframes pen-2 { 0%, 100% { transform: translateY(-50%); } 12% { transform: translateY(calc(-50% + var(--pen-amp) * 0.7)); }
  29% { transform: translateY(calc(-50% - var(--pen-amp))); } 47% { transform: translateY(calc(-50% + var(--pen-amp) * 0.3)); }
  63% { transform: translateY(calc(-50% - var(--pen-amp) * 0.5)); } 81% { transform: translateY(calc(-50% + var(--pen-amp) * 0.9)); } }
@keyframes pen-3 { 0%, 100% { transform: translateY(-50%); } 22% { transform: translateY(calc(-50% - var(--pen-amp) * 0.8)); }
  38% { transform: translateY(calc(-50% - var(--pen-amp) * 0.2)); } 55% { transform: translateY(calc(-50% + var(--pen-amp))); }
  74% { transform: translateY(calc(-50% - var(--pen-amp) * 0.4)); } 90% { transform: translateY(calc(-50% + var(--pen-amp) * 0.3)); } }
.seismo-event { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--accent); }
.seismo-event::before { content: ""; position: absolute; left: -5px; top: -1px; width: 9px; height: 8px; background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
.seismo-m { font: 600 12px var(--mono); color: var(--muted); text-align: right; }
.seismo-m.up { color: var(--up); } .seismo-m.down { color: var(--down); }
.seismo-row.quake .seismo-m { font-size: 13px; }
@media (max-width: 640px) {
  .seismo-row { grid-template-columns: 96px minmax(0, 1fr) 52px; gap: 8px; }
  .seismo-sub { text-align: left; }
  .seismo { padding: 8px 10px; }
}

/* датчик в герое главной: самая трясущаяся игра недели */
.hero { position: relative; }
.hero-sensor { position: absolute; right: 0; top: 56px; width: 320px; display: grid; gap: 10px; padding: 18px 20px; text-decoration: none; color: inherit;
  animation: rise 0.6s var(--ease) both 0.3s; transition: transform 0.3s var(--ease); }
.hero-sensor:hover { transform: translateY(-3px); }
.hero-sensor[hidden] { display: none; }
.hero-sensor .eyebrow { display: flex; align-items: center; gap: 8px; }
.sensor-dot { width: 7px; height: 7px; background: var(--accent); }
.sensor-game { font: 600 20px/1.2 var(--display); letter-spacing: -0.02em; color: var(--moon); }
.sensor-why { font-size: 13px; color: var(--text-2); }
.sensor-span { font: 500 11px/1.3 var(--mono); letter-spacing: 0.06em; color: var(--muted); }
@media (max-width: 980px) { .hero-sensor { position: static; width: auto; max-width: 420px; order: 3; } }

/* обрывки: выжимка на карточке, полный текст и оригинал - во всплывашке (clip.js) или по касанию на телефоне */
.fragments li.has-more { cursor: help; }
.fragments li.has-more .frag-short { text-decoration: underline dotted rgb(var(--fg-rgb) / 0.25); text-underline-offset: 4px; }
.frag-full { display: none; margin-top: 6px; font-style: normal; color: var(--text); }
.frag-full small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.fragments li.open .frag-full { display: block; }
.fragments li.open .frag-short { display: none; }
.viz-tip { max-width: 360px; }
.story .fragments li.open { display: block; -webkit-line-clamp: unset; overflow: visible; }

/* повод карточки: настроение - цветом направления, всплеск отзывов - солнцем */
.reason-up, .reason-down, .reason-volume { font-weight: 600; }
.reason-up { color: var(--up); }
.reason-down { color: var(--down); }
.reason-volume { color: var(--accent-text); }
.admin-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; margin: 10px 0 12px; font-size: 13.5px; color: var(--text-2); }
.admin-checks input, .admin-bulk input[type="checkbox"] { accent-color: var(--accent); }
.admin-num { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; color: var(--muted); }
.admin-num input { width: 84px; }
.admin-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-bulk input[type="search"] { width: 200px; }
.task-status:empty { display: none; }
.panel > .task-status { margin-bottom: 12px; padding: 10px 14px; background: var(--surface); }

/* админка, вкладка «Фон» */
.troubles { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.troubles li { padding: 9px 12px; background: var(--surface); border-left: 3px solid var(--down); font-size: 14px; }
.troubles li.calm { border-left-color: var(--green); color: var(--text-2); }
.admin-table .cell-wrap { white-space: normal; display: block; min-width: 220px; }

/* главная: быстрый вход под поиском и «показать все» под сеткой игр */
.hero-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 640px; margin: -8px 0 0; }
.hero-picks .eyebrow { margin-right: 4px; }
.hero-picks .pick { font-size: 13.5px; color: var(--text-2); text-decoration: none; padding: 5px 11px; border: 1px solid var(--line-2); background: var(--paper); }
.hero-picks .pick:hover { color: var(--moon); border-color: var(--accent); }
/* карточка оживает на экране (overview.js): лента пишется, когда её видно, а не за его краем */
.game-card:not(.seen) .tape-line { animation-play-state: paused; }
/* у трясущейся игры перо на конце ленты мелко дрожит - живое, но спокойное: смещение меньше пикселя, темп неровный,
   у каждой карточки своя фаза (overview.js, --pen-delay) */
.game-card.shaking.seen .tape-end { animation: end-tremble 2.6s steps(1, end) infinite var(--pen-delay, 0s); }
@keyframes end-tremble { 0%, 100% { transform: none; } 9% { transform: translate(0.4px, -0.7px); } 17% { transform: translate(-0.3px, 0.5px); }
  31% { transform: translate(0.2px, 0.8px); } 44% { transform: none; } 58% { transform: translate(-0.4px, -0.5px); }
  67% { transform: translate(0.3px, 0.3px); } 81% { transform: translate(-0.2px, -0.8px); } 90% { transform: translate(0.3px, 0.4px); } }
@media (prefers-reduced-motion: reduce) { .game-card.shaking .tape-end { animation: none; } }

/* админка: постраничные таблицы и сетка запусков Airflow */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; font-size: 13px; }
.af-grid td, .af-grid th { text-align: center; }
.af-grid td:first-child, .af-grid th:first-child { text-align: left; }
.af-cell { width: 28px; height: 24px; padding: 0; font: 600 12px var(--mono); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.af-cell.ok { color: var(--green); }
.af-cell.bad { color: var(--down); border-color: rgb(var(--down-rgb) / 0.6); }
.af-cell.busy { color: var(--accent-text); border-color: var(--accent); }
.lanes-table td:first-child { min-width: 200px; }
.lanes-table td small { display: block; margin-top: 2px; font-size: 11.5px; }
.admin-textarea { width: 100%; margin: 4px 0 10px; padding: 8px 11px; font: 13px/1.5 var(--mono); resize: vertical; color: var(--text);
                  background: var(--paper); border: 1px solid var(--line-2); border-radius: 0; }
.file-pick { display: inline-flex; align-items: center; cursor: pointer; padding: 7px 11px; border: 1px solid var(--line-2); font-size: 14px; }
.file-pick:hover { background: var(--surface-2); }
/* ИИ-разметка по шагам (вкладка «Модель»): строка - шаг, по щелчку - его лог */
.llm-run-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; }
.llm-run-step { width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; text-align: left;
                padding: 8px 12px; background: var(--paper); border: 0; color: var(--text); }
.llm-run-step:hover, .llm-run-step:focus-visible { background: var(--surface-2); }
.llm-run-mark { font: 600 13px var(--mono); text-align: center; }
.llm-run-step.ok .llm-run-mark { color: var(--green); }
.llm-run-step.bad .llm-run-mark, .llm-run-step.bad small { color: var(--down); }
.llm-run-step.busy .llm-run-mark, .llm-run-step.busy small { color: var(--accent-text); }
#llm-step-box h3 { margin: 16px 0 8px; font-size: 14px; }
.af-cell.muted { color: var(--muted); }
.admin-notes { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 14px; }
#af-log-box { margin-top: 14px; }

/* новость Steam у события: сноска, а не заголовок - мелко, приглушённо, со ссылкой на источник */
.news-card { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0 4px; padding: 10px; background: var(--surface-2); border-left: 2px solid var(--line-2); }
.news-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; flex: none; opacity: var(--cover-alpha); filter: saturate(0.85) var(--cover-filter); }
.news-body { display: grid; gap: 6px; min-width: 0; }
.news-lede { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-link { font: 12px var(--mono); color: var(--muted); text-decoration: none; }
.news-link:hover { color: var(--moon); }
.reaction-label:has(.reaction-thumb) { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.reaction-label:has(.reaction-thumb) > :not(.reaction-thumb) { grid-column: 2; }
.reaction-thumb { grid-row: 1 / span 2; width: 44px; height: 26px; object-fit: cover; opacity: calc(var(--cover-alpha) - 0.1); filter: saturate(0.8) var(--cover-filter); }
@media (max-width: 640px) { .news-thumb { width: 88px; } }
.method-check { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.method-check h3 { margin: 0 0 6px; }
#method-check-when { font-size: 12px; }

/* админка: DAG проекта карточками */
.dags { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 10px; }
.dag { background: var(--surface); border: 1px solid var(--line-2); padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.dag.active { border-color: var(--accent); }
.dag-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dag-head b { font-size: 15px; color: var(--moon); }
.dag-head code { font-size: 12px; }
.dag .card-sub { margin: 0; }
.dag-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.dag .admin-form { margin: 4px 0 0; }
.af-stop { font-size: 12px; color: var(--down); }

/* админка: вкладки - одна строка, прилипает к верху, на телефоне листается вбок; метка - только у того, что требует внимания */
.admin .tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 20;
  margin: 24px 0 16px; padding: 6px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.admin .tabs::-webkit-scrollbar { display: none; }
.admin .tabs button { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 9px 14px; border: 0; background: none; }
.admin .tabs button:hover:not(:disabled) { transform: none; background: var(--surface); }
.admin .tabs button.active { background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
.admin .tabs button small { min-height: 0; }
.admin .tabs button small:not(.hot) { display: none; }
.admin .tabs button small.hot { padding: 2px 6px; background: rgb(var(--accent-rgb) / 0.14); }
/* сводка сверху - кнопки: ведут на свою вкладку */
.admin-summary button.fact { text-align: left; border: 0; cursor: pointer; font: inherit; color: inherit; }
.admin-summary button.fact:hover { background: var(--surface-2); }
/* тосты: итог любого действия в одном месте, справа снизу */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 11px 14px; background: var(--surface-2); border-left: 3px solid var(--muted); font-size: 14px; color: var(--moon);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35); animation: rise 0.25s var(--ease) both; }
.toast.ok { border-left-color: var(--green); }
.toast.error { border-left-color: var(--down); }
/* игры: быстрые фильтры и сортировка по колонкам */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chips button { font-size: 13px; padding: 5px 10px; border: 1px solid var(--line-2); background: none; color: var(--text-2); }
.chips button.active { border-color: var(--accent); color: var(--moon); }
.admin-table th.sortable { cursor: pointer; user-select: none; }
.admin-table th.sortable:hover { color: var(--moon); }
.admin-table th[aria-sort="ascending"]::after { content: " ↑"; }
.admin-table th[aria-sort="descending"]::after { content: " ↓"; }
.admin-table a.game-link { color: var(--moon); text-decoration: none; }
.admin-table a.game-link:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .admin .tabs { margin: 16px -16px 12px; padding: 6px 16px; } }

/* ---------- страница «Данные и приватность» (templates/privacy.html) ---------- */
.doc-page { max-width: 720px; padding-top: 32px; }
.doc-page h1 { font: 600 clamp(28px, 6vw, 40px)/1.15 var(--mono); margin: 12px 0 16px; }
.doc-page h2 { margin: 32px 0 8px; font-size: 19px; }
.doc-page p, .doc-page li { color: var(--text-2); line-height: 1.6; }
.doc-page p { margin: 0 0 12px; }
.doc-page .lead { font-size: 18px; color: var(--text); }
.doc-page ul { padding-left: 20px; display: grid; gap: 8px; }
.doc-page a { color: var(--accent-text); }

/* ---------- картотека (static/js/deck.js): длинный список - стопка листов в ящике ----------
   Сверху - разделители с номерами, как в картотеке отчётов: активный того же цвета, что лист, и сливается с ним;
   под листом видны края следующих, пока они есть. Скос разделителя - тот же мотив, что у плит */
.deck { position: relative; isolation: isolate; outline: none; --sheet: var(--surface); }
#games-deck { --sheet: var(--paper); }
.deck-tabs { display: flex; align-items: flex-end; gap: 2px; padding-left: calc(var(--cut) + 4px); min-height: 30px; }
.deck-tabs[hidden] { display: none; }
.deck-tab, .deck-arrow { border: 0; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--muted); background: var(--surface-2);
  padding: 7px 11px 6px; cursor: pointer; clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
  transition: color 0.2s, background 0.2s, padding 0.2s var(--ease); }
.deck-tab:hover, .deck-arrow:not(:disabled):hover { color: var(--moon); background: var(--surface-3); }
/* открытый лист: разделитель выше соседей и цвета листа - стоит в ящике выдвинутым */
.deck-tab.active { color: var(--accent); background: var(--sheet); padding-top: 11px; padding-bottom: 8px; cursor: default; }
.deck-arrow { font-size: 14px; padding: 5px 10px 5px; }
.deck-arrow:disabled { opacity: 0.35; cursor: default; }
.deck-gap { font: 500 11px var(--mono); color: var(--muted); padding: 0 4px 6px; }
.deck-count { margin-left: auto; padding: 0 2px 7px 12px; font: 500 11px var(--mono); letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
/* края следующих листов - узкие полосы под листом, чем дальше, тем темнее и уже */
.deck::before, .deck::after { content: ""; position: absolute; z-index: -1; height: 14px; pointer-events: none; display: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); }
.deck::before { left: 8px; right: 8px; bottom: -6px; background: var(--surface-2); }
.deck::after { left: 18px; right: 18px; bottom: -12px; background: var(--surface-3); opacity: 0.6; }
.deck[data-under="1"]::before, .deck[data-under="2"]::before, .deck[data-under="2"]::after { display: block; }
.deck[data-under="1"], .deck[data-under="2"] { margin-bottom: 12px; }
/* лист игр - ящик потемнее плит: карточки лежат в нём, а не сливаются с ним */
.games.deck-sheet { background: var(--sheet); padding: var(--gap); }
.games.deck-sheet.list { padding: 6px 10px; }
/* смена листа: новый въезжает со стороны, куда листали, чуть повёрнутым - как вынутый из стопки */
.deck-sheet.flip-next { animation: sheet-next 0.38s var(--ease) both; }
.deck-sheet.flip-prev { animation: sheet-prev 0.38s var(--ease) both; }
.deck-sheet.flip-next .game-card, .deck-sheet.flip-prev .game-card { animation: none; }
@keyframes sheet-next { from { transform: translateX(28px) rotate(0.35deg); opacity: 0; } }
@keyframes sheet-prev { from { transform: translateX(-28px) rotate(-0.35deg); opacity: 0; } }
@media (max-width: 640px) {
  .deck-tabs { padding-left: 6px; }
  .deck-tab { padding: 7px 8px 6px; } .deck-tab.active { padding-top: 10px; }
  .games.deck-sheet { padding: 10px; }
}

/* ---------- админка: соцсети (admin.js, renderSocial) ---------- */
.social-connect { display: grid; gap: 6px; margin: 12px 0 18px; }
.social-net { display: flex; gap: 12px; font-size: 13px; } .social-net b { flex: 0 0 90px; }
.social-net .ok { color: var(--green); } .social-net .bad { color: var(--down); }
.social-net > button { flex: 0 0 auto; align-self: flex-start; }
.social-warm { font: 500 12px var(--mono); margin: -8px 0 16px; }
.social-warming { display: grid; gap: 8px; justify-items: start; padding: 16px; border: 1px dashed var(--line-2); }
.social-warming p { margin: 0; } .social-warming .bad { color: var(--down); }
.social-list { display: grid; gap: 18px; }
.social-item { display: grid; grid-template-columns: 320px 1fr; gap: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.social-art { display: grid; gap: 8px; align-content: start; }
.social-preview { width: 100%; aspect-ratio: 1200 / 630; object-fit: contain; background: var(--surface-2); display: block; cursor: zoom-in; }
.social-preview.tall { aspect-ratio: 4 / 5; width: 70%; justify-self: center; }
/* полный размер картинки поста: окно - по картинке, картинка - почти во весь экран (общая .modal держит 460 px) */
.modal.image-modal { width: auto; max-width: 96vw; padding: 12px; background: var(--paper); border: 1px solid var(--line-2); cursor: zoom-out; }
.image-modal img { display: block; width: auto; height: auto; max-width: calc(96vw - 26px); max-height: calc(92vh - 60px); margin: 0 auto 10px; }
.image-modal::backdrop { background: rgb(0 0 0 / 0.75); }
.social-side { display: grid; gap: 8px; align-content: start; }
.social-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.social-why { display: flex; flex-wrap: wrap; gap: 6px; }
.social-head .down { color: var(--down); } .social-head .up { color: var(--up); }
.social-text { width: 100%; resize: vertical; font: 14px/1.45 var(--body, inherit); background: var(--paper); color: var(--text);
  border: 1px solid var(--line-2); padding: 10px; }
.social-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.social-count { font: 500 12px var(--mono); color: var(--muted); } .social-count.bad { color: var(--down); }
@media (max-width: 760px) { .social-item { grid-template-columns: 1fr; } }

.button-link { display: inline-flex; align-items: center; text-decoration: none; border: 1px solid var(--line-2); padding: 6px 10px; font: 500 12px var(--mono); color: var(--text); }
.button-link:hover { color: var(--moon); background: var(--surface-3); }

/* указатель игр в подвале: свёрнут, раскрывается списком ссылок в несколько колонок */
.game-index { width: 100%; }
.game-index summary { cursor: pointer; font: 500 12px var(--mono); letter-spacing: 0.06em; color: var(--muted); }
.game-index nav { columns: 4 180px; column-gap: 24px; margin-top: 12px; font-size: 13px; }
.game-index nav a { display: block; padding: 2px 0; color: var(--text-2); text-decoration: none; break-inside: avoid; }
.game-index nav a:hover { color: var(--moon); }
