/* Layout: one column, a printed card per screen, big thumb buttons at the bottom.
   Look: three-ink linocut — black ink ground, cream paper, pumpkin orange,
   with misregistered offset shadows instead of glossy depth. Dark by choice:
   the game is played in dim rooms at night. */
:root {
  --ink: #14110f;
  --ink-2: #221c18;
  --ink-3: #3a302a;
  --paper: #efe3cc;
  --paper-dim: #b8aa92;
  --pumpkin: #f26b1d;
  --pumpkin-deep: #b9460c;
  --good: #9cc27a;
  --font-display: "Rubik Dirt", "Rubik", "Arial Black", system-ui, sans-serif;
  --font-ui: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: 2.3rem;
  --step-4: 3.2rem;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* No rubber band and no double tap zoom: a screen that fits stays put. */
html { overscroll-behavior: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
/* iOS zooms into any field with text under 16px, so no field goes below it. */
input, textarea, select { font-size: max(16px, 1em); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Paper grain over everything, very faint. */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .09; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

#app {
  min-height: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: max(14px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
h1 { font-family: var(--font-display); font-size: var(--step-4); line-height: .95; }
h2 { font-family: var(--font-display); font-size: var(--step-3); line-height: 1; }
h3 { font-family: var(--font-ui); font-weight: 700; font-size: var(--step-1); }
p { margin: 0; }
.muted { color: var(--paper-dim); }
.label {
  font-size: var(--step--1); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--pumpkin);
}

/* Top bar */
.bar { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.bar .title { flex: 1; min-width: 0; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-spacer { width: 44px; height: 44px; flex: none; }
.icon-btn {
  appearance: none; border: 2px solid var(--ink-3); background: var(--ink-2); color: var(--paper);
  width: 44px; height: 44px; border-radius: 6px; font: 700 1.2rem/1 var(--font-ui); cursor: pointer;
  display: grid; place-items: center;
}

/* Buttons: ink block with a misregistered orange offset. */
.btn {
  appearance: none; cursor: pointer; text-decoration: none; text-align: center;
  font: 700 var(--step-1)/1.1 var(--font-ui);
  color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 5px 5px 0 var(--pumpkin);
  padding: 16px 18px; min-height: 58px;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--pumpkin); }
.btn.hot { background: var(--pumpkin); box-shadow: 5px 5px 0 var(--paper); }
.btn.hot:active { box-shadow: 1px 1px 0 var(--paper); }
.btn.ghost { background: transparent; color: var(--paper); border-color: var(--ink-3); box-shadow: none; font-size: var(--step-0); min-height: 50px; }
.btn.small { font-size: var(--step-0); min-height: 48px; padding: 10px 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--pumpkin); outline-offset: 3px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.actions { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }

/* Printed paper card */
.card {
  background: var(--paper); color: var(--ink);
  border-radius: 3px; padding: 22px 20px;
  box-shadow: -4px 5px 0 var(--pumpkin-deep);
  position: relative;
}
.card .label { color: var(--pumpkin-deep); }
.card.prompt { text-align: center; }
/* Text cards breathe: content sits in the middle of a tall card with even gaps. */
.card.prompt, .role-card { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; min-height: clamp(200px, 32vh, 380px); padding: 28px 22px; }
.card.prompt > *, .role-card > * { margin: 0; max-width: 100%; }
.card.prompt .meta { margin-bottom: 0; }
.card.taboo { min-height: clamp(300px, 46vh, 460px); gap: 22px; }
.card.taboo .bigtext { margin-bottom: 6px; }
.card.taboo .chips-row { gap: 12px; margin-top: 4px; }
.role-card { min-height: clamp(300px, 50vh, 500px); gap: 18px; }
.tarot-back { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tarot-back small { font: 700 .72rem/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-dim); }
.card.tall { min-height: clamp(300px, 48vh, 480px); gap: 20px; }
.card.prompt p.big { font-size: clamp(1.45rem, 6vw, 2rem); line-height: 1.22; font-weight: 700; text-wrap: pretty; }
.card .who { font-family: var(--font-display); font-size: var(--step-2); line-height: 1; color: var(--ink); }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: .66rem; font-weight: 700; line-height: 1.2;
  padding: 2px 7px; border: 1.5px solid currentColor; border-radius: 99px; text-transform: uppercase; letter-spacing: .06em; opacity: .85;
}

.print { display: block; width: 100%; height: auto; border-radius: 2px; background: var(--paper); }
.print-frame { background: var(--paper); padding: 8px; border-radius: 2px; box-shadow: 5px 5px 0 var(--pumpkin); }

/* Home */
.hero { display: grid; gap: 14px; }
.hero .wordmark { width: 100%; max-width: 420px; margin: 0 auto; }
.players-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.games > * { min-width: 0; }
.game-tile {
  appearance: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--paper); background: none;
  display: flex; flex-direction: column; gap: 8px; font: inherit; min-width: 0; width: 100%;
}
img { max-width: 100%; }
.thumb, .print { width: 100%; height: auto; }
.game-tile .thumb { aspect-ratio: 4 / 3; width: 100%; max-width: 100%; object-fit: cover; background: var(--paper); border-radius: 2px; box-shadow: 4px 4px 0 var(--pumpkin); transition: transform .12s; }
.game-tile:nth-child(3n+2) .thumb { box-shadow: -4px 4px 0 var(--pumpkin); }
.game-tile:active .thumb { transform: scale(.97) rotate(-1deg); }
.game-tile .name { font-weight: 900; font-size: 1.02rem; line-height: 1.15; }
.game-tile .sub { font-size: var(--step--1); color: var(--paper-dim); line-height: 1.3; }

/* Forms */
.field { display: flex; gap: 10px; }
.field input {
  flex: 1; min-width: 0; font: 500 var(--step-1) var(--font-ui); color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink-3); border-radius: 4px; padding: 12px 14px; min-height: 56px;
}
.field input::placeholder { color: #8a7d68; }
.seat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: seat; }
.seat-list li {
  display: flex; align-items: center; gap: 10px; background: var(--ink-2); border: 2px solid var(--ink-3);
  border-radius: 4px; padding: 6px 6px 6px 12px; counter-increment: seat;
}
.seat-list li::before { content: counter(seat); font-weight: 900; color: var(--pumpkin); width: 1.4em; font-variant-numeric: tabular-nums; }
.seat-list .nm { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button {
  appearance: none; cursor: pointer; font: 700 var(--step-0) var(--font-ui); color: var(--paper);
  background: var(--ink-2); border: 3px solid var(--ink-3); border-radius: 4px; padding: 12px 6px; min-height: 64px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.seg button small { font-weight: 400; font-size: .78rem; color: var(--paper-dim); }
.seg button[aria-pressed="true"] { background: var(--pumpkin); color: var(--ink); border-color: var(--ink); }
.seg button[aria-pressed="true"] small { color: var(--ink); }
.toggle {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--ink-2);
  border: 2px solid var(--ink-3); border-radius: 4px; cursor: pointer;
}
.toggle input { width: 26px; height: 26px; accent-color: var(--pumpkin); flex: none; }
.toggle span { flex: 1; min-width: 0; }
.toggle small { display: block; color: var(--paper-dim); font-size: var(--step--1); }

/* Timer */
.timer { display: flex; align-items: center; gap: 12px; }
.timer .num { font: 900 var(--step-3)/1 var(--font-ui); font-variant-numeric: tabular-nums; min-width: 2.2ch; text-align: right; }
.timer .track { flex: 1; height: 12px; background: var(--ink-3); border-radius: 99px; overflow: hidden; }
.timer .fill { height: 100%; background: var(--pumpkin); width: 100%; transition: width .25s linear; }
.card .timer .track { background: #d6c6a8; }

/* Choice chips for picking a player */
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pick button {
  appearance: none; cursor: pointer; font: 700 var(--step-0) var(--font-ui); color: var(--paper); background: var(--ink-2);
  border: 3px solid var(--ink-3); border-radius: 4px; padding: 12px 10px; min-height: 56px; overflow-wrap: anywhere;
}
.pick button[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--pumpkin); }
.pick button.dead { opacity: .5; text-decoration: line-through; }

/* Bottle */
.table {
  position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 6px auto 0;
  border-radius: 50%; background: url("img/flasa-table.webp") center / 72% no-repeat;
}
.seat {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 36%; text-align: center; font-weight: 900; font-size: .9rem; line-height: 1.1; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  padding: 6px 8px; border-radius: 4px; background: var(--ink); border: 2px solid var(--ink-3);
  transition: background .3s, color .3s;
}
.seat.spinner { border-color: var(--paper); }
.seat.target { background: var(--pumpkin); color: var(--ink); border-color: var(--ink); }
.bottle {
  position: absolute; left: 50%; top: 50%; width: 14.4%; height: 43%; margin-left: -7.2%; margin-top: -21.5%;
  transform-origin: 50% 50%; transition: transform 3.4s cubic-bezier(.12,.75,.12,1);
  border: 0; background: none; padding: 0; cursor: pointer;
}
.bottle img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)); -webkit-user-select: none; user-select: none; }

