/*
 * Киоск-чекин для родителей. Дизайн-система перенесена из kursor-quiz:
 * ink #0F0F0F · CTA-градиент #FACC15→#F97316 · синий #007AFF · коралл #FF8562 ·
 * Montserrat · радиус 16px · пунктирная сетка фона · анимация rise.
 * Планшет = пальцы: все тач-таргеты ≥ 48px (кнопки 64–76px).
 * Все анимации — только transform/opacity, чтобы держать 60fps.
 */

:root {
  --ink: #0f0f0f;
  --paper: #ffffff;
  --cloud: #fafafa;
  --blue: #007aff;
  --blue-dark: #0063d1;
  --blue-soft: #eaf4ff;
  --orange: #f97316;
  --orange-soft: #fff4ec;
  --amber: #facc15;
  --accent: #ff8562;
  --accent-soft: #fff1ec;
  --accent-dark: #e05a33;
  --muted: #939393;
  --good: #1d9e75;
  --good-soft: #e7f6ef;
  --bad: #f95d51;
  --pink: #ff7ab8;
  --pink-soft: #ffeef7;
  --radius: 16px;
  --cta-grad: linear-gradient(90deg, #facc15 0%, #f97316 100%);
  --shadow-card: 0 10px 30px rgba(15, 15, 15, 0.08);
  --ease-pop: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 500 18px/1.5 Montserrat, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  /* та же широкая пунктирная сетка, что в квизе и на kursor.school */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='92'%3E%3Cpath d='M91.5 0V92' stroke='%230F0F0F' stroke-opacity='0.13' stroke-dasharray='3 3'/%3E%3Cpath d='M0 91.5H92' stroke='%230F0F0F' stroke-opacity='0.13' stroke-dasharray='3 3'/%3E%3C/svg%3E");
  background-size: 92px 92px;
  touch-action: manipulation;         /* без double-tap-zoom */
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;                   /* киоск: скроллится только контент экрана */
}

/* ------------------------------------------------------------- каркас */

#kiosk {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) 28px 10px;
  min-height: 64px;
}

.wordmark {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.wordmark .dot { color: var(--accent); }

.topbar .side { min-width: 120px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.topbar .side.left { justify-content: flex-start; }

.step-count {
  font: 600 15px/1 "JetBrains Mono", ui-monospace, Consolas, monospace;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.demo-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

/* прогресс анкеты — как в квизе: полоска с CTA-градиентом + кружок с подарком */
.progress-wrap {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 28px 6px;
}
.progress-wrap.on { display: flex; }

.progress {
  height: 10px;
  flex: 1;
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.1);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--cta-grad);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.5s var(--ease-pop);
  will-change: transform;
}

.progress-gift {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid rgba(15, 15, 15, 0.15);
  background: var(--paper);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: rgba(15, 15, 15, 0.35);
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease-pop);
}
.progress-gift.lit {
  border-color: var(--orange);
  background: var(--orange-soft);
  transform: scale(1.08);
}

/* ------------------------------------------------------------- экраны */

#stage {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 32px calc(28px + env(safe-area-inset-bottom));
  will-change: transform, opacity;
}

.screen-inner {
  width: 100%;
  max-width: 640px;
  margin: auto;               /* вертикальное центрирование коротких экранов */
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.screen-inner.wide { max-width: 1180px; }

/* переходы экранов: входящий поднимается (rise из квиза), уходящий растворяется */
.screen.enter { animation: screen-in 0.42s var(--ease-pop) both; }
.screen.leave { animation: screen-out 0.24s ease both; pointer-events: none; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes screen-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-18px); }
}

/* каскад появления детей экрана */
.rise   { animation: screen-in 0.42s var(--ease-pop) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.12s; }
.rise-3 { animation-delay: 0.19s; }
.rise-4 { animation-delay: 0.26s; }

/* --------------------------------------------------------- типографика */

h1 {
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  text-align: center;
}

.sub {
  font-size: clamp(18px, 2.2vw, 23px);
  color: rgba(15, 15, 15, 0.66);
  text-align: center;
  margin: 0 0 8px;
  line-height: 1.45;
}

