/*
  Лендинг Polymancer (L-03). Токены — ровно из DESIGN.md §2, литералов
  цвета ниже токенов нет. Тёмная тема по умолчанию; светлая — по системной
  настройке: лендинг открывают днём и с телефона.

  Движение — только CSS и одна подписка на прокрутку: угли над первым
  экраном, проявление блоков, бегущая по рамке основателя искра.
  При `prefers-reduced-motion` всё стоит.
*/

:root {
  --bg: #120C16;
  --bg-2: #0B070D;
  --surface: #1B1320;
  --surface-2: #261B2D;
  --ink: #F2E9F4;
  --muted: #B7A3BE;
  --line: #33253B;
  --accent: #B67FD8;
  --accent-2: #D38E5C;
  --accent-text: #DBA279;
  --on-accent: #1A0B22;
  --danger: #FF7F7F;
  --tex: 2.8%;

  --accent-fill: linear-gradient(120deg, var(--accent), var(--accent-2));
  --frame: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 40%, transparent);

  --radius: 10px;
  --radius-sm: 8px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;
  --stage-maxw: 1440px;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F5F0F6;
    --bg-2: #EAE3EC;
    --surface: #FCFAFC;
    --surface-2: #EAE1EE;
    --ink: #231829;
    --muted: #6F6078;
    --line: #D9CDDF;
    --accent: #8A4DB5;
    --accent-2: #A95D26;
    --accent-text: #8E4C1F;
    --on-accent: #FFFFFF;
    --danger: #B3384A;
    --tex: 5%;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
/* `hidden` сильнее любого display: иначе кнопки с inline-flex не прячутся. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  /* Ромбическая решётка гримуара — `--texture` из DESIGN.md. */
  background-image:
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--ink) var(--tex), transparent) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--ink) var(--tex), transparent) 0 1px, transparent 1px 36px);
  font-family: 'Alegreya Sans', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: var(--accent-text); }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, .word { font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; margin: 0; }
/* Заголовки — ровными строками, абзацы — без одинокого слова в конце. */
h1 span, h2, h3 { text-wrap: balance; }
/* Без этого двухстрочный заголовок раздела распадается на две надписи. */
h2 { line-height: 1.1; }
p, li { text-wrap: pretty; }

/* ---------- шапка ---------- */

.top {
  max-width: var(--stage-maxw);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .word { font-size: 27px; line-height: 1; }
.brand img { transition: transform .6s ease; }
.brand:hover img { transform: rotate(-60deg); }

.top-nav { display: flex; align-items: center; gap: 24px; }
.top-nav > a { color: var(--muted); text-decoration: none; font-weight: 500; }
.top-nav > a:hover { color: var(--ink); }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.lang button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 700 14px 'Alegreya Sans', sans-serif;
  padding: 6px 10px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }

@media (max-width: 640px) {
  .top-nav > a { display: none; }
}

/* ---------- кнопки ---------- */

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font: 700 17px 'Alegreya Sans', sans-serif;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }

/* Блик, пробегающий по кнопке при наведении. */
.btn-main::after, .btn-seal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s ease;
}
.btn-main:hover::after, .btn-seal:hover::after { transform: translateX(120%); }

.btn-main { background: var(--accent-fill); color: var(--on-accent); }
.btn-main:hover { color: var(--on-accent); }

/* Печать: медь с тиснёным ромбом — кнопка броска у d12. */
.btn-seal {
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent-2) 70%, white), var(--accent-2) 55%, color-mix(in srgb, var(--accent-2) 70%, black));
  color: var(--on-accent);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25), 0 6px 18px color-mix(in srgb, var(--accent-2) 30%, transparent);
  font-family: 'Cormorant SC', serif;
  font-size: 21px;
  padding: 12px 26px;
}
.btn-seal::before {
  content: '';
  width: 9px;
  height: 9px;
  background: currentColor;
  transform: rotate(45deg);
  opacity: .7;
}
.btn-seal:hover { color: var(--on-accent); filter: brightness(1.05); }

