/* Ценогуру — визуальный язык кассовой ленты.
   Ценник (бумага + янтарь) на графите, чек моноширинным, оторванный край
   у карточки. Никаких внешних шрифтов: игра должна открываться офлайн и
   внутри Telegram Mini App. */

:root {
  --ink: #0D0E11;
  --ink-2: #15171C;
  --ink-3: #1E222A;
  --paper: #F3EFE4;
  --paper-dim: #D9D4C6;
  --price: #FFC53D;
  --stamp: #E5402F;
  --hit: #52D9A3;
  --muted: #7C818C;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Roboto Mono", monospace;

  --pad: clamp(16px, 4.5vw, 26px);
  --radius: 3px;         /* ценник почти не скруглён — он бумажный */
  --tear: 11px;
}

* { box-sizing: border-box; }

/* .pitch и .combo объявлены как grid/flex, поэтому атрибут hidden сам по себе
   их не прячет — нужна явная перебивка */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  overflow-anchor: none;   /* карточка растёт при раскрытии — якорение мешает */
}

body {
  min-height: 100dvh;
  padding: 0 0 env(safe-area-inset-bottom);
  background-image:
    radial-gradient(120% 60% at 50% -10%, #1C2029 0%, transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.018) 39px 40px);
}

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--price); outline-offset: 3px; }

/* ---------- вход ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: var(--ink);
}

.intro__paper {
  width: min(420px, 100%);
  background: var(--paper);
  color: #14161A;
  padding: 30px var(--pad) 24px;
  border-radius: var(--radius);
  -webkit-mask: radial-gradient(circle var(--tear) at 50% 100%, transparent 98%, #000)
                0 100%/22px var(--tear) repeat-x, linear-gradient(#000 0 0);
  -webkit-mask-composite: source-out;
  mask: radial-gradient(circle var(--tear) at 50% 100%, transparent 98%, #000)
        0 100%/22px var(--tear) repeat-x, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.intro__eyebrow,
.intro__note {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7A776C;
}

.intro__head {
  margin: 12px 0 14px;
  font-size: clamp(52px, 17vw, 76px);
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: .88;
}

.intro__text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.45;
  color: #3B3E45;
}

.intro__go {
  width: 100%;
  margin: 22px 0 12px;
  padding: 17px;
  border: 0;
  border-radius: var(--radius);
  background: #14161A;
  color: var(--price);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.intro__note { text-align: center; letter-spacing: .08em; }

/* ---------- касса: счётчик сверху ---------- */

.till {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--pad) 10px;
  background: linear-gradient(var(--ink) 70%, transparent);
  max-width: 560px;
  margin: 0 auto;
}

.till__title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.till__bar {
  margin-top: 6px;
  height: 3px;
  width: min(180px, 42vw);
  background: var(--ink-3);
  overflow: hidden;
}

.till__bar i {
  display: block;
  height: 100%;
  background: var(--price);
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}

.till__score {
  text-align: right;
  line-height: 1;
}

.till__score b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.till__unit {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.combo {
  grid-column: 1 / -1;
  justify-self: start;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 9px;
  background: var(--price);
  color: #241B00;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.combo b { font-size: 15px; font-family: var(--sans); font-weight: 800; }
.combo--pop { animation: pop .35s cubic-bezier(.2,1.4,.4,1); }

/* ---------- ценник ---------- */

.stage {
  max-width: 560px;
  margin: 0 auto;
  padding: 4px var(--pad) 0;
  min-height: calc(100dvh - 290px);
  display: grid;
  /* карточка прижата к верху, а не по центру: когда раскрывается ответ,
     она растёт вниз и текст не прыгает под пальцем */
  align-content: start;
  padding-top: 10px;
}

.tag {
  position: relative;
  background: var(--paper);
  color: #14161A;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px var(--pad) 26px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  scroll-margin-top: 74px;
  /* оторванный край снизу — карточка отрезана от кассовой ленты */
  -webkit-mask: radial-gradient(circle var(--tear) at 50% 100%, transparent 98%, #000)
                0 100%/22px var(--tear) repeat-x, linear-gradient(#000 0 0);
  -webkit-mask-composite: source-out;
  mask: radial-gradient(circle var(--tear) at 50% 100%, transparent 98%, #000)
        0 100%/22px var(--tear) repeat-x, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: dealt .4s cubic-bezier(.2,.9,.25,1);
}

.tag--gold {
  background: linear-gradient(118deg, #FFE7A6 0%, #FFC53D 44%, #FFB000 58%, #FFD97A 100%);
}

.tag--gold .tag__q,
.tag--gold .verdict__label,
.tag--gold .tag__sub { color: #4A3800; }


/* штамп встаёт на место номера карточки, а не поверх цифр ответа */
.tag--miss .tag__no { visibility: hidden; }

.tag--miss::after {
  content: "МИМО";
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border: 3px solid var(--stamp);
  color: var(--stamp);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .1em;
  transform: rotate(-11deg);
  opacity: .82;
  animation: stamp .28s cubic-bezier(.2,1.6,.4,1);
}

.tag__top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #7A776C;
}

.tag__name {
  margin: 10px 0 2px;
  font-size: clamp(23px, 6.6vw, 32px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.03;
  text-wrap: balance;
}

.tag__sub {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #6E6B62;
}

.tag__q {
  margin: 16px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #3B3E45;
}

/* ---------- ставка ---------- */

.bet { margin-top: 14px; }

.bet__value {
  display: block;
  font-size: clamp(44px, 13vw, 62px);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: #14161A;
}

.bet__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  margin: 16px 0 4px;
  background:
    repeating-linear-gradient(90deg, #C3BEB0 0 1px, transparent 1px 10px) center/100% 12px no-repeat,
    linear-gradient(#0000 0 0);
  background-color: transparent;
}

.bet__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 34px;
  border: 0;
  border-radius: 2px;
  background: #14161A;
  box-shadow: 0 0 0 4px var(--price);
  cursor: grab;
}

.bet__slider::-moz-range-thumb {
  width: 14px;
  height: 34px;
  border: 0;
  border-radius: 2px;
  background: #14161A;
  box-shadow: 0 0 0 4px var(--price);
}

.bet__scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: #8B887E;
}

.bet__go {
  margin-top: 14px;
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: var(--radius);
  background: #14161A;
  color: var(--price);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: transform .08s;
}

.bet__go:active { transform: scale(.985); }

/* ---------- выбор из двух ---------- */

.pick { display: grid; gap: 10px; margin-top: 16px; }

.pick__opt {
  padding: 16px;
  text-align: left;
  border: 2px solid #14161A;
  border-radius: var(--radius);
  background: transparent;
  color: #14161A;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
}

.pick__opt span {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: #6E6B62;
}

.pick__opt:active { background: #14161A; color: var(--paper); }

.pick__opt--right { border-color: #14161A; background: var(--price); }
.pick__opt--wrong { border-color: #C9C3B3; color: #8B887E; }
.pick__opt--wrong span { color: #A29E92; }

.pick__opt u {
  float: right;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- раскрытие ---------- */

.verdict { position: relative; margin-top: 14px; animation: reveal .35s ease-out; }

.verdict__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.verdict__label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7A776C;
}

.verdict__fact {
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.verdict__gain { text-align: right; line-height: 1.1; }

/* у карточки «что дороже» правильный ответ уже подсвечен на кнопке —
   второй раз то же число не показываем */
.verdict--choice .verdict__row { justify-content: flex-end; }
.verdict--choice .verdict__fact,
.verdict--choice .verdict__row .verdict__label { display: none; }

.verdict__gain b {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: #14161A;
  animation: rise .5s cubic-bezier(.2,1.2,.3,1);
}

.verdict__gain span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6E6B62;
}

.verdict__past,
.verdict__locked {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #B9B4A6;
}

.verdict__past {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.verdict__past b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.verdict__past i { font-style: normal; }

.verdict__lockline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.verdict__lockline b {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.blurred { filter: blur(7px); user-select: none; }

.chip {
  flex: none;
  padding: 8px 14px;
  border: 2px solid #14161A;
  border-radius: 999px;
  background: #14161A;
  color: var(--price);
  font-size: 13px;
  font-weight: 700;
}

.chip--bot { background: transparent; color: #14161A; }

.verdict__comment {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #14161A;
}

.verdict__next {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: var(--radius);
  background: #14161A;
  color: var(--price);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 14px;
}

.verdict__next:active { transform: scale(.985); }


/* ---------- чек ---------- */

.receipt {
  max-width: 560px;
  margin: 34px auto 0;
  padding: 0 var(--pad) 26vh;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.receipt__head,
.receipt__foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 10px;
  color: #565B65;
}

.receipt__head { border-bottom: 1px dashed #2A2F39; padding-bottom: 8px; }
.receipt__head span:last-child { text-align: right; }
.receipt__foot { margin-top: 10px; }

.hint {
  max-width: 560px;
  margin: 14px auto 0;
  padding: 0 var(--pad);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #4B505A;
  text-align: center;
}

.receipt__list { list-style: none; margin: 0; padding: 0; }

.receipt__list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #23272F;
  animation: print .3s ease-out;
}

.receipt__list em {
  font-style: normal;
  color: #A9AEB8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt__list s { color: #565B65; text-decoration: none; }
.receipt__list b { color: var(--price); font-weight: 600; }
.receipt__list .miss b { color: var(--stamp); }

/* ---------- приглашение в бот ---------- */

.pitch {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: rgba(8,9,11,.86);
  backdrop-filter: blur(6px);
  animation: reveal .3s ease-out;
}

.pitch__paper {
  width: min(420px, 100%);
  background: var(--paper);
  color: #14161A;
  padding: 26px var(--pad) 22px;
  border-radius: var(--radius);
  -webkit-mask: radial-gradient(circle var(--tear) at 50% 100%, transparent 98%, #000)
                0 100%/22px var(--tear) repeat-x, linear-gradient(#000 0 0);
  -webkit-mask-composite: source-out;
  mask: radial-gradient(circle var(--tear) at 50% 100%, transparent 98%, #000)
        0 100%/22px var(--tear) repeat-x, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.pitch__eyebrow,
.pitch__stat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6E6B62;
  margin: 0;
}

.pitch__stat { margin-top: 6px; letter-spacing: .06em; }
.pitch__stat b { color: #14161A; }

.pitch__head {
  margin: 14px 0 8px;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.pitch__text { margin: 0; font-size: 15px; line-height: 1.45; color: #3B3E45; }

.pitch__cta {
  display: block;
  margin-top: 18px;
  padding: 15px;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius);
  background: #14161A;
  color: var(--price);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 14px;
}

.pitch__skip {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 0;
  background: none;
  color: #6E6B62;
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: underline;
}

/* ---------- тост ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  padding: 10px 16px;
  background: var(--price);
  color: #241B00;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  animation: rise .3s ease-out;
}

/* ---------- движение ---------- */

@keyframes dealt {
  from { opacity: 0; transform: translateY(18px) scale(.99); }
  to { opacity: 1; transform: none; }
}
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes print { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-11deg) scale(1.7); } to { opacity: .82; transform: rotate(-11deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- правовые страницы ---------- */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(26px + env(safe-area-inset-top)) var(--pad) 60px;
  background: var(--paper);
  color: #1A1D22;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
}

.doc__back,
.doc__foot a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6E6B62;
}

.doc__eyebrow {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7A776C;
}

.doc h1 {
  margin: 8px 0 18px;
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.doc__lead {
  margin: 0 0 30px;
  padding: 16px 18px;
  background: #E7E2D4;
  border-left: 4px solid var(--price);
  font-size: 15.5px;
}

.doc h2 {
  margin: 34px 0 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.doc h3 {
  margin: 22px 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc a { color: #1A1D22; text-decoration-color: var(--price); text-underline-offset: 3px; }

.doc__code {
  font-family: var(--mono);
  font-size: 14px;
  background: #E7E2D4;
  padding: 2px 6px;
  white-space: nowrap;
}

.doc__table {
  width: 100%;
  margin: 0 0 14px;
  border-collapse: collapse;
  font-size: 14.5px;
  display: block;
  overflow-x: auto;
}

.doc__table th,
.doc__table td {
  border-bottom: 1px solid #CFC9BA;
  padding: 9px 12px 9px 0;
  text-align: left;
  vertical-align: top;
}

.doc__table th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6E6B62;
  font-weight: 400;
}

.doc__foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px dashed #B9B4A6;
}

.intro__legal {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: #6E6B62;
}

.intro__legal a { color: #3B3E45; text-underline-offset: 2px; }

.receipt__legal {
  margin-top: 12px;
  display: flex;
  gap: 14px;
  justify-content: center;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.receipt__legal a { color: #565B65; }
