:root {
  --pink: #ff2d95;
  --yellow: #ffd60a;
  --cyan: #00e0ff;
  --violet: #7b2cff;
  --lime: #9dff00;
  --ink: #111;
  --rainbow: linear-gradient(90deg, #ff2d95, #ff8a00, #ffd60a, #9dff00, #00e0ff, #7b2cff, #ff2d95);
  --shadow: 0 10px 30px rgba(0,0,0,.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Rubik', system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  overflow-x: hidden;
  min-height: 100dvh;
}
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* фоновые «софиты» */
body::before {
  content: '';
  position: fixed; inset: -30%;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,45,149,.18), transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(0,224,255,.18), transparent 35%),
    radial-gradient(circle at 50% 85%, rgba(255,214,10,.22), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(123,44,255,.16), transparent 35%);
  animation: lights 14s ease-in-out infinite alternate;
}
@keyframes lights {
  0% { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(25deg) scale(1.15); }
}

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0; background: #fff; }
#flash.on { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }

body.shake { animation: shake .5s; }
@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
  40%, 60% { transform: translate3d(8px, 0, 0); }
}

/* ===== экраны ===== */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
}
.screen.active { display: flex; animation: screenIn .5s cubic-bezier(.2,.9,.3,1.2); }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: clamp(26px, 8vw, 40px);
  line-height: 1.05;
  text-align: center;
  margin: 8px 0 0;
  background: var(--rainbow);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: rainbowShift 4s linear infinite;
}
.title.small { font-size: clamp(22px, 6vw, 30px); }
@keyframes rainbowShift { to { background-position: 300% 0; } }
.sub { text-align: center; margin: 0; color: #555; font-size: 15px; }
.hint { text-align: center; margin: 0; color: #888; font-size: 13px; min-height: 1.4em; }

/* ===== диско-шар ===== */
.ball-wrap { height: 150px; display: grid; place-items: center; position: relative; }
.ball-wrap::before {
  content: ''; position: absolute; top: 0; width: 2px; height: 30px; background: #bbb;
}
.ball {
  width: 110px; height: 110px; border-radius: 50%;
  margin-top: 24px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.55) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 2px, transparent 2px 12px),
    radial-gradient(circle at 35% 30%, #fff, #c9d6ff 35%, #8fa3ff 60%, #5a4bd1 100%);
  box-shadow: 0 0 40px rgba(123,44,255,.45), 0 0 90px rgba(0,224,255,.35), inset -12px -12px 30px rgba(0,0,0,.25);
  animation: spin 6s linear infinite, bob 3s ease-in-out infinite;
  position: relative;
}
.ball::after {
  content: ''; position: absolute; inset: -40px;
  background: conic-gradient(from 0deg, transparent 0 20deg, rgba(255,214,10,.35) 22deg 26deg, transparent 28deg 60deg, rgba(255,45,149,.35) 62deg 66deg, transparent 68deg 130deg, rgba(0,224,255,.35) 132deg 136deg, transparent 138deg 220deg, rgba(157,255,0,.35) 222deg 226deg, transparent 228deg 300deg, rgba(123,44,255,.35) 302deg 306deg, transparent 308deg);
  border-radius: 50%;
  animation: spin 4s linear infinite reverse;
  filter: blur(1px);
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 50% { translate: 0 6px; } }

/* ===== PIN ===== */
.pin-dots { display: flex; gap: 14px; margin-top: 8px; }
.pin-dots span {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--ink); transition: .15s;
  animation: springIn .7s cubic-bezier(.2,1.6,.4,1) backwards;
}
.pin-dots span:nth-child(1) { animation-delay: .25s; }
.pin-dots span:nth-child(2) { animation-delay: .33s; }
.pin-dots span:nth-child(3) { animation-delay: .41s; }
.pin-dots span:nth-child(4) { animation-delay: .49s; }
@keyframes springIn {
  0% { opacity: 0; transform: translateY(40px) scale(.3); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
.pin-dots span.on { background: var(--pink); border-color: var(--pink); transform: scale(1.2); }
.pin-dots.ok span { background: var(--lime); border-color: var(--lime); animation: pop .4s; }
.pin-dots.bad span { background: #f33; border-color: #f33; }
@keyframes pop { 50% { transform: scale(1.6); } }

.keypad {
  display: grid; grid-template-columns: repeat(3, 76px); gap: 12px;
}
.keypad button {
  height: 64px; border-radius: 20px; border: 3px solid var(--ink);
  background: #fff; font-family: 'Unbounded', sans-serif; font-size: 24px; font-weight: 500;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s, background .2s;
  animation: keyIn .75s cubic-bezier(.2,1.5,.4,1) backwards;
}
/* ряды подгружаются один за другим, внутри ряда — слева направо */
.keypad button:nth-child(1) { animation-delay: .55s; } .keypad button:nth-child(2) { animation-delay: .62s; } .keypad button:nth-child(3) { animation-delay: .69s; }
.keypad button:nth-child(4) { animation-delay: .76s; } .keypad button:nth-child(5) { animation-delay: .83s; } .keypad button:nth-child(6) { animation-delay: .90s; }
.keypad button:nth-child(7) { animation-delay: .97s; } .keypad button:nth-child(8) { animation-delay: 1.04s; } .keypad button:nth-child(9) { animation-delay: 1.11s; }
.keypad button:nth-child(10) { animation-delay: 1.18s; } .keypad button:nth-child(11) { animation-delay: 1.25s; } .keypad button:nth-child(12) { animation-delay: 1.32s; }
@keyframes keyIn {
  0% { opacity: 0; transform: translateY(60px) scale(.6) rotate(-8deg); box-shadow: 0 0 0 var(--ink); }
  50% { opacity: 1; }
  100% { opacity: 1; transform: none; box-shadow: 4px 4px 0 var(--ink); }
}
.title { animation: rainbowShift 4s linear infinite, springIn .8s cubic-bezier(.2,1.4,.4,1) backwards; }
.sub { animation: springIn .7s cubic-bezier(.2,1.4,.4,1) .15s backwards; }
.keypad button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); background: var(--yellow); }
.keypad button.ghost { border-style: dashed; box-shadow: none; font-size: 20px; }
.keypad button.ghost:active { transform: scale(.92); }

/* ===== кнопки ===== */
.btn {
  border: 3px solid var(--ink); border-radius: 999px;
  background: #fff; padding: 14px 24px;
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 16px;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.big {
  width: 100%; max-width: 340px; padding: 18px 24px; font-size: 18px;
  background: var(--rainbow); background-size: 300% 100%;
  animation: rainbowShift 3s linear infinite, wiggle 2.4s ease-in-out infinite;
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
@keyframes wiggle { 0%, 100% { rotate: -1.5deg; } 50% { rotate: 1.5deg; } }
.btn.ghost-btn { box-shadow: none; border-style: dashed; font-weight: 500; font-size: 14px; }

/* ===== голова ===== */
.head-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.face {
  --mouth: 72%;
  position: relative;
  width: min(62vw, 260px);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  overflow: visible;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.18));
  animation: headIdle 3.2s ease-in-out infinite;
}
.head-stage.small .face { width: min(40vw, 160px); }
@keyframes headIdle { 50% { rotate: 2deg; translate: 0 -4px; } }
.face img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: 28px; user-select: none; -webkit-user-drag: none;
}
.face .top { clip-path: inset(0 0 calc(100% - var(--mouth)) 0); }
.face .bottom {
  clip-path: inset(var(--mouth) 0 0 0);
  transform-origin: 50% var(--mouth);
}
/* тёмный «рот» под нижней половиной: закрывает шов, когда челюсть уходит вниз */
.face .mouth {
  position: absolute; left: 22%; right: 22%;
  top: calc(var(--mouth) - 4%); height: 14%;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: radial-gradient(ellipse at 50% 30%, #5a1a2a, #22060e 70%);
}
/* веко: полоска лба над глазами, при моргании съезжает вниз на глаза */
.face .lid {
  clip-path: inset(calc(var(--eye) - var(--lid)) 0 calc(100% - var(--eye)) 0);
  transform: translateY(0);
  transition: transform .07s ease-in;
}
.face.blink .lid { transform: translateY(var(--lid)); }
.face.talking .bottom { animation: jaw .22s ease-in-out infinite alternate; }
@keyframes jaw {
  from { transform: rotate(0deg) translateY(0); }
  to { transform: rotate(6deg) translateY(4%); }
}
.face.happy { animation: happy .6s ease-in-out 3; }
@keyframes happy { 0%, 100% { rotate: 0deg; } 25% { rotate: -10deg; translate: -6px -14px; } 75% { rotate: 10deg; translate: 6px -14px; } }
.face.sad { animation: sad .8s ease-in-out 2; filter: drop-shadow(0 12px 24px rgba(0,0,0,.18)) grayscale(.6); }
@keyframes sad { 0%, 100% { rotate: 0deg; } 25% { rotate: -14deg; } 75% { rotate: 14deg; } }
.face.spin { animation: faceSpin 1s cubic-bezier(.3,1.4,.4,1) 1; }
@keyframes faceSpin { to { transform: rotate(720deg) scale(1.1); } }

.bubble {
  position: relative;
  background: #fff; border: 3px solid var(--ink); border-radius: 22px;
  padding: 14px 18px; min-height: 60px; width: 100%; max-width: 360px;
  font-size: 17px; line-height: 1.3; text-align: center; font-weight: 600;
  box-shadow: 5px 5px 0 var(--pink);
  opacity: 0; transform: scale(.8);
  transition: .25s cubic-bezier(.2,.9,.3,1.3);
}
.bubble.show { opacity: 1; transform: none; }
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -14px;
  width: 20px; height: 20px; background: #fff;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.bubble .cursor { display: inline-block; width: 3px; height: 1em; background: var(--pink); vertical-align: -2px; margin-left: 2px; animation: blink .6s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ===== квиз ===== */
.progress { display: flex; gap: 8px; }
.progress span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; transition: .3s; }
.progress span.cur { background: var(--yellow); transform: scale(1.3); }
.progress span.ok { background: var(--lime); }
.progress span.bad { background: #f55; }

.question {
  font-family: 'Unbounded', sans-serif; font-weight: 500;
  font-size: clamp(17px, 5vw, 22px); line-height: 1.25; text-align: center; margin: 4px 0;
}
.answers { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.answers button {
  border: 3px solid var(--ink); border-radius: 18px; background: #fff;
  padding: 14px 16px; font-size: 16px; font-weight: 600; text-align: left;
  box-shadow: 4px 4px 0 var(--ink);
  display: flex; align-items: center; gap: 12px;
  transition: transform .08s, box-shadow .08s, background .25s, border-color .25s;
  animation: answerIn .4s backwards;
}
.answers button:nth-child(1) { animation-delay: .05s; }
.answers button:nth-child(2) { animation-delay: .12s; }
.answers button:nth-child(3) { animation-delay: .19s; }
.answers button:nth-child(4) { animation-delay: .26s; }
@keyframes answerIn { from { opacity: 0; transform: translateX(-30px); } }
.answers button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.answers button b {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--ink); font-family: 'Unbounded', sans-serif; font-size: 14px;
}
.answers button:nth-child(1) b { background: var(--pink); color: #fff; }
.answers button:nth-child(2) b { background: var(--yellow); }
.answers button:nth-child(3) b { background: var(--cyan); }
.answers button:nth-child(4) b { background: var(--lime); }
.answers button.right { background: var(--lime); border-color: #3a8; animation: pop .4s; }
.answers button.wrong { background: #ffd5d5; border-color: #f33; animation: shake .4s; }
.answers button:disabled { cursor: default; opacity: .9; }

/* ===== отличия ===== */
.diff-wrap { display: grid; gap: 12px; width: 100%; }
.diff-pane {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border: 3px solid var(--ink); border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: 5px 5px 0 var(--ink); touch-action: manipulation;
}
.diff-pane svg, .diff-pane img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.diff-pane .mark {
  position: absolute; width: 0; height: 0; border-radius: 50%;
  border: 4px solid var(--pink); box-shadow: 0 0 0 3px #fff, 0 0 14px var(--pink);
  transform: translate(-50%, -50%);
  animation: markIn .4s cubic-bezier(.2,.9,.3,1.4) forwards;
  pointer-events: none;
}
.diff-pane .mark.cheat { border-color: var(--cyan); box-shadow: 0 0 0 3px #fff, 0 0 14px var(--cyan); }
@keyframes markIn { to { width: var(--d); height: var(--d); } }
.diff-pane .miss {
  position: absolute; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,51,51,.3); transform: translate(-50%, -50%);
  animation: missOut .5s forwards; pointer-events: none;
}
@keyframes missOut { to { transform: translate(-50%, -50%) scale(2); opacity: 0; } }
@media (min-width: 560px) { .diff-wrap { grid-template-columns: 1fr 1fr; } }

/* ===== билеты ===== */
.tickets { display: flex; flex-direction: column; gap: 18px; width: 100%; }
.ticket {
  position: relative;
  border: 3px solid var(--ink); border-radius: 22px; background: #fff;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  animation: ticketIn .6s cubic-bezier(.2,.9,.3,1.3) backwards;
}
.ticket:nth-child(2) { animation-delay: .2s; }
.ticket:nth-child(3) { animation-delay: .4s; }
.ticket:nth-child(4) { animation-delay: .6s; }
@keyframes ticketIn { from { opacity: 0; transform: translateY(40px) rotate(-4deg); } }
.ticket .head {
  padding: 14px 18px; color: #fff;
  background: var(--rainbow); background-size: 300% 100%; animation: rainbowShift 5s linear infinite;
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 17px;
  text-shadow: 0 2px 0 rgba(0,0,0,.3);
}
.ticket .body { display: flex; gap: 14px; padding: 14px 18px; align-items: center; }
.ticket .meta { flex: 1; font-size: 14px; line-height: 1.5; }
.ticket .meta b { font-size: 16px; }
.ticket .qr { flex: none; width: 110px; height: 110px; display: grid; place-items: center; border: 2px dashed #ccc; border-radius: 12px; padding: 4px; background: #fff; }
.ticket .qr img, .ticket .qr canvas { width: 100% !important; height: 100% !important; }
.ticket.locked .qr { filter: blur(5px); }
.ticket.locked::after {
  content: '🔒 Только для Кори'; position: absolute; inset: auto 0 14px 0; text-align: center;
  font-weight: 600; font-size: 14px; color: var(--pink);
}
.ticket.demo::before {
  content: 'ДЕМО'; position: absolute; top: 14px; right: -34px; z-index: 2;
  transform: rotate(45deg); background: var(--ink); color: var(--yellow);
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 11px; letter-spacing: 2px;
  padding: 4px 40px; pointer-events: none;
}
.ticket .scratch {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 14px, #ffe566 14px 28px);
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 18px; text-align: center; padding: 20px;
  cursor: pointer; transition: .5s cubic-bezier(.6,-.3,.3,1);
}
.ticket .scratch.off { transform: translateY(-110%) rotate(-6deg); opacity: 0; pointer-events: none; }

/* ===== отправь друзьям ===== */
.share {
  width: 100%; margin-top: 12px; padding: 18px;
  border: 3px dashed var(--ink); border-radius: 22px; background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  animation: ticketIn .6s cubic-bezier(.2,.9,.3,1.3) .8s backwards;
}
.share h3 { font-family: 'Unbounded', sans-serif; font-size: 17px; margin: 0; }
.share p { margin: 0; font-size: 14px; color: #555; }
.share-pin { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #888; }
.share-pin b {
  font-family: 'Unbounded', sans-serif; font-size: 24px; letter-spacing: 6px; color: var(--ink);
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 10px 6px 16px;
  box-shadow: 3px 3px 0 var(--ink);
}
.share-url { font-family: monospace; font-size: 14px; word-break: break-all; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 70; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600;
  transition: .3s;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* ===== тапай лари ===== */
.tap-game { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.tap-balance {
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: clamp(34px, 11vw, 52px);
  background: var(--rainbow); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbowShift 3s linear infinite; transition: transform .1s;
}
.tap-balance.bump { transform: scale(1.15); }
.tap-balance.drain { animation: none; -webkit-text-fill-color: #e33; color: #e33; }
/* при откате сумма выходит поверх ошибок */
.tap-balance.big {
  position: fixed; left: 50%; top: 42%; z-index: 69; transform: translate(-50%, -50%);
  font-size: clamp(44px, 14vw, 80px); white-space: nowrap; background: #fff; -webkit-background-clip: border-box; background-clip: border-box;
  padding: 10px 24px; border: 4px solid #e33; border-radius: 24px; box-shadow: 8px 8px 0 var(--ink), 0 0 60px rgba(255,0,0,.35);
  transition: none;
}
.tap-balance.big.bump { transform: translate(-50%, -50%) scale(1.08); }
.tap-balance.glitch { animation: glitch .2s steps(2) 1; }
@keyframes glitch {
  0% { transform: translate(-50%, -50%) skewX(-12deg); clip-path: inset(0 0 40% 0); }
  50% { transform: translate(-46%, -52%) skewX(10deg); clip-path: inset(30% 0 0 0); }
  100% { transform: translate(-50%, -50%); clip-path: none; }
}
.tap-timer { width: 100%; max-width: 300px; height: 12px; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.tap-timer i { display: block; height: 100%; width: 100%; background: var(--lime); transition: width 1s linear, background .3s; }
.coin {
  position: relative; width: min(60vw, 240px); aspect-ratio: 1; border-radius: 50%;
  border: 6px solid #e0a200; background: var(--yellow); overflow: hidden;
  box-shadow: 0 10px 0 #b07d00, 0 22px 30px rgba(0,0,0,.25), inset 0 0 0 8px #ffe566;
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .06s;
}
.coin img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); border-radius: 50%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.coin.pressed { transform: scale(.93) translateY(6px); box-shadow: 0 4px 0 #b07d00, 0 10px 16px rgba(0,0,0,.25), inset 0 0 0 8px #ffe566; }
.coin.dead { filter: grayscale(.8) brightness(.7); animation: shake .4s; }
/* зависание: монета «думает» */
.coin.frozen { filter: saturate(.4) brightness(.85); cursor: wait; }
.coin.frozen::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 46%; height: 46%; border-radius: 50%;
  border: 8px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin 1s linear infinite;
}
.coin.lag { animation: lag .3s steps(3); }
@keyframes lag { 0% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 100% { transform: none; } }
.coin .coin-x { display: none; position: absolute; inset: 0; place-items: center; font-size: 80px; color: #e33; font-weight: 900; text-shadow: 0 0 10px #fff; }
.coin.dead .coin-x { display: grid; }
.float {
  position: fixed; z-index: 66; pointer-events: none; font-family: 'Unbounded', sans-serif; font-weight: 800;
  color: var(--ink); -webkit-text-stroke: 1px #fff; paint-order: stroke fill;
  animation: floatUp .9s ease-out forwards;
}
@keyframes floatUp { to { transform: translate(-50%, -140px) rotate(var(--r)); opacity: 0; } }

.err {
  position: fixed; z-index: 68; width: min(78vw, 300px); pointer-events: none;
  border: 3px solid var(--ink); border-radius: 18px; background: #fff; padding: 14px 16px;
  box-shadow: 6px 6px 0 var(--ink); animation: errIn .35s cubic-bezier(.2,1.5,.4,1) backwards;
}
@keyframes errIn { from { transform: scale(.4) rotate(-10deg); opacity: 0; } }
.err b { display: flex; align-items: center; gap: 8px; font-family: 'Unbounded', sans-serif; font-size: 14px; margin-bottom: 6px; }
.err b::before { content: '⚠️'; }
.err p { margin: 0; font-size: 13px; color: #444; }
.err.pink { border-color: var(--pink); box-shadow: 6px 6px 0 var(--pink); }
/* одна «как в винде» */
.err.win {
  border: 2px solid #0a246a; border-radius: 0; padding: 0; box-shadow: 2px 2px 0 #000; background: #ece9d8;
  font-family: Tahoma, 'Segoe UI', sans-serif; animation: none;
}
.err.win b { margin: 0; padding: 4px 6px; background: linear-gradient(90deg, #0a246a, #a6caf0); color: #fff; font-family: Tahoma, sans-serif; font-weight: 700; font-size: 12px; justify-content: space-between; }
.err.win b::before { content: none; }
.err.win b::after { content: '✕'; border: 1px solid #fff; padding: 0 4px; font-size: 10px; }
.err.win p { display: flex; gap: 10px; align-items: center; padding: 14px 12px; font-size: 12px; color: #000; }
.err.win p::before { content: '❌'; font-size: 26px; }
.err.win .btns { display: flex; justify-content: center; gap: 8px; padding: 0 0 10px; }
.err.win .btns span { border: 1px solid #000; background: #ece9d8; box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff; padding: 2px 16px; font-size: 12px; }

.tap-result { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; animation: ticketIn .6s cubic-bezier(.2,.9,.3,1.3); }
.tap-result-title { font-family: 'Unbounded', sans-serif; font-size: 16px; color: #666; }
.tap-result-amount { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 64px; line-height: 1; }

/* ===== кошелёк ===== */
.wallet {
  position: fixed; top: 12px; left: 12px; z-index: 60;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 10px; border: 3px solid var(--ink); border-radius: 999px;
  background: var(--yellow); box-shadow: 3px 3px 0 var(--ink);
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 16px;
  animation: springIn .6s cubic-bezier(.2,1.6,.4,1) backwards;
}
.wallet .w-ico { font-size: 18px; }
.wallet.bump { animation: walletBump .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes walletBump { 50% { transform: scale(1.25) rotate(-4deg); background: var(--lime); } }

/* ===== Toasty! ===== */
.toasty {
  position: fixed; right: 0; bottom: 0; z-index: 65; pointer-events: none;
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(110%);
  transition: transform .18s cubic-bezier(.2,1.3,.5,1);
}
.toasty.up { transform: translateY(0); }
.toasty canvas { width: 150px; height: auto; image-rendering: pixelated; display: block; filter: drop-shadow(-4px 0 0 var(--ink)); }
.toasty-text {
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 26px; letter-spacing: 2px;
  color: var(--yellow); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  text-shadow: 3px 3px 0 #d00; margin-bottom: -6px; transform: rotate(-6deg);
  animation: toastyText .12s steps(2) infinite;
}
@keyframes toastyText { to { transform: rotate(-6deg) scale(1.08); } }

/* ===== звук ===== */
.snd {
  position: fixed; top: 10px; right: 10px; z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--ink);
  background: var(--yellow); box-shadow: 4px 4px 0 var(--ink);
  font-family: 'Unbounded', sans-serif; line-height: 1;
  animation: sndPulse 1.6s ease-in-out infinite;
}
.snd .ico { font-size: 20px; }
.snd .lbl { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.snd.on { background: var(--lime); animation: none; }
.snd:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
@keyframes sndPulse {
  0%, 100% { transform: scale(1); box-shadow: 4px 4px 0 var(--ink), 0 0 0 0 rgba(255,214,10,.7); }
  50% { transform: scale(1.12); box-shadow: 4px 4px 0 var(--ink), 0 0 0 14px rgba(255,214,10,0); }
}

/* Намеренно НЕ уважаем prefers-reduced-motion: это праздничный сайт, анимации — его суть.
   На Android эта настройка часто включена энергосбережением или «Убрать анимации». */