.btn-quiet { background: var(--surface-2); color: var(--ink); box-shadow: var(--frame); }
.btn-quiet:hover { color: var(--ink); }

/* ---------- первый экран: ролик под заголовком ---------- */

main { display: block; }

.stage {
  position: relative;
  max-width: var(--stage-maxw);
  margin: 0 auto;
  min-height: clamp(560px, 86vh, 880px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 1480px) {
  .stage { border-radius: 16px; box-shadow: var(--frame); }
}

.stage-media { position: absolute; inset: 0; z-index: -2; }
.stage-video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Заглушка до ролика: отсветы свечей и знак на орбите. */
.stage-soon {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 72% 42%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(ellipse 40% 50% at 88% 90%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
    var(--bg-2);
}
.stage-sigil {
  position: absolute;
  right: 9%;
  top: 50%;
  width: clamp(240px, 32vw, 460px);
  height: auto;
  transform: translateY(-58%);
  opacity: .9;
  filter: drop-shadow(0 0 40px color-mix(in srgb, var(--accent) 45%, transparent));
}
.stage-soon > span {
  position: absolute;
  right: 9%;
  top: calc(50% + clamp(120px, 16vw, 230px) - 8px);
  width: clamp(240px, 32vw, 460px);
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* Тень под текстом: слева и снизу — чтобы заголовок читался на любом кадре. */
.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 34%, transparent 66%),
    linear-gradient(0deg, var(--bg) 0%, transparent 38%);
}

.stage-copy {
  width: 100%;
  max-width: 660px;
  padding: 0 var(--gutter) clamp(32px, 6vh, 64px);
}

@media (max-width: 820px) {
  .stage { min-height: 0; flex-direction: column; align-items: stretch; }
  .stage-media { position: relative; height: 62vw; min-height: 240px; }
  .stage::before { background: linear-gradient(0deg, var(--bg) 0%, transparent 30%); height: 62vw; min-height: 240px; bottom: auto; }
  .stage-sigil { right: 50%; transform: translate(50%, -58%); width: 46vw; }
  .stage-soon span { right: 0; left: 0; width: auto; top: auto; bottom: 20px; }
  .stage-copy { max-width: none; padding-top: 8px; }
}

/* Угли: медные искры поднимаются над первым экраном. */
.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.embers i {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--accent-2) 60%, transparent);
  opacity: 0;
  animation: ember 9s linear infinite;
}
.embers i:nth-child(1)  { left: 52%; animation-delay: 0s;   animation-duration: 9s; }
.embers i:nth-child(2)  { left: 60%; animation-delay: 1.4s; animation-duration: 11s; }
.embers i:nth-child(3)  { left: 67%; animation-delay: 3.1s; animation-duration: 8s; }
.embers i:nth-child(4)  { left: 73%; animation-delay: .7s;  animation-duration: 12s; }
.embers i:nth-child(5)  { left: 79%; animation-delay: 4.6s; animation-duration: 10s; }
.embers i:nth-child(6)  { left: 85%; animation-delay: 2.2s; animation-duration: 9.5s; }
.embers i:nth-child(7)  { left: 90%; animation-delay: 5.8s; animation-duration: 11.5s; }
.embers i:nth-child(8)  { left: 57%; animation-delay: 6.5s; animation-duration: 10.5s; width: 3px; height: 3px; }
.embers i:nth-child(9)  { left: 70%; animation-delay: 7.7s; animation-duration: 8.5s; width: 3px; height: 3px; }
.embers i:nth-child(10) { left: 82%; animation-delay: 8.4s; animation-duration: 12.5s; width: 3px; height: 3px; }
.embers i:nth-child(11) { left: 64%; animation-delay: 9.9s; animation-duration: 9s; width: 5px; height: 5px; }
.embers i:nth-child(12) { left: 94%; animation-delay: 3.8s; animation-duration: 13s; width: 3px; height: 3px; }

