@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-cyrillic-wght-normal.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: 'Unbounded'; src: url('/fonts/unbounded-cyrillic-wght-normal.woff2') format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; src: url('/fonts/unbounded-latin-wght-normal.woff2') format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }

:root {
  --bg: #0b0a0f;
  --ink: #f5f2ed;
  --dim: #9a95a4;
  --glass: rgba(255, 255, 255, .05);
  --glass-2: rgba(255, 255, 255, .09);
  --edge: rgba(255, 255, 255, .08);
  --accent: #ff7a50;
  --accent-2: #ffc26b;
  --on: #1b0e08;
  --glow: rgba(255, 122, 80, .35);
  --beat: 0;
  --display: 'Unbounded', system-ui, sans-serif;
  /* шкала размеров: чётный шаг от базовых 16px, мельче 14px на телефоне не читается */
  --fs-cell: 12px; /* только клетки карточки: 3 в ряд, ширина около 100px */
  --fs-xs: 14px;
  --fs-s: 16px;
  --fs-m: 18px;
  --fs-l: 20px;
  --fs-h: clamp(24px, 7vw, 32px);
  --pad: 10px;
  --box: 11px;
  color-scheme: dark;
}

/* на телефоне поля страницы узкие, на большом экране дышат */
@media (min-width: 480px) { :root { --pad: 20px; --box: 16px; } }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 var(--fs-s)/1.5 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.i { width: 20px; height: 20px; flex: none; }
#app { position: relative; z-index: 1; }

/* ---------- Кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 0; min-height: 54px; padding: 0 16px;
  border-radius: 16px;
  font-weight: 700; font-size: var(--fs-s);
  transition: transform .15s, filter .2s, background .2s;
}
.btn span { white-space: nowrap; }
.btn:active { transform: scale(.97); }
.main { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on); box-shadow: 0 12px 30px -12px var(--glow); }
.main:hover { filter: brightness(1.06); }
.soft { background: var(--glass); border: 1px solid var(--edge); }
.soft:hover { background: var(--glass-2); }
.round {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--glass); border: 1px solid var(--edge);
}
.round.ghost { visibility: hidden; }
.actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
@media (max-width: 360px) { .actions .i { display: none; } }

/* ---------- Полка ---------- */
.shelf {
  max-width: 460px; min-height: 100dvh; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) var(--pad) max(20px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: auto; }
