/* ==========================================================================
   Home Alone Pop-Up Trivia - the phone controller (/)
   --------------------------------------------------------------------------
   Built on /static/shared/theme.css (everything prefixed ha-). This file is
   only the page: the app shell, the seven screens and the host sheets.

   Layout rules that everything below follows
   - The page itself never scrolls. .app is exactly one dynamic viewport tall
     (100dvh, 100vh fallback); every screen is absolutely placed inside
     .stage and lists scroll inside their own box (.scroll).
   - Sizes are written in the shared design unit, calc(n * var(--u)), so the
     "fit" pass in play.js can shrink or grow a whole screen by setting --u
     on its .fit container (question, result and idle screens).
   - Real tap targets never go below 56 px, whatever --u is.
   ========================================================================== */

:root {
  --bar-h: 56px;                       /* header height, without the safe area */
  --pad-x: calc(16 * var(--u));
  --header: #c8102e;                   /* keep in sync with <meta name="theme-color"> */
}

html,
body {
  height: 100%;
  overflow: hidden;
}
html { touch-action: manipulation; }
body {
  position: relative;
  -webkit-touch-callout: none;
}
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }

/* --------------------------------------------------------------------------
   Tap targets: the shared components are sized in --u (0.9px on the narrowest
   phones, and smaller inside a fitted screen), so pin the minimums in px.
   -------------------------------------------------------------------------- */
.ha-btn { min-height: max(56px, calc(56 * var(--u))); }
.ha-btn--lg { min-height: max(64px, calc(72 * var(--u))); }
.ha-btn--icon { min-width: max(56px, calc(56 * var(--u))); width: max(56px, calc(56 * var(--u))); }
.ha-answer { min-height: max(56px, calc(68 * var(--u))); }
.ha-toggle--block { min-height: max(56px, calc(56 * var(--u))); }
.ha-btn.is-busy { pointer-events: none; opacity: 0.7; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
}
/* Engines without dynamic viewport units (old iOS): 100vh is taller than the
   visible page there, 100% of the body is not. */