@keyframes ember {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: .9; }
  50%  { transform: translate(-18px, -45vh); }
  80%  { opacity: .5; }
  100% { transform: translate(12px, -90vh); opacity: 0; }
}

h1 { font-size: clamp(42px, 6vw, 84px); line-height: .98; letter-spacing: -.005em; }
h1 span { display: block; }
.h1-2 {
  margin-top: .16em;
  font-size: .5em;
  line-height: 1.05;
  color: var(--accent-text);
}

.lead { color: var(--muted); font-size: clamp(18px, 1.6vw, 21px); margin: 20px 0 26px; max-width: 32em; }

.join-row { display: flex; gap: 10px; flex-wrap: wrap; }
.join input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 85%, transparent);
  color: var(--ink);
  font: 18px 'Alegreya Sans', sans-serif;
}
.join input::placeholder { color: var(--muted); }
.join .btn { flex: 0 0 auto; }
@media (max-width: 480px) {
  .join .btn { flex: 1 1 100%; white-space: normal; }
}
.join.done .join-row, .join.done .join-note { display: none; }
.join-note { color: var(--muted); font-size: 15px; margin: 10px 0 0; }
.join-msg { margin: 10px 0 0; min-height: 1.5em; font-weight: 500; }
.join-msg:empty { min-height: 0; }
.join-msg.bad { color: var(--danger); }

/* ---------- разделы ---------- */

section:not(.stage) { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter) 0; }
.section-title { font-size: clamp(32px, 4vw, 48px); margin-bottom: clamp(20px, 3vw, 36px); }

.media {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--frame);
  aspect-ratio: 16 / 10;
  position: relative;
}
.media video, .media img.shot-img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Заглушка кадра, пока ролика нет. */
.media-soon {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: var(--muted);
  font-size: 15px;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%),
    var(--surface);
}

.center { text-align: center; }
.section-hint { color: var(--muted); font-size: 15px; margin: 0 0 clamp(28px, 4vw, 56px); }
.section-hint.center { margin-top: calc(-1 * clamp(10px, 2vw, 24px)); }
.section-lead { color: var(--muted); font-size: clamp(17px, 1.5vw, 19px); max-width: 44em; margin: calc(-1 * clamp(8px, 1.5vw, 18px)) 0 clamp(24px, 3vw, 40px); }

/* Бегущие руны по краю карты — орнамент гримуара. Текст удвоен, лента
   уезжает на половину и начинается заново без шва. */
.runes {
  position: absolute;
  left: 0; right: 0;
  height: 20px;
  overflow: hidden;
  pointer-events: none;
  font: 15px/20px Georgia, serif;
  letter-spacing: 7px;
  color: color-mix(in srgb, var(--accent-2) 85%, transparent);
}
.runes-top { top: 10px; }
.runes-bottom { bottom: 10px; }
.runes b { display: inline-block; white-space: nowrap; font-weight: 400; animation: runes 16s linear infinite; }
@keyframes runes { to { transform: translateX(-50%); } }

/* ---------- отличия: три карты ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3.4vw, 48px);
  align-items: stretch;
}
@media (max-width: 960px) { .cards { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin: 0 auto; } }

.card {
  --rx: 0deg;
  --ry: 0deg;
  --gx: 50%;
  --gy: 50%;
  position: relative;
  perspective: 1000px;
}
.card-body {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 46px 22px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 70%, var(--surface)), var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 45%, transparent);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .18s ease-out, box-shadow .4s ease;
}
/* Переливающаяся рамка карты. */
.card-body::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), color-mix(in srgb, var(--accent) 40%, #8FD3C9), var(--accent), var(--accent-2));
  background-size: 200% 100%;
  animation: holo 6s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
@keyframes holo { to { background-position: 200% 50%; } }

.card:hover .card-body {
  transform: translateY(-34px) scale(1.05) rotateX(var(--rx)) rotateY(var(--ry));
  box-shadow:
    inset 0 0 0 1px var(--accent-2),
    0 60px 90px rgb(0 0 0 / .45),
    0 0 60px color-mix(in srgb, var(--accent-2) 28%, transparent);
}
.card:hover .runes b { animation-duration: 5s; }

/* Блик фольги за курсором: виден только у пятна под мышью. */
.card-glare {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(115deg, rgb(255 236 210 / .16) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(25deg, color-mix(in srgb, var(--accent) 12%, transparent) 0 1px, transparent 1px 9px),
    radial-gradient(circle at var(--gx) var(--gy), rgb(255 236 210 / .10), transparent 14%);
  -webkit-mask-image: radial-gradient(circle at var(--gx) var(--gy), #000 0%, rgb(0 0 0 / .5) 9%, transparent 20%);
  mask-image: radial-gradient(circle at var(--gx) var(--gy), #000 0%, rgb(0 0 0 / .5) 9%, transparent 20%);
  transition: opacity .3s ease, transform .18s ease-out;
}
.card:hover .card-glare {
  opacity: 1;
  transform: translateY(-34px) scale(1.05) rotateX(var(--rx)) rotateY(var(--ry));
}

.cartouche {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  font: 700 15px 'Cormorant SC', serif;
  letter-spacing: .15em;
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 70%, transparent);
}
.card-media { width: 100%; border-radius: var(--radius-sm); }
.card h3 { font-size: clamp(26px, 2.2vw, 30px); line-height: 1.05; color: var(--accent-text); margin-top: 4px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* ---------- облики: слайдер двух роликов ---------- */

/*
  Второй ролик лежит поверх первого и обрезан слева по разделителю
  (`--split` ставит landing.js — встроенных стилей CSP не пускает).
  Ползунок прозрачный и во весь кадр: его тянут где угодно, видна линия.
*/
.compare { --split: 50%; touch-action: pan-y; border-radius: 14px; }
.compare video { position: absolute; inset: 0; }
.compare-b { clip-path: inset(0 0 0 var(--split)); }
.compare-line {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: var(--accent-2);
  pointer-events: none;
}
.compare:not(.touched) .compare-line i { animation: knob-nudge 2.4s ease-in-out infinite; }
@keyframes knob-nudge { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.compare-line i {
  position: absolute;
  top: 50%; left: 50%;
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-2) 25%, transparent);
}
.compare-line i::before, .compare-line i::after {
  content: '';
  position: absolute;
  top: 50%;
  margin-top: -7px;
  border: 7px solid transparent;
}
.compare-line i::before { left: 6px; border-right-color: var(--on-accent); }
.compare-line i::after { right: 6px; border-left-color: var(--on-accent); }
.compare-tag {
  position: absolute;
  top: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  pointer-events: none;
}
.compare-tag-a { left: 20px; }
.compare-tag-b { right: 20px; }
.compare-range {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}
.compare:has(.compare-range:focus-visible) .compare-line i { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ---------- d12 ---------- */

.d12-grid {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
@media (max-width: 900px) { .d12-grid { grid-template-columns: minmax(0, 1fr); } }
.d12-left { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.d12-left .section-hint { margin: 0; }

/*
  Кость: двенадцать пятиугольников вокруг центра. `--k` — масштаб (на узком
  экране кость меньше). Каждая грань: повернуть к своему месту, отодвинуть
  на радиус вписанной сферы и довернуть, чтобы цифра стояла ровно.
*/
.die-stage {
  --k: 1;
  position: relative;
  width: calc(420px * var(--k));
  height: calc(420px * var(--k));
  perspective: calc(1100px * var(--k));
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}
@media (max-width: 520px) { .die-stage { --k: .72; } }
.die {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  transform-style: preserve-3d;
}
.df {
  --pent: polygon(50% 0%, 97.55% 34.55%, 79.39% 90.45%, 20.61% 90.45%, 2.45% 34.55%);
  position: absolute;
  left: calc(-88.47px * var(--k));
  top: calc(-88.47px * var(--k));
  width: calc(176.94px * var(--k));
  height: calc(176.94px * var(--k));
  clip-path: var(--pent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-2) 55%, white), var(--accent-2) 45%, color-mix(in srgb, var(--accent-2) 55%, black));
  backface-visibility: hidden;
}
/*
  Грань: аметист с медным ободком. Цифры — гарнитурой интерфейса, а не
  Cormorant: у той старинные цифры, и 1 с 7 на кости путались. Выбранная
  грань (`.on`) — светлая медь с тёмной цифрой; остальные чуть приглушены,
  чтобы выпавшая читалась сразу. Цвета кости — материал, а не интерфейс,
  и в светлой теме не меняются.
*/
.df b {
  position: absolute;
  inset: calc(6px * var(--k));
  clip-path: var(--pent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: calc(10px * var(--k));
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 38%, rgb(255 255 255 / .16), transparent 55%),
    linear-gradient(170deg, #6E4592, #3E2452 62%, #2A1736);
  font: 700 calc(54px * var(--k))/1 'Alegreya Sans SC', 'Alegreya Sans', sans-serif;
  font-variant-numeric: lining-nums;
  color: #F7E6D2;
  text-shadow: 0 2px 0 #1A0B22, 0 0 calc(12px * var(--k)) rgb(0 0 0 / .45);
  transition: background .4s ease, color .4s ease, filter .4s ease;
  filter: brightness(.82);
}
.df.on b {
  background:
    radial-gradient(circle at 50% 35%, rgb(255 255 255 / .55), transparent 60%),
    linear-gradient(170deg, #F6CFA4, #D9935F 60%, #A9622F);
  color: #2A1220;
  text-shadow: 0 1px 0 rgb(255 255 255 / .5);
  filter: none;
}
/* Черта под 6 и 9 — как на настоящей кости. */
.df b.under::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 30%;
  width: calc(22px * var(--k));
  height: 3px;
  margin-left: calc(-11px * var(--k));
  background: currentColor;
}
.df1  { transform: rotateY(0deg)   rotateX(90deg)      translateZ(calc(115.81px * var(--k))) rotateZ(0deg); }
.df2  { transform: rotateY(0deg)   rotateX(26.565deg)  translateZ(calc(115.81px * var(--k))) rotateZ(36deg); }
.df3  { transform: rotateY(72deg)  rotateX(26.565deg)  translateZ(calc(115.81px * var(--k))) rotateZ(36deg); }
.df4  { transform: rotateY(144deg) rotateX(26.565deg)  translateZ(calc(115.81px * var(--k))) rotateZ(36deg); }
.df5  { transform: rotateY(216deg) rotateX(26.565deg)  translateZ(calc(115.81px * var(--k))) rotateZ(36deg); }
.df6  { transform: rotateY(288deg) rotateX(26.565deg)  translateZ(calc(115.81px * var(--k))) rotateZ(36deg); }
.df8  { transform: rotateY(36deg)  rotateX(-26.565deg) translateZ(calc(115.81px * var(--k))) rotateZ(0deg); }
.df7  { transform: rotateY(108deg) rotateX(-26.565deg) translateZ(calc(115.81px * var(--k))) rotateZ(0deg); }
.df11 { transform: rotateY(180deg) rotateX(-26.565deg) translateZ(calc(115.81px * var(--k))) rotateZ(0deg); }
.df10 { transform: rotateY(252deg) rotateX(-26.565deg) translateZ(calc(115.81px * var(--k))) rotateZ(0deg); }
.df9  { transform: rotateY(324deg) rotateX(-26.565deg) translateZ(calc(115.81px * var(--k))) rotateZ(0deg); }
.df12 { transform: rotateY(0deg)   rotateX(-90deg)     translateZ(calc(115.81px * var(--k))) rotateZ(0deg); }
.die-shadow {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 62%;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgb(0 0 0 / .6), transparent 70%);
  pointer-events: none;
}
.die-buttons { display: flex; gap: 10px; align-items: center; }
.die-step { min-width: 56px; font-size: 22px; }
.die-roll { font-size: 20px; padding: 12px 26px; gap: 10px; }
.die-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.die-roll:hover .die-icon { transform: rotate(-30deg); transition: transform .4s ease; }

.d12-face { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.d12-num { margin: 0; display: flex; align-items: baseline; gap: 14px; color: var(--muted); }
.d12-num b { font: 700 clamp(72px, 8vw, 110px)/.9 'Cormorant SC', serif; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.d12-face h3 { font-size: clamp(32px, 3.4vw, 44px); line-height: 1.02; }
.d12-text { margin: 0; font-size: 19px; line-height: 1.55; max-width: 620px; }
.d12-media { max-width: 620px; border-radius: 12px; }
/* Двенадцать фишек — одним рядом, на узком экране — двумя по шесть: флекс
   с переносом отправлял «12» одну на вторую строку. */
.d12-chips { display: grid; grid-template-columns: repeat(12, minmax(0, 44px)); gap: 6px; }
@media (max-width: 560px) { .d12-chips { grid-template-columns: repeat(6, 44px); } }
.d12-chips button {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font: 700 16px 'Alegreya Sans SC', 'Alegreya Sans', sans-serif;
  font-variant-numeric: lining-nums;
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.d12-chips button[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); box-shadow: none; }

/* ---------- бесплатно и статус ---------- */

.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.plan { padding: 22px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--frame); }
.plan h3 { font-size: 26px; }
.plan .price { font-weight: 700; color: var(--accent-text); margin: 2px 0 8px; }
.plan p { margin: 0; color: var(--muted); }
.plan p.price { color: var(--accent-text); }
.plan-status p { margin-top: 8px; }
/* Цена Pro предварительная (M5-46): пометка мелко, но целиком. */
.plans-note { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.community-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px !important; }

/* ---------- проявление при прокрутке ---------- */

.js-reveal .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.js-reveal .reveal.shown { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .embers, .card-body::before, .runes b, .compare-line i { animation: none !important; }
  .card-body, .card-glare { transition: none; }
  .embers { display: none; }
  .btn-main::after, .btn-seal::after { display: none; }
}

/* ---------- уведомление из письма ---------- */

.notice {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px var(--gutter);
  background: var(--surface-2);
  box-shadow: 0 1px 0 var(--line);
}
.notice p { margin: 0; font-weight: 500; }

/* ---------- подвал ---------- */

.rule { display: flex; align-items: center; gap: 10px; }
.rule i { width: 9px; height: 9px; background: var(--accent-2); transform: rotate(45deg); flex: none; }
.rule b { flex: 1; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }

.foot { max-width: var(--maxw); margin: clamp(48px, 7vw, 96px) auto 0; padding: 0 var(--gutter) 40px; text-align: center; }
.foot-sigil { display: block; margin: 0 auto; }
.tagline { font-family: 'Cormorant SC', serif; font-weight: 700; font-size: 22px; color: var(--accent-text); margin: 22px 0 8px; }
.foot-links { display: flex; gap: 8px 20px; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 15px; margin: 0; }
.foot-links a { color: var(--muted); }
.foot-social { display: flex; gap: 8px 18px; justify-content: center; flex-wrap: wrap; margin: 14px 0 0; font-size: 15px; font-weight: 500; }
.foot-social a { color: var(--accent-text); text-decoration: none; }
.foot-social a:hover { color: var(--accent-2); text-decoration: underline; }

/* ---------- политика ---------- */

.doc { max-width: 760px; margin: 0 auto; padding: 24px var(--gutter) 48px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 8px; }
.doc h2 { font-size: 26px; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--muted); }
.doc strong { color: var(--ink); }
.doc-draft { padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--accent); }
.doc [lang]:not(:lang(en)) { display: none; }
html:lang(ru) .doc [lang="en"] { display: none; }
html:lang(ru) .doc [lang="ru"] { display: block; }
