/* ─────────────────────────────────────────────
   Посвящение в студенты РГУ · 2026
   Скелет: афишная типографика, острые углы у всего,
   пилюли только у кнопок, без теней, медленное движение.
   Цвет: жидкий градиент в hero + один акцент «чернила».
───────────────────────────────────────────── */

:root {
  --obsidian: #0A0A0C;
  --inkstone: #18181B;
  --paper: #FFFFFF;
  --felt: #8D8D96;
  --hair: rgba(255, 255, 255, .14);
  --hair-strong: rgba(255, 255, 255, .3);

  /* единственный цвет интерфейса — чернила печати */
  --accent: #6C4DFF;
  --accent-ink: #5134E0;

  /* палитра жидкого hero */
  --liq-indigo: #1C1F6B;
  --liq-violet: #6C4DFF;
  --liq-amber: #FF9E3D;
  --liq-cream: #FFE2B8;

  --paper-ink: #0A0A0C;
  --paper-mute: #6D6D74;

  --f-sans: "Onest", "Golos Text", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --f-hand: "Caveat", cursive;

  --gutter: 16px;
  --tabbar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.19, 1, .22, 1);
  --ease-thud: cubic-bezier(.6, 0, .9, .5);
  --slow: 1.25s;
  --mid: .8s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--paper);
  background: var(--obsidian);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--paper); outline-offset: 4px; }
.mono { font-family: var(--f-mono); font-feature-settings: "zero"; }
.muted { color: var(--felt); max-width: 34ch; }

/* ─── Пилюли — единственное скругление в системе ─── */
.pill {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px;
  padding: 12px 33px;
  border-radius: 75px;
  border: 1px solid transparent;
  font-size: 16px; font-weight: 400; letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color var(--mid) var(--ease), background-color var(--mid) var(--ease), letter-spacing var(--mid) var(--ease), opacity .4s ease;
  touch-action: manipulation;
}
.pill-ghost { border-color: var(--hair-strong); color: var(--paper); }
.pill-ghost:hover { border-color: var(--paper); letter-spacing: .3px; }
.pill-accent { background: var(--accent); color: var(--paper); }
.pill-accent:hover { background: var(--accent-ink); }
.pill:disabled { opacity: .3; cursor: not-allowed; }