@supports not (height: 100dvh) {
  .app { height: 100%; }
}
/* on a laptop the controller is a phone-width column */
@media (min-width: 520px) {
  .app {
    background-color: #0b1a2e;
    background-image: radial-gradient(ellipse 130% 75% at 50% 0%, #21467a 0%, #14305a 32%, #0b1a2e 68%, #060f1d 100%);
    box-shadow: 0 0 0 3px rgba(255, 253, 247, 0.14), 0 0 90px rgba(0, 0, 0, 0.6);
  }
}
/* a phone held sideways: use the width, the height is what is scarce */
@media (orientation: landscape) and (max-height: 520px) {
  .app { max-width: 780px; }
}

/* ---- header -------------------------------------------------------------- */
.bar {
  position: relative;
  z-index: 30;
  flex: none;
  display: flex;
  align-items: center;
  height: calc(var(--bar-h) + var(--safe-t));
  padding: var(--safe-t) calc(var(--safe-r) + 10px) 0 calc(var(--safe-l) + 14px);
  background-color: var(--header);
  background-image: linear-gradient(180deg, #c8102e 0%, #c8102e 45%, #a90c24 100%);
  color: #ffffff;
}
.bar__left,
.bar__right { position: relative; z-index: 2; display: flex; align-items: center; }
.bar__left { flex: 1 1 auto; min-width: 0; }
.bar__right { flex: none; margin-left: 10px; }
.bar__right > * + * { margin-left: 12px; }

/* snow lying along the bottom edge of the header, dripping onto the stage */
.bar .bar__snow {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0;
  pointer-events: none;
}
.bar .bar__snow.ha-snowcap::before {
  top: calc(-7 * var(--u));
  right: -4px;
  left: -4px;
  height: calc(26 * var(--u));
  border-radius: 0;
  background-size: calc(92 * var(--u)) 100%;
  z-index: 1;
}

.bar__brand {
  display: flex;
  align-items: center;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}
.bar__brand > .ha-icon { width: 34px; height: 34px; margin-right: 8px; }

.bar__id { display: flex; align-items: center; min-width: 0; }
.bar__id > .ha-avatar { margin-right: 9px; }
.bar__who { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.bar__name {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}
.bar__room {
  margin-top: 1px;
  overflow: hidden;
  color: #ffd9de;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bar__room b { color: #ffffff; font-weight: 900; }
.bar__title {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}
/* On a narrow phone the host's crown leaves no room for both "Question 12" and the score pill:
   during a question the title wins (the score is on the result screen a moment later). */
@media (max-width: 389px) {
  .app.is-host[data-screen="question"] .bar__score,
  .app.is-host[data-screen="result"] .bar__score { display: none; }
}

.bar__score {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--gold);
  color: #33210a;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #a86f00;
}
.bar__score.is-bump { animation: play-bump 0.5s var(--ease-spring); }

/* round header buttons: 44 px to look at, 56 px to hit */
.bar__btn {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: #8e0b20;
  color: #ffffff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.07s ease-out, box-shadow 0.07s ease-out;
}
.bar__btn::after { content: ""; position: absolute; top: -6px; right: -6px; bottom: -6px; left: -6px; }
.bar__btn > .ha-icon { width: 24px; height: 24px; }
.bar__btn:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0, 0, 0, 0.3); }
.bar__btn:focus { outline: none; }
.bar__btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.bar__btn[aria-pressed="true"] { background: #4a0f1b; color: #ffb3ba; }
.bar__btn--host {
  border-color: var(--gold);
  background: var(--snow);        /* the crown icon is gold: it needs a light disc, not a gold one */
  box-shadow: 0 3px 0 #a86f00;
}
.bar__btn--host > .ha-icon { width: 30px; height: 30px; }
.bar__btn--host.is-new { animation: play-bump 0.6s var(--ease-spring) 2; }

/* fairy lights strung under the eave */
.app__lights {
  top: calc(var(--safe-t) + var(--bar-h) + 2 * var(--u));
  z-index: 20;
}
/* focus screens drop the lights; so do very short viewports */
.app[data-screen="question"] .app__lights,
.app[data-screen="result"] .app__lights { display: none; }

/* slim "Reconnecting" strip, straight under the header */
.net {
  position: absolute;
  top: calc(var(--safe-t) + var(--bar-h));
  right: 0;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  background: var(--gold);
  color: #33210a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  animation: play-net-in 0.25s var(--ease-out) both;
}
.net .ha-dots { height: 14px; margin-left: 6px; }
.net .ha-dots > i { width: 6px; height: 6px; margin: 0 2px; background: #33210a; box-shadow: none; }

/* ---- stage and screens --------------------------------------------------- */
.stage {
  position: relative;
  z-index: 10;            /* above the snow layer (5): flakes fall behind the controls */
  flex: 1 1 auto;
  min-height: 0;
}
.screen {
  --pad-t: calc(48 * var(--u));        /* clears the lights */
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  flex-direction: column;
  padding: var(--pad-t) calc(var(--safe-r) + var(--pad-x)) calc(var(--safe-b) + 14 * var(--u)) calc(var(--safe-l) + var(--pad-x));
  overflow: hidden;
}
.screen.is-active {
  display: flex;
  animation: play-screen-in 0.26s var(--ease-out) backwards;
}
.screen--question,
.screen--result { --pad-t: calc(26 * var(--u)); }   /* just clears the snow drips */

/* a list that scrolls inside its own box, never the page */
.scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

/* A screen body that play.js scales (by setting --u on it) until it fits. */
.fit {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* room for rings and shadows that would otherwise be clipped */
  margin: 0 calc(-8 * var(--u));
  padding: calc(4 * var(--u)) calc(8 * var(--u)) 0;
}
.fit > * { flex: none; }
.fit > .fit__gap { flex: 1 1 0px; min-height: 0; }
/* even the smallest scale did not fit (a very long question on a very short
   screen): let the body scroll rather than clip anything */
.fit.is-overflow {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* --------------------------------------------------------------------------
   1. Join
   -------------------------------------------------------------------------- */
.screen--join {
  overflow-y: auto;                    /* the one screen that may scroll: the keyboard takes half of it */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.join {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
  margin: auto;                        /* centred while there is room, top-aligned once it scrolls */
}
.join__logo { margin: 0 auto calc(10 * var(--u)); }
.join__logo--full { width: min(calc(230 * var(--u)), 30vh); width: min(calc(230 * var(--u)), 30dvh); }
.join__logo--word { display: none; width: min(calc(250 * var(--u)), 100%); margin-bottom: calc(14 * var(--u)); }

.join__form { display: flex; flex-direction: column; }
.join__form > .ha-field + .ha-field { margin-top: calc(14 * var(--u)); }
.join__form .ha-label { text-align: center; }
.join__name { text-align: center; }
.join__go { margin-top: calc(20 * var(--u)); }
.join__go .ha-dots { margin-left: calc(6 * var(--u)); }

.join__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: calc(20 * var(--u));
  color: var(--snow-dim);
  font-size: calc(15 * var(--u));
  line-height: 1.2;
  text-align: center;
}
.join__hint > .ha-icon { width: calc(26 * var(--u)); height: calc(26 * var(--u)); margin-right: calc(8 * var(--u)); }

.join__note,
.join__error {
  margin: 0 0 calc(14 * var(--u));
  padding: calc(10 * var(--u)) calc(14 * var(--u));
  border-radius: calc(14 * var(--u));
  font-size: calc(16 * var(--u));
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}
.join__note { background: var(--gold); color: #33210a; box-shadow: 0 calc(4 * var(--u)) 0 #a86f00; }
.join__error {
  margin: calc(14 * var(--u)) 0 0;
  background: #4a0f1b;
  border: calc(3 * var(--u)) solid var(--red-bright);
  color: #ffd9de;
  animation: ha-pop-in 0.3s var(--ease-spring) both;
}

.join__busy {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(30 * var(--u)) 0;
  font-family: var(--font-display);
  font-size: calc(24 * var(--u));
  text-align: center;
}
.join__busy p { margin-top: calc(14 * var(--u)); }

/* room code: four tiles under one invisible input */
.codebox { position: relative; }
.codebox__cells { display: flex; justify-content: center; }
.codebox__cell {
  --tile: var(--ans-0);
  --tile-edge: var(--ans-0-dark);
  --tile-ink: #ffffff;
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  max-width: calc(78 * var(--u));
  height: calc(74 * var(--u));
  margin: 0 calc(5 * var(--u)) calc(6 * var(--u));
  border: calc(3 * var(--u)) dashed rgba(255, 253, 247, 0.5);
  border-radius: calc(18 * var(--u));
  background: rgba(6, 15, 29, 0.5);
  color: var(--tile-ink);
  font-family: var(--font-display);
  font-size: calc(42 * var(--u));
  line-height: 1;
}
.codebox__cell:nth-child(2) { --tile: var(--ans-1); --tile-edge: var(--ans-1-dark); }
.codebox__cell:nth-child(3) { --tile: var(--ans-2); --tile-edge: var(--ans-2-dark); --tile-ink: #33210a; }
.codebox__cell:nth-child(4) { --tile: var(--ans-3); --tile-edge: var(--ans-3-dark); --tile-ink: #06283d; }
.codebox__cell.is-filled {
  border: 0;
  background: var(--tile);
  box-shadow:
    inset 0 calc(3 * var(--u)) 0 rgba(255, 255, 255, 0.38),
    inset 0 calc(-3 * var(--u)) 0 rgba(0, 0, 0, 0.14),
    0 calc(6 * var(--u)) 0 var(--tile-edge),
    0 calc(10 * var(--u)) calc(12 * var(--u)) rgba(0, 0, 0, 0.35);
  animation: play-key 0.24s var(--ease-spring);
}
.codebox.is-focus .codebox__cell.is-active { border-style: solid; border-color: var(--gold); box-shadow: 0 0 0 calc(4 * var(--u)) rgba(255, 209, 102, 0.4); }
.codebox.is-focus .codebox__cell.is-active.is-filled { box-shadow: 0 0 0 calc(4 * var(--u)) rgba(255, 209, 102, 0.6), 0 calc(6 * var(--u)) 0 var(--tile-edge); }
/* blinking caret in the next empty tile */
.codebox.is-focus .codebox__cell.is-active:not(.is-filled)::after {
  content: "";
  width: calc(4 * var(--u));
  height: calc(36 * var(--u));
  border-radius: 999px;
  background: var(--gold);
  animation: play-caret 1s steps(1) infinite;
}
.codebox.is-error { animation: ha-shake 0.45s both; }
.codebox.is-error .codebox__cell:not(.is-filled) { border-color: var(--red-bright); }
.codebox__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;                     /* below 16px iOS zooms the page on focus */
  opacity: 0;
  text-transform: uppercase;
  -webkit-user-select: text;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
}

/* --------------------------------------------------------------------------
   2. Lobby (and the player rows shared with the final screen and host sheet)
   -------------------------------------------------------------------------- */
.hero { flex: none; display: flex; justify-content: center; padding: calc(2 * var(--u)) calc(8 * var(--u)) 0; }
/* "You're in" on a big gift tag that sways from its string */
.hero__tag {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  padding: calc(8 * var(--u)) calc(20 * var(--u)) calc(8 * var(--u)) calc(36 * var(--u));
  border: calc(4 * var(--u)) solid var(--red-bright);
  border-radius: calc(44 * var(--u)) calc(18 * var(--u)) calc(18 * var(--u)) calc(44 * var(--u));
  background-color: #fff6dc;
  background-image: linear-gradient(180deg, #fffaf0 0%, #ffeec2 100%);
  color: var(--ink);
  box-shadow: 0 calc(5 * var(--u)) 0 rgba(6, 15, 29, 0.45), 0 calc(12 * var(--u)) calc(18 * var(--u)) rgba(0, 0, 0, 0.3);
  transform-origin: calc(18 * var(--u)) 50%;
  animation: play-sway 4.2s ease-in-out infinite;
}
.hero__tag::before {        /* punched hole with a brass eyelet */
  content: "";
  position: absolute;
  top: 50%;
  left: calc(11 * var(--u));
  width: calc(13 * var(--u));
  height: calc(13 * var(--u));
  margin-top: calc(-6.5 * var(--u));
  border-radius: 50%;
  background: #0b1a2e;
  box-shadow: 0 0 0 calc(3.5 * var(--u)) #e0a021;
}
.hero__tag::after {         /* the string, up towards the lights */
  content: "";
  position: absolute;
  top: 50%;
  left: calc(-12 * var(--u));
  width: calc(30 * var(--u));
  height: calc(34 * var(--u));
  margin-top: calc(-34 * var(--u));
  border-top: calc(3 * var(--u)) solid var(--gold);
  border-right: calc(3 * var(--u)) solid var(--gold);
  border-radius: 0 100% 0 0;
  pointer-events: none;
}
.hero__tag > .ha-avatar { margin-right: calc(12 * var(--u)); }
.hero__text { display: flex; flex-direction: column; min-width: 0; }
.hero__kicker {
  color: var(--red);
  font-size: calc(13 * var(--u));
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.hero__name {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: calc(30 * var(--u));
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hero__tag.is-long .hero__name { font-size: calc(23 * var(--u)); }

.tvnote { flex: none; display: flex; justify-content: center; margin-top: calc(12 * var(--u)); }
.tvnote__chip { background: #2a4370; color: var(--snow-shade); }

.ha-panel.roster {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: calc(28 * var(--u));
  padding: calc(26 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u));
}
.roster__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(10 * var(--u)) calc(6 * var(--u));
}
.roster__title { font-family: var(--font-display); font-weight: 400; font-size: calc(21 * var(--u)); line-height: 1.1; }
.roster__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(30 * var(--u));
  height: calc(30 * var(--u));
  padding: 0 calc(9 * var(--u));
  border-radius: 999px;
  background: var(--gold);
  color: #33210a;
  font-family: var(--font-display);
  font-size: calc(17 * var(--u));
  line-height: 1;
  box-shadow: 0 calc(2 * var(--u)) 0 #a86f00;
}

.plist { display: flex; flex-direction: column; }
.plist > li { flex: none; }
/* one player: a gift tag in a row that is at least 56 px tall */
.prow {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: max(56px, calc(58 * var(--u)));
  padding: calc(4 * var(--u)) calc(8 * var(--u)) calc(6 * var(--u)) calc(14 * var(--u));   /* left: the tag's string hangs out */
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
.prow > .ha-tag { flex: 1 1 auto; min-width: 0; transition: transform 0.07s ease-out; }
button.prow { cursor: pointer; }
button.prow:active > .ha-tag { transform: translateY(calc(3 * var(--u))) scale(0.98); }
button.prow:focus { outline: none; }
button.prow:focus-visible > .ha-tag { outline: 3px solid var(--gold); outline-offset: 2px; }
.prow__medal { margin-right: calc(12 * var(--u)); }
.prow__crown {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: calc(30 * var(--u));
  height: calc(30 * var(--u));
  margin-left: calc(8 * var(--u));
  border: calc(2 * var(--u)) solid var(--gold-dark);
  border-radius: 50%;
  background: #ffffff;
}
.prow__crown > .ha-icon { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
.prow__away {
  flex: none;
  margin-left: calc(8 * var(--u));
  font-size: calc(12 * var(--u));
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.prow__more { flex: none; margin-left: calc(6 * var(--u)); color: #8493a8; }
.prow__more > .ha-icon { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }

/* bottom of the lobby / final screens: the host's big button, or "waiting" */
.foot {
  flex: none;
  display: flex;
  flex-direction: column;
  padding-top: calc(16 * var(--u));
  text-align: center;
}
.foot:empty { display: none; }
.foot .ha-btn { margin-bottom: calc(8 * var(--u)); }   /* the 3D edge hangs below the box */
.foot__hint { margin-top: calc(4 * var(--u)); color: var(--snow-dim); font-size: calc(14 * var(--u)); line-height: 1.25; }
.waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-height: calc(46 * var(--u));
  font-size: calc(18 * var(--u));
  line-height: 1.25;
}
.waiting b { color: var(--gold); font-weight: 900; }
.waiting .ha-dots { margin-left: calc(8 * var(--u)); }

/* --------------------------------------------------------------------------
   3. Menu - the host's DVD remote, and the waiting view for everyone else
   -------------------------------------------------------------------------- */
.menu { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.menu__main {
  display: flex;
  flex-direction: column;
  margin: auto 0;
  text-align: center;
}
.menu__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(84 * var(--u));
  height: calc(84 * var(--u));
  margin: 0 auto calc(12 * var(--u));
  border: calc(4 * var(--u)) solid #ffffff;
  border-radius: 50%;
  background: #d9f0ff;
  box-shadow: 0 calc(5 * var(--u)) 0 rgba(0, 0, 0, 0.3);
}
.menu__badge > .ha-icon { width: calc(54 * var(--u)); height: calc(54 * var(--u)); }
.menu__title { font-size: calc(38 * var(--u)); }
.menu__sub { margin: calc(10 * var(--u)) 0 calc(22 * var(--u)); color: var(--snow-dim); font-size: calc(17 * var(--u)); line-height: 1.25; }

/* a big two-line button: icon, title, small caption */
.bigbtn {
  justify-content: flex-start;
  min-height: max(72px, calc(86 * var(--u)));
  padding-left: calc(22 * var(--u));
  padding-right: calc(18 * var(--u));
  text-align: left;
  white-space: normal;
}
.bigbtn + .bigbtn { margin-top: calc(22 * var(--u)); }
.bigbtn > .ha-icon { width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
.bigbtn__text { display: flex; flex-direction: column; min-width: 0; margin-left: calc(14 * var(--u)); }
.bigbtn__text b { font-weight: 400; font-size: calc(27 * var(--u)); line-height: 1.05; }
.bigbtn__text small {
  margin-top: calc(4 * var(--u));
  font-family: var(--font-body);
  font-size: calc(13 * var(--u));
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-shadow: none;
  text-transform: uppercase;
  opacity: 0.72;
}

.scenes { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.scenes__head {
  flex: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: calc(10 * var(--u));
}
/* 2 x 3 scene cards: the same six per page as the TV */
.scenes__grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: repeat(4, minmax(56px, 1fr));
  grid-gap: calc(10 * var(--u));
  gap: calc(10 * var(--u));
  padding-bottom: calc(6 * var(--u));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.scenes__grid::-webkit-scrollbar { display: none; }
/* keep the cards roughly 16:11 instead of stretching on a tall phone */
@supports (aspect-ratio: 1 / 1) {
  .scenes__grid { flex: 0 1 auto; aspect-ratio: 100 / 106; margin: auto 0; }
}
.scene {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: calc(3 * var(--u)) solid var(--snow);
  border-radius: calc(16 * var(--u));
  background-color: var(--pine);
  background-image: linear-gradient(160deg, #1a7a4c 0%, #0f5132 55%, #0b1a2e 100%);
  color: #ffffff;
  font: inherit;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 calc(5 * var(--u)) 0 rgba(0, 0, 0, 0.42);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.07s ease-out, box-shadow 0.07s ease-out;
}
.scene:active { transform: translateY(calc(4 * var(--u))); box-shadow: 0 calc(1 * var(--u)) 0 rgba(0, 0, 0, 0.42); }
.scene:focus { outline: none; }
.scene:focus-visible { border-color: var(--gold); }
.scene__img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.scene.is-nothumb .scene__img { display: none; }
/* no thumbnail: a film icon on the festive gradient */
.scene__ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 18%; }
.scene__ph > .ha-icon { width: 34%; height: auto; max-height: 60%; opacity: 0.9; }
.scene::after {             /* scrim so the title reads over any frame */
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 68%;
  background: linear-gradient(180deg, rgba(6, 15, 29, 0) 0%, rgba(6, 15, 29, 0.82) 62%, rgba(6, 15, 29, 0.94) 100%);
  pointer-events: none;
}
.scene__num {
  position: absolute;
  top: calc(6 * var(--u));
  left: calc(6 * var(--u));
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: calc(28 * var(--u));
  height: calc(28 * var(--u));
  padding: 0 calc(6 * var(--u));
  border-radius: 999px;
  background: var(--gold);
  color: #33210a;
  font-family: var(--font-display);
  font-size: calc(16 * var(--u));
  line-height: 1;
  box-shadow: 0 calc(2 * var(--u)) 0 rgba(0, 0, 0, 0.4);
}
.scene__time {
  position: absolute;
  top: calc(8 * var(--u));
  right: calc(7 * var(--u));
  z-index: 1;
  padding: calc(3 * var(--u)) calc(7 * var(--u));
  border-radius: 999px;
  background: rgba(6, 15, 29, 0.78);
  font-size: calc(12 * var(--u));
  font-weight: 900;
  line-height: 1.1;
}
.scene__title {
  position: absolute;
  right: calc(8 * var(--u));
  bottom: calc(6 * var(--u));
  left: calc(8 * var(--u));
  z-index: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: calc(14.5 * var(--u));
  font-weight: 900;
  line-height: 1.12;
  text-shadow: 0 calc(1.5 * var(--u)) 0 rgba(0, 0, 0, 0.6);
}
.scenes__empty { grid-column: 1 / -1; grid-row: 1 / -1; align-self: center; color: var(--snow-dim); text-align: center; }
.scenes__nav { flex: none; display: flex; align-items: center; margin-top: calc(12 * var(--u)); padding-bottom: calc(8 * var(--u)); }
.scenes__nav > .ha-btn + .ha-btn { margin-left: calc(12 * var(--u)); }
.scenes__back { padding-left: calc(14 * var(--u)); padding-right: calc(20 * var(--u)); }
.ha-btn > .play-ico { width: calc(24 * var(--u)); height: calc(24 * var(--u)); }

.menu--guest { align-items: center; justify-content: center; text-align: center; }
.guest__art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(112 * var(--u));
  height: calc(112 * var(--u));
  border: calc(5 * var(--u)) solid #ffffff;
  border-radius: 50%;
  background: #d9f0ff;
  box-shadow: 0 calc(6 * var(--u)) 0 rgba(0, 0, 0, 0.3);
}
.guest__art > .ha-icon { width: calc(72 * var(--u)); height: calc(72 * var(--u)); }
.guest__title { margin-top: calc(22 * var(--u)); font-family: var(--font-display); font-weight: 400; font-size: calc(28 * var(--u)); line-height: 1.15; overflow-wrap: break-word; }
.guest__title b { color: var(--gold); font-weight: 400; }
.guest__tag { margin-top: calc(22 * var(--u)); max-width: 100%; padding-left: calc(14 * var(--u)); }
.guest__sub { margin-top: calc(18 * var(--u)); color: var(--snow-dim); font-size: calc(16 * var(--u)); }
.guest .ha-dots { margin-top: calc(18 * var(--u)); }
.guest { display: flex; flex-direction: column; align-items: center; max-width: 100%; }

/* --------------------------------------------------------------------------
   4. Playing, no question
   -------------------------------------------------------------------------- */
.idle { align-items: center; text-align: center; }
.idle__art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100 * var(--u));
  height: calc(100 * var(--u));
  border: calc(5 * var(--u)) solid #ffffff;
  border-radius: 50%;
  background: #d9f0ff;
  box-shadow: 0 calc(6 * var(--u)) 0 rgba(0, 0, 0, 0.3);
}
.idle__art > .ha-icon { width: calc(64 * var(--u)); height: calc(64 * var(--u)); }
.idle__title { margin-top: calc(16 * var(--u)); font-size: calc(36 * var(--u)); }
.idle__sub { margin-top: calc(10 * var(--u)); color: var(--snow-dim); font-size: calc(16 * var(--u)); line-height: 1.2; }

.stats {
  display: flex;
  align-self: stretch;
  margin-top: calc(22 * var(--u));
  padding: calc(12 * var(--u)) calc(4 * var(--u));
  border: calc(3 * var(--u)) solid rgba(255, 253, 247, 0.2);
  border-radius: calc(22 * var(--u));
  background-color: #14294a;
  background-image: linear-gradient(180deg, #1d3a66 0%, #14294a 100%);
  box-shadow: 0 calc(7 * var(--u)) 0 rgba(0, 0, 0, 0.28);
}
.stat { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 calc(4 * var(--u)); }
.stat + .stat { border-left: calc(2 * var(--u)) solid var(--line); }
.stat__label { color: var(--ice); font-size: calc(11.5 * var(--u)); font-weight: 900; letter-spacing: 0.12em; line-height: 1.2; text-transform: uppercase; }
.stat__value { margin-top: calc(3 * var(--u)); color: var(--gold); font-family: var(--font-display); font-size: calc(32 * var(--u)); line-height: 1.05; white-space: nowrap; }
.stat__value.is-sm { font-size: calc(26 * var(--u)); line-height: 1.3; }
.stat__value.is-xs { font-size: calc(21 * var(--u)); line-height: 1.6; }
.stat__sub { margin-top: calc(1 * var(--u)); color: var(--snow-dim); font-size: calc(12.5 * var(--u)); font-weight: 900; line-height: 1.2; white-space: nowrap; }
.stat__value--streak { display: flex; align-items: center; color: #ff9f43; }
.stat__value--streak > .ha-icon { width: calc(30 * var(--u)); height: calc(30 * var(--u)); margin-right: calc(4 * var(--u)); }

.tip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(46 * var(--u));
  margin-top: calc(18 * var(--u));
  color: var(--snow-shade);
  font-size: calc(16 * var(--u));
  line-height: 1.25;
}
.tip > .ha-icon { flex: none; width: calc(30 * var(--u)); height: calc(30 * var(--u)); margin-right: calc(8 * var(--u)); }
.tip.is-swap > span { animation: ha-fade-in 0.4s ease-out both; }

/* a fact from the movie pops up over the lower half for a few seconds */
.factslot {
  position: absolute;
  right: calc(var(--safe-r) + var(--pad-x));
  bottom: calc(var(--safe-b) + 34 * var(--u));
  left: calc(var(--safe-l) + var(--pad-x));
  z-index: 5;
  padding-left: calc(18 * var(--u));     /* the ornament badge hangs off the left edge */
  pointer-events: none;
}
.factslot:empty { display: none; }

/* --------------------------------------------------------------------------
   5. Question
   -------------------------------------------------------------------------- */
.q__timer { position: relative; display: flex; align-items: center; margin-bottom: calc(8 * var(--u)); }
.q__timer > .ha-candy { flex: 1 1 auto; min-width: 0; }
/* seconds left, in a snowball */
.q__secs {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(46 * var(--u));
  height: calc(46 * var(--u));
  margin-left: calc(10 * var(--u));
  border-radius: 50%;
  background-color: var(--snow);
  background-image: linear-gradient(180deg, #ffffff 40%, #dbe7f1 100%);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: calc(24 * var(--u));
  line-height: 1;
  box-shadow: 0 calc(4 * var(--u)) 0 rgba(0, 0, 0, 0.32);
}
.q__secs.is-urgent {
  background: var(--red-bright);
  color: #ffffff;
  animation: ha-pulse 0.5s ease-in-out infinite;
}
.q__secs.is-paused { background: var(--ans-3); color: #06283d; }
/* "Movie paused", centred on the frozen bar */
.q__paused {
  position: absolute;
  top: 50%;
  left: calc(50% - 28 * var(--u));
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 calc(2 * var(--u)) 0 var(--ans-3-dark), 0 0 0 calc(3 * var(--u)) rgba(6, 15, 29, 0.55);
}

.q__text {
  margin: calc(6 * var(--u)) 0 calc(14 * var(--u));
  font-size: calc(24 * var(--u));
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 calc(2 * var(--u)) 0 rgba(0, 0, 0, 0.35);
  overflow-wrap: break-word;
  word-wrap: break-word;
  text-wrap: balance;
}
.q__text.is-long { font-size: calc(20 * var(--u)); }

.q .ha-answers { grid-gap: calc(14 * var(--u)); gap: calc(14 * var(--u)); margin-bottom: calc(15 * var(--u)); }
.q .ha-answer {
  animation: play-answer-in 0.34s var(--ease-spring) backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.q .ha-answer__text { overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.q .ha-answer.is-selected .ha-answer__chip { animation: play-bump 0.4s var(--ease-spring); }
/* a 5th / 6th choice, should a cue ever carry one */
.ha-answer[data-choice="4"] { --a: #b085f5; --a-dark: #6b3fc0; --a-ink: #ffffff; }
.ha-answer[data-choice="5"] { --a: #ff9f43; --a-dark: #c2600c; --a-ink: #33210a; --a-ts: 0 calc(1 * var(--u)) 0 rgba(255, 255, 255, 0.4); }
/* a phone held sideways: two columns */
@media (orientation: landscape) and (max-height: 520px) {
  .q .ha-answers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.q__status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-height: calc(28 * var(--u));
  font-size: calc(16 * var(--u));
  line-height: 1.2;
  text-align: center;
}
.q__status > .ha-icon { width: calc(26 * var(--u)); height: calc(26 * var(--u)); margin-right: calc(6 * var(--u)); }
.q__status b { font-family: var(--font-display); font-weight: 400; font-size: calc(21 * var(--u)); }
.q__status i { margin-left: calc(10 * var(--u)); color: var(--snow-dim); font-style: normal; }
.q__status.is-locked b { color: #6ee7a8; }
.q__status.is-locked { animation: ha-pop-in 0.35s var(--ease-spring) both; }

/* --------------------------------------------------------------------------
   6. Result - a full-screen verdict
   -------------------------------------------------------------------------- */
.screen--result { cursor: pointer; }
.screen--result[data-verdict="correct"] { background: radial-gradient(ellipse 130% 75% at 50% 0%, #34c57e 0%, #1a7a4c 42%, #0f5132 100%); }
.screen--result[data-verdict="wrong"] { background: radial-gradient(ellipse 130% 75% at 50% 0%, #f25a67 0%, #c8102e 42%, #8e0b20 100%); }
.screen--result[data-verdict="slow"] { background: radial-gradient(ellipse 130% 75% at 50% 0%, #4a6ea8 0%, #1d3a66 42%, #0b1a2e 100%); }

.res { align-items: center; text-align: center; }
/* the tick / cross / clock sits on a white coin so it reads on any verdict colour */
.res__icon {
  width: calc(104 * var(--u));
  height: calc(104 * var(--u));
  padding: calc(9 * var(--u));
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 calc(6 * var(--u)) 0 rgba(0, 0, 0, 0.25);
  animation: play-stamp 0.5s var(--ease-spring) both;
}
.res__icon > .ha-icon { width: 100%; height: 100%; }
.res__title {
  margin-top: calc(8 * var(--u));
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(46 * var(--u));
  line-height: 1.05;
  text-shadow: 0 calc(4 * var(--u)) 0 rgba(0, 0, 0, 0.28);
}
.res__points {
  margin-top: calc(2 * var(--u));
  color: var(--gold);
  font-family: var(--font-display);
  font-size: calc(62 * var(--u));
  line-height: 1.05;
  text-shadow: 0 calc(4 * var(--u)) 0 #a86f00, 0 calc(9 * var(--u)) 0 rgba(0, 0, 0, 0.25);
  animation: ha-pop-in 0.5s var(--ease-spring) 0.18s both;
}
.res__streak { margin-top: calc(10 * var(--u)); animation: ha-pop-in 0.45s var(--ease-spring) 0.4s both; }
.res__comeback { margin-top: calc(10 * var(--u)); background: var(--gold); color: #33210a; animation: ha-pop-in 0.45s var(--ease-spring) 0.3s both; }
.res__comeback .ha-icon { width: 1.1em; height: 1.1em; margin-right: 0.35em; }
.res__card {
  align-self: stretch;
  margin-top: calc(16 * var(--u));
  padding: calc(12 * var(--u)) calc(16 * var(--u)) calc(14 * var(--u));
  border-radius: calc(20 * var(--u));
  background: var(--snow);
  color: var(--ink);
  box-shadow: 0 calc(6 * var(--u)) 0 rgba(0, 0, 0, 0.28);
  overflow-wrap: break-word;
}
.res__card-label { color: #5a6b80; font-size: calc(12 * var(--u)); font-weight: 900; letter-spacing: 0.12em; line-height: 1.2; text-transform: uppercase; }
.res__answer { margin-top: calc(2 * var(--u)); font-size: calc(23 * var(--u)); font-weight: 900; line-height: 1.15; }
.res__explain { margin-top: calc(6 * var(--u)); color: #33455e; font-size: calc(15.5 * var(--u)); font-weight: 800; line-height: 1.25; }
.res__standing { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: calc(14 * var(--u)); }
.res__pill {
  display: inline-flex;
  align-items: center;
  min-height: calc(40 * var(--u));
  margin: calc(4 * var(--u));
  padding: calc(4 * var(--u)) calc(14 * var(--u));
  border-radius: 999px;
  background: rgba(6, 15, 29, 0.38);
  font-size: calc(16 * var(--u));
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}
.res__pill b { margin-left: calc(6 * var(--u)); color: var(--gold); font-family: var(--font-display); font-weight: 400; font-size: calc(20 * var(--u)); }
.res__move { display: inline-flex; align-items: center; margin-left: calc(8 * var(--u)); font-family: var(--font-display); font-size: calc(17 * var(--u)); }
.res__move > .ha-icon { width: calc(14 * var(--u)); height: calc(14 * var(--u)); margin-right: calc(3 * var(--u)); }
.res__move--up { color: #7dffb8; }
.res__move--down { color: #ffc2c8; }

.res__foot {
  flex: none;
  padding-top: calc(10 * var(--u));
  color: rgba(255, 255, 255, 0.8);
  font-size: calc(12.5 * var(--u));
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}
.res__bar { height: calc(6 * var(--u)); margin-top: calc(8 * var(--u)); border-radius: 999px; background: rgba(6, 15, 29, 0.35); overflow: hidden; }
.res__bar > i { display: block; width: 100%; height: 100%; border-radius: 999px; background: #ffffff; transform-origin: 0 50%; }
.res__bar > i.is-run { animation: play-drain 8s linear both; }

/* --------------------------------------------------------------------------
   7. Final
   -------------------------------------------------------------------------- */
.final__title { flex: none; text-align: center; font-size: calc(36 * var(--u)); }
.final__me { flex: none; display: flex; align-items: center; justify-content: center; margin-top: calc(14 * var(--u)); }
.final__art { flex: none; width: calc(84 * var(--u)); height: calc(84 * var(--u)); margin-right: calc(14 * var(--u)); animation: play-stamp 0.6s var(--ease-spring) both; }
.final__art > .ha-icon { width: 100%; height: 100%; }
.final__me > .ha-medal { margin-right: calc(14 * var(--u)); animation: play-stamp 0.6s var(--ease-spring) both; }
.final__text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.final__place { font-family: var(--font-display); font-size: calc(34 * var(--u)); line-height: 1.05; text-shadow: 0 calc(3 * var(--u)) 0 rgba(0, 0, 0, 0.3); }
.final__score { margin-top: calc(4 * var(--u)); color: var(--gold); font-size: calc(18 * var(--u)); font-weight: 900; line-height: 1.2; }
.final__note {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: calc(12 * var(--u));
  color: var(--snow-shade);
  font-size: calc(14.5 * var(--u));
  line-height: 1.25;
  text-align: center;
}
.final__note > .ha-icon { flex: none; width: calc(26 * var(--u)); height: calc(26 * var(--u)); margin-right: calc(8 * var(--u)); }
.ha-panel.roster--final { margin-top: calc(30 * var(--u)); }

/* --------------------------------------------------------------------------
   Sheets and dialogs
   -------------------------------------------------------------------------- */
.ha-modal__card:focus { outline: none; }
.sheet__head { position: relative; flex: none; display: flex; align-items: center; justify-content: center; min-height: 44px; margin-bottom: calc(8 * var(--u)); padding: 0 48px; }
.sheet__head .ha-modal__title { display: flex; align-items: center; margin: 0; }
.sheet__head .ha-modal__title > .ha-icon { width: calc(34 * var(--u)); height: calc(34 * var(--u)); margin-right: calc(8 * var(--u)); }
.sheet__close {
  position: absolute;
  top: 50%;
  right: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 2px solid rgba(255, 253, 247, 0.5);
  border-radius: 50%;
  background: #0b1a2e;
  color: var(--snow);
  -webkit-appearance: none;
  appearance: none;
}
.sheet__close::after { content: ""; position: absolute; top: -6px; right: -6px; bottom: -6px; left: -6px; }
.sheet__close > .ha-icon { width: 18px; height: 18px; }
.sheet__close:active { transform: scale(0.92); }
/* padding so button edges and tag strings are not clipped by the scroller */
.sheet__body { margin: 0 calc(-8 * var(--u)); padding: calc(6 * var(--u)) calc(8 * var(--u)) calc(4 * var(--u)); }
.sheet__label { display: flex; align-items: baseline; margin: calc(20 * var(--u)) 0 calc(6 * var(--u)); }
.sheet__sub { margin-left: calc(8 * var(--u)); color: var(--snow-dim); font-size: calc(11 * var(--u)); letter-spacing: 0.06em; }

.hc-transport { display: flex; align-items: center; margin-bottom: calc(22 * var(--u)); }
.hc-transport > .ha-btn + .ha-btn { margin-left: calc(12 * var(--u)); }
.hc-transport__main { flex: 1 1 auto; min-width: 0; }
.hc-transport .ha-btn--icon > .ha-icon { width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
.hc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-gap: calc(18 * var(--u)) calc(12 * var(--u));
  gap: calc(18 * var(--u)) calc(12 * var(--u));
  padding-bottom: calc(8 * var(--u));
}
.hc-grid:empty { display: none; }
.hc-grid > .ha-btn { width: 100%; padding: calc(8 * var(--u)) calc(10 * var(--u)); font-size: calc(18 * var(--u)); white-space: normal; }
.hc-grid > .ha-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.hc-setting { padding: calc(4 * var(--u)) 0 calc(6 * var(--u)); }
.hc-setting__row { display: flex; align-items: baseline; justify-content: space-between; font-size: calc(17 * var(--u)); line-height: 1.2; }
.hc-setting__row b { color: var(--gold); font-family: var(--font-display); font-weight: 400; font-size: calc(22 * var(--u)); }
.hc-setting .ha-range { height: max(48px, calc(48 * var(--u))); }
.hc-filters {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: calc(8 * var(--u)); gap: calc(8 * var(--u)); padding-bottom: calc(10 * var(--u));
}
.hc-chip {
  min-height: max(48px, calc(48 * var(--u))); padding: 0 calc(4 * var(--u));
  border: calc(2 * var(--u)) solid var(--line); border-radius: 999px; background: rgba(255, 253, 247, 0.06);
  color: var(--snow); font: 800 calc(15 * var(--u)) var(--font-body); white-space: nowrap;
}
.hc-chip.is-on { background: var(--gold); border-color: var(--gold); color: #33210a; }
.hc-chip:active { transform: scale(0.96); }
.sheet__body .ha-toggle--block + .ha-toggle--block { border-top: calc(2 * var(--u)) solid var(--line); }
.sheet__body .plist { margin: 0 calc(-6 * var(--u)); }

.psheet__who { display: flex; justify-content: center; margin: calc(4 * var(--u)) 0 calc(20 * var(--u)); padding-left: calc(14 * var(--u)); }
.psheet__btns { display: flex; flex-direction: column; padding-bottom: calc(6 * var(--u)); }
.psheet__btns > .ha-btn + .ha-btn { margin-top: calc(18 * var(--u)); }

.confirm__text { color: var(--snow-shade); font-size: calc(17 * var(--u)); line-height: 1.3; text-align: center; overflow-wrap: break-word; }
.confirm__text:empty { display: none; }
#confirm .ha-modal__title { overflow-wrap: break-word; }
#confirm .ha-modal__actions > .ha-btn { padding-left: calc(10 * var(--u)); padding-right: calc(10 * var(--u)); white-space: normal; }

/* toasts sit under the header so they never cover the answers */
.ha-toasts--top { top: calc(var(--safe-t) + var(--bar-h) + 14px); }

/* --------------------------------------------------------------------------
   Short viewports (a 320 x 568 phone with the browser bars showing, or a
   phone on its side): spend the height on the game, not the trimmings.
   -------------------------------------------------------------------------- */
@media (max-height: 540px) {
  :root { --bar-h: 48px; }
  .bar__btn { width: 40px; height: 40px; }
  .bar__btn::after { top: -8px; right: -8px; bottom: -8px; left: -8px; }
  .app__lights { display: none; }
  .screen { --pad-t: calc(28 * var(--u)); }
  .screen--question,
  .screen--result { --pad-t: calc(22 * var(--u)); }
  .q .ha-answers { grid-gap: calc(11 * var(--u)); gap: calc(11 * var(--u)); margin-bottom: calc(12 * var(--u)); }
  .q__text { margin: calc(4 * var(--u)) 0 calc(10 * var(--u)); }
  .q__status { min-height: calc(24 * var(--u)); }
  .join__logo--full { display: none; }
  .join__logo--word { display: block; }
  .join__hint { margin-top: calc(14 * var(--u)); }
  .ha-panel.roster { margin-top: calc(22 * var(--u)); }
  .foot { padding-top: calc(12 * var(--u)); }
  .foot__hint { display: none; }
  .menu__badge { display: none; }
  .menu__sub { margin-bottom: calc(16 * var(--u)); }
  .final__title { font-size: calc(28 * var(--u)); }
  .final__me { margin-top: calc(8 * var(--u)); }
  .final__art { width: calc(60 * var(--u)); height: calc(60 * var(--u)); }
}
/* really short (a phone on its side): lobby and final scroll as one page
   instead of squeezing their lists to nothing */
@media (max-height: 420px) {
  .screen--lobby,
  .screen--final,
  .screen--menu { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .screen--lobby > *,
  .screen--final > * { flex: none; }
  .screen--lobby .scroll,
  .screen--final .scroll { overflow: visible; }
  .ha-panel.roster { flex: none; }
  .scenes__grid { min-height: 220px; }
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes play-screen-in {
  from { opacity: 0; transform: translateY(calc(14 * var(--u))) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes play-answer-in {
  from { opacity: 0; transform: translateY(calc(18 * var(--u))) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes play-net-in {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
@keyframes play-bump {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.22); }
}
@keyframes play-key {
  from { transform: scale(0.7); }
  to { transform: scale(1); }
}
@keyframes play-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes play-sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50% { transform: rotate(1.6deg); }
}
@keyframes play-stamp {
  0% { transform: scale(2.2) rotate(-14deg); opacity: 0; }
  55% { transform: scale(0.9) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes play-drain {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .screen.is-active,
  .q .ha-answer,
  .hero__tag,
  .q__secs.is-urgent,
  .codebox.is-error,
  .codebox__cell.is-filled,
  .bar__score.is-bump,
  .bar__btn--host.is-new,
  .res__icon,
  .final__art,
  .final__me > .ha-medal { animation: none !important; }
}