/* Kto som */
.forehead {
  position: fixed; inset: 0; z-index: 30; background: var(--pumpkin); color: var(--ink);
  display: grid; grid-template-columns: 1fr 1fr; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.forehead .word {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none;
  font-family: var(--font-display); font-size: clamp(2.4rem, 11vw, 5.5rem); line-height: 1; padding: 0 6vw;
}
.forehead .hint { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom, 0px)); text-align: center; font-weight: 700; font-size: var(--step-0); }
.forehead .top { position: absolute; left: 0; right: 0; top: max(14px, env(safe-area-inset-top, 0px)); display: flex; justify-content: space-between; padding: 0 max(16px, env(safe-area-inset-left, 0px)); font: 900 var(--step-2)/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.forehead button { appearance: none; border: 0; background: transparent; cursor: pointer; }
.forehead.flash-ok { background: var(--good); }
.forehead.flash-pass { background: var(--paper-dim); }
@media (orientation: landscape) { .forehead .word { font-size: clamp(2.4rem, 9vw, 6rem); } }

/* Seansa */
.seance { background: #070605; margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); padding-inline: var(--gutter-l) var(--gutter-r); flex: 1; display: flex; flex-direction: column; gap: 18px; padding-block: 8px; }
.candle {
  appearance: none; border: 0; background: none; cursor: pointer; margin: 10px auto 0; display: block; width: 120px; height: 180px; position: relative;
}
.candle .flame {
  position: absolute; left: 50%; top: 8px; width: 34px; height: 56px; margin-left: -17px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 70%, var(--paper) 0 22%, var(--pumpkin) 55%, transparent 72%);
  animation: flicker 1.6s infinite alternate ease-in-out; transform-origin: 50% 90%;
}
.candle .wax { position: absolute; left: 50%; bottom: 0; width: 46px; height: 110px; margin-left: -23px; background: var(--paper); border-radius: 3px 3px 2px 2px; box-shadow: 4px 0 0 var(--pumpkin-deep); }
.candle.out .flame { animation: none; opacity: .15; transform: scale(.5); }
@keyframes flicker { 0% { transform: rotate(-3deg) scaleY(1); opacity: .9 } 40% { transform: rotate(2deg) scaleY(1.08) } 70% { transform: rotate(-1deg) scaleY(.94); opacity: 1 } 100% { transform: rotate(3deg) scaleY(1.04); opacity: .85 } }
.ghost-text {
  min-height: 6.5em; font-family: var(--font-display); font-size: clamp(1.7rem, 8vw, 2.6rem); line-height: 1.12;
  text-align: center; color: var(--paper); text-wrap: balance; letter-spacing: .02em;
}
.ghost-text .cursor { display: inline-block; width: .5ch; color: var(--pumpkin); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0 } }
.seance.flicker { animation: room 0.9s steps(2) 1; }
@keyframes room { 0% { filter: brightness(1) } 30% { filter: brightness(.2) } 60% { filter: brightness(1.4) } 100% { filter: brightness(1) } }