.label {
  font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--felt);
  margin-bottom: 14px;
}
.whisper {
  font-weight: 300;
  font-size: clamp(30px, 8.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -.5px;
  max-width: 14ch;
}

/* построчное появление крупного текста */
.ln { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.ln > span { display: inline-block; animation: rise var(--slow) both var(--ease); }
.ln + .ln > span { animation-delay: .08s; }
@keyframes rise { from { transform: translateY(105%); } }
.ln-light { font-weight: 300; }

/* ─── Шапка ─── */
.topbar {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1078px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) 0;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand-img {
  display: block; height: 40px; width: auto;
  transition: opacity var(--mid) var(--ease), transform var(--mid) var(--ease);
}
/* пока на экране большой логотип hero, маленький в шапке спрятан */
.hero-logo-visible .brand-img { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.topbar-rgu { display: block; height: 30px; width: auto; opacity: .92; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Экраны ─── */
main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 40px); }
.screen { display: none; }
.screen.is-active { display: block; animation: fade var(--mid) var(--ease); }
@keyframes fade { from { opacity: 0; } }
.band {
  max-width: 1078px; margin: 0 auto;
  padding: 46px var(--gutter) 0;
}
#tab-live, #tab-battle, #tab-friends, #tab-oracle { padding-top: calc(86px + env(safe-area-inset-top, 0px)); }

/* ─── Hero ─── */
.hero {
  position: relative;
  min-height: 92svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  /* запасной вариант, если нет WebGL */
  background:
    radial-gradient(60% 50% at 75% 20%, var(--liq-amber), transparent 70%),
    radial-gradient(70% 60% at 20% 35%, var(--liq-violet), transparent 70%),
    radial-gradient(80% 60% at 60% 70%, var(--liq-indigo), transparent 75%),
    var(--obsidian);
}
.liquid { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 55%; z-index: -1;
  background: linear-gradient(to bottom, transparent, rgba(10,10,12,.55) 55%, var(--obsidian));
}
.hero-inner {
  width: 100%; max-width: 1078px; margin: 0 auto;
  padding: 0 var(--gutter) 34px;
}
.hero-title { margin: 0 -6px; }
/* оригинальный логотип «пишется» слева направо, как росчерк */
.hero-logo {
  display: block;
  width: 100%; max-width: 900px; height: auto;
  animation: write 2.6s .2s both cubic-bezier(.45, .05, .25, 1);
}
.hero-seen .hero-logo { animation: none; }
@keyframes write {
  from { clip-path: inset(0 100% 0 0); opacity: .4; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
.hero-row {
  display: flex; flex-direction: column; gap: 22px;
  margin-top: 26px;
}
.hero-lead { font-size: 16px; line-height: 1.45; max-width: 30ch; color: rgba(255,255,255,.88); animation: fade 1.6s .5s both var(--ease); }
.hero-row .pill { align-self: flex-start; animation: fade 1.6s .7s both var(--ease); }
@media (min-width: 720px) {
  .hero-row { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .hero-row .pill { align-self: auto; }
}

/* Вращающийся бейдж */
.badge-spin {
  position: absolute; z-index: 2;
  right: var(--gutter); top: calc(78px + env(safe-area-inset-top, 0px));
  width: 104px; height: 104px;
  display: grid; place-items: center;
  color: var(--paper);
}
.badge-spin svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; }
.badge-arrow { font-size: 22px; font-weight: 300; transition: transform var(--mid) var(--ease); }
.badge-spin:hover .badge-arrow { transform: translateY(4px); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Билет ─── */
#ticketBlock { padding-top: 56px; scroll-margin-top: 20px; }
#ticketBlock .whisper { margin-bottom: 12px; }
.ticket-lead { margin-bottom: 28px; max-width: 38ch; }

/* цвет факультета на билете: до выбора — чернила */
.ticket { --fac: var(--accent); max-width: 520px; perspective: 1400px; }
.ticket-flip {
  position: relative;
  display: grid;
  transform-style: preserve-3d;
  /* лёгкий наклон вслед за телефоном */
  transform: rotateX(calc(var(--ty, 0) * -3deg)) rotateY(calc(var(--tx, 0) * 4deg));
  transition: transform var(--flip-speed, 1.25s) var(--ease);
}
.ticket.is-flipped .ticket-flip { transform: rotateY(180deg); }
.tk {
  grid-area: 1 / 1;
  position: relative;
  padding: 16px 16px 12px;
  color: var(--paper-ink);
  background: var(--paper);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.tk-front, .tk-back { display: flex; flex-direction: column; }
.tk-back { transform: rotateY(180deg); }

/* Печать документа: при первом появлении билет «выезжает» из принтера */
.ticket.is-printing .tk-front { animation: print 1.6s var(--ease) both; }
@keyframes print {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-14px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

/* Гильош — защитная сетка, рисуется линиями при печати; цвет — факультет */
.tk-guilloche { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tk-guilloche path { fill: none; stroke: var(--fac); stroke-width: .6; opacity: .14; transition: stroke 1s var(--ease); }
.ticket.is-printing .tk-guilloche path { stroke-dasharray: 2400; animation: draw 2.4s .3s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 2400; } to { stroke-dashoffset: 0; } }
.tk-band { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--fac); transition: background 1s var(--ease); }

.tk-head {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 2px 0 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--paper-ink);
}
.tk-title { flex: 1; min-width: 0; font-weight: 500; font-size: 11px; line-height: 1.2; letter-spacing: 1.2px; text-transform: uppercase; }
.tk-no { text-align: right; line-height: 1; color: var(--paper-ink); }
.tk-no small { display: block; font-size: 9px; color: var(--paper-mute); margin-bottom: 3px; }
.tk-no b { font-weight: 500; font-size: 20px; letter-spacing: .04em; color: var(--fac); transition: color 1s var(--ease); }

/* Оригинальные белые логотипы на белом билете: форма из файла, цвет — краска */
.mask-logo {
  flex: none; display: block;
  background: var(--paper-ink);
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
}
.mask-rgu { height: 34px; aspect-ratio: 460 / 200; -webkit-mask-image: url("assets/rgu_logo.png"); mask-image: url("assets/rgu_logo.png"); }
.mask-sk { height: 28px; aspect-ratio: 924 / 512; -webkit-mask-image: url("assets/logotip_sk.png"); mask-image: url("assets/logotip_sk.png"); }

.tk-body { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 14px; }
.tk-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  display: grid; place-items: center;
  border: 1px dashed var(--paper-mute);
  font-size: 30px; font-weight: 300; color: var(--paper-mute);
  transition: color var(--mid) var(--ease), border-color var(--mid) var(--ease);
}
.tk-photo.has-initials { border-color: transparent; color: var(--paper); text-shadow: 0 1px 14px rgba(10,10,12,.45); }
/* голограмма на уголке фото: появляется с печатью и переливается при наклоне */
.tk-holo {
  position: absolute; right: -10px; bottom: -10px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle, transparent 52%, rgba(255,255,255,.75) 54%, transparent 58%),
    conic-gradient(from calc(var(--tx, 0) * 220deg + var(--ty, 0) * 90deg),
      #ff9ad5, #ffe48a, #8affc7, #8ad8ff, #c39aff, #ff9ad5);
  border: 1px solid rgba(255,255,255,.9);
  opacity: 0; transform: scale(.2) rotate(-120deg);
  transition: transform 1s .9s var(--ease), opacity .4s .9s ease;
}
.tk-holo b { font-size: 7px; font-weight: 600; letter-spacing: .5px; color: rgba(10,10,12,.55); }
.tk-front.is-locked .tk-holo { opacity: 1; transform: none; }

.fields { display: grid; gap: 10px; min-width: 0; }
.field { display: block; }
.field-label {
  display: block;
  font-size: 10px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--paper-mute);
}
.hand {
  width: 100%;
  min-height: 40px;
  padding: 0 2px;
  border: 0; border-bottom: 1px solid var(--paper-ink); border-radius: 0;
  background: transparent;
  font-family: var(--f-hand); font-size: 26px; font-weight: 700; line-height: 1.4;
  color: var(--accent-ink);
  -webkit-appearance: none; appearance: none;
  transition: background .4s ease, border-color .4s ease;
}
.hand::placeholder { color: rgba(109,109,116,.55); font-weight: 600; }
.hand:focus { outline: none; border-bottom-color: var(--accent); background: rgba(108,77,255,.06); }
.select-wrap { position: relative; display: block; }
.select-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; font-size: 16px; cursor: pointer;
}
.select-wrap:focus-within .select-face { border-bottom-color: var(--accent); background: rgba(108,77,255,.06); }
.select-face {
  display: block;
  font-size: 23px;
  background-image: linear-gradient(45deg, transparent 50%, var(--paper-ink) 50%), linear-gradient(135deg, var(--paper-ink) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 22px;
  text-overflow: ellipsis;
}
.select-face.is-empty { color: rgba(109,109,116,.7); font-weight: 600; }
.field-row { display: flex; gap: 20px; }
.field-static { font-weight: 500; font-size: 14px; }

.tk-foot { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 14px; }
.issuer { display: flex; align-items: center; gap: 8px; }
.issuer .field-label { line-height: 1.25; }
.signbox { display: flex; flex-direction: column; align-items: flex-end; }
.sign {
  font-family: var(--f-hand); font-size: 24px; font-weight: 600;
  transform: rotate(-4deg); line-height: 1;
  border-bottom: 1px solid var(--paper-mute); padding: 0 6px 2px;
}

/* машиночитаемая строка внизу — как в паспорте */
.tk-mrz {
  position: relative;
  margin: 12px -16px -12px; padding: 8px 16px 9px;
  border-top: 1px solid rgba(10,10,12,.12);
  background: rgba(10,10,12,.035);
  font-size: 10.5px; line-height: 1.45; letter-spacing: .08em;
  color: rgba(10,10,12,.62);
  white-space: pre; overflow: hidden;
}
.tk-mrz { margin-top: auto !important; }
.tk-foot { margin-bottom: 14px; }

/* блик плёнки, ловит наклон телефона */
.tk-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 47%, transparent 58%);
  background-size: 260% 100%;
  background-position: calc(50% + var(--tx, 0) * 70%) 0;
  mix-blend-mode: soft-light;
}

.tk-front.is-locked .hand { pointer-events: none; border-bottom-color: transparent; opacity: 1; }
.tk-front.is-locked .select-native { pointer-events: none; }
.tk-front.is-locked .select-face { background-image: none; border-bottom-color: transparent; }

/* Печать — тот же бейдж, что крутится в hero */
.stamp {
  position: absolute; right: -1%; bottom: 12%;
  width: 38%; max-width: 170px;
  color: var(--accent-ink);
  mix-blend-mode: multiply;
  opacity: 0; pointer-events: none;
  transform: rotate(-120deg) scale(2.6);
}
.stamp svg { display: block; width: 100%; }
.stamp.is-down {
  opacity: .92;
  transform: rotate(-14deg) scale(1);
  transition: transform .32s var(--ease-thud), opacity .14s linear;
}
.ticket.is-thud .ticket-flip { animation: thud .6s .3s var(--ease); }
@keyframes thud { 25% { transform: translateY(5px) scale(.985); } }

/* Оборот: отметки вечера */
.tk-back-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 0 12px; margin-bottom: 14px; border-bottom: 1px solid var(--paper-ink); }
.tk-count { font-size: 14px; color: var(--paper-mute); }
.tk-count b { font-size: 22px; font-weight: 500; color: var(--paper-ink); }
.marks { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; }
.mark { display: grid; justify-items: center; gap: 4px; text-align: center; }
.mark-seal {
  position: relative;
  width: 100%; max-width: 92px; aspect-ratio: 1;
  display: grid; place-items: center;
  border: 1px dashed rgba(10,10,12,.25); border-radius: 50%;
  color: rgba(10,10,12,.3);
  font-size: 9px; font-weight: 500; letter-spacing: .4px; text-transform: uppercase;
}
.mark-seal svg { position: absolute; inset: -4%; width: 108%; height: 108%; opacity: 0; color: var(--mark, var(--accent-ink)); mix-blend-mode: multiply; }
.mark-cap { font-size: 9.5px; line-height: 1.25; color: var(--paper-mute); max-width: 12ch; }
.mark.is-on .mark-seal { border-color: transparent; color: transparent; }
.mark.is-on .mark-seal svg { opacity: .9; transform: rotate(var(--rot, -8deg)); }
.mark.is-new .mark-seal svg { animation: seal .5s var(--ease-thud) both; }
@keyframes seal { from { opacity: 0; transform: rotate(-90deg) scale(2.4); } to { opacity: .9; transform: rotate(var(--rot, -8deg)) scale(1); } }
.mark.is-on .mark-cap { color: var(--paper-ink); }
.tk-back-note { margin-top: 12px; font-size: 12px; line-height: 1.4; color: var(--paper-mute); }
/* предсказание оракула, вписанное «от руки» */
.tk-omen { margin-top: 14px; padding-top: 10px; border-top: 1px dashed rgba(10,10,12,.25); }
.tk-omen-text { margin-top: 4px; font-family: var(--f-hand); font-weight: 600; font-size: 21px; line-height: 1.15; color: var(--accent-ink); }

