/* ---------- шрифты: свои файлы, без сторонних 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;
}

/* ---------- токены: палитра от земли, две темы ----------
   Базальт и почва, лунный текст, солнце - бренд. Настроение - васильки (рост) и маки (спад); сила тряски - от неба к лаве;
   горная зелень - изредка. Тема - системная или выбранная кнопкой в шапке (атрибут data-theme ставит скрипт в <head>).
   Полупрозрачные слои считаются от --fg-rgb: в тёмной теме это светлые блики, в светлой - тени. */
:root {
  color-scheme: dark;
  --bg: #15110e;
  --surface: #1e1914;
  --surface-2: #28211a;
  --surface-3: #342b22;
  --fg-rgb: 236 230 214;
  --bg-rgb: 21 17 14;
  --shadow-rgb: 0 0 0;
  --line: rgb(var(--fg-rgb) / 0.07);
  --line-2: rgb(var(--fg-rgb) / 0.12);
  --moon: #ece6d6;
  --text: #e8e1d2;
  --text-2: #b5a995;
  --muted: #807463;

  /* бренд - логотип, активная вкладка, фокус. Данные - рост и спад */
  --accent: #f0b44c;
  --accent-rgb: 240 180 76;
  --accent-ink: #1b1206;
  --sky: #9cc7e4;
  --ochre: #d99a3a;
  --lava: #ff6a1f;
  --green: #7fae6a;
  --up: #7196ec;
  --down: #e5553f;
  --down-rgb: 229 85 63;

  --radius: 0px;
  --bevel: 8px;
  --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: #f1ece4; --surface: #fbf8f3; --surface-2: #f1eadf; --surface-3: #e4dacb;
    --fg-rgb: 35 27 20; --bg-rgb: 241 236 228; --shadow-rgb: 70 50 30;
    --moon: #2b221a; --text: #231b14; --text-2: #5d5044; --muted: #8a7c6c;
    --accent: #a8650a; --accent-rgb: 168 101 10; --accent-ink: #ffffff;
    --sky: #4f88b5; --ochre: #b77a1c; --lava: #d9480f; --green: #4b7a3a;
    --up: #3d62c4; --down: #c13d27; --down-rgb: 193 61 39;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1ece4; --surface: #fbf8f3; --surface-2: #f1eadf; --surface-3: #e4dacb;
  --fg-rgb: 35 27 20; --bg-rgb: 241 236 228; --shadow-rgb: 70 50 30;
  --moon: #2b221a; --text: #231b14; --text-2: #5d5044; --muted: #8a7c6c;
  --accent: #a8650a; --accent-rgb: 168 101 10; --accent-ink: #ffffff;
  --sky: #4f88b5; --ochre: #b77a1c; --lava: #d9480f; --green: #4b7a3a;
  --up: #3d62c4; --down: #c13d27; --down-rgb: 193 61 39;
}

* { 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);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
/* зерно поверх фона: почти незаметно, но убирает «пластиковую» гладкость */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .topbar, .footer { position: relative; z-index: 1; }

/* ---------- фон: сетка сейсмографной бумаги ---------- */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(var(--fg-rgb) / 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--fg-rgb) / 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

main { max-width: 1240px; margin: 0 auto; padding: 8px 20px 48px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
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); border-radius: 0; padding: 0 5px; }

select, input, button {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  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: 1px solid var(--accent); outline-offset: 2px; }
button { cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s; }
button:hover:not(:disabled) { border-color: rgb(var(--fg-rgb) / 0.22); }
:disabled { opacity: 0.45; cursor: not-allowed; }
.primary { background: var(--moon); color: var(--bg); border-color: var(--moon); font-weight: 600; }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.ghost { background: transparent; }
.link { background: none; border: none; padding: 0; color: var(--text-2); font-size: 13px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover:not(:disabled) { color: var(--text); text-decoration-color: var(--text-2); }

/* ---------- шапка ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgb(var(--bg-rgb) / 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; text-decoration: none; }
/* название: afterpatch. Раз в цикл нарастает дрожь, слово сдвигает по разлому - «afterpat» вверх-влево, «ch» вниз-вправо,
   в щели появляется точка (адрес afterpat.ch), и всё садится обратно */
.wordmark { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); display: inline-flex; align-items: baseline; white-space: nowrap; 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); 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; } }
.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; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gauge-track { stroke: var(--line-2); }
.gauge-bar { stroke: var(--moon); }
.gauge-tick { stroke: rgb(var(--fg-rgb) / 0.25); }
.gauge-value { fill: var(--moon); font-family: var(--body); }
.gauge-sub { fill: var(--muted); font-family: var(--body); }
.months-axis { stroke: rgb(var(--fg-rgb) / 0.15); }
.switcher-btn { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 280px; color: var(--text-2); background: var(--surface); }
.switcher-btn #switcher-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.switcher-icon { color: var(--muted); font-size: 15px; line-height: 1; }
.account { display: flex; align-items: center; gap: 8px; }
.lang-switch { font-family: var(--mono); font-size: 12px; color: var(--text-2); text-decoration: none; padding: 6px 8px; border-radius: 0; }
.lang-switch:hover { color: var(--moon); background: var(--surface-2); }
.account .who { color: var(--muted); font-size: 13px; }