/* Lebka */
.skull-wrap { display: grid; place-items: center; padding: 10px 0; }
.skull { width: min(70vw, 300px); aspect-ratio: 1; display: grid; place-items: center; }
.skull img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid var(--paper); }
.skull.lit { animation: pulse var(--pulse, 1.2s) infinite ease-in-out; }
@keyframes pulse { 0%, 100% { transform: scale(1) rotate(-1deg) } 50% { transform: scale(1.05) rotate(1.5deg) } }
.boom {
  position: fixed; inset: 0; z-index: 40; background: var(--pumpkin); color: var(--ink); display: grid; place-items: center;
  font-family: var(--font-display); font-size: clamp(4rem, 26vw, 9rem); animation: boom .5s ease-out 1;
}
@keyframes boom { 0% { transform: scale(1.3); filter: brightness(2) } 100% { transform: scale(1); filter: none } }

/* Upíri */
.role-card { text-align: center; }
.role-card .role { font-family: var(--font-display); font-size: var(--step-4); line-height: 1; margin: 6px 0 10px; }
.handoff { text-align: center; padding: 40px 0 10px; display: grid; gap: 10px; }
.handoff .nm { font-family: var(--font-display); font-size: var(--step-4); line-height: 1; color: var(--pumpkin); overflow-wrap: anywhere; }