.hero-emoji {
  font-size: clamp(56px, 8vw, 84px);
  text-align: center;
  margin-bottom: 18px;
  line-height: 1;
}

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

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  color: inherit;
  background: none;
  padding: 0;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  padding: 16px 28px;
  border-radius: var(--radius);
  font-size: 21px;
  font-weight: 700;
  transition: transform 0.15s var(--ease-pop), filter 0.15s, opacity 0.15s;
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn-cta {
  background: var(--cta-grad);
  color: #fff;
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.32);
}
.btn-cta:active { filter: brightness(1.06); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  min-height: 56px;
}
.btn-outline {
  background: var(--paper);
  border: 2px solid rgba(15, 15, 15, 0.85);
  color: var(--ink);
}

/* пульс главной кнопки на экране приветствия */
.btn-pulse { animation: btn-pulse 2.4s ease-in-out infinite 1s; }
@keyframes btn-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}

/* --------------------------------------------------- плашки-ответы (как в квизе) */

.chips { display: grid; gap: 14px; margin-top: 26px; }
.chips.cols-2 { grid-template-columns: 1fr 1fr; }

.chip {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 2.5px solid rgba(15, 15, 15, 0.1);
  background: var(--paper);
  font-size: 21px;
  font-weight: 600;
  text-align: left;
  transition: transform 0.16s var(--ease-pop), border-color 0.16s, background 0.16s;
  will-change: transform;
}
.chip:active { transform: scale(0.97); }
.chip.on {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.chip .chip-label { flex: 1; }
.chip .chip-emoji { font-size: 30px; line-height: 1; }

.chip .chip-radio {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid rgba(15, 15, 15, 0.25);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  flex: 0 0 auto;
  transition: background 0.16s, border-color 0.16s, transform 0.16s var(--ease-pop);
}
.chip.on .chip-radio {
  border-color: var(--blue);
  background: var(--blue);
  transform: scale(1.1);
}

/* очередь детей: уже выбравший — приглушён, с бейджем выбора */
.chip.chip-done {
  opacity: 0.6;
  pointer-events: none;
  background: var(--good-soft);
  border-color: rgba(29, 158, 117, 0.35);
}
.chip .chip-picked {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--good);
  white-space: nowrap;
}

/* маленькие круглые чипы возраста */
.age-chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }
.age-chip {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2.5px solid rgba(15, 15, 15, 0.12);
  background: var(--paper);
  font-size: 24px;
  font-weight: 700;
  transition: transform 0.15s var(--ease-pop), border-color 0.15s, background 0.15s;
}
.age-chip:active { transform: scale(0.94); }
.age-chip.on { border-color: var(--blue); background: var(--blue-soft); }

/* переключатель языка */
.lang-switch {
  display: inline-flex;
  margin: 0 auto 30px;
  border: 2px solid rgba(15, 15, 15, 0.12);
  border-radius: 999px;
  padding: 5px;
  background: var(--paper);
}
.lang-switch button {
  min-width: 96px;
  min-height: 48px;
  padding: 8px 22px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
.lang-switch button.on {
  background: var(--ink);
  color: #fff;
}

/* ------------------------------------------------------- экран кода */

.code-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  gap: 44px;
  align-items: center;
  width: 100%;
  max-width: 1020px;
  margin: auto;
}
/* правая колонка должна умещаться в планшетные 800px вместе с шапкой */
.code-pane h1 { font-size: clamp(22px, 2.5vw, 30px); margin-bottom: 10px; }
.code-pane .code-display { min-height: 64px; font-size: 30px; }
.code-pane .numpad { margin-top: 14px; }
.code-pane .numpad .key { min-height: 62px; font-size: 25px; }
.code-pane .btn { min-height: 60px; margin-top: 14px; }

/* ------- макет фирменного билета: копия документа из WhatsApp, свой CSS ------- */

.ticket-wrap { display: flex; flex-direction: column; gap: 18px; }

.ticket {
  width: 100%;
  max-width: 412px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background: #faf3ea;
  box-shadow: 0 22px 60px rgba(15, 15, 15, 0.22);
}

/* тёмный верх со слоганом и оранжевой волной */
.ticket-top {
  position: relative;
  overflow: hidden;
  padding: 18px 22px 26px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 80% 10%, rgba(90, 80, 140, 0.55) 0%, transparent 55%),
    linear-gradient(135deg, #37324b 0%, #262133 48%, #17141f 100%);
}
.tt-brand { font-size: 19px; font-weight: 800; letter-spacing: 0.08em; }
.tt-pix {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0 8px 4px;
  background: #fff;
  box-shadow: 4px -4px 0 0 rgba(255, 255, 255, 0.85), 8px 0 0 0 rgba(255, 255, 255, 0.55);
}
.tt-brand small {
  display: block;
  margin-top: 3px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}