/* ---------- анимации ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@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; }
.spark .line { stroke-dasharray: 1; animation: draw 1.2s var(--ease) both; }
.spark .area { animation: fade 1.2s ease both; }

/* ---------- общие блоки ---------- */
.card {
  position: relative;
  border-radius: 0;
  padding: 20px 22px;
  margin-bottom: 16px;
}
/* рамка-волосок с градиентом: светлее сверху слева, как от невысокого света. Фон карточки - --card-bg,
   рамка - --edge; при наведении светлеет только рамка */
.card, .tile, .game-card, .story {
  clip-path: polygon(var(--bevel) 0, 100% 0, 100% calc(100% - var(--bevel)), calc(100% - var(--bevel)) 100%, 0 100%, 0 var(--bevel));
  --card-bg: var(--surface);
  --edge: rgb(var(--fg-rgb) / 0.11);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(155deg, var(--edge), rgb(var(--fg-rgb) / 0.025) 45%, rgb(var(--fg-rgb) / 0.05)) border-box;
}
.game-card:hover, .story:hover { --edge: rgb(var(--fg-rgb) / 0.3); }
/* блик за курсором на карточках, по которым щёлкают: координаты ставит pointermove в main.js */
.game-card::after, .story::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--fg-rgb) / 0.06), transparent 65%);
}
.game-card:hover::after, .story:hover::after { opacity: 1; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.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-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.error { background: var(--surface); border: 1px solid var(--down); border-radius: 0; padding: 16px; margin: 16px 0; color: var(--down); }
.split-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.loading { opacity: 0.45; pointer-events: none; transition: opacity 0.2s; }
.chip { font-size: 12px; color: var(--text-2); background: transparent; border: 1px solid var(--line-2); border-radius: 0; padding: 2px 10px; text-decoration: none; }
a.chip:hover { color: var(--text); border-color: rgb(var(--fg-rgb) / 0.25); }
.chip.warn { color: var(--down); border-color: rgb(var(--down-rgb) / 0.35); }
.badge { font-size: 11px; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 0; padding: 0 8px; }
.steam { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 0; border: 1px solid var(--line-2); opacity: 0.8; transition: opacity 0.2s, border-color 0.2s; }
.steam:hover { opacity: 1; border-color: rgb(var(--fg-rgb) / 0.3); }
.steam svg { width: 16px; height: 16px; }

/* ---------- главная ---------- */
.hero { padding: 44px 0 30px; max-width: 820px; }
.hero h1 {
  font-family: var(--display); font-size: clamp(28px, 4.4vw, 46px); line-height: 1.1; margin: 12px 0 14px; font-weight: 500; text-wrap: balance; max-width: 900px;
  color: var(--moon);
  /* лунный свет сверху: буквы чуть светлее у верхнего края и уходят в сиреневатый серый */
  background: linear-gradient(180deg, var(--text) 10%, var(--text-2) 105%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lead { color: var(--text-2); font-size: 16px; max-width: 640px; }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 28px; }
.hero-stat b { display: block; font-size: 28px; font-weight: 500; color: var(--moon); }
.hero-stat span { color: var(--muted); font-size: 13px; }

/* «Что происходит»: заходы по всем играм. Цвет - только тонкая полоса слева и число, остальное лунное */
.pulse-card { margin: 0 0 34px; }
.pulse-card h2, .section-title { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: 0; }
.pulse { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.story {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: stretch; text-align: left;
  padding: 0; border-radius: 0;
  transition: transform 0.25s var(--ease); animation: rise 0.45s var(--ease) both;
}
.story:hover:not(:disabled) { transform: translateY(-2px); border-color: transparent; }
.story-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 14px 12px 16px; min-width: 0; width: 100%; }
.story-body > * { max-width: 100%; }
.story-game { font-weight: 600; color: var(--moon); font-size: 15px; }
/* «в эфире»: точка акцента с расходящимся кольцом - данные свежие */
.live { --ring: rgb(var(--accent-rgb) / 0.5); display: inline-block; width: 7px; height: 7px; border-radius: 0; background: var(--accent);
        margin-right: 10px; vertical-align: 2px; animation: ping 2.2s ease-out infinite; }
.story-title { color: var(--moon); font-size: 16px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }

/* ---------- клип: шкала из пяти делений и цитата (static/js/clip.js) ---------- */
.mood-scale { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 2px; width: 100%; }
.mood-scale:empty { display: none; }
.mood-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; max-width: 180px; }
.mood-bar span { height: 4px; border-radius: 0; background: rgb(var(--fg-rgb) / 0.06); }
.mood-bar span:nth-child(3) { background: rgb(var(--fg-rgb) / 0.1); }
/* отмеченное деление - приглушённым цветом, без свечения: шкала подсказывает, а не кричит */
.mood-bar span.on { opacity: 0.7; }
.mood-label { font-size: 12px; color: var(--muted); }
.mood-label b { font-weight: 500; color: var(--text-2); opacity: 0.9; }
.fragments { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.fragments li { position: relative; padding-left: 12px; font-size: 13px; line-height: 1.4; color: var(--text); font-style: italic; }
.fragments li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 5px; height: 5px; border-radius: 0; opacity: 0.7; }
.fragments li.up::before { background: var(--up); }
.fragments li.down::before { background: var(--down); }
.story .fragments li { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.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 .eyebrow { margin: 0; }
#pulse-ahead-list { display: contents; }
.ahead-item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 12px; border-radius: 0;
  border: 1px solid var(--line); background: var(--surface); 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; border-radius: 0; background: var(--dot); }
.pulse-ahead .eyebrow { margin-right: 4px; }
.ahead-item b { color: var(--moon); font-weight: 500; }
.ahead-item:hover b { text-decoration: underline; text-underline-offset: 3px; }
.section-title { font-size: 17px; margin-bottom: 4px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 12px; }
.toolbar .search { flex: 1 1 280px; }
.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(--moon); width: 15px; height: 15px; padding: 0; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 0; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; font-size: 13px; padding: 5px 11px; color: var(--muted); border-radius: 0; }
.seg button.active, .seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.seg button small { color: var(--muted); font-size: 11px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.games-count { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.game-card {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  border-radius: 0;
  padding: 18px 18px 14px;
  transition: transform 0.25s var(--ease), border-color 0.25s;
  animation: rise 0.45s var(--ease) both;
}
.game-card:hover { transform: translateY(-2px); }
.game-card h3 { font-size: 15px; line-height: 1.3; padding-right: 36px; }
.game-card .steam { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; }
.game-card .steam svg { width: 14px; height: 14px; }
.game-card .genres { color: var(--muted); font-size: 12px; margin-top: -6px; }
.game-card .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.big { font-size: 36px; font-weight: 500; line-height: 1; color: var(--moon); letter-spacing: -0.02em; }
.big small { font-size: 16px; color: var(--text-2); margin-left: 2px; }
.rating { color: var(--text-2); font-size: 12px; }
.llm-mark { font-size: 11px; color: var(--sky); }
.delta { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }
.spark { width: 100%; height: 44px; display: block; overflow: visible; }

/* список вместо карточек: для тех, кто сравнивает много игр */
.games.list { display: block; }
.games.list .game-card {
  cursor: pointer; flex-direction: row; align-items: center; gap: 16px; border-radius: 0; border-width: 0 0 1px;
  border-color: var(--line); background: none; padding: 10px 6px; animation-duration: 0.3s; }
.games.list .game-card:hover { transform: none; background: var(--surface); }
.games.list .game-card::after { display: none; }
.games.list .game-card h3 { flex: 1 1 200px; padding: 0; }
.games.list .genres { display: none; }
.games.list .row { flex: 0 0 260px; }
.games.list .big { font-size: 20px; }
.games.list .spark { flex: 0 0 180px; width: 180px; height: 28px; }
.foot { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.games.list .foot { flex: 0 0 140px; text-align: right; justify-content: flex-end; }
.games.list .steam { position: static; order: -1; flex: none; }
.games.list .row { align-items: center; }

/* ---------- страница игры ---------- */
.game-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 0 16px; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--text); }
.title-row { display: flex; align-items: center; gap: 14px; margin: 8px 0; }
#game-title { font-family: var(--display); font-size: clamp(26px, 4vw, 42px); line-height: 1.1; font-weight: 500; color: var(--moon); }
.game-meta { color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.gauge { flex: none; width: 190px; }
/* табло оценки (util.readout): две плиты, как в значке - «за всё время» слева и «за 30 дней» справа, разделены косым
   разломом; правая, «после», съехала вниз и подсвечена солнцем */
.gauge { width: 250px; }
.readout { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
.readout-plate { display: grid; gap: 2px; align-content: start; min-height: 86px; padding: 12px 18px 12px 12px; background: var(--surface-2); }
.readout-plate.before { clip-path: polygon(8px 0, 100% 0, calc(100% - 16px) 100%, 0 100%, 0 8px); }
.readout-plate.after { margin-left: -12px; padding: 12px 12px 12px 24px; transform: translateY(10px);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); }
.readout-value { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1; color: var(--moon); letter-spacing: -0.03em; }
.readout-plate.before .readout-value { font-size: 22px; color: var(--text-2); }
.readout-label { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.readout-delta { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.readout-delta.up { color: var(--up); } .readout-delta.down { color: var(--down); }
.tile-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gauge-caption { color: var(--text-2); font-size: 13px; margin-top: 22px; text-align: right; }

.digest { border-left: 2px solid var(--sky); padding: 4px 0 4px 18px; margin: 4px 0 20px; max-width: 900px; }
.digest h2 { font-size: 19px; margin: 6px 0 6px; line-height: 1.35; color: var(--moon); }
.digest p { color: var(--text-2); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.tile { border-radius: 0; padding: 16px 18px; position: relative; overflow: hidden; }
.tile:has(.spark) { padding-bottom: 42px; }
.tile-label { color: var(--muted); font-size: 12px; }
.tile-value { font-size: 32px; font-weight: 500; line-height: 1.15; margin: 6px 0 2px; color: var(--moon); letter-spacing: -0.02em; }
.tile-note { color: var(--text-2); font-size: 13px; }
.tile .spark { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; opacity: 0.7; }
/* пульс недели: точка статуса. Спокойно - тускло, волнение - сиреневым, шторм - акцентом с расходящимся кольцом */
.vital-dot { display: inline-block; width: 9px; height: 9px; border-radius: 0; margin-right: 10px; vertical-align: 5px; background: var(--muted); }
.vital-unrest .vital-dot { background: var(--sky); }
.vital-storm .vital-dot { --ring: rgb(var(--accent-rgb) / 0.55); background: var(--accent); animation: ping 1.6s ease-out infinite; }
.tile-pulse .tile-value, .tile .tile-value.tile-word { font-size: 24px; }
.vital-chip { font-size: 11px; display: inline-flex; align-items: center; gap: 5px; }
.vital-chip .vital-dot { width: 6px; height: 6px; margin: 0; vertical-align: 0; }

.tabs {
  position: sticky;
  top: 58px;
  z-index: 10;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 4px;
  margin-bottom: 18px;
  background: rgb(var(--bg-rgb) / 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.tabs button { flex: none; border: none; background: none; color: var(--muted); padding: 12px 14px; border-radius: 0; font-size: 14px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); }
/* индикатор активной вкладки едет к новой, а не перескакивает */
.tabs-indicator { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; background: var(--accent); border-radius: 0; transition: transform 0.35s var(--ease), width 0.35s var(--ease); }

.chart { min-height: 500px; }

/* ---------- реакция на патчи ---------- */

.dot { width: 8px; height: 8px; border-radius: 0; 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; }

.highlights { display: flex; flex-direction: column; gap: 14px; }
.highlight { display: flex; gap: 12px; align-items: flex-start; animation: rise 0.4s var(--ease) both; }
.highlight-mark { flex: none; width: 32px; height: 32px; border-radius: 0; display: grid; place-items: center; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.highlight b { display: block; font-size: 14px; font-weight: 500; }
.highlight span { color: var(--muted); font-size: 13px; }

.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick { background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 14px; }
.pick p { color: var(--text-2); margin-top: 6px; }

/* ---------- слова ---------- */
.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;
  border-radius: 0;
  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(--surface-2); border: 1px solid var(--line); border-radius: 0; padding: 14px 16px; }
.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; border-radius: 0; 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; border-radius: 0; 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); }
.heat-wrap { overflow-x: auto; }
.heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.heat th { color: var(--muted); font-weight: 400; padding: 2px 6px; white-space: nowrap; }
.heat tbody th { text-align: right; color: var(--text-2); }
.heat td { min-width: 40px; height: 28px; text-align: center; border-radius: 0; font-family: var(--mono); color: var(--text); }
.digests { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.digest-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; padding: 14px 16px; }
.digest-item h3 { font-size: 14px; margin: 4px 0 6px; line-height: 1.35; }
.digest-item p { color: var(--text-2); font-size: 14px; }
.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; border-radius: 0; background: color-mix(in oklab, var(--down) 38%, var(--surface)); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 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); border-radius: 0; 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(--surface-2); border: 1px solid var(--line); border-radius: 0; 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); border-radius: 0; padding: 0 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 11px; border-radius: 0; padding: 1px 8px; border: 1px solid var(--line-2); color: var(--text-2); }
.tag.up { border-color: color-mix(in oklab, var(--up) 45%, transparent); color: var(--up); }
.tag.down { border-color: color-mix(in oklab, var(--down) 45%, transparent); color: var(--down); }
#reviews-more { margin-top: 14px; }

/* ---------- модальные окна ---------- */
.modal {
  width: min(460px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 0;
  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; }
body:not([data-login]) .need-login { display: none; }
body[data-login] .need-logout { display: none; }
#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-head { margin: 14px 0 18px; color: var(--text-2); }
.stats-head .spark { height: 50px; margin-top: 8px; }
.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); }
@media (max-width: 760px) { .stats-grid { grid-template-columns: 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; border-radius: 0; 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); border-radius: 0; 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; }

