@font-face { font-family: "Dela Gothic One"; src: url("fonts/DelaGothicOne.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Onest"; src: url("fonts/Onest.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("fonts/Oswald.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }

:root {
  --red: #E8392B; --brick: #9E1F17; --light: #FFE9B0; --tag: #FFD23F; --ink: #1A1410;
  --paper: #FFF8EC; --ok: #1FB574; --bad: #3A0E0B; --heat: 0;
  --disp: "Dela Gothic One", "Onest", system-ui, sans-serif;
  --num: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --txt: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 20px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #9E1F17; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: #fff; font-family: var(--txt);
  background: linear-gradient(180deg, var(--red) 0%, #D23324 45%, var(--brick) 100%) fixed;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- studio backdrop ---------- */
.studio { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.dots { position: absolute; inset: 0; opacity: .22;
  background-image: radial-gradient(circle, rgba(255, 233, 176, .9) 1.4px, transparent 2.2px);
  background-size: 26px 26px; mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.3) 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.3) 60%, transparent 100%); }
.spot { position: absolute; top: -10%; height: 120%; transform-origin: 50% 0;
  width: calc(46vw - var(--heat) * 16vw); max-width: 520px;
  background: linear-gradient(180deg, rgba(255,233,176, calc(.13 + var(--heat) * .1)) 0%, rgba(255,233,176,.04) 75%, transparent 100%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); transition: width .6s, background .6s; }
.s1 { left: -6%; transform: rotate(-16deg); }
.s2 { left: 50%; margin-left: calc(-23vw + var(--heat) * 8vw); }
.s3 { right: -6%; transform: rotate(16deg); }
@media (min-width: 1131px) { .s2 { margin-left: calc(-260px + var(--heat) * 80px); } }
.vignette { position: absolute; inset: 0; transition: box-shadow .8s;
  box-shadow: inset 0 0 calc(60px + var(--heat) * 140px) calc(var(--heat) * 60px) rgba(40, 6, 4, calc(.25 + var(--heat) * .4)); }

main, .bar { position: relative; z-index: 1; }

/* ---------- header ---------- */
.bar { position: sticky; top: 0; z-index: 20; padding: calc(8px + var(--sat)) 12px 8px;
  background: linear-gradient(180deg, rgba(158,31,23,.96), rgba(158,31,23,.88)); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.bar-row { display: flex; align-items: center; gap: 8px; max-width: 1180px; margin: 0 auto; }
.logo-sm { font-family: var(--disp); font-size: 20px; letter-spacing: .01em; white-space: nowrap; }
.logo-sm .q, .logo .q, .rc-logo .q { color: var(--tag); display: inline-block; transform: rotate(14deg); transform-origin: 30% 10%; margin-left: .04em; }
.wallet { display: flex; gap: 6px; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: var(--paper); color: var(--ink); border-radius: 999px;
  padding: 4px 10px 4px 5px; font: 700 16px/1 var(--num); font-variant-numeric: tabular-nums; min-width: 54px; }
.pill.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
.icons { display: flex; gap: 2px; }
.icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.icon:hover { background: rgba(255,255,255,.12); }
.icon svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#btnSound .mute { display: none; } #btnSound.off .mute { display: inline; } #btnSound.off .wave { display: none; }

.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; max-width: 1180px; margin: 6px auto 0;
  text-align: left; padding: 6px 2px 0; }
.strip-text { font-size: 15px; white-space: nowrap; }
.strip-text b { font-weight: 700; } .strip-text .onkon { color: var(--tag); font-family: var(--num); font-size: calc(17px + var(--heat) * 5px); letter-spacing: .01em; }
.dotsep { margin: 0 6px; opacity: .7; }
.segs { display: flex; gap: 3px; flex: 1 1 140px; min-width: 120px; }
.seg { flex: 1; height: 8px; border-radius: 3px; background: rgba(255,255,255,.25); }
.seg.done { background: #fff; } .seg.cur { background: var(--tag); box-shadow: 0 0 0 2px rgba(255,210,63,.4); }
.seg.safe { height: 12px; margin-top: -2px; }
.seg.safe:not(.done):not(.cur) { background: rgba(255,210,63,.5); }
.mist { display: flex; gap: 3px; align-items: center; }
.mist::before { content: "mistakes"; font-size: 12px; margin-right: 3px; opacity: .9; }
.mist .m { width: 9px; height: 9px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); }
.mist .m.on { background: var(--bad); border-color: #fff; }
@media (min-width: 1000px) { .strip { cursor: default; pointer-events: none; } }

/* ---------- icons ---------- */
.coin-ico { display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #FFF8EC 0 12%, transparent 13%), var(--tag);
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 5px var(--tag), inset 0 0 0 6px rgba(26,20,16,.55); }
.coin-ico.sm { width: 14px; height: 14px; vertical-align: -2px; margin-left: 3px; box-shadow: inset 0 0 0 1.5px var(--ink), inset 0 0 0 3.5px var(--tag), inset 0 0 0 4.5px rgba(26,20,16,.5); }
.coin-ico.lg { width: 44px; height: 44px; box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 9px var(--tag), inset 0 0 0 11px rgba(26,20,16,.55); }
.ruby-ico { display: inline-block; width: 20px; height: 20px; flex: none;
  background: linear-gradient(135deg, #fff 0 18%, var(--red) 19% 55%, var(--brick) 56%);
  clip-path: polygon(50% 100%, 0 38%, 22% 6%, 78% 6%, 100% 38%); }
.ruby-ico.sm { width: 14px; height: 14px; vertical-align: -2px; margin-left: 3px; }
.ruby-ico.xl { width: 64px; height: 64px; }
.chest-ico { display: inline-block; width: 26px; height: 22px; flex: none; border-radius: 6px 6px 3px 3px; background:
  linear-gradient(var(--ink), var(--ink)) 50% 45%/6px 7px no-repeat, linear-gradient(180deg, var(--red) 0 42%, var(--ink) 42% 50%, var(--brick) 50%);
  box-shadow: inset 0 0 0 2px var(--ink); }
.minus-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bad); flex: none; box-shadow: 0 0 0 2px var(--red); }
.minus-ico::before { content: ""; width: 10px; height: 3px; background: #fff; border-radius: 2px; }
.hint-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--tag); flex: none; box-shadow: inset 0 0 0 2px var(--ink); }
.hint-ico::before { content: "?"; color: var(--ink); font: 800 14px/1 var(--txt); }

/* ---------- screens ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 12px 12px calc(20px + var(--sab)); }
.paper { background: var(--paper); color: var(--ink); border-radius: 14px; outline: 1.5px dashed rgba(26,20,16,.28); outline-offset: -7px; }

/* start */
.start { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: calc(4px + var(--sat)); max-width: 640px; margin: 0 auto; }
.poster { position: relative; width: 100%; border-radius: var(--r); overflow: hidden; box-shadow: 0 18px 40px -18px rgba(40,6,4,.8); background: var(--brick); aspect-ratio: 1 / 1; max-width: min(100%, 420px, 46vh); }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster-cap { position: absolute; left: 10px; bottom: 8px; font-size: 12px; background: rgba(26,20,16,.72); padding: 3px 8px; border-radius: 6px; }
.logo { margin: 0; font: 400 clamp(34px, 12vw, 96px)/1 var(--disp); letter-spacing: -.01em; white-space: nowrap; text-shadow: 0 5px 0 var(--brick); }
.logo .q { font-size: 1.2em; }
.tagline { margin: -4px 0 0; font-size: 18px; line-height: 1.35; font-weight: 600; max-width: 30ch; }
.rules-mini { width: 100%; padding: 14px 16px; display: grid; gap: 10px; text-align: left; font-size: 15px; line-height: 1.35; }
.rm-row { display: flex; gap: 10px; align-items: center; }
.mode { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.mode-label { width: 100%; font-weight: 700; font-size: 15px; }
.mode-opt { padding: 10px 14px; min-height: 44px; border-radius: 999px; border: 2px solid rgba(255,255,255,.75); font-weight: 700; font-size: 15px; }
.mode-opt.on { background: #fff; color: var(--ink); border-color: #fff; }
.mode-note { margin: -4px 0 0; font-size: 14px; line-height: 1.35; max-width: 42ch; }
.big-btn { width: 100%; max-width: 420px; min-height: 64px; border-radius: 18px; background: var(--tag); color: var(--ink);
  font: 400 24px/1 var(--disp); box-shadow: 0 6px 0 #B98F12, 0 14px 30px -10px rgba(40,6,4,.7); transition: transform .12s; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #B98F12; }
.text-btn { text-decoration: underline; font-weight: 600; padding: 8px; min-height: 44px; }
.best { margin: 0; font-size: 14px; min-height: 1em; }

/* game */
.game { display: grid; gap: 16px; }
.col-main { display: flex; flex-direction: column; gap: 12px; min-height: calc(100dvh - 150px); }
.col-side { display: none; }
.card { background: #fff; color: var(--ink); border-radius: var(--r); padding: 14px 16px 16px;
  box-shadow: 0 22px 34px -20px rgba(255,233,176,.55), 0 10px 26px -12px rgba(40,6,4,.75); }
.card.enter { animation: cardIn .34s cubic-bezier(.2,.8,.2,1); }
.card.leave { animation: cardOut .22s ease forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes cardOut { to { opacity: 0; transform: translateY(-10px); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; padding: 5px 9px; border-radius: 999px;
  background: var(--paper); border: 1.5px dashed rgba(26,20,16,.3); line-height: 1.15; }
.chip.yr { background: var(--tag); border-style: solid; border-color: var(--ink); font-weight: 800; font-size: 14px; }
.chip.cat { background: var(--ink); color: #fff; border-color: var(--ink); }
.ic { width: 13px; height: 13px; flex: none; background: currentColor; }
.ic.pin { clip-path: path("M6.5 0C3.4 0 1 2.4 1 5.3 1 9 6.5 13 6.5 13S12 9 12 5.3C12 2.4 9.6 0 6.5 0Zm0 7.4a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z"); }
.ic.cal { clip-path: polygon(0 15%, 100% 15%, 100% 100%, 0 100%, 0 35%, 100% 35%, 100% 42%, 0 42%); border-radius: 2px; }
.ic.shop { clip-path: polygon(0 30%, 15% 0, 85% 0, 100% 30%, 92% 30%, 92% 100%, 8% 100%, 8% 30%); }
.item { margin: 0; font: 800 clamp(22px, 6.4vw, 30px)/1.15 var(--txt); letter-spacing: -.01em; text-wrap: balance; }
.ask { margin: 8px 0 0; font-size: 17px; line-height: 1.3; font-weight: 600; }
.guess { margin: 10px 0 0; display: inline-block; font-size: 14px; line-height: 1.3; background: var(--tag); padding: 6px 10px; border-radius: 8px; }
.ctx { margin: 10px 0 0; font-size: 15px; line-height: 1.4; color: #4a3f37; }
.explain { margin-top: 12px; background: var(--paper); border-radius: 14px; padding: 12px 14px 14px; outline: 1.5px dashed rgba(26,20,16,.3); outline-offset: -6px; animation: cardIn .3s ease; }
.ex-head { font-weight: 800; font-size: 17px; margin-bottom: 10px; }
.ex-head.ok { color: #0d7a4c; } .ex-head.bad { color: var(--bad); }
.ex-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ex-cell { border-radius: 10px; padding: 8px 10px; background: #fff; border: 1.5px solid rgba(26,20,16,.15); display: grid; gap: 2px; }
.ex-cell.ans { border: 2px solid var(--ink); background: #fff; box-shadow: inset 0 -4px 0 var(--tag); }
.ex-cell small { font-size: 12px; color: #5a4e45; font-weight: 600; }
.ex-cell b { font: 700 24px/1.1 var(--num); font-variant-numeric: tabular-nums; }
.ex-cell em { font-style: normal; font-size: 12px; font-weight: 700; }
.ex-f { margin: 10px 0 0; font-size: 15px; line-height: 1.4; }
.ex-r { margin: 6px 0 0; font-size: 14px; line-height: 1.35; }
.ex-cpi { margin: 8px 0 0; font-size: 12px; line-height: 1.35; color: #5a4e45; }

.stakes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stk { display: flex; align-items: center; gap: 6px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 6px 7px; min-width: 0; }
.stk span { display: grid; line-height: 1.1; font-size: 13px; min-width: 0; }
.stk b { font: 700 18px/1.05 var(--num); font-variant-numeric: tabular-nums; }
.stk small { font-size: 11px; line-height: 1.15; color: #5a4e45; }
.stk.plus { box-shadow: inset 0 0 0 2px var(--ok); } .stk.plus b { color: #0d7a4c; }
.stk.minus b { color: var(--bad); }

/* ---------- price tags ---------- */
.tags { display: grid; gap: 10px; margin-top: auto; perspective: 900px; }
.tag { position: relative; display: block; width: 100%; min-height: 64px; text-align: left; transform-style: preserve-3d;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s; transform-origin: 6% 50%; }
.t-face, .t-back { position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 6px 18px 6px 40px;
  background: var(--tag); color: var(--ink); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%); border-radius: 10px 0 10px 10px;
  box-shadow: inset 0 -5px 0 rgba(26,20,16,.12); }
.t-face { position: relative; min-height: 64px; flex-wrap: wrap; row-gap: 0; }
.t-hole { position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
  background: var(--brick); box-shadow: inset 0 0 0 2px rgba(26,20,16,.5); }
.tag::before { content: ""; position: absolute; left: -2px; top: 50%; width: 16px; height: 2px; background: rgba(255,248,236,.85); transform: translateY(-1px) rotate(-30deg); transform-origin: 100% 50%; z-index: 2; }
.t-letter { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--tag); font: 800 15px/1 var(--txt); }
.t-price { margin-left: auto; font: 700 clamp(30px, 9vw, 40px)/1 var(--num); font-variant-numeric: tabular-nums; letter-spacing: .005em; white-space: nowrap; }
.t-price .cur { font-size: .7em; margin-right: .06em; vertical-align: .14em; }
.t-price .approx { font-size: .62em; margin-right: .12em; vertical-align: .18em; font-weight: 500; }
.t-note { flex-basis: 100%; text-align: right; font-size: 12.5px; font-weight: 600; color: #4a3a12; margin-top: 2px; }
.t-note:empty { display: none; }
.t-vote { flex-basis: 100%; position: relative; height: 18px; margin-top: 4px; background: rgba(26,20,16,.12); border-radius: 5px; overflow: hidden; }
.t-vote i { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 5px; transition: width .5s; }
.t-vote span { position: absolute; right: 6px; top: 0; font: 700 12px/18px var(--txt); color: var(--ink); background: var(--tag); padding: 0 4px; border-radius: 4px; }
.t-back { transform: rotateX(180deg); background: var(--bad); color: #fff; justify-content: space-between; box-shadow: inset 0 0 0 3px var(--red); font: 400 20px/1 var(--disp); }
.t-back small { font: 700 22px/1 var(--num); opacity: .8; text-decoration: line-through; }
.t-back .t-hole { background: var(--red); }
.stamp { position: absolute; left: 92px; top: 50%; z-index: 3; pointer-events: none; padding: 4px 12px; border: 4px solid var(--ok); border-radius: 8px;
  color: var(--ok); font: 400 22px/1 var(--disp); background: #FFF8EC; opacity: 0; transform: translateY(-50%) rotate(-12deg) scale(2.2); }

.tag:hover:not(:disabled) .t-face { filter: brightness(1.04); }
.tag:active:not(:disabled) { transform: scale(.985); }
.tag.out { opacity: .32; pointer-events: none; }
.tag.out .t-price { text-decoration: line-through; }
.tag.tipped .t-letter { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.tags.locked .tag { pointer-events: none; }
.tags.locked .tag:not(.picked) { opacity: .5; }
.tag.picked { transform: translateY(-6px) rotate(-1.4deg); animation: swing 1.4s ease-in-out infinite; opacity: 1 !important; }
.tag.picked .t-face { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); clip-path: none; animation: pulse .7s ease-in-out infinite alternate; }
@keyframes swing { 0%, 100% { transform: translateY(-6px) rotate(-1.6deg); } 50% { transform: translateY(-6px) rotate(1.2deg); } }
@keyframes pulse { from { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); } to { box-shadow: 0 0 0 5px #fff, 0 0 0 9px rgba(255,248,236,.35); } }
.tags.revealed .tag { animation: none; }
.tags.revealed .tag.picked { transform: translateY(-4px); }
.tags.revealed .tag.picked .t-face { animation: none; }
.tag.right { opacity: 1 !important; }
.tag.right .t-face { background: var(--ok); color: #fff; box-shadow: 0 0 0 3px #fff; clip-path: none; }
.tag.right .t-letter { background: #fff; color: #0d7a4c; }
.tag.right .t-note { color: #fff; }
.stamp { display: none; }
.tags { overflow-x: clip; }
.tag.right.picked .stamp { display: block; }
.tag.right.picked .stamp, .tags.revealed .tag.right .stamp { animation: stamp .32s cubic-bezier(.3,1.6,.5,1) forwards; }
.tags.revealed .tag.right:not(.picked) .stamp { display: none; }
@keyframes stamp { to { opacity: 1; transform: translateY(-50%) rotate(-12deg) scale(1); } }
.tag.wrong { transform: rotateX(180deg) !important; }
.tag.wrong.picked { animation: none; }

/* ---------- actions & hints ---------- */
.actions { display: grid; gap: 8px; }
.hints { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hint { display: grid; gap: 1px; align-content: center; justify-items: center; min-height: 64px; padding: 6px 4px; border-radius: 12px;
  background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 3px 0 rgba(26,20,16,.25); }
.h-name { font-weight: 800; font-size: 14px; line-height: 1.1; }
.h-note { font-size: 11px; line-height: 1.1; color: #5a4e45; }
.h-cost { display: inline-flex; align-items: center; font: 700 14px/1 var(--num); margin-top: 3px; background: var(--tag); border-radius: 999px; padding: 2px 7px 2px 8px; }
.hint:disabled { cursor: default; }
.hint.used { opacity: .55; } .hint.used .h-cost { background: #e9dfcf; }
.hint.poor { opacity: .7; } .hint.poor .h-cost { background: #e9dfcf; }
.hint:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(26,20,16,.25); }
.hint-note { margin: 0; font-size: 13px; text-align: center; }
.act-row { display: flex; gap: 8px; }
body.answered .act-row { position: sticky; bottom: calc(10px + var(--sab)); z-index: 5; }
.act-row:has(> :not([hidden])) { margin-top: 2px; }
.next, .walk { min-height: 56px; border-radius: 14px; font-weight: 800; font-size: 18px; padding: 0 16px; }
.next { flex: 1; background: var(--tag); color: var(--ink); box-shadow: 0 4px 0 #B98F12; }
.walk { background: var(--brick); border: 2px solid rgba(255,255,255,.8); font-size: 15px; flex: 0 1 auto; margin: 0 auto; }
.expert { padding: 12px 14px; font-size: 15px; line-height: 1.4; animation: cardIn .3s ease; }

/* ---------- receipt ---------- */
.receipt { position: relative; background: var(--paper); color: var(--ink); padding: 16px 14px 26px; border-radius: 6px 6px 0 0;
  font-family: var(--num); box-shadow: 0 16px 30px -16px rgba(40,6,4,.8); }
.rc-teeth { position: absolute; left: 0; right: 0; bottom: -10px; height: 12px;
  background: linear-gradient(-45deg, transparent 6px, var(--paper) 6px) 0 0/12px 12px repeat-x, linear-gradient(45deg, transparent 6px, var(--paper) 6px) 0 0/12px 12px repeat-x; }
.rc-head { text-align: center; border-bottom: 2px dashed rgba(26,20,16,.35); padding-bottom: 8px; margin-bottom: 6px; }
.rc-logo { font: 400 26px/1 var(--disp); }
.rc-sub { font: 500 12px/1.4 var(--txt); color: #5a4e45; margin-top: 4px; }
.rc-rows { display: grid; }
.rc-row { position: relative; display: grid; grid-template-columns: 16px auto 1fr auto 48px; align-items: baseline; gap: 6px; padding: 5px 6px; font-size: 16px; font-variant-numeric: tabular-nums; border-radius: 4px; }
.rc-row + .rc-row { border-top: 1px dashed rgba(26,20,16,.18); }
.rc-mark { font-family: var(--txt); font-weight: 800; font-size: 13px; }
.rc-l { font-weight: 500; white-space: nowrap; }
.rc-l em { display: block; font: 700 10.5px/1 var(--txt); font-style: normal; letter-spacing: .04em; color: var(--brick); text-transform: uppercase; }
.rc-fill { border-bottom: 2px dotted rgba(26,20,16,.3); height: 1px; }
.rc-v { font-weight: 600; text-align: right; }
.rc-c { font: 600 12px/1 var(--num); color: #5a4e45; text-align: right; white-space: nowrap; }
.rc-row.safe .rc-v, .rc-row.safe .rc-l { font-weight: 700; }
.rc-row.safe .rc-v::before { content: "★ "; color: var(--brick); }
.rc-row.done { color: #6b5d52; } .rc-row.done .rc-mark { color: #0d7a4c; }
.rc-row.cur { background: var(--tag); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.rc-row.cur .rc-v { font-size: 19px; }
.rc-row.punch { animation: punch .34s ease; }
@keyframes punch { 0% { transform: translateX(0); } 30% { transform: translateX(-6px); background: var(--ok); color: #fff; } 100% { transform: none; } }
.rc-foot { font: 500 12px/1.35 var(--txt); color: #5a4e45; border-top: 2px dashed rgba(26,20,16,.35); margin-top: 8px; padding-top: 8px; }

/* sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(26,20,16,.55); opacity: 0; transition: opacity .22s; }
.sheet { position: relative; width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; padding: 46px 12px calc(18px + var(--sab));
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.sheet-wrap.in .sheet { transform: none; } .sheet-wrap.in .sheet-bg { opacity: 1; }
.sheet-x { position: absolute; top: 4px; right: 8px; width: 44px; height: 44px; font-size: 30px; line-height: 1; color: #fff; z-index: 2; }
.paper-sheet { background: var(--paper); color: var(--ink); border-radius: 20px 20px 0 0; padding: 18px 18px calc(20px + var(--sab)); }
.paper-sheet .sheet-x { color: var(--ink); }
.paper-sheet h3 { margin: 0 0 8px; font: 400 24px/1.1 var(--disp); }
.help { margin: 0; padding-left: 18px; display: grid; gap: 9px; font-size: 15px; line-height: 1.42; }
kbd { font: 700 12px/1 var(--num); border: 1.5px solid var(--ink); border-radius: 4px; padding: 1px 5px; }

.dialog-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(26,20,16,.6); padding: 20px; }
.dialog { padding: 22px 20px 18px; max-width: 380px; font-size: 17px; line-height: 1.4; }
.dialog p { margin: 0 0 16px; font-weight: 600; }
.dialog-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.dialog-btns button { flex: 1 1 140px; min-height: 50px; border-radius: 12px; font-weight: 800; }
.ghost { border: 2px solid var(--ink) !important; }
.danger { background: var(--bad); color: #fff; box-shadow: inset 0 0 0 2px var(--red); }

/* ---------- chest overlay ---------- */
.chest-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(58,14,11,.86); padding: 20px; pointer-events: none; }
.chest-card { text-align: center; display: grid; justify-items: center; gap: 4px; padding: 10px 18px 18px; }
.chest-art { position: relative; width: 210px; height: 168px; }
.chest-svg { width: 100%; height: 100%; overflow: visible; }
.chest-lid { transform-origin: 100px 74px; transform-box: view-box; }
.chest-glow { opacity: 0; }
.chest-wrap.open .chest-lid { animation: lid .36s cubic-bezier(.3,1.4,.5,1) .12s forwards; }
.chest-wrap.open .chest-glow { animation: glow .4s ease .2s forwards; }
.chest-wrap.open .chest-card { animation: pop .3s cubic-bezier(.3,1.5,.5,1); }
.chest-wrap.close { animation: fade .22s ease forwards; }
@keyframes lid { to { transform: translateY(-26px) rotate(-24deg); } }
@keyframes glow { to { opacity: 1; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes fade { to { opacity: 0; } }
.chest-coins { position: absolute; left: 50%; top: 45%; }
.fly-coin { position: absolute; width: 22px; height: 22px; margin: -11px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 35% 30%, #FFF8EC 0 14%, transparent 15%), var(--tag); box-shadow: inset 0 0 0 2px var(--ink);
  animation: coin .7s cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes coin { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 60% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 40px)) scale(.9); } }
.chest-num { display: flex; align-items: center; gap: 10px; font: 400 56px/1 var(--disp); color: var(--tag); text-shadow: 0 4px 0 var(--brick); }
.chest-sub { font-weight: 700; font-size: 16px; }
.chest-sub.dark { color: var(--ink); font-weight: 600; max-width: 30ch; line-height: 1.35; font-size: 15px; }
.ruby-wrap .chest-card { padding: 22px 22px 22px; max-width: 360px; animation: pop .34s cubic-bezier(.3,1.5,.5,1); }
.ruby-big { display: flex; gap: 6px; }
.ruby-big .ruby-ico:nth-child(2) { transform: translateY(-10px); }
.ruby-num { color: var(--red); text-shadow: none; font-size: 40px; }

.toast { position: fixed; left: 50%; bottom: calc(18px + var(--sab)); z-index: 45; transform: translateX(-50%); width: min(92vw, 440px);
  background: var(--bad); color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: 0 0 0 3px var(--red), 0 18px 30px -10px rgba(0,0,0,.6); display: grid; gap: 4px; }
.toast b { font-size: 17px; } .toast span { font-size: 14px; line-height: 1.35; }
.toast.show { animation: toastIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes toastIn { from { transform: translate(-50%, 30px); opacity: 0; } }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.floater { position: absolute; transform: translateX(-50%); font: 700 18px/1 var(--num); color: #fff; background: var(--bad); padding: 3px 8px; border-radius: 8px; animation: floatUp 1.1s ease forwards; }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 26px); } }

/* ---------- final ---------- */
.final { display: grid; justify-items: center; gap: 22px; padding-top: 8px; }
.receipt.long { width: 100%; max-width: 460px; padding: 20px 18px 34px; }
.fr-title { font: 400 30px/1.1 var(--disp); text-align: center; margin-top: 10px; }
.fr-why { font: 500 15px/1.4 var(--txt); text-align: center; margin: 6px 0 0; }
.fr-prize { text-align: center; margin: 14px 0 8px; padding: 10px 0; border-top: 2px dashed rgba(26,20,16,.35); border-bottom: 2px dashed rgba(26,20,16,.35); }
.fr-prize small { display: block; font: 600 13px/1 var(--txt); color: #5a4e45; }
.fr-prize b { font: 400 clamp(30px, 10vw, 54px)/1.1 var(--disp); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fr-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fr-stats div { background: #fff; border-radius: 8px; padding: 6px 10px; border: 1.5px solid rgba(26,20,16,.12); }
.fr-stats small { display: block; font: 600 12px/1.2 var(--txt); color: #5a4e45; }
.fr-stats b { font: 700 22px/1.2 var(--num); }
.fr-eco { margin-top: 10px; font: 500 15px/1.2 var(--txt); }
.fr-eco div, .fr-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 2px; border-bottom: 1px dashed rgba(26,20,16,.2); }
.fr-eco b { font-family: var(--num); font-size: 17px; }
.fr-list { margin-top: 10px; font: 500 13px/1.3 var(--txt); }
.fr-row b { font-size: 15px; } .fr-row.ok b { color: #0d7a4c; } .fr-row.bad b { color: var(--brick); }
.fr-prize { position: relative; }
.fr-stamp { position: absolute; bottom: -20px; right: -6px; font: 400 18px/1 var(--disp); color: var(--ok); border: 4px solid var(--ok); border-radius: 8px; padding: 6px 10px; transform: rotate(-14deg); background: rgba(255,248,236,.85); animation: stampIn .4s cubic-bezier(.3,1.6,.5,1) .5s both; }
.fr-stamp.zero { color: var(--brick); border-color: var(--brick); font-size: 18px; }
@keyframes stampIn { from { opacity: 0; transform: rotate(-14deg) scale(2.2); } }
.final-actions { width: 100%; display: grid; justify-items: center; }
.board { width: 100%; max-width: 460px; padding: 16px 18px; }
.board h3 { margin: 0 0 8px; font: 400 20px/1 var(--disp); }
.lb-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px dashed rgba(26,20,16,.2); font-size: 15px; }
.lb-row a { color: var(--ink); font-weight: 700; }
.lb-row b { font-family: var(--num); }
.lb-row.mine { background: var(--tag); border-radius: 6px; padding: 6px 6px; }

/* ---------- wide ---------- */
@media (min-width: 720px) {
  .tags { grid-template-columns: repeat(3, 1fr); }
  .t-face { padding: 12px 16px 12px 38px; min-height: 96px; }
  .t-price { font-size: 36px; }
  .item { font-size: 32px; }
  .card { padding: 22px 24px 24px; }
  .stamp { right: 10%; }
}
@media (min-width: 1000px) {
  .game { grid-template-columns: 1fr 330px; align-items: start; }
  .col-side { display: block; position: sticky; top: 112px; }
  .col-main { min-height: 0; }
  .tags { margin-top: 4px; }
  .segs { flex-basis: 260px; flex-grow: 0; }
}
@media (max-width: 380px) {
  .logo-sm { font-size: 17px; }
  .pill { font-size: 14px; padding: 3px 8px 3px 4px; min-width: 0; }
  .icon { width: 36px; }
  .strip-text { font-size: 14px; }
  .t-price { font-size: 28px; }
  .h-note { display: none; }
}
@media (max-width: 380px) {
  .stk > i { display: none; }
  .stk { padding: 5px 7px; }
  .card { padding: 12px 13px 14px; }
  .ask { font-size: 16px; }
  .ctx { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .tag.picked { transform: none; }
  .tag.wrong { transform: none !important; }
  .tag.wrong .t-face { background: var(--bad); color: #fff; }
  .tag.wrong .t-letter { background: #fff; color: var(--bad); }
  .stamp { transform: translateY(-50%) rotate(-12deg); }
  .chest-wrap.open .chest-lid { transform: translateY(-26px) rotate(-24deg); }
}

/* after an answer the hints step aside so the explanation and the next button stay close */
body.answered .hints, body.answered .hint-note, body.answered .stakes { display: none; }
@media (min-width: 720px) { .stamp { left: 50%; transform: translate(-50%, -50%) rotate(-12deg) scale(2.2); } @keyframes stamp { to { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } } }
