/* Mind the Blank. Pub-cartoon look: flat colour floods, thick ink outlines,
   hard drop shadows, beer-mat cards and a pint glass for a clock.
   Everything is sized in em off #app's font-size, which tracks phone width,
   and every screen is a fixed-height flex column: nothing ever scrolls. */

:root {
  --ink: #17112b;
  --foam: #fff4d6;
  --lager: #ffc914;
  --pink: #ff3f8e;
  --pink-deep: #d4116a;
  --teal: #12c4b0;
  --sky: #3fa7ff;
  --red: #f2452e;
  --display: 'Titan One', 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --body: 'Nunito', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --app-h: 100dvh;
  --app-top: 0px;
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--ink); }
body { font-family: var(--body); font-weight: 800; color: var(--foam); -webkit-font-smoothing: antialiased; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input { font: inherit; user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; }

/* ------------------------------------------------------------ shell */

#app {
  --bg: #4b2a9b; --bg2: #5633ae;
  position: fixed; left: 0; right: 0; top: var(--app-top); height: var(--app-h);
  max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden; overflow: clip;
  font-size: clamp(15px, 4.4vw, 19px);
  background: var(--bg); transition: background-color .35s;
  padding-top: env(safe-area-inset-top);
}
#app[data-phase='prompt'] { --bg: #0b8f86; --bg2: #0e9d93; }
#app[data-phase='reveal'] { --bg: #d92573; --bg2: #e4347f; }
#app[data-phase='vote'] { --bg: #1f6fd6; --bg2: #2b7de3; }
#app[data-phase='results'] { --bg: #2a1458; --bg2: #331a69; }
#app[data-phase='final'] { --bg: #e2600f; --bg2: #ec701c; }

.burst { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.burst::before {
  content: ''; position: absolute; left: 50%; top: 34%; width: 240vmax; height: 240vmax; translate: -50% -50%;
  background: repeating-conic-gradient(var(--bg) 0 9deg, var(--bg2) 9deg 18deg);
  animation: spin 90s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }

#bar { position: relative; z-index: 2; display: flex; align-items: center; gap: .6em; padding: .5em .8em 0; }
.bar-title { flex: 1; text-align: center; font-family: var(--display); font-size: 1.05em; letter-spacing: .01em; text-shadow: 0 .1em 0 var(--ink); }
.bar-btn { width: 2.5em; height: 2.5em; flex: none; display: grid; place-items: center; background: var(--foam); color: var(--ink); border: .16em solid var(--ink); border-radius: .8em; box-shadow: 0 .2em 0 var(--ink); }
.bar-btn:active { translate: 0 .15em; box-shadow: 0 .05em 0 var(--ink); }
.bar-btn.ghost { visibility: hidden; }
.ic { display: inline-grid; width: 1.3em; height: 1.3em; flex: none; }
.ic svg { width: 100%; height: 100%; }

#stage { position: relative; z-index: 1; flex: 1; min-height: 0; }
.screen { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: .7em; padding: .7em 1em calc(.9em + env(safe-area-inset-bottom)); }
.screen.enter { animation: enter .32s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes enter { from { opacity: 0; scale: .94; } }

.offline-pill { position: absolute; z-index: 5; top: calc(.5em + env(safe-area-inset-top)); left: 50%; translate: -50% -4em; background: var(--red); color: #fff; border: .15em solid var(--ink); border-radius: 99px; padding: .3em 1em; font-size: .85em; transition: translate .25s; }
#app.offline .offline-pill { translate: -50% 0; }

#toast { position: absolute; z-index: 30; left: 50%; bottom: calc(1.2em + env(safe-area-inset-bottom)); translate: -50% 6em; max-width: 88%; background: var(--ink); color: var(--foam); border: .14em solid var(--foam); border-radius: 1em; padding: .6em 1em; text-align: center; font-size: .92em; pointer-events: none; opacity: 0; }
#toast.show { animation: toast 3.2s both; }
@keyframes toast { 0%, 100% { translate: -50% 6em; opacity: 0; } 8%, 88% { translate: -50% 0; opacity: 1; } }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ------------------------------------------------------------ controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 2.8em; padding: .55em 1.2em;
  font-family: var(--display); font-size: 1em; line-height: 1.1; color: var(--ink); text-align: center;
  background: var(--lager); border: .17em solid var(--ink); border-radius: 99px; box-shadow: 0 .26em 0 var(--ink);
  transition: translate .06s, box-shadow .06s;
}
.btn:active:not(:disabled) { translate: 0 .2em; box-shadow: 0 .06em 0 var(--ink); }
.btn.big { font-size: 1.2em; min-height: 2.7em; }
.btn.small { font-size: .82em; min-height: 2.4em; padding: .4em .9em; }
.btn.alt { background: var(--foam); }
.btn.quiet { background: transparent; color: var(--foam); border-color: var(--foam); box-shadow: none; }
.btn.danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .55; filter: saturate(.4); cursor: default; }
.btn.busy { pointer-events: none; opacity: .7; }
.btn.busy::after { content: ''; width: .9em; height: .9em; border: .18em solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.grow { flex: 1; }
.link { align-self: center; padding: .5em 1em; text-decoration: underline; text-underline-offset: .2em; font-size: .95em; }
.stack { display: flex; flex-direction: column; gap: .7em; }
.actions { display: flex; align-items: center; gap: .7em; }
.actions.centre { justify-content: center; min-height: 3.6em; }
.hint { font-size: .8em; opacity: .85; text-align: center; font-weight: 700; }
.waiting { text-align: center; font-family: var(--display); font-size: 1.05em; text-shadow: 0 .1em 0 var(--ink); }
.label { font-size: .78em; font-weight: 900; opacity: .85; }

.field {
  width: 100%; min-width: 0; height: 2.9em; padding: 0 1em;
  font-size: 1.05em; font-weight: 800; color: var(--ink); background: #fff;
  border: .17em solid var(--ink); border-radius: .9em; box-shadow: inset 0 .18em 0 rgba(23, 17, 43, .12);
}
.field::placeholder { color: rgba(23, 17, 43, .45); }
.field:focus { outline: none; border-color: var(--pink-deep); box-shadow: 0 0 0 .18em var(--lager); }

.step { width: 2.3em; height: 2.3em; flex: none; display: grid; place-items: center; font-family: var(--display); font-size: 1.05em; color: var(--ink); background: var(--foam); border: .16em solid var(--ink); border-radius: 50%; box-shadow: 0 .18em 0 var(--ink); }
.step:active:not(:disabled) { translate: 0 .12em; box-shadow: 0 .04em 0 var(--ink); }
.step:disabled { opacity: .4; }
.step-val { min-width: 2.4em; text-align: center; font-family: var(--display); font-size: 1.15em; }

/* ------------------------------------------------------------ faces */

.av { display: inline-flex; flex-direction: column; align-items: center; gap: .1em; width: 2.6em; flex: none; }
.av-face { display: block; width: 100%; }
.av-face svg { display: block; width: 100%; height: auto; overflow: visible; }
.av-name { max-width: 6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85em; }
.av.lg { width: 4.2em; }
.av.xl { width: 6.5em; }
.av.off { opacity: .4; filter: grayscale(1); }

.strip { display: flex; justify-content: center; gap: .15em; min-height: 2.2em; flex-wrap: nowrap; overflow: hidden; }
.who { position: relative; display: inline-flex; flex: 0 1 2em; min-width: 0; opacity: .5; transition: opacity .2s, translate .2s; }
.who .av { width: 100%; }
.who.done { opacity: 1; translate: 0 -.15em; }
.who .ic { position: absolute; right: -.25em; bottom: -.1em; width: 1.05em; height: 1.05em; padding: .12em; color: var(--ink); background: #a4e53a; border: .1em solid var(--ink); border-radius: 50%; }
#app.kb .strip { display: none; }

/* ------------------------------------------------------------ beer-mat card */

.mat {
  position: relative; flex: 1; min-height: 3.6em; display: flex; padding: 1.1em 1.2em;
  color: var(--ink); background: var(--foam);
  border: .22em solid var(--ink); border-radius: 1.4em; box-shadow: 0 .42em 0 var(--ink);
  rotate: -1.2deg;
}
.mat::before { content: ''; position: absolute; inset: .42em; border: .12em dashed rgba(23, 17, 43, .22); border-radius: 1em; pointer-events: none; }
.mat-q { flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; font-family: var(--display); font-size: 30px; line-height: 1.2; }
.q { display: block; width: 100%; text-wrap: balance; overflow-wrap: anywhere; }
.blank { display: inline-block; min-width: 3.4em; height: .95em; margin: 0 .12em; border-bottom: .2em solid var(--ink); vertical-align: baseline; }
.blank.filled { display: inline; height: auto; min-width: 0; margin: 0; padding: 0 .12em; color: var(--pink-deep); border-bottom: 0; background: linear-gradient(transparent 58%, rgba(255, 201, 20, .75) 0); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mat.stamped::after { content: 'Sent'; position: absolute; right: -.5em; top: -.7em; rotate: 12deg; padding: .25em .8em; font-family: var(--display); font-size: .95em; color: #fff; background: var(--pink); border: .17em solid var(--ink); border-radius: 99px; box-shadow: 0 .2em 0 var(--ink); animation: stamp .3s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { from { scale: 2.2; opacity: 0; } }
#app.kb .mat { padding: .6em .9em; rotate: 0deg; }
#app.kb .mat::before { display: none; }

/* ------------------------------------------------------------ pint timer and chip */

.pint { position: relative; height: 100%; aspect-ratio: 80 / 114; flex: none; }
.pint svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pint-num { position: absolute; inset: 22% 0 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.7em; color: var(--ink); -webkit-text-stroke: .22em var(--foam); paint-order: stroke fill; }
.pint.low { animation: wobble .5s ease-in-out infinite; }
.pint.low .pint-num { color: var(--red); }
@keyframes wobble { 25% { rotate: -5deg; } 75% { rotate: 5deg; } }

.chip { display: inline-flex; flex-direction: column; align-items: center; gap: .1em; width: 4.4em; flex: none; }
.chip-face { width: 3.1em; height: 3.1em; filter: drop-shadow(0 .2em 0 var(--ink)); transition: translate .08s, filter .08s; }
.chip-face svg, .chip-hero svg, .score-chip svg { display: block; width: 100%; height: 100%; }
.chip:active:not(:disabled) .chip-face { translate: 0 .15em; filter: drop-shadow(0 .05em 0 var(--ink)); }
.chip-label { font-size: .62em; font-weight: 900; line-height: 1.1; text-align: center; white-space: nowrap; }
.chip.armed .chip-face { animation: chipglow 1.2s ease-in-out infinite; }
.chip.armed .chip-label { color: var(--lager); }
@keyframes chipglow { 50% { filter: drop-shadow(0 0 .5em var(--lager)); rotate: 8deg; } }
.chip-hero { width: 6em; height: 6em; margin: 0 auto; filter: drop-shadow(0 .3em 0 var(--ink)); animation: chipspin 2.4s ease-in-out infinite; }
@keyframes chipspin { 50% { rotate: 14deg; scale: 1.06; } }

/* ------------------------------------------------------------ home */

.home { justify-content: center; align-items: stretch; gap: 1em; text-align: center; }
.logo { font-size: 1em; display: flex; flex-direction: column; align-items: center; gap: .1em; font-family: var(--display); font-weight: 400; line-height: 1; }
.logo-top { font-size: 2.6em; color: var(--foam); -webkit-text-stroke: .22em var(--ink); paint-order: stroke fill; text-shadow: 0 .12em 0 var(--ink); rotate: -3deg; }
.logo-gap { position: relative; display: flex; gap: .12em; padding: 0 .3em .45em; font-size: 3.4em; }
.logo-gap::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: .2em; background: var(--foam); border: .06em solid var(--ink); border-radius: 99px; box-shadow: 0 .06em 0 var(--ink); }
.tile { display: grid; place-items: center; width: 1.02em; height: 1.2em; color: var(--ink); background: var(--lager); border: .07em solid var(--ink); border-radius: .2em; box-shadow: 0 .09em 0 var(--ink); rotate: calc((var(--i) - 2) * 3deg); animation: drop .5s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(.25s + var(--i) * .11s); }
.tile:nth-child(even) { background: var(--pink); color: #fff; translate: 0 .06em; }
@keyframes drop { from { translate: 0 -3em; opacity: 0; rotate: -30deg; } }
.tagline { font-size: 1.05em; text-shadow: 0 .1em 0 var(--ink); text-wrap: balance; }
.home-crowd { display: flex; justify-content: center; align-items: flex-end; gap: .4em; min-height: 0; flex: 0 1 7em; }
.home-punter { animation: bob 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.8s); }
.home-punter .av { width: 5em; }
.home-punter:nth-child(2) .av { width: 6.2em; }
@keyframes bob { 50% { translate: 0 -.45em; rotate: 2deg; } }
.note { font-size: .8em; opacity: .85; text-wrap: balance; }

/* ------------------------------------------------------------ lobby */

.invite { display: flex; align-items: center; justify-content: space-between; gap: .8em; padding: .7em .9em; color: var(--ink); background: var(--foam); border: .2em solid var(--ink); border-radius: 1.2em; box-shadow: 0 .35em 0 var(--ink); }
.invite-text { display: flex; flex-direction: column; align-items: flex-start; gap: .35em; min-width: 0; }
.invite.demo p { font-size: .9em; }
.code { display: flex; gap: .16em; font-family: var(--display); font-size: 2.3em; line-height: 1; }
.code span { display: grid; place-items: center; width: 1.05em; height: 1.25em; color: var(--ink); background: var(--lager); border: .07em solid var(--ink); border-radius: .18em; }
.qr { width: 6.6em; height: 6.6em; flex: none; border: .16em solid var(--ink); border-radius: .5em; overflow: hidden; }
.qr svg { display: block; width: 100%; height: 100%; }

.crowd { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); align-content: center; justify-items: center; gap: .3em .2em; overflow: hidden; }
.seat { position: relative; width: 100%; max-width: 8em; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.seat .av { width: 100%; }
.seat .av-face { width: 82%; }
.seat .av-name { max-width: 100%; font-size: .82em; text-shadow: 0 .1em 0 var(--ink); }
.seat.me .av-name { color: var(--lager); }
@keyframes pop { from { scale: 0; } }
.badge { position: absolute; right: 2%; top: 14%; display: grid; place-items: center; width: 1.7em; height: 1.7em; color: var(--ink); background: var(--lager); border: .13em solid var(--ink); border-radius: 50%; }
.badge .ic { width: 1em; height: 1em; }

.settings { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em 1.2em; }
.stepper { display: flex; align-items: center; gap: .35em; }
.stepper .label { margin-right: .2em; }
.settings-read { font-size: .9em; opacity: .9; }
.toggle { display: flex; align-items: center; gap: .5em; font-size: .9em; }
.toggle input { width: 1.4em; height: 1.4em; accent-color: var(--lager); }
.foot { display: flex; flex-direction: column; gap: .5em; }

/* ------------------------------------------------------------ prompt */

.prompt .top { display: flex; justify-content: center; height: min(17%, 7em); flex: none; }
.form { display: flex; flex-direction: column; gap: .6em; }
.fields { display: flex; flex-direction: column; gap: .45em; }
.form.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { translate: -.4em 0; } 40%, 80% { translate: .4em 0; } }
.status { display: flex; flex-direction: column; align-items: center; gap: .2em; padding: .4em 0; text-align: center; }
.status-main { font-family: var(--display); font-size: 1.6em; text-shadow: 0 .1em 0 var(--ink); }
.status-sub { font-size: .95em; }
/* Keyboard open: drop the top bar, shrink the clock, put two blanks side by side. */
#app.kb[data-phase='prompt'] #bar { display: none; }
#app.kb .prompt { gap: .45em; padding-top: .4em; padding-bottom: .5em; }
#app.kb .prompt .top { height: 2.7em; }
#app.kb .prompt .pint-num { font-size: 1em; }
#app.kb .prompt .fields { flex-direction: row; }
#app.kb .prompt .field { height: 2.6em; padding: 0 .7em; }
#app.kb .prompt .btn.big { min-height: 2.3em; }
#app.kb .chip-label { display: none; }
#app.kb .chip { width: 3.2em; }

.splash { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); font-family: var(--display); transition: opacity .28s, scale .28s; }
.splash.out { opacity: 0; scale: 1.25; pointer-events: none; }
.splash-round { font-size: 4em; color: var(--lager); -webkit-text-stroke: .16em var(--ink); paint-order: stroke fill; text-shadow: 0 .09em 0 var(--ink); rotate: -4deg; animation: slam .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.splash-of { font-size: 1.5em; text-shadow: 0 .1em 0 var(--ink); animation: slam .45s .12s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes slam { from { scale: 3; opacity: 0; } }

/* ------------------------------------------------------------ reveal */

.reveal { align-items: stretch; }
.count { text-align: center; font-family: var(--display); font-size: 1.1em; min-height: 1.2em; text-shadow: 0 .1em 0 var(--ink); }
.reveal-holder { flex: 1; min-height: 0; display: flex; align-items: center; padding: .4em .2em; }
.lead { width: 100%; font-family: var(--display); font-size: 1.9em; line-height: 1.15; text-align: center; text-shadow: 0 .1em 0 var(--ink); text-wrap: balance; }
.mat.big { max-height: 100%; height: 100%; animation: deal .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.mat.tilt0 { rotate: -2deg; }
.mat.tilt1 { rotate: 1.6deg; }
.mat.tilt2 { rotate: -.6deg; }
@keyframes deal { from { translate: 110% 0; rotate: 16deg; } }
.dots { display: flex; justify-content: center; gap: .4em; }
.dots i { width: .6em; height: .6em; border: .12em solid var(--ink); border-radius: 50%; background: rgba(255, 255, 255, .35); }
.dots i.on { background: var(--lager); }

/* ------------------------------------------------------------ vote */

.vote-head { display: flex; align-items: stretch; gap: .8em; height: 5.4em; flex: none; }
.vote-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2em; }
.vote-title h2 { font-size: 1.45em; text-shadow: 0 .1em 0 var(--ink); }
.vote-q { flex: 1; min-height: 0; overflow: hidden; font-size: 17px; line-height: 1.22; opacity: .95; }
.vote-q .blank { min-width: 2.4em; border-color: var(--foam); }
.vote .pint-num { font-size: 1.15em; }
.tiles { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: .6em; }
.answer { position: relative; flex: 1 1 0; min-height: 0; display: flex; align-items: center; gap: .5em; max-height: 5.6em; padding: .35em .9em; overflow: hidden; text-align: left; color: var(--ink); background: var(--foam); border: .18em solid var(--ink); border-radius: 1em; box-shadow: 0 .26em 0 var(--ink); transition: translate .08s, background-color .12s; }
.tile-text { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; overflow: hidden; font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; }
.answer.picked { background: var(--lager); translate: 0 -.12em; }
.answer.mine { opacity: .6; border-style: dashed; box-shadow: none; }
.answer:disabled:not(.mine):not(.picked) { opacity: .75; }
.tag { flex: none; padding: .2em .6em; font-size: .7em; font-weight: 900; color: var(--foam); background: var(--ink); border-radius: 99px; }
.tag.pick { display: grid; padding: .25em; color: var(--ink); background: #a4e53a; border: .15em solid var(--ink); }
.pager { display: flex; align-items: center; justify-content: center; gap: 1em; font-family: var(--display); }
.pager .step { width: 2em; height: 2em; }

/* ------------------------------------------------------------ results */

.results { padding: 0; }
.reel { height: 100%; display: flex; flex-direction: column; gap: .7em; padding: .7em 1em calc(.9em + env(safe-area-inset-bottom)); }
.reel-bar { display: flex; gap: .3em; }
.reel-bar i { flex: 1; height: .4em; border-radius: 99px; background: rgba(255, 255, 255, .25); }
.reel-bar i.on { background: var(--lager); }
.slide { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: .9em; animation: enter .32s cubic-bezier(.2, 1.3, .4, 1) both; }
.slide h2 { font-size: 1.7em; text-align: center; text-shadow: 0 .1em 0 var(--ink); }
.slide .mat.big { flex: 0 1 46%; height: auto; animation: none; }
.credit { display: flex; align-items: center; gap: .8em; animation: pop .35s .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.credit-name { font-family: var(--display); font-size: 1.7em; line-height: 1.05; text-shadow: 0 .1em 0 var(--ink); }
.credit-votes { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; font-size: 1.1em; color: var(--lager); }
.sticker { padding: .2em .7em; font-size: .78em; font-weight: 900; color: var(--ink); background: var(--lager); border: .14em solid var(--ink); border-radius: 99px; rotate: -3deg; }
.voters { display: flex; flex-wrap: wrap; gap: .2em; min-height: 2.4em; }
.voter { animation: pop .3s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(1.2s + var(--i) * .16s); }
.voter .av { width: 2.3em; }
.rest { display: flex; flex-direction: column; gap: .45em; min-height: 0; overflow: hidden; }
.rest-row { display: flex; align-items: center; gap: .6em; padding: .3em .7em; color: var(--ink); background: var(--foam); border: .15em solid var(--ink); border-radius: .9em; }
.rest-row .av { width: 2em; }
.rest-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92em; }
.votes-pill { min-width: 1.8em; padding: .1em .5em; text-align: center; font-family: var(--display); color: var(--foam); background: var(--ink); border-radius: 99px; }
.verdict { align-items: center; text-align: center; }
.faces { display: flex; justify-content: center; }
.faces .av + .av { margin-left: -1em; }
.faces .av.xl { animation: bob 1.6s ease-in-out infinite; }
.faces.sm .av { width: 2.8em; }
.verdict-title { font-size: 2.5em !important; color: var(--lager); -webkit-text-stroke: .16em var(--ink); paint-order: stroke fill; rotate: -2deg; text-wrap: balance; }
.verdict-sub { font-size: 1.1em; max-width: 19em; text-wrap: balance; }

.summary { height: 100%; display: flex; flex-direction: column; gap: .7em; padding: .7em 1em calc(.9em + env(safe-area-inset-bottom)); }
.you-card { display: flex; align-items: center; gap: .9em; padding: .7em 1em; color: var(--ink); background: #a4e53a; border: .2em solid var(--ink); border-radius: 1.2em; box-shadow: 0 .35em 0 var(--ink); rotate: -1deg; }
.you-card.is-drink { background: var(--lager); }
.you-card.is-pint { background: var(--red); color: #fff; }
.you-points { display: flex; flex-direction: column; align-items: center; font-family: var(--display); font-size: 2.3em; line-height: .95; }
.you-points small { font-family: var(--body); font-size: .32em; font-weight: 900; }
.you-lines { flex: 1; display: flex; flex-direction: column; gap: .15em; font-size: 1.02em; line-height: 1.2; }
.you-chip { font-size: .85em; opacity: .8; }
.winner-strip { display: flex; align-items: center; gap: .7em; min-height: 0; }
.winner-strip > div:last-child { flex: 1; min-width: 0; }
.winner-title { font-family: var(--display); font-size: 1.25em; line-height: 1.1; text-shadow: 0 .1em 0 var(--ink); }
.winner-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: .8em; line-height: 1.25; opacity: .95; }
.winner-line .blank.filled { color: var(--lager); background: none; }
.damage { flex: 0 1 auto; margin-bottom: auto; min-height: 0; display: flex; flex-direction: column; gap: .45em; overflow: hidden; padding: .7em .9em; background: rgba(0, 0, 0, .28); border: .15em solid var(--ink); border-radius: 1.1em; }
.damage h3 { font-size: 1.1em; color: var(--lager); }
.dmg { display: flex; align-items: center; gap: .7em; }
.drink-ic { width: 1.9em; flex: none; }
.drink-ic svg { display: block; width: 100%; }
.dmg-body { flex: 1; min-width: 0; }
.dmg-label { font-size: .95em; }
.dmg-why { display: block; font-size: .82em; font-weight: 700; opacity: .8; }
.you-total { font-family: var(--display); }
.dmg-names { display: flex; flex-wrap: wrap; gap: .25em; margin-top: .15em; }
.name-chip { padding: .08em .6em; font-size: .82em; color: var(--ink); background: var(--foam); border-radius: 99px; }
.name-chip.me { background: var(--pink); color: #fff; }
.dry, .pending { font-size: .92em; opacity: .9; }
.pending { color: var(--lager); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.sweep { flex: 0 1 auto; margin-bottom: auto; min-height: 0; display: flex; flex-direction: column; gap: .5em; padding: .7em .9em; color: var(--ink); background: var(--foam); border: .2em solid var(--ink); border-radius: 1.2em; box-shadow: 0 .35em 0 var(--ink); }
.sweep h3 { font-size: 1.3em; }
.sweep .hint { text-align: left; }
.sweep-rows { min-height: 0; display: flex; flex-direction: column; gap: .4em; overflow: hidden; padding: .3em 0; }
.sweep-row { display: flex; align-items: center; gap: .5em; }
.sweep-row .av { width: 2.2em; }
.sweep-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sweep .step { width: 2em; height: 2em; background: var(--lager); }

/* ------------------------------------------------------------ final */

.final { text-align: center; color: var(--ink); }
.final-title { font-size: 2.2em; color: var(--lager); -webkit-text-stroke: .16em var(--ink); paint-order: stroke fill; rotate: -2deg; text-wrap: balance; }
.final-sub { font-size: .95em; color: var(--foam); text-shadow: 0 .08em 0 var(--ink); text-wrap: balance; }
.podium { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: .4em; padding: 0 .4em; }
.podium-step { display: flex; flex-direction: column; align-items: center; min-height: 0; animation: rise .6s cubic-bezier(.2, 1.3, .4, 1) both; }
.podium-step.step-1 { animation-delay: .5s; }
.podium-step.step-2 { animation-delay: .25s; }
@keyframes rise { from { translate: 0 120%; } }
.podium-step .av { width: min(4.6em, 100%); }
.podium-step.step-1 .av { width: min(5.8em, 100%); }
.podium-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; color: var(--foam); text-shadow: 0 .1em 0 var(--ink); }
.podium-block { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: .3em; font-family: var(--display); background: var(--foam); border: .2em solid var(--ink); border-bottom: 0; border-radius: .8em .8em 0 0; }
.podium-block b { font-size: 1.7em; font-weight: 400; line-height: 1; }
.podium-block small { font-family: var(--body); font-size: .7em; font-weight: 900; }
.step-1 .podium-block { height: 6.4em; background: var(--lager); }
.step-2 .podium-block { height: 4.9em; }
.step-3 .podium-block { height: 3.7em; }
.award { flex: none; display: flex; flex-direction: column; gap: .4em; }
.award-card { display: flex; align-items: center; gap: .7em; height: 7.6em; padding: .6em .9em; text-align: left; background: var(--foam); border: .2em solid var(--ink); border-radius: 1.1em; box-shadow: 0 .3em 0 var(--ink); animation: enter .3s both; }
.award-text { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.award-title { font-family: var(--display); font-size: 1.15em; color: var(--pink-deep); line-height: 1.1; }
.award-quote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; font-size: .8em; line-height: 1.22; }
.award-line { margin-top: .15em; font-size: .85em; opacity: .8; }

/* ------------------------------------------------------------ overlays */

#overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end; }
.scrim { position: absolute; inset: 0; background: rgba(23, 17, 43, .72); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: 100%; max-height: 96%; display: flex; flex-direction: column; color: var(--ink); background: var(--foam); border: .2em solid var(--ink); border-bottom: 0; border-radius: 1.6em 1.6em 0 0; animation: sheet .28s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes sheet { from { translate: 0 100%; } }
.sheet-body { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .8em; padding: 1.3em 1.1em calc(1.1em + env(safe-area-inset-bottom)); }
.sheet-body h2 { font-size: 1.6em; padding-right: 1.8em; }
.sheet-body p { font-weight: 700; line-height: 1.35; }
.sheet .hint { text-align: left; opacity: .7; }
.sheet-x { position: absolute; right: .8em; top: .8em; z-index: 1; display: grid; place-items: center; width: 2.3em; height: 2.3em; background: #fff; border: .16em solid var(--ink); border-radius: 50%; }
.sheet .btn.quiet { color: var(--ink); border-color: var(--ink); }

.join-form { display: flex; align-items: center; gap: .9em; }
.face-pick { position: relative; flex: none; }
.face-pick .av { width: 5.6em; }
.face-pick .badge { right: -4%; top: auto; bottom: 0; }
.join-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5em; }
.code-field { font-family: var(--display); font-size: 1.3em; letter-spacing: .25em; text-transform: uppercase; }
.error { min-height: 1.3em; font-size: .88em; color: var(--red); }
#app.kb .sheet .hint, #app.kb .sheet .error:empty { display: none; }

.scores { display: flex; flex-direction: column; gap: .35em; padding: 0; list-style: none; min-height: 0; }
.scores li { display: flex; align-items: center; gap: .5em; padding: .25em .7em; background: #fff; border: .14em solid var(--ink); border-radius: .9em; }
.scores li.me { background: var(--lager); }
.scores .av { width: 2.1em; }
.rank { width: 1.2em; font-family: var(--display); text-align: center; }
.score-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-name small { opacity: .6; }
.score-wins { display: inline-flex; align-items: center; gap: .15em; min-width: 2em; font-size: .85em; }
.score-wins .ic { width: 1.1em; height: 1.1em; }
.score-chip { width: 1.5em; height: 1.5em; flex: none; }
.score-chip.used { opacity: .22; filter: grayscale(1); }
.score-pts { min-width: 1.6em; text-align: right; font-family: var(--display); font-size: 1.3em; }
.scores.dense { display: grid; grid-template-columns: 1fr 1fr; font-size: .78em; }
.scores.dense .score-wins, .scores.dense .score-chip { display: none; }

.rules { display: flex; flex-direction: column; gap: .5em; padding-left: 1.2em; font-size: .9em; font-weight: 700; line-height: 1.32; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.rules li { flex: none; }
.rules ~ .btn { flex: none; }
.rules li::marker { color: var(--pink-deep); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-height: 620px) {
  #app { font-size: clamp(13.5px, 4vw, 16px); }
}