/* поддержка проекта - одна ссылка в подвале, если задан SUPPORT_URL */
.support { align-self: flex-start; color: var(--text-2); font-size: 12px; text-decoration: none; border: 1px solid var(--line-2);
           border-radius: 0; 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: 11px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .split-2, .words-grid, .picks { grid-template-columns: 1fr; }
  .gauge { width: 210px; }
  .readout-value { font-size: 24px; }
  .aspect-quotes { grid-template-columns: 1fr; }
  .games.list .spark, .games.list .foot { display: none; }
}
@media (max-width: 640px) {
  main { padding: 4px 14px 36px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .brand span { display: none; }
  .switcher-btn { min-width: 0; flex: 1; }
  .switcher-btn kbd { display: none; }
  .tabs { top: 54px; }
  .game-hero { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tile { padding: 12px 14px; }
  .tile-value { font-size: 24px; }
  .card { padding: 16px; }
  .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; }
  .games.list .row { flex-basis: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- меню графика (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); border-radius: 0; 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; border-radius: 0;
  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); border-radius: 0; 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(--surface-2); border: 1px solid var(--line); border-radius: 0; 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; border-radius: 0; 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; }

/* ---------- переключатели и слои ---------- */
.small-seg button { font-size: 12px; padding: 3px 9px; }
.seg button[hidden] { display: none; }

/* ---------- главная картинка «Обзора»: три варианта (looks.js) ---------- */
.look { position: relative; min-height: 180px; }
.viz-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; }
.viz-eyebrow { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; flex-basis: 100%; }
.viz-head b { font-size: 26px; font-weight: 500; color: var(--moon); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.viz-head .muted { font-size: 14px; }
.viz-depth-row { flex-basis: 100%; margin-bottom: 6px; }
.viz-axis { display: flex; justify-content: space-between; color: var(--muted); font: 11px var(--mono); margin-top: 6px; }
.viz-note { color: var(--muted); font-size: 12px; margin-top: 10px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 12px; margin-top: 10px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 0; }
.key-up { background: var(--up); }
.key-down { background: var(--down); }
.key-mark { width: 8px !important; height: 8px !important; transform: rotate(45deg); background: var(--moon); }
.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 rgb(var(--fg-rgb) / 0.14); border-radius: 0; 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; }

/* монитор: кардиограмма отклонения от нормы */
.monitor { position: relative; height: 200px; border-radius: 0; overflow: hidden;
  background:
    linear-gradient(rgb(var(--fg-rgb) / 0.04) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgb(var(--fg-rgb) / 0.04) 1px, transparent 1px) 0 0 / 7.69% 100%,
    color-mix(in oklab, var(--surface-2) 60%, var(--bg)); }
.monitor svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.monitor-zero { stroke: rgb(var(--fg-rgb) / 0.28); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.monitor-trace { fill: none; stroke: var(--moon); stroke-width: 1.8; stroke-linejoin: bevel; vector-effect: non-scaling-stroke; }
.monitor-dot { position: absolute; right: -4px; width: 9px; height: 9px; border-radius: 0; translate: 0 -50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.monitor-hit { position: absolute; inset: 0; }
.monitor-mark { position: absolute; top: 0; bottom: 0; width: 14px; translate: -50% 0; padding: 0; border: 0; border-radius: 0; background: none; z-index: 1; }
.monitor-mark::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--c, var(--muted)); opacity: 0.5; }
.monitor-mark::after { content: ""; position: absolute; left: 50%; top: 6px; width: 8px; height: 8px; translate: -50% 0; rotate: 45deg;
  background: var(--c, var(--muted)); }