/* Mannequin */
.cam { position: relative; width: 100%; aspect-ratio: 3 / 4; background: var(--ink-2); border-radius: 3px; overflow: hidden; border: 3px solid var(--paper); }
.cam canvas, .cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .count { position: absolute; inset: 0; display: grid; place-items: center; font: 900 clamp(4rem, 22vw, 8rem)/1 var(--font-ui); color: var(--paper); text-shadow: 5px 5px 0 var(--pumpkin); pointer-events: none; }

/* Summary */
.rank { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rank th, .rank td { padding: 10px 6px; text-align: left; border-bottom: 2px solid var(--ink-3); }
.rank th { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .07em; color: var(--paper-dim); font-weight: 700; }
.rank td.n { text-align: right; width: 4.2em; }
.rank tr:first-child td { color: var(--pumpkin); font-weight: 900; }

.quit-dialog {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(10, 8, 7, .78);
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
}
.quit-dialog .card { width: min(100%, 420px); }
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  background: var(--paper); color: var(--ink); font-weight: 700; padding: 12px 18px; border-radius: 4px; box-shadow: 4px 4px 0 var(--pumpkin);
  max-width: calc(100% - 32px);
}
.noscript { padding: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 520px) { .games { grid-template-columns: 1fr 1fr; gap: 20px; } }

/* ============================ splash ============================ */
.splash {
  position: fixed; top: 0; left: 0; right: 0; height: var(--screen-h, 100%); z-index: 100; background: var(--paper); cursor: pointer;
  display: block; outline: none; touch-action: none; user-select: none; -webkit-user-select: none;
}
.splash-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.splash-hint {
  position: absolute; left: 0; right: 0; bottom: max(22px, env(safe-area-inset-bottom, 0px)); margin: 0;
  text-align: center; font: 700 var(--step--1)/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper); text-shadow: 0 1px 0 var(--ink), 0 0 10px var(--ink);
  opacity: 0; animation: hint 2.4s ease-in-out 2.5s infinite;
}
@keyframes hint { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }
.splash.fade-out { transition: opacity .35s; opacity: 0; }
.shatter { position: fixed; top: 0; left: 0; width: 100vw; height: var(--screen-h, 100vh); z-index: 100; pointer-events: none; }

/* ============================ home ============================ */
/* Home never scrolls or bounces: pinned to the viewport, body locked. */
body.lock { overflow: hidden; position: fixed; inset: 0; width: 100%; }
#app.is-home { position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; min-height: 0; overflow: hidden; gap: 14px; overscroll-behavior: none; touch-action: pan-x; }
.top-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.top-btn {
  appearance: none; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 8px 12px; cursor: pointer;
  font: 700 var(--step-0)/1 var(--font-ui); color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); border-radius: 10px; box-shadow: 4px 4px 0 var(--pumpkin);
  transition: transform .08s, box-shadow .08s;
}
.top-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--pumpkin); }
.top-btn .ico { display: inline-flex; width: 30px; height: 24px; flex: none; }
.top-btn svg { width: 100%; height: 100%; fill: var(--ink); }
.top-btn svg .hole { fill: var(--paper); }
.top-btn svg .ln { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }

.carousel { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); }
.car-track { position: relative; flex: 1; min-height: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow: hidden; }
.car-card {
  position: absolute; left: 50%; top: 50%; width: var(--w, 280px); aspect-ratio: 2 / 3;
  appearance: none; border: 0; padding: 0; margin: 0; cursor: pointer; background: var(--paper);
  border-radius: 6px; box-shadow: 6px 6px 0 var(--pumpkin); will-change: transform, filter;
  -webkit-touch-callout: none;
}
.car-card img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; pointer-events: none; }
.car-min {
  position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font: 700 var(--step--1)/1.2 var(--font-ui); pointer-events: none;
}
.car-caption { display: grid; grid-template-rows: auto auto; align-content: start; justify-items: center; text-align: center; gap: 2px; padding: 6px 16px 0; height: 62px; flex: none; overflow: hidden; }
.car-caption .name { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.1; color: var(--paper); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-caption .sub { font-size: var(--step--1); color: var(--paper-dim); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================ v3 ============================ */
.center { text-align: center; }
.status { text-align: center; color: var(--paper-dim); margin: 0; }
.steps { padding-left: 1.2em; margin: 0; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; text-align: center; color: var(--paper-dim); }
.results li.ok { color: var(--paper); }

/* Language strip before the logo */
.lang-screen {
  position: fixed; inset: 0; z-index: 110; background: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.lang-hint { margin: 0; color: var(--paper-dim); font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase; }
.flags {
  display: flex; gap: 10px; overflow-x: auto; max-width: 100%; padding: 8px max(16px, calc(50% - 22px));
  scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.flags::-webkit-scrollbar { display: none; }
.flag {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  font-size: 26px; line-height: 1; background: var(--ink-2); border: 2px solid var(--ink-3); scroll-snap-align: center;
  transition: transform .12s, border-color .12s;
}
.flag:active { transform: scale(.92); }
.flag.on { border-color: var(--pumpkin); box-shadow: 0 0 0 3px rgba(242, 107, 29, .25); }

/* Curse over the whole screen */
.curse {
  position: fixed; inset: 0; z-index: 90; background: rgba(10, 8, 7, .96);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(24px, env(safe-area-inset-bottom, 0px));
  animation: curse-in .45s ease-out both;
}
.curse h1 { font-size: clamp(2.4rem, 12vw, 4.2rem); line-height: 1; color: var(--pumpkin); text-wrap: balance; text-shadow: 4px 4px 0 #000; }
.curse .explain { max-width: 30em; color: var(--paper); margin: 0; }
.curse .btn { min-width: 200px; }
@keyframes curse-in { 0% { opacity: 0; transform: scale(1.08); filter: blur(6px); } 60% { opacity: 1; } 100% { transform: none; filter: none; } }

/* Mannequin: the canvas already contains the frame */
.cam:has(canvas.framed) { border: 0; background: transparent; }
.cam canvas.framed { object-fit: contain; }
.btn[disabled] { opacity: .45; }

/* Placeholder card until a game has its illustration */
.car-ph {
  width: 100%; height: 100%; border-radius: 6px; display: grid; grid-template-rows: 1fr auto auto 1fr; justify-items: center; gap: 10px;
  padding: 18px; text-align: center; color: var(--ink);
  background:
    radial-gradient(circle at 50% 28%, rgba(242, 107, 29, .22) 0 22%, transparent 23%),
    repeating-linear-gradient(-8deg, rgba(20, 17, 15, .05) 0 2px, transparent 2px 7px),
    var(--paper);
  border: 3px solid var(--ink);
}
.car-ph .ph-num { align-self: end; font: 900 3.4rem/1 var(--font-display); color: var(--pumpkin); text-shadow: 3px 3px 0 var(--ink); }
.car-ph .ph-name { font: 400 1.7rem/1.05 var(--font-display); text-wrap: balance; }
.car-ph .ph-sub { font-size: .9rem; color: #5a4c40; }

/* Hold to reveal */
.hold { display: grid; gap: 10px; justify-items: center; }
.hold-word {
  min-height: 3.2em; width: 100%; display: grid; place-items: center; text-align: center; padding: 10px 14px;
  font: 400 clamp(1.6rem, 8vw, 2.4rem)/1.1 var(--font-display); color: var(--paper-dim);
  background: var(--ink-2); border: 2px dashed var(--ink-3); border-radius: 6px; user-select: none; -webkit-user-select: none;
}
.hold-word.on { color: var(--ink); background: var(--paper); border-style: solid; border-color: var(--pumpkin); }
.hold-btn { touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* Scoreboards and big centred texts used by the newer games */
.scoreline { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-weight: 800; }
.scoreline .team { padding: 6px 12px; border-radius: 99px; border: 2px solid var(--ink-3); }
.scoreline .team.on { border-color: var(--pumpkin); color: var(--pumpkin); }
.bigtext { font: 400 clamp(2rem, 10vw, 3.4rem)/1.05 var(--font-display); text-align: center; text-wrap: balance; margin: 0; }
.vs { display: grid; grid-template-columns: 1fr; gap: 12px; }
.vs .opt { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 16px; text-align: center; font-weight: 800; font-size: 1.15rem; line-height: 1.25; box-shadow: 4px 4px 0 var(--pumpkin); }
.vs .or { text-align: center; font: 400 1.4rem/1 var(--font-display); color: var(--pumpkin); }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pchip { appearance: none; border: 2px solid var(--ink-3); background: var(--ink-2); color: var(--paper); border-radius: 99px; padding: 8px 12px; font-weight: 800; cursor: pointer; }
.pchip[aria-pressed="true"] { background: var(--pumpkin); color: var(--ink); border-color: var(--ink); }
.pchip .n { margin-left: 6px; font-variant-numeric: tabular-nums; opacity: .8; }
.pchip.out { opacity: .4; text-decoration: line-through; }

/* Batch 1 widgets */
.orb {
  width: min(52vw, 220px); aspect-ratio: 1; margin: 6px auto; border-radius: 50%; position: relative; border: 0; padding: 0; display: block;
  background: radial-gradient(circle at 35% 30%, #fff8 0 8%, transparent 9%), radial-gradient(circle at 50% 55%, #3a302a 0 45%, #14110f 70%);
  box-shadow: 0 0 0 6px var(--ink-3), 0 0 30px rgba(242, 107, 29, .15); cursor: pointer;
}
.orb.big { width: min(64vw, 260px); }
.orb span { position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, rgba(242, 107, 29, .0), rgba(242, 107, 29, .0)); transition: background .6s; }
.orb.glow span { background: radial-gradient(circle, rgba(242, 107, 29, .55), rgba(242, 107, 29, 0) 70%); }
.orb.swirl span { animation: swirl 1.6s ease-in-out; background: conic-gradient(from 0deg, rgba(242, 107, 29, .6), rgba(239, 227, 204, .4), rgba(242, 107, 29, .6)); }
@keyframes swirl { from { transform: rotate(0); filter: blur(4px); } to { transform: rotate(720deg); filter: blur(1px); } }
.fortune { min-height: 3.5em; text-align: center; }
.tarot-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tarot {
  appearance: none; border: 0; padding: 0; cursor: pointer; height: clamp(150px, 21vh, 190px); perspective: 900px; position: relative; background: none; color: var(--ink); width: 100%;
}
.tarot > div { position: absolute; inset: 0; border-radius: 6px; backface-visibility: hidden; transition: transform .6s; }
.tarot-back { display: grid; place-items: center; font-size: 2.2rem; color: var(--pumpkin); background: repeating-linear-gradient(45deg, var(--ink-2) 0 8px, var(--ink) 8px 16px); border: 3px solid var(--pumpkin); }
.tarot-face { transform: rotateY(180deg); background: var(--paper); border: 3px solid var(--ink); padding: 12px 16px; overflow: auto; font-size: .95rem; line-height: 1.3; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.tarot-face p { margin: 0; }
.tarot-face .label { font-size: .72rem; letter-spacing: .08em; }
.tarot-name { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.05; text-wrap: balance; }
.tarot.open .tarot-back { transform: rotateY(180deg); }
.tarot.open .tarot-face { transform: rotateY(360deg); }
.pad-wrap { display: grid; gap: 8px; justify-items: center; }
.pad { width: min(100%, 420px); aspect-ratio: 1; border-radius: 6px; touch-action: none; box-shadow: 4px 4px 0 var(--pumpkin); }
.story p { margin: 0 0 6px; text-align: left; }
.meta.center { display: flex; justify-content: center; }

/* Batch 2 widgets */
.mirror { position: relative; width: min(100%, 360px); aspect-ratio: 3 / 4; margin: 0 auto; border-radius: 48% 48% 10px 10px / 30% 30% 10px 10px; overflow: hidden; border: 6px solid #3a302a; background: radial-gradient(circle at 50% 40%, #2a2420, #070605); --dark: .25; }
.mirror-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); filter: grayscale(.7) contrast(1.2) brightness(.8); }
.mirror-veil { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(0,0,0,0) 30%, rgba(0,0,0,.9) 80%), rgba(60, 0, 0, var(--dark)); pointer-events: none; transition: background .4s; }
.mirror.nocam .mirror-video { display: none; }
.mirror.glitch { animation: glitch .12s steps(2) infinite; }
.mirror.glitch .mirror-veil { background: rgba(170, 0, 0, .55); }
@keyframes glitch { 0% { transform: translate(0, 0) skewX(0); filter: hue-rotate(0); } 50% { transform: translate(-6px, 3px) skewX(4deg); filter: hue-rotate(90deg); } 100% { transform: translate(5px, -4px) skewX(-3deg); } }
.death { color: var(--pumpkin); font-weight: 800; }
.ouija { background: radial-gradient(circle at 50% 40%, #4a3a2c, #241c16); border: 3px solid #6b5440; border-radius: 12px; padding: 26px 12px; }
.ouija-word { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.ouija-word span { width: 1.6em; height: 2em; border-bottom: 3px solid var(--paper-dim); display: grid; place-items: center; font: 400 clamp(1.4rem, 7vw, 2.2rem)/1 var(--font-display); color: var(--paper); }
.bigtext.dance { animation: bob .5s ease-in-out infinite alternate; }
.bigtext.freeze { color: var(--pumpkin); }
@keyframes bob { from { transform: translateY(-4px) rotate(-2deg); } to { transform: translateY(4px) rotate(2deg); } }
.meter { height: 18px; background: var(--ink-3); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--paper), var(--pumpkin)); transition: width .06s linear; }
.maze-wrap { display: grid; justify-items: center; width: 100%; }
.maze-wrap.gone { display: none; }
.maze { display: block; margin: 0 auto; width: min(calc(100% - 6px), 360px, calc(56dvh * 360 / 560)); height: auto; aspect-ratio: 360 / 560; border-radius: 8px; touch-action: none; box-shadow: 4px 4px 0 var(--pumpkin); }
.duel { position: relative; display: grid; grid-template-rows: 1fr 1fr; height: min(62vh, 520px); border-radius: 10px; overflow: hidden; border: 3px solid var(--ink-3); }
.duel-half { appearance: none; border: 0; background: var(--ink-2); color: var(--paper); font: 400 1.6rem/1 var(--font-display); cursor: pointer; touch-action: manipulation; }
.duel-half + .duel-ghost + .duel-half, .duel-half:last-child { border-top: 2px dashed var(--ink-3); }
.duel-half.flip span { display: inline-block; transform: rotate(180deg); }
.duel-ghost { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.2); font-size: 5rem; opacity: 0; pointer-events: none; transition: transform .12s, opacity .12s; }
.duel-ghost.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.duel.over .duel-half { opacity: .6; }
.duel.over .duel-half.win { opacity: 1; background: var(--pumpkin); color: var(--ink); }
.duel-half.win span { display: inline-block; animation: nameshake .5s ease-in-out 3; }
.duel-half.flip.win span { animation-name: nameshake-flip; }
@keyframes nameshake { 0%, 100% { transform: translateX(0) scale(1.15); } 20% { transform: translateX(-8px) rotate(-4deg) scale(1.2); } 40% { transform: translateX(8px) rotate(4deg) scale(1.2); } 60% { transform: translateX(-6px) rotate(-3deg) scale(1.2); } 80% { transform: translateX(6px) rotate(3deg) scale(1.2); } }
@keyframes nameshake-flip { 0%, 100% { transform: rotate(180deg) translateX(0) scale(1.15); } 20% { transform: rotate(176deg) translateX(-8px) scale(1.2); } 40% { transform: rotate(184deg) translateX(8px) scale(1.2); } 60% { transform: rotate(177deg) translateX(-6px) scale(1.2); } 80% { transform: rotate(183deg) translateX(6px) scale(1.2); } }
.score10 button { min-width: 3em; }

/* Batch 4 widgets */
.blind-wrap { position: relative; width: min(100%, 420px); margin: 0 auto; }
.blind-wrap .pad { width: 100%; display: block; }
.blind-veil { position: absolute; inset: 0; border-radius: 6px; background: var(--ink); color: var(--ink-3); display: grid; place-items: center; text-align: center; padding: 16px; font-weight: 800; pointer-events: none; transition: opacity .4s; }
.blind-wrap.open .blind-veil { opacity: 0; }
.blind-wrap.open .pad { pointer-events: none; }
.rap-words { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.rap-words span { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 10px 14px; font: 400 clamp(1.4rem, 7vw, 2rem)/1 var(--font-display); box-shadow: 4px 4px 0 var(--pumpkin); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.duo > div { border: 2px solid var(--ink-3); border-radius: 6px; padding: 8px; overflow-wrap: anywhere; }
.duo .label { margin: 0 0 4px; }
.darkness { position: fixed; inset: 0; z-index: 60; background: #000; color: #3a3330; display: grid; place-content: center; text-align: center; gap: 8px; font-weight: 800; }
.dark-num { font: 400 clamp(5rem, 30vw, 9rem)/1 var(--font-display); color: #2a2422; }
.cups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 360px; margin: 0 auto; width: 100%; }
.cup { appearance: none; aspect-ratio: 3 / 4; border: 2px solid var(--ink); border-radius: 6px 6px 22px 22px; background: linear-gradient(var(--paper) 0 35%, var(--pumpkin) 35%); color: var(--ink); font: 400 2rem/1 var(--font-display); cursor: pointer; box-shadow: 3px 3px 0 var(--ink-3); }
.cup:disabled { opacity: .25; cursor: default; }
.card.warn { border: 2px solid var(--pumpkin); }
.check { display: flex; gap: 10px; align-items: center; justify-content: center; font-weight: 800; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--pumpkin); }
.lava-alarm { display: grid; gap: 10px; justify-items: center; animation: lavaflash .5s steps(2) infinite; padding: 18px 0; border-radius: 6px; }
.lava-num { font: 400 clamp(5rem, 30vw, 9rem)/1 var(--font-display); color: var(--pumpkin); }
@keyframes lavaflash { 0% { background: transparent; } 100% { background: rgba(255, 90, 20, .25); } }
.bigtext.calm { opacity: .7; }
.pchip.on { border-color: var(--pumpkin); color: var(--pumpkin); }
@media (prefers-reduced-motion: reduce) { .lava-alarm { animation: none; background: rgba(255, 90, 20, .2); } }
.hold-word.long { font: 800 1.05rem/1.35 "Rubik", system-ui, sans-serif; }

.write-in { width: 100%; font: 500 var(--step-1) var(--font-ui); color: var(--ink); background: var(--paper); border: 3px solid var(--ink-3); border-radius: 4px; padding: 12px 14px; min-height: 56px; }
.card.taboo .pchip.out { background: transparent; border-color: var(--pumpkin-deep); color: var(--ink); opacity: .8; font-size: 1.02rem; padding: 7px 14px; text-decoration-thickness: 2px; }
.card.prompt.compact { min-height: 0; padding: 22px 20px; }
.tally { display: grid; gap: 8px; }
.krik-clock { font-variant-numeric: tabular-nums; }
.vs { gap: 16px; margin-block: 6px; }
.vs .opt { min-height: clamp(96px, 15vh, 140px); display: grid; place-items: center; padding: 22px 18px; font-size: 1.25rem; text-wrap: balance; }

/* Mŕtvy sa nehýbe: the freeze word fills the screen and turns with the phone */
.freeze-full { position: fixed; inset: 0; z-index: 60; background: var(--pumpkin); color: var(--ink); overflow: hidden; animation: boom .35s ease-out; }
.ff-box { position: absolute; left: 50%; top: 50%; display: grid; justify-items: center; gap: 14px; transform-origin: 50% 50%; }
.ff-word { font: 400 100px/0.95 var(--font-display); white-space: nowrap; letter-spacing: .01em; }
.ff-sub { font: 800 clamp(1.1rem, 5vw, 1.6rem)/1.2 var(--font-ui); text-align: center; }
.freeze-full .timer { width: min(70vw, 420px); }
.freeze-full .timer .track { background: rgba(20, 17, 15, .25); }
.freeze-full .timer .fill { background: var(--ink); }
.freeze-full .timer .num { color: var(--ink); }
.music-row { gap: 10px; }
.music-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border-radius: 6px; font: 800 1.05rem var(--font-ui); cursor: pointer; border: 3px solid var(--ink-3); background: var(--ink-2); color: var(--paper); }
.music-btn .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.music-btn.spotify .dot { background: #1ed760; }
.music-btn.apple .dot { background: linear-gradient(135deg, #fa5c74, #fb233b); }

/* Start-up failure notice */
.crash {
  position: fixed; inset: 0; z-index: 200; background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); text-align: center;
}
.crash-msg { font-size: var(--step--1); color: var(--paper-dim); overflow-wrap: anywhere; }

/* iOS home-screen app with the see-through status bar lays the page out a status bar
 * short of the screen; a document that tall again makes iOS use the whole screen. */
@media (display-mode: standalone) {
  html { min-height: calc(100% + env(safe-area-inset-top, 0px)); }
}

/* ============================ purchase ============================ */
.car-lock {
  position: absolute; top: 8px; left: 8px; padding: 3px 7px; border-radius: 999px;
  background: var(--ink); font: 700 var(--step--1)/1.2 var(--font-ui); pointer-events: none;
}
.link { appearance: none; background: none; border: 0; padding: 0; color: var(--pumpkin); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.paywall { text-align: center; }
/* Thank-you after payment: logo and words in the middle, the button at the bottom. */
.paywall.thanks { display: flex; flex-direction: column; flex: 1; min-height: calc(var(--screen-h, 100dvh) - max(14px, env(safe-area-inset-top, 0px)) - max(20px, env(safe-area-inset-bottom, 0px))); }
.thanks-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.paywall .thanks-mid .thanks-logo { flex: none; width: min(56vw, 240px); height: min(56vw, 240px); max-width: none; object-fit: contain; border-radius: 22%; box-shadow: 6px 6px 0 var(--paper); }
.paywall .pay-extra { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 12px; }
.paywall .pay-n { text-align: center; font-weight: 700; }
.paywall .pay-total { font: 900 var(--step-2)/1.1 var(--font-ui); color: var(--paper); margin: 0; }
.paywall input[type="email"] { width: 100%; padding: 14px; border-radius: 6px; border: 2px solid var(--line, #3a312b); background: var(--paper); color: var(--ink); }

[hidden] { display: none !important; }