.ticket-actions { display: grid; gap: 12px; max-width: 520px; margin-top: 18px; }
.hold {
  --p: 0;
  width: 100%; min-height: 60px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.hold-fill {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.28);
  transform-origin: left; transform: scaleX(var(--p));
}
.hold-label { position: relative; }
.hint { font-size: 13px; color: var(--felt); }

.after { display: grid; gap: 10px; max-width: 520px; margin-top: 18px; animation: fade 1.2s 1s both var(--ease); }
.link-btn { justify-self: center; padding: 10px; font-size: 13px; color: var(--felt); text-decoration: underline; text-underline-offset: 3px; }

/* ─── Эфир ─── */
.now { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: end; margin-bottom: 46px; }
.now-num {
  font-weight: 300;
  font-size: clamp(96px, 30vw, 180px);
  line-height: .74;
  letter-spacing: -.05em;
  color: var(--accent);
}
.now-title { font-weight: 400; font-size: clamp(22px, 6.4vw, 39px); line-height: 1.1; }
.now-next { margin-top: 10px; font-size: 13px; color: var(--felt); }
.now-next span { color: var(--paper); }

.poll-head { margin-bottom: 22px; }
.poll-head .whisper { margin-bottom: 8px; }
.poll {
  list-style: none;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px;
}
@media (min-width: 720px) { .poll { grid-template-columns: repeat(3, 1fr); gap: 28px 14px; } }
.poll-opt { display: block; width: 100%; text-align: left; }
.poll-img {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--inkstone);
}
.poll-img::after {
  content: ""; position: absolute; inset: 0;
  border: 2px solid var(--paper);
  opacity: 0; transition: opacity var(--mid) var(--ease);
}
.poll-abbr {
  position: absolute; left: 10px; bottom: 6px;
  font-weight: 300; font-size: clamp(28px, 9.4vw, 52px); line-height: 1; letter-spacing: -.03em;
  color: #fff;
  transition: transform var(--slow) var(--ease);
}
.poll-opt:hover .poll-abbr { transform: translateY(-6px); }
.poll-full { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--felt); min-height: 2.6em; }
.poll-tag {
  position: absolute; top: 8px; left: 8px;
  padding: 4px 10px; border-radius: 75px;
  background: var(--paper); color: var(--paper-ink);
  font-size: 11px;
  opacity: 0; transform: translateY(-6px);
  transition: opacity .4s ease, transform var(--mid) var(--ease);
}
.poll-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 10px; }
.poll-name { font-size: 16px; }
.poll-pct { font-family: var(--f-mono); font-size: 13px; color: var(--felt); opacity: 0; transition: opacity .4s ease; }
.poll-bar { display: block; height: 1px; margin-top: 8px; background: var(--hair); }
.poll-bar i { display: block; height: 100%; width: 0; background: var(--fac, var(--paper)); transition: width var(--slow) var(--ease); }
.poll.is-voted .poll-pct { opacity: 1; }
.poll.is-voted .poll-opt { cursor: default; }
.poll-opt.is-mine .poll-img::after { opacity: 1; }
.poll-opt.is-mine .poll-tag { opacity: 1; transform: none; }
.poll-opt.is-mine .poll-bar { height: 2px; }
.meta { margin-top: 18px; font-size: 12px; color: var(--felt); }