.monitor-mark.turn::after { background: transparent; border: 1.5px solid var(--c, var(--muted)); }

/* голоса по неделям: рекомендуют вверх, не рекомендуют вниз */
.votes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 220px; }
.votes-col { display: flex; flex-direction: column; min-width: 0; }
.votes-marks { height: 18px; display: flex; justify-content: center; align-items: center; }
.votes-mark { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 0; rotate: 45deg; background: var(--c, var(--muted)); }
.votes-mark.turn { background: transparent; border: 1.5px solid var(--c, var(--muted)); }
.votes-bars { flex: 1; display: flex; flex-direction: column; cursor: default; }
.votes-half { flex: 1; display: flex; }
.votes-half.top { align-items: flex-end; border-bottom: 1px solid rgb(var(--fg-rgb) / 0.2); }
.votes-half.bottom { align-items: flex-start; }
.votes-up, .votes-down { width: 100%; transition: height 0.5s var(--ease); }
.votes-up { background: var(--up); border-radius: 0; }
.votes-down { background: var(--down); border-radius: 0; }
.votes-col.partial .votes-up, .votes-col.partial .votes-down { opacity: 0.45; }
.votes-bars:hover .votes-up, .votes-bars:hover .votes-down { filter: brightness(1.25); }

/* календарь недель */
.weeks { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.week { aspect-ratio: 1; border-radius: 0; border: 1px solid transparent; padding: 0; position: relative;
  background: color-mix(in oklab, var(--c) var(--k), var(--surface-2)); }
.week.neutral { background: var(--surface-3); }
.week.partial { opacity: 0.55; }
.week.selected, .week:hover { border-color: var(--moon); }
.week-mark { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--moon); }
.weeks-detail { font-size: 14px; color: var(--text-2); margin-top: 12px; min-height: 22px; }
.weeks-detail b { color: var(--moon); font-weight: 500; }
.weeks-scale { gap: 8px !important; }
.scale-bar { width: 90px !important; height: 8px !important; border-radius: 0!important;
  background: linear-gradient(90deg, var(--down), var(--surface-3) 50%, var(--up)); }