.tt-slogan {
  position: relative;
  z-index: 2;
  margin-top: 22px;
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.01em;
}
.tt-glyph {
  position: absolute;
  color: #fff;
  opacity: 0.13;
  font: 700 26px/1 "JetBrains Mono", ui-monospace, monospace;
}
.tt-g1 { top: 36%; right: 13%; }
.tt-g2 { top: 56%; right: 6%; font-size: 21px; }
.tt-wave {
  position: absolute;
  right: -46px;
  bottom: -78px;
  width: 240px;
  height: 170px;
  background: linear-gradient(135deg, #fb923c 0%, #f97316 70%);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: rotate(-9deg);
}

/* кремовый низ */
.ticket-bottom { padding: 15px 22px 18px; color: #161616; }
.tb-doc {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.tb-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8f8a83;
}
.ticket-bottom > .tb-label { margin-top: 14px; }
.tb-name { margin-top: 2px; font-size: clamp(27px, 3vw, 36px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.tb-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 9px 18px;
  border: 2px solid var(--orange);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.tb-pill i { font-style: normal; color: var(--orange); }
.tb-cols { display: flex; gap: 34px; margin-top: 16px; }
.tb-cols b { display: block; margin-top: 3px; font-size: 15.5px; font-weight: 700; }
.tb-kind {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(22, 22, 22, 0.12);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.tb-foot {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1.5px dashed rgba(22, 22, 22, 0.3);
}
.tb-foot b { display: block; margin-top: 3px; font-size: 22px; font-weight: 800; line-height: 1.1; }

/* красный «обведённый от руки» кружок вокруг номера билета */
.tb-code { position: relative; }
.tb-code svg {
  position: absolute;
  inset: -12px -16px;
  width: calc(100% + 32px);
  height: calc(100% + 24px);
  overflow: visible;
  pointer-events: none;
}
.tb-code ellipse {
  fill: none;
  stroke: #e53935;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: draw-circle 0.9s ease-out 0.6s forwards;
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }

.tb-barcode {
  margin-left: auto;
  width: 112px;
  height: 46px;
  background: repeating-linear-gradient(
    90deg,
    #161616 0 2px, transparent 2px 4px,
    #161616 4px 7px, transparent 7px 9px,
    #161616 9px 10px, transparent 10px 14px,
    #161616 14px 16px, transparent 16px 18px
  );
}

.ticket-arrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--bad);
  font-weight: 700;
  font-size: 17px;
}
.ticket-arrow svg { flex: 0 0 auto; animation: bounce-x 1.6s ease-in-out infinite; }
@keyframes bounce-x {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(7px); }
}

/* поле кода + цифровая клавиатура */
.code-pane { display: flex; flex-direction: column; align-items: center; }

.code-display {
  width: 100%;
  min-height: 76px;
  border: 2.5px solid rgba(15, 15, 15, 0.12);
  border-radius: var(--radius);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 34px/1 "JetBrains Mono", ui-monospace, Consolas, monospace;
  letter-spacing: 0.14em;
  transition: border-color 0.2s;
}
.code-display.focus { border-color: var(--blue); }
.code-display .ph { color: var(--muted); font: 500 20px/1 Montserrat, sans-serif; letter-spacing: 0; }
.code-display .caret {
  width: 3px;
  height: 36px;
  background: var(--blue);
  margin-left: 6px;
  border-radius: 2px;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.code-display.shake { animation: shake 0.5s ease; border-color: var(--bad); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 380px;
  margin-top: 20px;
}
.numpad .key {
  min-height: 72px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 2px solid rgba(15, 15, 15, 0.08);
  font-size: 28px;
  font-weight: 700;
  transition: transform 0.12s var(--ease-pop), background 0.12s;
  will-change: transform;
}
.numpad .key:active { transform: scale(0.93); background: var(--blue-soft); }
.numpad .key.aux { font-size: 22px; color: var(--muted); }

.code-error {
  margin-top: 18px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: #fff5f4;
  border: 1.5px solid rgba(249, 93, 81, 0.4);
  color: #c9302c;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

/* --------------------------------------------------- экран подтверждения */

.confirm-card {
  margin-top: 26px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(15, 15, 15, 0.1);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.confirm-card .head {
  background: var(--blue);
  color: #fff;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  font-size: 21px;
}
.confirm-row + .confirm-row { border-top: 1px solid rgba(15, 15, 15, 0.08); }
.confirm-row .label { color: var(--muted); font-size: 17px; font-weight: 600; }
.confirm-row b { font-weight: 800; font-size: 23px; text-align: right; }

.confirm-actions { display: grid; gap: 12px; margin-top: 26px; }

/* --------------------------------------------------- успех и финал */

.big-check {
  width: 148px;
  height: 148px;
  margin: 0 auto 26px;
}
/* на финале вместе с карточкой кабинета — компактнее, чтобы всё влезло в 800px */
.big-check-final { width: 96px; height: 96px; margin-bottom: 16px; }
.screen[data-screen="final"] h1 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 6px; }
.big-check circle {
  fill: var(--good);
  transform-origin: center;
  animation: pop-in 0.5s var(--ease-pop) both;
}
.big-check path {
  fill: none;
  stroke: #fff;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: draw-check 0.45s ease-out 0.35s forwards;
}
@keyframes pop-in {
  from { transform: scale(0); }
  60%  { transform: scale(1.12); }
  to   { transform: scale(1); }
}
@keyframes draw-check { to { stroke-dashoffset: 0; } }

/* маршрут по кабинету на финале — самое крупное на экране */
.room-card {
  margin: 22px auto 6px;
  width: 100%;
  max-width: 440px;
  padding: 20px 40px 24px;
  border-radius: 26px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(90, 80, 140, 0.5) 0%, transparent 55%),
    linear-gradient(135deg, #37324b 0%, #1b1727 100%);
  box-shadow: 0 20px 55px rgba(15, 15, 15, 0.28);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.room-label {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.room-no {
  font-size: clamp(76px, 10vw, 108px);
  font-weight: 800;
  line-height: 1.02;
  background: var(--cta-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.room-time { font-size: 20px; font-weight: 700; margin-top: 6px; }

/* несколько детей: ряд мини-карточек, каждому — свой кабинет */
.rooms-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}
.room-card.mini {
  margin: 0;
  flex: 0 1 240px;
  max-width: 260px;
  padding: 18px 22px 20px;
}
.room-card.mini .room-no { font-size: clamp(56px, 7vw, 76px); }
.room-kid { font-size: 19px; font-weight: 800; letter-spacing: 0.01em; }
.room-mk { font-size: 14px; font-weight: 600; opacity: 0.85; line-height: 1.3; }

/* маленький праздничный бейдж после «Да» на гранте */
.grant-yay {
  margin-top: 20px;
  padding: 16px 22px;
  border-radius: var(--radius);
  background: var(--good-soft);
  border: 2px solid rgba(29, 158, 117, 0.35);
  color: var(--good);
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  animation: pop-in 0.45s var(--ease-pop) both;
}

/* --------------------------------------------------- передача планшета */

.handoff-art {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  margin: 8px 0 30px;
  font-size: 84px;
  line-height: 1;
}
.handoff-art .tablet {
  font-size: 64px;
  animation: hand-swing 2s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes hand-swing {
  0%, 100% { transform: rotate(-6deg) translateX(-4px); }
  50%      { transform: rotate(8deg) translateX(10px); }
}

/* --------------------------------------------------- выбор МК */

.pick-head { text-align: center; margin-bottom: 6px; }
.pick-head h1 { margin-bottom: 6px; }

.rail-wrap { position: relative; width: 100%; margin-top: 18px; }

.rail {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 18px 28px 26px;
  scroll-padding-inline: 28px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.rail-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid rgba(15, 15, 15, 0.1);
  box-shadow: 0 6px 18px rgba(15, 15, 15, 0.14);
  font-size: 24px;
  display: grid;
  place-items: center;
  transition: opacity 0.2s, transform 0.15s;
}
.rail-arrow:active { transform: translateY(-50%) scale(0.92); }
.rail-arrow.prev { left: -8px; }
.rail-arrow.next { right: -8px; }
.rail-arrow.off { opacity: 0; pointer-events: none; }

.mk-card {
  scroll-snap-align: center;
  flex: 0 0 300px;
  border-radius: 22px;
  background: var(--paper);
  border: 1.5px solid rgba(15, 15, 15, 0.09);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;   /* button-флекс сжимает детей по контенту — растягиваем явно */
  padding: 0;
  transition: transform 0.18s var(--ease-pop), box-shadow 0.18s;
  will-change: transform;
}
.mk-card:active { transform: scale(0.965); }
.mk-card.star { border-color: rgba(249, 115, 22, 0.55); box-shadow: 0 10px 30px rgba(249, 115, 22, 0.18); }

.mk-art {
  position: relative;
  width: 100%;
  height: 186px;
  display: grid;
  place-items: center;
  font-size: 84px;
  line-height: 1;
}
/* градиентные подложки в палитре квиза */
.grad-blue   { background: linear-gradient(135deg, #eaf4ff 0%, #c9e4ff 60%, #a9d4ff 100%); }
.grad-coral  { background: linear-gradient(135deg, #fff1ec 0%, #ffd9cc 60%, #ffc4b0 100%); }
.grad-orange { background: linear-gradient(135deg, #fff4ec 0%, #ffe3c2 60%, #ffd39e 100%); }
.grad-mint   { background: linear-gradient(135deg, #e7f6ef 0%, #c8ecd9 60%, #abe2c6 100%); }
.grad-violet { background: linear-gradient(135deg, #f1edff 0%, #ddd3ff 60%, #cbbcff 100%); }
.grad-sun    { background: linear-gradient(135deg, #fff9e1 0%, #ffedad 60%, #ffe27e 100%); }
.grad-ink    { background: linear-gradient(135deg, #2a2a2e 0%, #17171a 100%); }

.mk-art .badge-star {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 7px 13px;
  box-shadow: 0 4px 12px rgba(15, 15, 15, 0.25);
  white-space: nowrap;
}
.mk-art .badge-age {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 7px 13px;
  white-space: nowrap;
}

.mk-body { width: 100%; padding: 18px 20px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1; }
.mk-body h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.mk-body p { margin: 0; font-size: 15.5px; line-height: 1.45; color: rgba(15, 15, 15, 0.66); flex: 1; }

.badge-girls {
  align-self: flex-start;
  background: var(--pink-soft);
  color: #c2447f;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 12px;
}

.show-all { margin: 6px auto 0; width: auto; padding: 14px 34px; min-height: 56px; font-size: 18px; }
.rail-title { font-size: 18px; font-weight: 700; color: var(--muted); margin: 18px 0 0; text-align: center; }

/* модалка подтверждения выбора */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.45);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 24px;
  animation: fade-in 0.25s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border-radius: 24px;
  padding: 34px 30px 28px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(15, 15, 15, 0.3);
  animation: modal-in 0.35s var(--ease-pop) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(34px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.modal .m-emoji { font-size: 64px; line-height: 1; margin-bottom: 14px; }
.modal h2 { margin: 0 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.modal p { margin: 0 0 24px; font-size: 18px; color: rgba(15, 15, 15, 0.66); line-height: 1.45; }
.modal .m-actions { display: grid; gap: 12px; }

/* «Вы ещё здесь?» */
.idle-modal .count {
  font: 800 44px/1 "JetBrains Mono", ui-monospace, monospace;
  color: var(--orange);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------- конфетти-канвас */

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

/* --------------------------------------------------- адаптив */

@media (max-width: 900px) {
  .code-layout { grid-template-columns: 1fr; gap: 26px; max-width: 560px; }
  .ticket-mock { max-width: 480px; margin: 0 auto; width: 100%; }
}

@media (max-width: 640px) {
  .screen { padding: 8px 20px 24px; }
  .chips.cols-2 { grid-template-columns: 1fr; }
  .mk-card { flex-basis: 262px; }
  .mk-art { height: 156px; font-size: 68px; }
  h1 { font-size: 27px; }
}

/* планшет в ландшафте — карточкам чуть больше воздуха */
@media (min-width: 1100px) {
  .mk-card { flex-basis: 320px; }
  .mk-art { height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ?snap=1 — скриншоты и автотесты: все анимации мгновенно в конечном состоянии */
.snap-mode *, .snap-mode *::before, .snap-mode *::after {
  animation-delay: 0s !important;
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}