.fly-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.fly {
  position: absolute; font-size: 34px;
  will-change: transform, opacity;
  animation: fly 2.6s var(--ease) forwards;
}
.fly.is-remote { font-size: 22px; opacity: .7; }
@keyframes fly {
  0% { transform: translate(-50%, 0) scale(.3); opacity: 0; }
  12% { transform: translate(-50%, -34px) scale(1.15); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), -65vh) scale(.9) rotate(var(--rot)); opacity: 0; }
}

/* ─── Крупные заголовки разделов ─── */
.display-md {
  font-weight: 400;
  font-size: clamp(56px, 16.4vw, 160px);
  line-height: .8;
  letter-spacing: -.04em;
  margin: 0 0 22px -.04em;
}

/* ─── Битва ─── */
.battle-pick { margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 16px;
  border-radius: 75px; border: 1px solid var(--hair-strong);
  font-size: 14px;
  transition: background-color .4s ease, color .4s ease, border-color .4s ease;
}
.chip { display: inline-flex; align-items: center; gap: 8px; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--fac); }
.chip.is-on { background: var(--paper); color: var(--paper-ink); border-color: var(--paper); }

.tapzone { display: grid; justify-items: center; gap: 16px; margin: 40px 0 46px; }
.tap-wrap { position: relative; }
.tap-wrap.is-shake { animation: shake .4s; }
@keyframes shake {
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, -1px); }
}
.tap {
  position: relative;
  width: min(70vw, 280px); aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-content: center; gap: 0;
  overflow: hidden;
  isolation: isolate;
  color: var(--paper);
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform .15s var(--ease);
}
/* «жидкая» кнопка — второй и последний цветной жест */
.tap::before {
  content: ""; position: absolute; inset: -30%; z-index: -1;
  background: conic-gradient(from 0deg, var(--liq-indigo), var(--liq-violet), var(--liq-amber), var(--liq-cream), var(--liq-violet), var(--liq-indigo));
  background: conic-gradient(from 0deg,
    color-mix(in srgb, var(--fac, var(--liq-violet)) 35%, #0A0A0C),
    var(--fac, var(--liq-violet)),
    color-mix(in srgb, var(--fac, var(--liq-violet)) 45%, #FFFFFF),
    var(--fac, var(--liq-violet)),
    color-mix(in srgb, var(--fac, var(--liq-violet)) 35%, #0A0A0C));
  filter: blur(18px);
  animation: spin 9s linear infinite;
}
.tap.is-hit { transform: scale(.94); }
.tap:disabled { filter: grayscale(1) brightness(.5); cursor: not-allowed; }
.tap-count { font-size: 56px; font-weight: 400; line-height: 1; }
.tap-label { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; text-align: center; margin-top: 6px; }
.wave {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--paper);
  pointer-events: none;
  animation: wave .9s var(--ease) forwards;
}
@keyframes wave { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.combo {
  position: absolute; z-index: 2; right: -4px; top: -6px;
  padding: 6px 14px; border-radius: 75px;
  background: var(--paper); color: var(--paper-ink);
  font-size: 18px; font-weight: 500;
  transform: scale(0);
  transition: transform .4s var(--ease);
  pointer-events: none;
}
.combo.is-on { transform: scale(1); }
.combo.is-bump { animation: bump .3s var(--ease); }
@keyframes bump { 50% { transform: scale(1.18); } }
.tap-for { font-size: 14px; color: var(--felt); }
.tap-for b { color: var(--paper); font-weight: 500; }
.plus {
  position: absolute; pointer-events: none;
  font-family: var(--f-mono); font-size: 16px; color: var(--paper);
  animation: plus .8s var(--ease) forwards;
}
@keyframes plus { to { transform: translateY(-60px); opacity: 0; } }

.board { position: relative; border-top: 1px solid var(--hair); }
.row {
  position: absolute; left: 0; right: 0;
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  height: 60px;
  border-bottom: 1px solid var(--hair);
  transition: transform var(--slow) var(--ease);
}
.row-place { font-weight: 300; font-size: 28px; letter-spacing: -.03em; color: var(--felt); }
.row-main { min-width: 0; }
.row-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-name small { font-size: 12px; color: var(--felt); margin-left: 6px; }
.row-bar { height: 1px; margin-top: 8px; background: var(--hair); }
.row-bar i { display: block; height: 100%; background: var(--fac, var(--paper)); transition: width var(--slow) var(--ease); }
.row-score { font-family: var(--f-mono); font-size: 13px; color: var(--felt); }
.row.is-first .row-place { color: var(--paper); }
.row.is-mine .row-place, .row.is-mine .row-name { color: var(--accent); }
.row.is-mine .row-bar i { height: 3px; margin-top: -1px; }

/* ─── Программа ─── */
.timeline { list-style: none; border-top: 1px solid var(--hair); }
.tl {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--hair);
  animation: fade 1.2s both var(--ease);
}
.tl-time { font-family: var(--f-mono); font-size: 13px; color: var(--felt); padding-top: 6px; }
.tl-title { font-size: 22px; line-height: 1.2; }
.tl-desc { font-size: 14px; color: var(--felt); margin-top: 4px; }
.tl.is-done { opacity: .38; }
.tl.is-now .tl-time { color: var(--paper); }
.tl.is-now .tl-title { font-size: clamp(30px, 9vw, 45px); font-weight: 300; letter-spacing: -.02em; line-height: 1.05; }
.tl-now {
  display: inline-block; margin-bottom: 10px;
  padding: 4px 12px; border-radius: 75px;
  background: var(--accent); color: var(--paper);
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
}

/* ─── Организаторы ─── */
.orgs { margin-top: 68px; padding-top: 28px; border-top: 1px solid var(--hair); }
.orgs-row { display: flex; align-items: center; gap: 36px; }
.orgs-row img { display: block; height: 48px; width: auto; opacity: .9; }

/* ─── Таббар-пилюля ─── */
.tabbar {
  --i: 0;
  position: fixed; z-index: 30;
  left: 12px; right: 12px;
  bottom: calc(12px + var(--safe-b));
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 460px; margin: 0 auto;
  height: var(--tabbar-h);
  padding: 4px;
  border-radius: 75px;
  border: 1px solid var(--hair-strong);
  background: rgba(10,10,12,.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.tab-blob {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / 5);
  border-radius: 75px;
  background: var(--paper);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform var(--mid) var(--ease);
}
.tab {
  position: relative;
  border-radius: 75px;
  font-size: 13px; color: rgba(255,255,255,.75);
  transition: color .5s ease;
}
.tab.is-active { color: var(--paper-ink); }

/* ─── Конфетти, тост ─── */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
.toast {
  position: fixed; left: 50%; z-index: 50;
  top: calc(16px + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -16px);
  max-width: calc(100% - 2 * var(--gutter));
  padding: 12px 22px;
  border-radius: 75px;
  background: var(--paper); color: var(--paper-ink);
  font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .4s ease, transform var(--mid) var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  :root { --gutter: 40px; }
  .band { padding-top: 68px; }
  .badge-spin { width: 132px; height: 132px; right: max(var(--gutter), calc((100vw - 1078px) / 2 + var(--gutter))); }
}

/* ─── Доступность ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ─── Программа внутри «Эфира» ─── */
.program { margin-top: 56px; }
.poll.is-closed .poll-opt { cursor: default; opacity: .55; }

/* ─── Прогнозы ─── */
.preds { margin-top: 56px; }
.preds .whisper { margin-bottom: 8px; }
.pred-list { list-style: none; margin-top: 22px; border-top: 1px solid var(--hair); }
.pred { padding: 20px 0; border-bottom: 1px solid var(--hair); }
.pred-q { display: flex; gap: 12px; align-items: baseline; font-size: 18px; line-height: 1.3; margin-bottom: 14px; }
.pred-q .mono { color: var(--felt); font-size: 13px; }
.pred .chips { gap: 6px; }
.pred .chip { min-height: 38px; padding: 0 13px; font-size: 13px; }
.pred.is-locked .chip:not(.is-on) { opacity: .45; }
.pred-dist { margin-top: 12px; font-size: 13px; color: var(--felt); }
.pred-dist b { color: var(--paper); font-weight: 500; }
.pred-verdict { margin-top: 10px; font-size: 13px; }
.pred-verdict.is-right { color: #5BE38E; }
.pred-verdict.is-wrong { color: #FF8A8A; }
.pred-result {
  margin-top: 22px; padding: 20px 18px;
  border: 1px solid var(--hair-strong);
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(108,77,255,.35), transparent 70%),
    var(--inkstone);
}
.pred-result .label { margin-bottom: 6px; }
.pred-rank { font-weight: 300; font-size: clamp(30px, 9vw, 44px); line-height: 1.05; letter-spacing: -.02em; }
.pred-score { margin-top: 8px; color: var(--felt); font-size: 14px; }

/* ─── Свои ─── */
.fr-empty { margin-top: 28px; padding: 22px 18px; border: 1px dashed var(--hair-strong); display: grid; gap: 14px; }
.fr-empty .pill { justify-self: start; }
.fr-me {
  margin-top: 28px; padding: 18px 18px 16px;
  display: grid; gap: 2px;
  background: var(--paper); color: var(--paper-ink);
  border-top: 4px solid var(--myfac, var(--accent));
}
.fr-me .label { margin: 0; color: var(--paper-mute); }
.fr-num { font-weight: 500; font-size: clamp(56px, 18vw, 84px); line-height: 1; letter-spacing: .02em; color: var(--myfac, var(--accent)); }
.fr-num small { font-size: .26em; font-weight: 400; color: var(--paper-mute); letter-spacing: 0; margin-right: 2px; }
.fr-me-sub { font-size: 13px; color: var(--paper-mute); }
.fr-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }
.fr-input {
  min-width: 0; width: 100%;
  min-height: 56px; padding: 0 16px;
  background: transparent; color: var(--paper);
  border: 1px solid var(--hair-strong); border-radius: 0;
  font-size: 26px; letter-spacing: .3em;
}
.fr-input:focus { outline: none; border-color: var(--paper); }
.fr-input::placeholder { color: rgba(255,255,255,.2); }
.fr-hint { min-height: 1.4em; margin-top: 8px; }
.fr-hint.is-ok { color: #5BE38E; }
.fr-block { margin-top: 36px; }
.fr-block-head { display: flex; justify-content: space-between; align-items: baseline; }
.fr-block-head .label { margin-bottom: 12px; }
.fr-block-head .mono { color: var(--felt); font-size: 13px; }
.fr-facs { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fr-fac {
  position: relative; aspect-ratio: 3 / 2;
  display: flex; align-items: flex-end; padding: 8px 10px;
  border: 1px solid var(--hair);
  font-size: 15px; color: var(--felt);
  overflow: hidden;
  transition: color .6s ease, border-color .6s ease;
}
.fr-fac::before { content: ""; position: absolute; inset: 0; background: var(--liq); opacity: 0; transition: opacity 1s var(--ease); }
.fr-fac span { position: relative; }
.fr-fac.is-on { color: #fff; border-color: transparent; }
.fr-fac.is-on::before { opacity: 1; }
.fr-board { margin-top: 12px; }

/* ─── Оракул ─── */
.orb-wrap { display: grid; place-items: center; margin: 34px 0 26px; }
.orb {
  position: relative;
  width: min(72vw, 300px); aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-items: center;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: transform .8s var(--ease);
}
.orb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.orb::after {
  /* стеклянный блик */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(40% 30% at 32% 24%, rgba(255,255,255,.55), transparent 70%),
              radial-gradient(70% 70% at 50% 50%, transparent 60%, rgba(10,10,12,.55));
  pointer-events: none;
}
.orb-ring { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); transform: rotate(-90deg); pointer-events: none; }
.orb-ring circle { fill: none; stroke: var(--paper); stroke-width: .8; stroke-dasharray: 302; stroke-dashoffset: calc(302 * (1 - var(--p, 0))); opacity: .8; }
.orb-label { position: relative; z-index: 1; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.9); transition: opacity .4s ease; }
.orb.is-holding { transform: scale(.96); }
.orb.is-holding .orb-label { opacity: 0; }
.orb.is-done { animation: orb-flash .9s var(--ease); }
@keyframes orb-flash { 30% { transform: scale(1.06); filter: brightness(1.6); } }

.omen { display: grid; gap: 14px; animation: rise-omen 1.25s var(--ease) both; }
@keyframes rise-omen { from { opacity: 0; transform: translateY(24px); } }
.omen-card {
  position: relative;
  padding: 22px 18px 18px;
  background: var(--paper); color: var(--paper-ink);
  /* отрывной край сверху — как у талона */
  -webkit-mask: radial-gradient(circle 5px at 8px 0, transparent 98%, #000) -8px 0 / 16px 100% repeat-x;
  mask: radial-gradient(circle 5px at 8px 0, transparent 98%, #000) -8px 0 / 16px 100% repeat-x;
}
.omen-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--paper-ink); }
.omen-no { font-size: 13px; color: var(--accent-ink); }
.omen-text { margin: 18px 0 10px; font-weight: 300; font-size: clamp(24px, 7vw, 32px); line-height: 1.18; letter-spacing: -.01em; }
.omen-foot { display: flex; justify-content: space-between; align-items: flex-end; }
.omen-foot .field-label { line-height: 1.35; }
.omen-stamp { width: 92px; height: 92px; color: var(--accent-ink); mix-blend-mode: multiply; transform: rotate(-12deg); opacity: .9; }
.omen.is-new .omen-stamp { animation: seal .5s .7s var(--ease-thud) both; --rot: -12deg; }
.omen-actions { display: grid; gap: 10px; }

/* ─── Статус связи ─── */
.net-status {
  position: fixed; left: 50%; z-index: 55;
  top: calc(12px + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -20px);
  max-width: calc(100% - 2 * var(--gutter));
  padding: 10px 18px; border-radius: 75px;
  background: var(--accent); color: var(--paper);
  font-size: 13px; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .4s ease, transform var(--mid) var(--ease);
}
.net-status.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ─── Бинго первокурсника ─── */
.bingo-block { margin-top: 64px; padding-top: 36px; border-top: 1px solid var(--hair); }
.bingo-block .whisper { margin-bottom: 10px; }
.bingo { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 22px; max-width: 520px; }
.bingo-cell {
  position: relative;
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: flex-end;
  padding: 10px;
  border: 1px solid var(--hair-strong);
  font-size: 12.5px; line-height: 1.25; text-align: left;
  color: rgba(255,255,255,.85);
  overflow: hidden;
  transition: background-color .5s var(--ease), border-color .5s var(--ease), color .5s var(--ease);
}
.bingo-cell svg {
  position: absolute; right: 6px; top: 6px; width: 44%;
  color: var(--paper); opacity: 0; transform: rotate(-20deg) scale(1.8);
  transition: opacity .2s ease, transform .35s var(--ease-thud);
}
.bingo-cell.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bingo-cell.is-on svg { opacity: .95; transform: rotate(-10deg) scale(1); }
.bingo-cell.is-line { background: var(--paper); border-color: var(--paper); color: var(--paper-ink); }
.bingo-cell.is-line svg { color: var(--accent-ink); }
.bingo-cell.is-free { cursor: default; }

/* ─── Мини-билеты знакомых ─── */
.fr-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fr-mini {
  position: relative;
  display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  padding: 14px 10px 10px;
  background: var(--paper); color: var(--paper-ink);
  border-top: 4px solid var(--fac);
  animation: fade .8s var(--ease);
}
.fr-mini-photo {
  width: 40px; aspect-ratio: 3 / 4;
  display: grid; place-items: center;
  background: var(--liq); color: #fff;
  font-size: 15px; font-weight: 300;
}
.fr-mini b { display: block; font-weight: 500; font-size: 15px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-mini span { font-size: 11px; color: var(--paper-mute); }
.fr-mini .mono { display: block; margin-top: 2px; font-size: 11px; color: var(--fac); }
.fr-none { grid-column: 1 / -1; color: var(--felt); font-size: 14px; padding: 14px 0; border-top: 1px solid var(--hair); }
.fr-mini .fr-mini-photo { font-size: 15px; color: #fff; text-shadow: 0 1px 8px rgba(10,10,12,.4); }
.omen-sub { font-size: 15px; line-height: 1.4; color: var(--paper-mute); margin-bottom: 14px; }
.omen-item { font-family: var(--f-hand); font-weight: 700; font-size: 26px; line-height: 1.1; color: var(--accent-ink); padding: 10px 0 14px; margin-bottom: 14px; border-top: 1px dashed rgba(10,10,12,.25); border-bottom: 1px dashed rgba(10,10,12,.25); }
.mark { cursor: pointer; }

/* ─── Восстановление билета ─── */
.restore { display: grid; gap: 10px; margin-top: 4px; }
.restore-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.restore .fr-input { font-size: 22px; letter-spacing: .2em; }
.tk-pin { margin-top: 12px; font-size: 12px; color: var(--paper-mute); }
.tk-pin b { font-weight: 500; font-size: 15px; color: var(--paper-ink); letter-spacing: .1em; margin: 0 6px; }
.tk-pin span { font-family: var(--f-sans); font-size: 11px; }