/* ---------- реакции на события ---------- */
.reactions { display: flex; flex-direction: column; gap: 2px; }
.reaction { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 44px; align-items: center; gap: 14px;
  padding: 8px 8px; border: 1px solid transparent; border-radius: 0; background: none; text-align: left; width: 100%; }
.reaction:hover { background: var(--surface-2); border-color: var(--line); }
.reaction-label { display: flex; flex-direction: column; min-width: 0; }
.reaction-label b { font-weight: 500; color: var(--moon); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reaction-label small { color: var(--muted); font-size: 12px; }
.reaction-track { position: relative; height: 22px; }
.reaction-zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgb(var(--fg-rgb) / 0.25); }
.reaction-bar { position: absolute; top: 5px; height: 12px; border-radius: 0; background: var(--c); }
.reaction.flat .reaction-bar, .reaction.unknown .reaction-bar { opacity: 0.35; }
.reaction-ci { position: absolute; top: 10px; height: 2px; background: var(--c); opacity: 0.45; border-radius: 0; }
.reaction-value { text-align: right; font: 13px var(--mono); color: var(--c); }
.reactions-axis { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 44px; gap: 14px; padding: 6px 8px 0;
  color: var(--muted); font-size: 11px; }
.reactions-scale { display: flex; justify-content: space-between; }

/* ---------- слои графика ---------- */
.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); border-radius: 0; 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: 640px) {
  .weeks { grid-template-columns: repeat(8, 1fr); }
  .votes { height: 180px; gap: 2px; }
  .monitor { height: 160px; }
  .reaction { grid-template-columns: minmax(0, 1fr) 90px 40px; gap: 8px; }
  .reactions-axis { grid-template-columns: minmax(0, 1fr) 90px 40px; gap: 8px; font-size: 10px; }
}
.card[hidden], section[hidden] { display: none; }