.brand b { display: block; font: 700 var(--fs-l)/1.1 var(--display); letter-spacing: -.01em; }
.brand small { color: var(--dim); font-size: var(--fs-xs); }
/* маленькая пластинка: логотип и пластинка в конверте — как большая в игре */
.mark, .stack .disc {
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #0b0a0f 0 5%, transparent 5.5%),
    radial-gradient(circle closest-side, var(--accent) 0 40%, #111 41% 44%, transparent 44.5%),
    conic-gradient(from 20deg, transparent 0 8%, rgba(255, 255, 255, .12) 13%, transparent 20% 55%, rgba(255, 255, 255, .08) 62%, transparent 70%),
    repeating-radial-gradient(circle closest-side, #16141b 0 2%, #26232d 2% 4%);
  box-shadow: 0 6px 16px -6px #000, inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.mark { display: block; flex: none; width: 42px; height: 42px; --accent: #ff7a50; }
.shelf h1 { font: 700 var(--fs-h)/1.1 var(--display); letter-spacing: -.02em; }
/* главный вход в игру: крупнее обычной кнопки и со свечением */
.quiz { min-height: 64px; margin-top: 12px; font: 700 var(--fs-l)/1 var(--display); letter-spacing: -.01em;
  box-shadow: 0 18px 42px -16px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .25); }
.quiz .i { width: 24px; height: 24px; }
.or { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: var(--fs-xs);
  font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--edge); }
.sleeves { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.sleeve {
  display: grid; grid-template-columns: 72px 1fr; column-gap: 30px; align-items: center;
  padding: 10px;
  cursor: pointer;
  border-radius: 22px;
  background: var(--glass); border: 1px solid var(--edge);
  animation: rise .5s cubic-bezier(.2, .7, .3, 1) both;
  transition: background .2s, border-color .2s;
}
.sleeve:nth-child(2) { animation-delay: .06s; }
.sleeve:nth-child(3) { animation-delay: .12s; }
.sleeve:hover { background: var(--glass-2); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.sleeve-link { display: contents; }
.stack { position: relative; grid-row: 1 / 3; width: 72px; height: 72px; }
/* стопка конвертов: две задние обложки сдвинуты влево-вверх, из передней выглядывает пластинка */
.stack i, .stack .disc { position: absolute; inset: 0; transition: transform .45s cubic-bezier(.3, .7, .2, 1); }
.stack i::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--img) center / cover; opacity: 0; transition: opacity .7s ease; }
.stack i.on::after { opacity: 1; }
.stack i {
  border-radius: 6px;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #120d18)) center / cover;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.stack .c3 { transform: translate(-5px, -5px) rotate(-7deg) scale(.94); filter: brightness(.5); }
.stack .c2 { transform: translate(-2px, -2px) rotate(-3deg) scale(.97); filter: brightness(.72); }
.stack .disc { inset: 5%; transform: translateX(27%); }
.sleeve:hover .stack .disc { transform: translateX(36%) rotate(120deg); }
.sleeve:hover .stack .c3 { transform: translate(-7px, -7px) rotate(-10deg) scale(.94); }
.info { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-self: end; }
.info b { font: 700 var(--fs-m)/1.2 var(--display); letter-spacing: -.01em; }
.info small { color: var(--dim); font-size: var(--fs-xs); line-height: 1.35; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-self: start; }
.tag { padding: 3px 9px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.tag.dim { color: var(--dim); background: var(--glass-2); }

/* ---------- Дека ---------- */
.deck {
  max-width: 460px; height: 100dvh; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) var(--pad) 0;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}
.deck.loading { align-items: center; justify-content: center; gap: 16px; padding-bottom: 24px; text-align: center; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--glass-2); border-top-color: var(--accent); animation: turn .8s linear infinite; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.counter { display: flex; align-items: center; gap: 8px; }
.counter b { font: 800 28px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.counter span { text-align: left; font-size: var(--fs-xs); line-height: 1.25; color: var(--dim); }
.hud-title { font: 700 var(--fs-m)/1.2 var(--display); }
.counter em { display: block; font-style: normal; }
.score {
  height: 42px; padding: 0 14px 0 11px;
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 99px;
  /* та же капсула, что и круглая кнопка рядом: высота, рамка, толщина контура */
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  font: 700 var(--fs-m)/1 var(--display);
  transition: box-shadow .3s;
}
.score .i { width: 18px; height: 18px; stroke-width: 2.6; }
@media (max-width: 360px) {
  .hud { gap: 6px; }
  .hud .round { width: 38px; height: 38px; }
  .score { height: 38px; padding: 0 11px 0 9px; }
}
.strip { display: flex; gap: 2px; height: 5px; }
.strip i { flex: 1; border-radius: 2px; background: var(--glass-2); transition: background .3s; }
.strip .hit { background: var(--accent); }
.strip .miss { background: color-mix(in srgb, var(--ink) 28%, transparent); }
.strip .cur { background: var(--ink); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

.stage { flex: 1; min-height: 0; display: grid; place-items: center; container-type: size; }
.turntable {
  --d: min(340px, 80cqw, 100cqh / 1.22);
  position: relative; width: var(--d); aspect-ratio: 1;
  display: grid; place-items: center;
}
.viz { position: absolute; inset: -12%; width: 124%; height: 124%; pointer-events: none; }
.arc { position: absolute; inset: 0; transform: rotate(-90deg); }
.arc circle { fill: none; stroke-width: 2.4; stroke: var(--glass-2); }
#arc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 6px var(--glow)); }
.play {
  position: relative;
  width: 86%; aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-items: center;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  outline: none;
  scale: calc(1 + var(--beat) * .035);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9), 0 0 calc(var(--beat) * 70px) color-mix(in srgb, var(--accent) 45%, transparent);
}
.play:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.vinyl {
  position: absolute; inset: 0; border-radius: 50%; clip-path: circle(50%);
  background:
    radial-gradient(circle closest-side, var(--accent) 0 48%, #111 48.5% 52%, transparent 52.5%),
    repeating-radial-gradient(circle, #19171f 0 2px, #1f1c26 2px 4px);
  /* крутится всегда, на паузе просто замирает — без возврата в исходное положение */
  animation: turn 3.2s linear infinite paused;
}
.play::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 10%, rgba(255, 255, 255, .07) 16%, transparent 24% 60%, rgba(255, 255, 255, .05) 66%, transparent 74%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  pointer-events: none;
}
.spindle { position: relative; z-index: 2; width: 4%; aspect-ratio: 1; border-radius: 50%; background: #0b0a0f; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .15); }
.on .vinyl { animation-play-state: running; }
.arm {
  position: absolute; z-index: 2; top: -6%; right: -9%; width: 24%;
  transform-origin: 73% 9%; transform: rotate(-10deg);
  transition: transform .8s cubic-bezier(.3, .7, .3, 1);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6));
  pointer-events: none;
}
.arm circle:first-child { fill: #2a2733; stroke: rgba(255, 255, 255, .15); }
.arm circle + circle { fill: var(--accent); }
.arm path { fill: none; stroke: #cfc9d8; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.arm rect { fill: #3a3644; stroke: rgba(255, 255, 255, .2); }
.on .arm { transform: rotate(17deg); }

.panel {
  margin: 0 calc(-1 * var(--pad));
  padding: 14px var(--pad) max(16px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  border-top: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  display: flex; flex-direction: column; gap: 12px;
}
.timeline { display: flex; align-items: center; gap: 14px; }
.track { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toggle {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on);
  box-shadow: 0 10px 24px -10px var(--glow);
  transition: transform .15s;
}
.toggle svg { width: 22px; height: 22px; }
.toggle:active { transform: scale(.94); }
.times { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--dim); font-variant-numeric: tabular-nums; margin-top: -2px; align-items: center; }
/* цена трека по шкале: засечки на 5 и 15 секундах, над зонами — сколько очков */
.marks { position: relative; height: 14px; font-variant-numeric: tabular-nums; }
.marks i { position: absolute; bottom: 0; width: 2px; height: 8px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 45%, transparent); }
.marks .m1 { left: var(--m1); }
.marks .m2 { left: var(--m2); }
.marks b { position: absolute; top: 0; transform: translateX(-50%); font: 700 var(--fs-xs)/1 var(--display); color: var(--dim); }
.marks .z1 { left: var(--z1); }
.marks .z2 { left: var(--z2); }
.marks .z3 { left: var(--z3); }
/* подсвечена та цена, которая идёт прямо сейчас */
.marks[data-zone="3"] .z1, .marks[data-zone="2"] .z2, .marks[data-zone="1"] .z3 { color: var(--accent); transform: translateX(-50%) scale(1.25); }
.marks.short .m2, .marks.short .z3 { display: none; }
.seek { --p: 0%; width: 100%; height: 22px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p), var(--glass-2) var(--p)); }
.seek::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p), var(--glass-2) var(--p)); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--glow); }
.seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--glow); }
.err { color: #ff8b8b; font-size: var(--fs-xs); text-align: center; }
.err:empty { display: none; }

.ticket { display: grid; perspective: 900px; }
.face {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 92px; max-height: calc(15px * 1.45 * 4 + 44px);
  padding: 12px 16px;
  border-radius: 18px;
  overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  scrollbar-width: thin; scrollbar-color: var(--glass-2) transparent;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .45s cubic-bezier(.3, .7, .3, 1);
}
/* длинная подсказка прокручивается, низ гаснет, пока не долистали */
.face.scrolls:not(.end) { -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.face small { font-size: var(--fs-xs); font-weight: 700; color: var(--accent); }
.face p { font-size: var(--fs-s); line-height: 1.45; }
.front { background: rgba(0, 0, 0, .22); border: 1px dashed var(--edge); }
.back {
  transform: rotateX(180deg);
  flex-direction: row; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, #15121b), color-mix(in srgb, var(--accent-2) 14%, #15121b));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.back > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.back:not(:has(.art)) > div { align-items: center; text-align: center; }
.back p { font: 700 var(--fs-m)/1.3 'Manrope', sans-serif; text-wrap: pretty; }
.art { width: 64px; height: 64px; flex: none; border-radius: 10px; box-shadow: 0 8px 18px -8px #000; }
.flipped .front { transform: rotateX(-180deg); }
.flipped .back { transform: rotateX(0); }
/* скрытая сторона билета не перехватывает касания */
.ticket:not(.flipped) .back, .flipped .front { pointer-events: none; }

/* ---------- Карточка лото ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; }
.cell {
  aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 9px;
  font: 600 var(--fs-xs)/1 var(--display); color: var(--dim);
  background: var(--glass); border: 1px solid var(--edge);
  position: relative;
}
.cell.hit { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on); border-color: transparent; }
.cell.miss { color: color-mix(in srgb, var(--dim) 60%, transparent); }
.cell.miss::after { content: ''; position: absolute; inset: 22%; background: linear-gradient(to top right, transparent calc(50% - 1px), currentColor 0 calc(50% + 1px), transparent 0); }
.cell.cur { color: var(--ink); border-color: var(--ink); animation: blink 1.2s ease-in-out infinite; }

.sub { color: var(--dim); font-size: var(--fs-s); }
@keyframes fade { from { opacity: 0; } }

/* ---------- Финал ---------- */
.finale { gap: 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.total { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-top: auto; }
.big { display: flex; align-items: baseline; gap: 8px; }
.big b { font: 800 clamp(72px, 24vw, 110px)/.9 var(--display); letter-spacing: -.05em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big span { font: 600 var(--fs-l)/1 var(--display); color: var(--dim); }
.total h1 { font: 700 var(--fs-h)/1.15 var(--display); letter-spacing: -.02em; }
.total .sub { margin: 0; }
.finale .grid { margin-bottom: auto; }
/* карточка большой партии прокручивается, кнопки остаются на месте */
.finale .grid { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ---------- Эффекты ---------- */
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.bgfx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .8s; }
.edges {
  position: fixed; inset: 0; z-index: 8; pointer-events: none;
  opacity: 0; transition: opacity .6s;
  box-shadow:
    inset 0 0 calc(12px + var(--beat) * 70px) calc(var(--beat) * 10px) color-mix(in srgb, var(--accent) 60%, transparent),
    inset 0 0 calc(4px + var(--beat) * 20px) 0 color-mix(in srgb, var(--accent-2) 60%, transparent);
}
body::before {
  content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 35% at 50% 45%, var(--accent), transparent 70%);
  opacity: 0; filter: blur(40px);
  transition: opacity .08s linear;
}
body.playing::before { opacity: calc(.05 + var(--beat) * .28); }
body.playing .bgfx, body.playing .edges { opacity: 1; }
body.flash::after {
  content: ''; position: fixed; inset: 0; z-index: 9; pointer-events: none;
  background: radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%);
  animation: flash .7s ease-out forwards;
}
@keyframes flash { to { opacity: 0; } }
.note {
  position: fixed; z-index: 10; pointer-events: none;
  color: var(--accent); text-shadow: 0 0 12px var(--glow);
  animation: float 1.4s cubic-bezier(.2, .7, .3, 1) forwards;
}
.note:nth-child(odd) { color: var(--accent-2); }
@keyframes float {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  15% { opacity: 1; }
  to { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bgfx, .edges { display: none; }
}
@media (max-height: 620px) {
  .shelf { gap: 14px; }
  .face { min-height: 76px; max-height: calc(15px * 1.45 * 3 + 44px); }
}
@media (max-width: 350px) {
  .stack { width: 64px; height: 64px; }
  .sleeve { grid-template-columns: 64px 1fr; column-gap: 26px; }
  .tag { font-size: var(--fs-xs); padding: 3px 8px; }
}

/* Очки, серия, рекорд */
.worth { font-weight: 700; color: var(--accent); }
.score.hot { color: var(--on); background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; box-shadow: 0 0 18px var(--glow); animation: hot 1s ease-in-out infinite alternate; }
@keyframes hot { to { box-shadow: 0 0 30px var(--accent); } }
.rec { color: var(--accent); }
.toast {
  position: fixed; left: 50%; top: 38%; z-index: 12; pointer-events: none;
  padding: 12px 22px; border-radius: 99px;
  font: 800 22px/1 var(--display); letter-spacing: -.02em; white-space: nowrap;
  color: var(--on); background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 40px -8px var(--glow);
  animation: pop-toast 1.6s cubic-bezier(.2, .8, .3, 1.2) forwards;
}
@keyframes pop-toast {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  30% { transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(.95); }
}

/* Обложка на этикетке после ответа */
.label {
  position: absolute; z-index: 1; inset: 26%; border-radius: 50%;
  overflow: hidden; clip-path: circle(50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .5);
}
/* картинка отдельным слоем: до ответа размыта до цветовых пятен, после — чёткая; круг этикетки не меняется */
.label::before {
  content: ''; position: absolute; inset: -20%;
  background: var(--img) center / cover no-repeat;
  filter: blur(12px) saturate(1.5);
  transition: filter .8s ease, inset .8s ease;
}
.label.open::before { inset: 0; filter: none; animation: unblur .8s ease both; }
@keyframes unblur { from { inset: -20%; filter: blur(12px) saturate(1.5); } }

/* Смена трека: новая пластинка опускается на проигрыватель */
.enter .play { animation: drop .6s cubic-bezier(.2, .8, .3, 1.1) both; }
@keyframes drop { from { opacity: 0; transform: translateY(-14%) scale(.86) rotate(-40deg); } }

/* Настройка партии на полке */
.setting { display: flex; flex-direction: column; gap: 8px; }
.setting > span { font-size: var(--fs-xs); font-weight: 700; color: var(--dim); }
.tag.reset { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); background: var(--glass-2); }
.tag.reset .i { width: 12px; height: 12px; stroke-width: 2.6; }
.tag.reset:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--glass); border: 1px solid var(--edge); }
.picker button { min-height: 38px; border-radius: 10px; font-size: var(--fs-s); font-weight: 700; color: var(--dim); transition: background .2s, color .2s; }
.picker [aria-checked="true"] { color: var(--on); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.count { font-style: normal; white-space: nowrap; color: color-mix(in srgb, var(--accent) 80%, var(--dim)); font-weight: 700; }

/* ---------- Боковое меню ---------- */
.menu-btn { margin-left: auto; }
.brand-link { display: flex; align-items: center; gap: 12px; min-width: 0; }
.side-panel > a.on { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.side-panel > a.on b { color: var(--accent); }
.side { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.side-veil { position: absolute; inset: 0; background: rgba(5, 4, 8, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .35s; }
.side-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 360px);
  display: flex; flex-direction: column; gap: 10px;
  padding: max(20px, env(safe-area-inset-top)) var(--pad) max(20px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), #0e0c12;
  border-left: 1px solid var(--edge);
  box-shadow: -40px 0 90px -30px rgba(0, 0, 0, .8);
  transform: translateX(105%); transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.side-panel::before {
  content: ''; position: absolute; left: -1px; top: 14%; bottom: 14%; width: 2px; border-radius: 2px;
  background: linear-gradient(transparent, var(--accent), var(--accent-2), transparent); box-shadow: 0 0 22px var(--glow);
}
.side-panel header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.side-panel header b { font: 700 var(--fs-l)/1.1 var(--display); letter-spacing: -.01em; }
.side-panel header .round { margin-left: auto; }
.side-panel > a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--edge);
  opacity: 0; transform: translateX(28px);
  transition: opacity .45s, transform .45s cubic-bezier(.2, .8, .2, 1), background .2s, border-color .2s;
  transition-delay: calc(.1s + var(--i) * .06s), calc(.1s + var(--i) * .06s), 0s, 0s;
}
.side-panel > a:hover { background: var(--glass-2); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.side-panel > a b { display: block; font-weight: 700; font-size: var(--fs-m); }
.side-panel > a small { color: var(--dim); font-size: var(--fs-xs); }
.side-panel > a .i { color: var(--accent); flex: none; }
.side-panel footer { margin-top: auto; text-align: center; font-size: var(--fs-xs); color: var(--dim); }
.side-panel footer a { color: var(--ink); font-weight: 700; }
.menu-open .side { pointer-events: auto; }
.menu-open .side-veil { opacity: 1; }
.menu-open .side-panel { transform: none; }
.menu-open .side-panel > a { opacity: 1; transform: none; }