/* ---------- обложки игр с CDN Steam ---------- */
.cover { display: block; object-fit: cover; background: var(--surface-3); opacity: 0; transition: opacity 0.4s ease; }
.cover.loaded { opacity: 1; }
.story-cover { width: 100%; height: 96px; object-position: center 30%; border-radius: 0;
  mask-image: linear-gradient(#000 50%, transparent); -webkit-mask-image: linear-gradient(#000 50%, transparent); }
/* обложки Steam яркие - на тёмной странице их чуть приглушаем */
.story-cover.loaded { opacity: 0.82; filter: saturate(0.9); }
.card-cover { position: absolute; inset: 0 0 auto 0; width: 100%; height: 100%; border-radius: inherit; z-index: 0; pointer-events: none;
  mask-image: linear-gradient(rgb(var(--shadow-rgb) / 0.3), transparent 55%); -webkit-mask-image: linear-gradient(rgb(var(--shadow-rgb) / 0.3), transparent 55%); }
.game-card > :not(.card-cover, .steam) { position: relative; z-index: 1; }
.game-card > .steam { z-index: 1; }
.game-cover:empty { display: none; }
.hero-cover { width: 138px; aspect-ratio: 460 / 215; border-radius: 0; box-shadow: 0 8px 24px rgb(var(--shadow-rgb) / 0.45); }

/* ---------- мини-монитор на карточках главной ---------- */
.mini-monitor { width: 100%; height: 28px; margin-top: auto; padding-top: 6px; overflow: visible; }
.mini-zero { stroke: rgb(var(--fg-rgb) / 0.22); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.mini-trace { fill: none; stroke: var(--moon); stroke-width: 1.4; stroke-linejoin: bevel; vector-effect: non-scaling-stroke;
  animation: reveal 1.4s var(--ease) both 0.2s; }
.monitor-trace { animation: reveal 1.6s var(--ease) both; }
/* линия проявляется слева направо; пунктирная прорисовка (dasharray + pathLength) ломается вместе с non-scaling-stroke и рвала линию */
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* точка статуса в строке над названием: по центру строки, а не на базовой линии букв */
.story .eyebrow { display: flex; align-items: center; gap: 7px; }
.story .vital-dot { width: 7px; height: 7px; margin: 0; vertical-align: 0; flex: none; }

/* ---------- эта неделя в игре ---------- */
.week-game { position: relative; margin: 4px 0 20px; padding: 18px 22px; border-radius: 0;
  background: linear-gradient(120deg, color-mix(in oklab, var(--accent) 7%, var(--surface)), var(--surface) 60%);
  border: 1px solid color-mix(in oklab, var(--accent) 18%, transparent); }
.week-game .eyebrow { font-weight: 500; margin-bottom: 8px; }
.week-game-headline { font: 500 clamp(19px, 2.4vw, 24px)/1.3 var(--display); color: var(--moon); letter-spacing: -0.01em; text-wrap: balance; }
.week-game-summary { color: var(--text-2); margin-top: 6px; max-width: 760px; }
.week-game-moments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.week-game-moments:empty { display: none; }
.week-chip { display: inline-flex; gap: 6px; align-items: baseline; font-size: 13px; border-radius: 0; padding: 4px 12px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); }
.week-game-words { color: var(--muted); font-size: 13px; margin-top: 10px; }
.week-game-words:empty { display: none; }
.week-game-words b { color: var(--text-2); font-weight: 500; }
.month-card h2 { font-size: 17px; line-height: 1.35; color: var(--moon); margin: 6px 0; }
.turn-title { color: var(--text-2) !important; }

@media (max-width: 640px) {
  .hero-cover { width: 96px; }
  .week-game { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) { .mini-trace, .monitor-trace { animation: none; } }

/* ---------- месяц: два числа и столбик на день ---------- */
.month-card { display: flex; flex-direction: column; }
.month-visual { flex: 1; padding-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.month-figs { display: flex; gap: 28px; }
.month-fig { display: flex; flex-direction: column; gap: 2px; }
.month-fig b { font-size: 34px; font-weight: 500; color: var(--moon); line-height: 1; font-variant-numeric: tabular-nums; }
.month-fig b small { font-size: 15px; color: var(--muted); margin-left: 2px; }
.month-fig + .month-fig b { color: var(--muted); font-size: 22px; }
.month-fig span { font-size: 12px; color: var(--muted); }
/* столбики занимают всю высоту карточки, какой бы длинной ни была соседняя «Коротко» */
.month-bars { position: relative; flex: 1; display: flex; align-items: flex-end; gap: 3px; min-height: 120px; }
.month-bar { flex: 1; height: 100%; position: relative; border-radius: 0; background: rgb(var(--fg-rgb) / 0.03); }
.month-bar::after { content: ''; position: absolute; inset: auto 0 0 0; height: var(--h, 0); border-radius: 0;
  background: var(--c, var(--line-2)); opacity: var(--o, 1); transform-origin: bottom; animation: bar-grow 0.6s ease both; }
.month-bar.empty { background: repeating-linear-gradient(-45deg, transparent 0 3px, rgb(var(--fg-rgb) / 0.04) 3px 5px); }
.month-level { position: absolute; left: 0; right: 0; border-top: 1px dashed rgb(var(--fg-rgb) / 0.45); pointer-events: none; }
@keyframes bar-grow { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) { .month-bar::after { animation: none; } }

/* на телефоне «Неделя в играх» - лента, листается пальцем: столбик из шести карточек занимал бы несколько экранов */
@media (max-width: 640px) {
  .pulse { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -14px; padding: 0 14px 6px; scroll-padding: 0 14px; scrollbar-width: none; }
  .pulse::-webkit-scrollbar { display: none; }
  .pulse > .story { scroll-snap-align: start; }
}

/* ---------- зацеп страницы игры: главный момент последних недель ---------- */
.clip-hero { margin: 4px 0 12px; padding: 18px 22px; border-radius: 0; background: var(--surface);
  border: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; animation: rise 0.4s var(--ease) both; }
.clip-hero[hidden] { display: none; }
.clip-hero .eyebrow { margin: 0; }
.clip-hero-title { font: 500 clamp(19px, 2.4vw, 24px)/1.3 var(--display); color: var(--moon); letter-spacing: -0.01em; text-wrap: balance; }
.clip-hero .mood-bar { max-width: 240px; }
.clip-hero .fragments { gap: 6px; }
.clip-hero .fragments li { font-size: 15px; max-width: 760px; }
.clip-hero .link { margin-top: 10px; font-size: 13px; }
.week-game-clip:empty { display: none; }
.week-game-clip .fragments li { max-width: 760px; }

/* заглушки «Недели в играх», пока считается ответ */
.story.skeleton { pointer-events: none; min-height: 290px; 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; } }
@media (prefers-reduced-motion: reduce) { .story.skeleton { animation: none; } }

/* ---------- штамп толчка и жар карточек (static/js/stamp.js) ----------
   Направление - васильки и маки, сила - жар: от охры (M2) к лаве (M5). Уголки вместо рамки - язык штампа и карточки */
.h2 { --heat: var(--ochre); }
.h3 { --heat: color-mix(in srgb, var(--ochre) 60%, var(--lava)); }
.h4 { --heat: color-mix(in srgb, var(--ochre) 30%, var(--lava)); }
.h5 { --heat: var(--lava); }
.stamp { --dc: var(--muted); position: relative; display: inline-grid; justify-items: center; align-self: flex-start; line-height: 1.05;
  padding: 5px 11px 6px; color: var(--dc); font-family: var(--display); font-weight: 700; white-space: nowrap; }
.stamp.up { --dc: var(--up); } .stamp.down { --dc: var(--down); }
.stamp.h2, .stamp.h3, .stamp.h4, .stamp.h5 { --dc: var(--heat); }
.stamp.h2.up .stamp-v, .stamp.h3.up .stamp-v, .stamp.h4.up .stamp-v, .stamp.h5.up .stamp-v { color: var(--up); }
.stamp.h2.down .stamp-v, .stamp.h3.down .stamp-v, .stamp.h4.down .stamp-v, .stamp.h5.down .stamp-v { color: var(--down); }
.stamp::before, .stamp::after { content: ""; position: absolute; width: 8px; height: 8px; border: 2px solid var(--dc); }
.stamp::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.stamp::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.stamp small { font-size: 8.5px; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.9; }
.stamp-v { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.stamp-wave { width: 24px; height: 12px; }
.stamp-wave path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: bevel; }
.mood-scale { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.mood-label { font-size: 12px; color: var(--muted); }
/* уголки карточки: тусклые у тихой игры, цвета жара у той, что трясёт */
.story { position: relative; }
.story .corners { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.story .corners::before, .story .corners::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgb(var(--fg-rgb) / 0.18); }
.story .corners::before { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 4px; }
.story .corners::after { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 4px; }
.story.shaking .corners::before, .story.shaking .corners::after { border-color: var(--heat); border-width: 3px; width: 20px; height: 20px; }

/* ---------- «Настроение» и «Недели» на обзоре игры (static/js/looks.js) ---------- */
.mood-chart { position: relative; height: 220px; margin-top: 8px; }
.mood-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mood-band { fill: rgb(var(--fg-rgb) / 0.07); }
.mood-zone { fill: var(--heat); opacity: 0.16; }
.mood-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: bevel; vector-effect: non-scaling-stroke; }
.mood-line.up { stroke: var(--up); } .mood-line.down { stroke: var(--down); }
.mood-now { position: absolute; right: -4px; width: 8px; height: 8px; border-radius: 0; background: var(--text); transform: translateY(-50%); }
.mood-mark { position: absolute; bottom: -6px; width: 12px; height: 12px; padding: 0; border: 0; background: none; transform: translateX(-50%); cursor: pointer; }
.mood-mark::before { content: ""; position: absolute; left: 50%; bottom: 6px; width: 2px; height: 14px; background: var(--accent); transform: translateX(-50%); }
.mood-mark.turn::before { background: rgb(var(--fg-rgb) / 0.35); height: 9px; }
.mood-mark::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 6px; height: 6px; background: var(--c, var(--accent)); transform: translateX(-50%) rotate(45deg); }
.quake-log { position: relative; height: 34px; margin: 4px 0 2px; }
.quake-log-line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgb(var(--fg-rgb) / 0.18); }
.quake-dot { position: absolute; top: 50%; padding: 0; border: 0; border-radius: 0; transform: translate(-50%, -50%); background: var(--c, var(--muted)); cursor: pointer; }
.quake-dot.m1 { width: 9px; height: 9px; } .quake-dot.m2 { width: 12px; height: 12px; } .quake-dot.m3 { width: 16px; height: 16px; }
.quake-dot.m4 { width: 22px; height: 22px; } .quake-dot.m5 { width: 28px; height: 28px; }
.heli { display: grid; gap: 1px; margin-top: 8px; }
.heli-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 58px; align-items: center; gap: 10px; height: 22px; }
.heli-date { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.heli-trace { position: relative; height: 22px; }
.heli-trace svg { width: 100%; height: 100%; display: block; }
.heli-trace path { fill: none; stroke: rgb(var(--fg-rgb) / 0.45); stroke-width: 1.1; stroke-linejoin: bevel; vector-effect: non-scaling-stroke; }
.heli-row.shaking.up path { stroke: var(--up); stroke-width: 1.5; } .heli-row.shaking.down path { stroke: var(--down); stroke-width: 1.5; }
.heli-row.partial { opacity: 0.6; }
.heli-event { position: absolute; top: -3px; bottom: -3px; width: 2px; padding: 0; border: 0; background: var(--accent); cursor: pointer; }
.heli-m { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--muted); }
.heli-m.up { color: var(--up); } .heli-m.down { color: var(--down); }
.viz-head .stamp { margin-right: 4px; }

/* обрезанные скосом карточки: рамка фокуса внутри, иначе её срежет */
.card:focus-visible, .tile:focus-visible, .game-card:focus-visible, .story:focus-visible { outline-offset: -3px; }
/* у карточек карты толчков вместо скоса - уголки (.corners): скос срезал бы верхний */
.story { clip-path: none; }

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