/* The big screen. Everything is sized in "screen units" (--vw and --vh, defined
   below) so the picture scales to any TV and to any shape of browser window. */

:root {
  --night: #0a1a33;
  --night2: #15376b;
  --snow: #f5f9ff;
  --muted: #a9bcd9;
  --red: #d62839;
  --green: #22a565;
  --gold: #ffc94d;
  --ink: #2a1a10;

  /* The layout is drawn for a 16:9 screen. One --vw is 1% of that picture's
     width and one --vh is 1% of its height. In a window that is shorter than
     16:9 (a browser with its tabs and bookmarks showing) the picture shrinks to
     fit the height, so nothing is ever cut off the bottom. */
  --vw: min(1vw, 1.7778vh);
  --vh: calc(var(--vw) * 0.5625);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--snow);
  background: radial-gradient(120% 90% at 50% 0%, var(--night2), var(--night) 70%) fixed;
  overflow: hidden;
  line-height: 1.25;
}

b { font-weight: 800; }
ul, ol { list-style: none; }
a { color: var(--gold); }
[hidden] { display: none !important; }

/* ---------- snow ---------- */

#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
/* Each flake is moved by the page, a frame at a time (tv.js): Safari can leave a CSS animation stuck. */
#snow i {
  position: absolute; left: 0; top: 0;
  width: var(--size); height: var(--size);
  border-radius: 50%; background: #fff; opacity: .55;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) { #snow { display: none; } }

/* ---------- top bar ---------- */

#bar {
  position: fixed; inset: 0 0 auto 0; height: calc(7 * var(--vh)); z-index: 5;
  display: flex; align-items: center; gap: calc(2 * var(--vw)); padding: 0 calc(2.5 * var(--vw));
  font-size: calc(2.2 * var(--vh)); color: var(--muted);
}
#bar .title { color: var(--gold); font-weight: 800; }
#bar .spacer { flex: 1; }
#bar .secs { font-size: calc(4.4 * var(--vh)); font-weight: 800; color: var(--snow); min-width: 2.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.hurry #bar .secs { color: var(--red); }

#progress { position: fixed; top: calc(7 * var(--vh)); left: 0; height: calc(.6 * var(--vh)); width: 0; background: var(--gold); z-index: 5; transition: width .25s linear; }
.hurry #progress { background: var(--red); }

/* ---------- stage ---------- */

.stage { position: absolute; inset: calc(7 * var(--vh)) 0 0 0; z-index: 1; display: grid; place-items: center; padding: calc(2 * var(--vh)) calc(3 * var(--vw)) calc(4 * var(--vh)); text-align: center; }
.stage.s-start, .stage.s-menu, .stage.s-lobby { inset: 0; }

.eyebrow { font-size: calc(1.5 * var(--vw)); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

button { font: inherit; cursor: pointer; border: 0; border-radius: calc(1 * var(--vw)); }
button.big { background: var(--red); color: #fff; font-weight: 800; font-size: calc(1.8 * var(--vw)); padding: calc(1 * var(--vw)) calc(2.4 * var(--vw)); box-shadow: 0 calc(.4 * var(--vw)) 0 #8f1420; }
button.big:disabled { opacity: .35; cursor: default; }
button.ghost { background: rgba(255, 255, 255, .1); color: var(--snow); font-size: calc(1.3 * var(--vw)); padding: calc(.9 * var(--vw)) calc(1.6 * var(--vw)); }
.buttons { display: flex; gap: calc(1.2 * var(--vw)); align-items: center; justify-content: center; margin-top: calc(2 * var(--vw)); }

.chips { display: flex; flex-wrap: wrap; gap: calc(.7 * var(--vw)); justify-content: center; }
.chip { background: rgba(255, 255, 255, .12); border-radius: 99px; padding: calc(.45 * var(--vw)) calc(1.2 * var(--vw)); font-size: calc(1.5 * var(--vw)); font-weight: 700; }
.chips.many { gap: calc(.4 * var(--vw)); }
.chips.many .chip { padding: calc(.25 * var(--vw)) calc(.8 * var(--vw)); font-size: calc(1.1 * var(--vw)); }
.chip.done { background: var(--green); }
/* On a landing page a name can be taken out of the room: a cross sits on the chip's corner while the pointer is over it. */
.chip { position: relative; }
.chip .x { display: none; position: absolute; top: calc(-.55 * var(--vw)); right: calc(-.55 * var(--vw)); width: calc(1.9 * var(--vw)); height: calc(1.9 * var(--vw)); padding: 0; border-radius: 50%; background: var(--red); color: #fff; font-size: calc(1.4 * var(--vw)); font-weight: 800; line-height: 1; align-items: center; justify-content: center; box-shadow: 0 calc(.15 * var(--vw)) calc(.4 * var(--vw)) rgba(0, 0, 0, .4); }
.chip:hover .x, .chip .x:focus-visible { display: flex; }
.chip:hover { background: rgba(255, 255, 255, .22); }
.eyebrow .tip { margin-left: calc(.8 * var(--vw)); font-size: calc(1.05 * var(--vw)); letter-spacing: 0; text-transform: none; font-weight: 600; opacity: .8; }
.chip.off { opacity: .4; }
.chip.empty { background: none; color: var(--muted); font-weight: 400; }

/* ---------- start ---------- */

/* The menu is three games tall on a 16:9 screen, so it is drawn tight enough for its last line (join on a
   phone, credits) to stay on the screen. */
.start h1 { font-size: calc(4.8 * var(--vw)); }
.start p { font-size: calc(1.8 * var(--vw)); color: var(--muted); margin: calc(.8 * var(--vw)) 0 calc(1.8 * var(--vw)); }
.start .small { font-size: calc(1.3 * var(--vw)); margin: calc(1.4 * var(--vw)) 0 0; }
.start .buttons { margin-top: calc(2.5 * var(--vw)); }

/* The menu: one card per game. Picking one opens that game's own lobby. */
/* Two games to a row. Each card takes two of four columns, so a last card left on its own row can sit in the middle. */
.pack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(1.5 * var(--vw)) calc(2 * var(--vw)); width: calc(80 * var(--vw)); margin: 0 auto; }
.pack .packcard { grid-column: span 2; }
.pack .packcard:last-child:nth-child(odd) { grid-column: 2 / span 2; }
.packcard {
  display: flex; flex-direction: column; gap: calc(.7 * var(--vw)); text-align: left; color: var(--snow);
  background: rgba(255, 255, 255, .08); border: calc(.2 * var(--vw)) solid rgba(255, 255, 255, .18);
  border-radius: calc(1.8 * var(--vw)); padding: calc(1.5 * var(--vw)) calc(2.2 * var(--vw));
  transition: transform .12s, border-color .12s, background .12s;
}
.packcard:hover, .packcard:focus-visible { border-color: var(--gold); background: rgba(255, 201, 77, .1); transform: translateY(calc(-.3 * var(--vw))); outline: none; }
.packicon { display: flex; align-items: center; height: calc(4 * var(--vw)); font-size: calc(3.8 * var(--vw)); line-height: 1; color: var(--gold); }
.packcard .cardtop { align-items: center; }
.packtitle { font-size: calc(2.6 * var(--vw)); color: var(--gold); }
.packcard .tag { margin-top: 0; }
.packcard .blurb { font-size: calc(1.5 * var(--vw)); line-height: 1.3; }

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

.lobby { display: grid; grid-template-columns: 1fr 1fr; gap: calc(5 * var(--vw)); align-items: center; width: 100%; max-width: calc(88 * var(--vw)); }
.joinbox h1 { font-size: calc(3.4 * var(--vw)); margin-bottom: calc(1.6 * var(--vw)); }
.qr { width: calc(19 * var(--vw)); margin: 0 auto; background: #fff; padding: calc(.6 * var(--vw)); border-radius: calc(1.2 * var(--vw)); line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }
.scan { font-size: calc(1.9 * var(--vw)); font-weight: 700; margin-top: calc(1.2 * var(--vw)); }
.or { font-size: calc(1.4 * var(--vw)); color: var(--muted); margin-top: calc(.5 * var(--vw)); }
.or b { color: var(--snow); }
.code { font-size: calc(6 * var(--vw)); font-weight: 800; letter-spacing: .18em; color: var(--gold); margin-right: -.18em; line-height: 1.1; }

.side { text-align: left; }
.side .eyebrow { margin: calc(1.6 * var(--vw)) 0 calc(.7 * var(--vw)); }
.side .chips { justify-content: flex-start; min-height: calc(3 * var(--vw)); }
.side .buttons { justify-content: flex-start; flex-wrap: wrap; }
.buttons button { white-space: nowrap; }
.gamecard { background: rgba(255, 255, 255, .08); border: calc(.15 * var(--vw)) solid rgba(255, 255, 255, .18); border-radius: calc(1.4 * var(--vw)); padding: calc(1.4 * var(--vw)) calc(1.8 * var(--vw)); }
.gamecard h2 { font-size: calc(2.6 * var(--vw)); color: var(--gold); }
/* The game's name on the left, and a little box in the top right saying how many can play. */
.cardtop { display: flex; align-items: flex-start; justify-content: space-between; gap: calc(1.5 * var(--vw)); }
.tag {
  flex: none; margin-top: calc(.45 * var(--vw)); padding: calc(.3 * var(--vw)) calc(.9 * var(--vw));
  border: calc(.15 * var(--vw)) solid rgba(255, 255, 255, .4); border-radius: calc(.8 * var(--vw));
  font-size: calc(1.2 * var(--vw)); font-weight: 700; white-space: nowrap;
}
.gamecard p { font-size: calc(1.5 * var(--vw)); margin-top: calc(.5 * var(--vw)); }
.gamecard .range { color: var(--muted); font-size: calc(1.25 * var(--vw)); }
.gamecard .about { margin-top: 0; font-weight: 700; }
.gamecard .about + .tag { margin-top: calc(.2 * var(--vw)); }
.joinbox .gicon { color: var(--gold); }
.hint { font-size: calc(1.4 * var(--vw)); color: var(--muted); margin-top: calc(1.2 * var(--vw)); min-height: calc(1.8 * var(--vw)); }

/* ---------- how to play ---------- */

.intro h1 { font-size: calc(4.2 * var(--vw)); color: var(--gold); margin-bottom: calc(3 * var(--vw)); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(2 * var(--vw)); max-width: calc(86 * var(--vw)); }
.steps li { background: rgba(255, 255, 255, .08); border-radius: calc(1.6 * var(--vw)); padding: calc(2 * var(--vw)) calc(1.6 * var(--vw)); display: flex; flex-direction: column; gap: calc(.8 * var(--vw)); align-items: center; }
.steps .icon { font-size: calc(4.5 * var(--vw)); line-height: 1; }
.steps b { font-size: calc(2.4 * var(--vw)); }
.steps span { font-size: calc(1.6 * var(--vw)); color: var(--muted); }
.steps em { color: var(--snow); font-style: normal; font-weight: 800; }
.goal { font-size: calc(2 * var(--vw)); margin-top: calc(3 * var(--vw)); }

/* ---------- question ---------- */

.question { font-size: calc(4 * var(--vw)); font-weight: 800; max-width: calc(82 * var(--vw)); margin: 0 auto; text-wrap: balance; }
.question.small { font-size: calc(2.1 * var(--vw)); font-weight: 700; color: var(--muted); max-width: calc(86 * var(--vw)); }
.prompt { font-size: calc(1.9 * var(--vw)); color: var(--muted); margin: calc(1.6 * var(--vw)) 0 calc(2.4 * var(--vw)); }
.prompt b { color: var(--snow); }
.town .prompt { margin: calc(.8 * var(--vw)) 0 0; }
.ask .prompt { font-size: calc(2.2 * var(--vw)); margin: calc(3 * var(--vw)) 0; }

/* ---------- the street ---------- */

/* --per is the number of plots in a row. --w is the width of one plot, and every
   size inside a plot is a fraction of it, so the street scales as one piece. */
.street {
  --w: min(calc(13 * var(--vw)), calc(calc(94 * var(--vw)) / var(--per)), calc(21 * var(--vh)));
  position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  width: calc(var(--w) * var(--per) + 2px); margin: 0 auto;
  padding-top: calc(var(--w) * .55); row-gap: calc(var(--w) * .45);
}
/* Two rows: the height of the screen is now the limit, and each plot keeps to one line of names. */
.street.two { --w: min(calc(calc(94 * var(--vw)) / var(--per)), calc(13 * var(--vh))); }
.street.two .who { min-height: 1.25em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.street.two .gifts { height: 1.3em; }
.plot { width: var(--w); padding: 0 calc(var(--w) * .07); transition: transform .5s, opacity .5s; }
.plot .mult {
  display: inline-block; background: var(--gold); color: var(--ink); border-radius: 99px;
  font-weight: 800; font-size: calc(var(--w) * .15); padding: 0 calc(var(--w) * .08); margin-bottom: calc(var(--w) * .05);
}
.plot .roof { position: relative; height: calc(var(--w) * .36); background: var(--red); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.plot .roof::after { content: ''; position: absolute; inset: 0; background: #fff; clip-path: polygon(50% 0, 68% 36%, 60% 30%, 50% 40%, 40% 30%, 32% 36%); }
.plot .body {
  height: calc(var(--w) * .46); margin: 0 calc(var(--w) * .06);
  display: grid; place-items: center;
  background: linear-gradient(#fff1c4, #ffd879); color: var(--ink);
}
.plot .num { font-weight: 800; font-size: calc(var(--w) * .25); font-variant-numeric: tabular-nums; }
.plot[data-len="m"] .num { font-size: calc(var(--w) * .18); }
.plot[data-len="l"] .num { font-size: calc(var(--w) * .125); }
.plot[data-len="xl"] .num { font-size: calc(var(--w) * .078); } /* someone typed 999,999,999,999 */
.plot .ground { height: calc(var(--w) * .07); background: var(--snow); margin: 0 calc(var(--w) * -.07); }
.plot.row-start .ground { border-radius: 99px 0 0 99px; }
.plot.row-end .ground { border-radius: 0 99px 99px 0; }
.plot.row-start.row-end .ground { border-radius: 99px; }
.plot .who { font-size: calc(var(--w) * .125); font-weight: 700; margin-top: calc(var(--w) * .06); min-height: 2.5em; overflow-wrap: anywhere; }
/* Only the winning house lists who put presents on it, in at most three lines.
   The space is always kept, so the results below never move or get pushed off. */
.plot .gifts { display: flex; flex-direction: column; gap: .15em; font-size: calc(var(--w) * .105); color: var(--muted); height: 4.1em; overflow: hidden; }
.plot .gifts span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A snowbank with a flat-ish top, so three lines of words fit inside it at any size. */
.plot.drift .mound {
  height: calc(var(--w) * .56); margin-top: calc(var(--w) * .26);
  display: grid; place-items: end center; padding-bottom: calc(var(--w) * .06);
  background: var(--snow); color: var(--night); border-radius: 45% 45% 0 0 / 70% 70% 0 0;
  font-weight: 800; font-size: calc(var(--w) * .088); line-height: 1.12;
}
/* "Smaller than the smallest guess" sits low in the snowbank, where it is widest. */
.plot.drift .mound span { display: block; max-width: 80%; text-wrap: balance; }

.landed .plot.lose { opacity: .45; }
.landed .plot.win { transform: translateY(calc(var(--w) * -.06)) scale(1.07); }
.landed .plot.win .body, .landed .plot.win .mound { box-shadow: 0 0 calc(var(--w) * .3) var(--gold); }
.landed .plot.over .body { position: relative; background: #cfd6e2; }
.landed .plot.over .body::after {
  content: 'OVER'; position: absolute; top: 4%; right: 4%;
  background: var(--red); color: #fff; font-weight: 800; font-size: calc(var(--w) * .08); padding: 0 .4em; border-radius: .3em;
}
.landed .plot.win .gifts { color: var(--gold); font-weight: 700; }

.sleigh {
  position: absolute; left: 0; top: 0; z-index: 2;
  font-size: calc(var(--w) * .36); line-height: 1.2; white-space: nowrap;
  transform: translate(calc(-70 * var(--vw)), 0);
  transition: transform 0ms cubic-bezier(.3, .05, .2, 1);
}
.sleigh span { display: inline-block; transform: scaleX(-1); }

.answer { font-size: calc(2.6 * var(--vw)); color: var(--muted); margin-top: calc(.8 * var(--vw)); min-height: calc(3.6 * var(--vw)); }
.answer.shown { color: var(--snow); }
.answer b { color: var(--gold); font-size: calc(3.4 * var(--vw)); }

/* The green and red boxes: one line, always. Long names shorten rather than wrap. */
.gains { display: flex; flex-wrap: nowrap; gap: calc(.7 * var(--vw)); justify-content: center; height: calc(3 * var(--vw)); margin-top: calc(.6 * var(--vw)); max-width: calc(94 * var(--vw)); }
.gains li { border-radius: 99px; padding: calc(.4 * var(--vw)) calc(1.2 * var(--vw)); font-size: calc(1.5 * var(--vw)); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gains .up { background: var(--green); }
.gains .down { background: rgba(214, 40, 57, .75); }
.gains .none { color: var(--muted); font-weight: 400; }

/* Says who the room is waiting for, now that nothing moves on by itself. */
.hostline { font-size: calc(1.4 * var(--vw)); color: var(--muted); min-height: calc(1.8 * var(--vw)); margin-top: calc(1.4 * var(--vw)); }
.town .hostline { margin-top: 0; }

.town { width: 100%; display: flex; flex-direction: column; gap: calc(1 * var(--vw)); align-items: center; }
.town .chips { margin-top: calc(1 * var(--vw)); }

/* ---------- scores: the top five ---------- */

.scores h1 { font-size: calc(3.4 * var(--vw)); margin-bottom: calc(1.6 * var(--vw)); }

/* Five slots. A row is placed by its slot number, so moving a player is just
   changing that number: the browser slides the row to its new place. Slot 5 is
   one step below the last row, where rows wait out of sight. */
.ladder {
  --row: calc(4.4 * var(--vw)); --gap: calc(.7 * var(--vw));
  position: relative; width: calc(52 * var(--vw)); margin: 0 auto; text-align: left;
  height: calc(var(--rows) * var(--row) + (var(--rows) - 1) * var(--gap));
}
.rung {
  position: absolute; left: 0; right: 0; top: 0; height: var(--row);
  display: flex; align-items: center; gap: calc(1.2 * var(--vw)); padding: 0 calc(1.5 * var(--vw));
  border-radius: calc(1.1 * var(--vw)); background: #1d2f52; font-size: calc(2 * var(--vw));
  transform: translateY(calc(var(--slot) * (var(--row) + var(--gap))));
  transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .6s, background .6s;
}
.rung.out { opacity: 0; }
.rung.rising { z-index: 2; box-shadow: 0 calc(.5 * var(--vw)) calc(1.6 * var(--vw)) rgba(0, 0, 0, .5); } /* climbers pass in front */
.rung.lead { background: #4b4630; }
.rung .rank {
  width: calc(2.6 * var(--vw)); height: calc(2.6 * var(--vw)); border-radius: 50%; flex: none;
  display: grid; place-items: center; background: rgba(255, 255, 255, .16); font-size: calc(1.5 * var(--vw)); font-weight: 800;
}
.rung.lead .rank { background: var(--gold); color: var(--ink); }
.rung .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rung .score { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* What the player just won or lost. It pops in beside the total before the total rolls. */
.rung .delta {
  border-radius: 99px; padding: calc(.15 * var(--vw)) calc(.9 * var(--vw)); font-size: calc(1.5 * var(--vw)); font-weight: 800; white-space: nowrap;
  opacity: 0; transform: translateX(calc(1.5 * var(--vw))) scale(.7); transition: opacity .35s, transform .35s cubic-bezier(.2, 1.4, .3, 1);
}
.rung .delta.up { background: var(--green); }
.rung .delta.down { background: rgba(214, 40, 57, .85); }
.ladder.deltas .delta { opacity: 1; transform: none; }
.scores .hostline { margin-top: calc(1.6 * var(--vw)); }

/* ---------- the final podium ---------- */

.finale h1 { font-size: calc(4 * var(--vw)); color: var(--muted); min-height: calc(5.2 * var(--vw)); margin-bottom: calc(1 * var(--vw)); }
.finale h1.won { color: var(--gold); animation: pop .6s cubic-bezier(.2, 1.6, .3, 1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.podium {
  display: flex; align-items: flex-end; justify-content: center; gap: calc(1 * var(--vw));
  height: calc(25 * var(--vw)); width: fit-content; margin: 0 auto; padding: 0 calc(2 * var(--vw));
  border-bottom: calc(.6 * var(--vw)) solid var(--snow); border-radius: 0 0 calc(.4 * var(--vw)) calc(.4 * var(--vw));
}
.step { width: calc(13 * var(--vw)); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
/* Each place starts flat and unnamed. "shown" raises the block and brings in the name. */
.step .who {
  display: flex; flex-direction: column; max-width: 100%; margin-bottom: calc(.7 * var(--vw));
  opacity: 0; transform: translateY(calc(1.5 * var(--vw))); transition: opacity .5s .45s, transform .5s .45s;
}
.step .pname { font-size: calc(2 * var(--vw)); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .pscore { font-size: calc(1.4 * var(--vw)); font-weight: 700; color: var(--muted); }
.step .block {
  width: 100%; height: var(--h); border-radius: calc(1 * var(--vw)) calc(1 * var(--vw)) 0 0;
  display: grid; place-items: center; font-size: calc(4.6 * var(--vw)); font-weight: 800; color: rgba(42, 26, 16, .6);
  transform: scaleY(0); transform-origin: bottom; transition: transform .8s cubic-bezier(.2, 1.25, .3, 1);
}
.step.shown .who { opacity: 1; transform: none; }
.step.shown .block { transform: scaleY(1); }
.step.p1 { --h: calc(16.5 * var(--vw)); }
.step.p2 { --h: calc(12.5 * var(--vw)); }
.step.p3 { --h: calc(9.5 * var(--vw)); }
.step.p4 { --h: calc(7 * var(--vw)); }
.step.p5 { --h: calc(5.2 * var(--vw)); }
.step.p1 .block { background: linear-gradient(#ffe391, #f0b429); }
.step.p2 .block { background: linear-gradient(#f4f6fa, #b4bdcb); }
.step.p3 .block { background: linear-gradient(#f2b780, #c57633); }
.step.p4 .block, .step.p5 .block { background: linear-gradient(#5d7bb2, #3a5285); color: rgba(255, 255, 255, .8); font-size: calc(3.2 * var(--vw)); }
.step.p1 .pname { color: var(--gold); }
.buttons.waiting { visibility: hidden; } /* until the podium has finished */

/* Falls the whole height of the real window, like the snow. */
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 4; }
.confetti i {
  position: absolute; top: -4vh; width: calc(.7 * var(--vw)); height: calc(1.3 * var(--vw)); border-radius: calc(.15 * var(--vw));
  opacity: .9; animation: drop linear 2 both;
}
@keyframes drop { to { transform: translateY(112vh) rotate(var(--spin)); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* ---------- messages ---------- */

/* A small note while the browser is still refusing to play sound. */
#soundhint { position: fixed; left: calc(2.5 * var(--vw)); bottom: calc(3 * var(--vh)); z-index: 8; padding: calc(.5 * var(--vw)) calc(1.2 * var(--vw)); border-radius: 99px; background: #fff1cf; color: #2a1a10; font-size: calc(1.2 * var(--vw)); font-weight: 800; }
/* The corner: sound settings and full screen, on every page. Always there on the menu and on a landing
   page; in a game they show only while the mouse is moving, so the game's own screens stay as drawn. */
#corner { position: fixed; right: calc(1.5 * var(--vw)); bottom: calc(2.5 * var(--vh)); z-index: 8; display: flex; align-items: flex-end; gap: calc(.8 * var(--vw)); opacity: 0; pointer-events: none; transition: opacity .25s; }
body.setup #corner, body.pointing #corner, #corner.open, #corner:focus-within { opacity: 1; pointer-events: auto; }
#corner .knob { width: calc(4.2 * var(--vw)); height: calc(4.2 * var(--vw)); min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(11, 29, 58, .92); color: #f5f9ff; box-shadow: 0 0 0 2px rgba(245, 249, 255, .25), 0 4px 14px rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; cursor: pointer; }
#corner .knob[hidden] { display: none; }
#corner .knob svg { width: 55%; height: 55%; }
#corner .knob:hover { background: #1e3357; }
#corner .knob:focus-visible, #soundpanel input:focus-visible { outline: 3px solid #ffc94d; outline-offset: 2px; }
#corner .knob[aria-expanded="true"] { background: #ffc94d; color: #2a1a10; box-shadow: none; }
/* End the game: a red pill with the question on it after the first tap. */
#corner #endknob.armed { width: auto; gap: calc(.6 * var(--vw)); padding: 0 calc(1.4 * var(--vw)); border-radius: 999px; background: #c81f33; font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; font-size: max(15px, calc(1.25 * var(--vw))); white-space: nowrap; }
#corner #endknob.armed svg { width: calc(1.8 * var(--vw)); min-width: 18px; height: auto; }
#soundpanel { position: absolute; right: 0; bottom: calc(100% + .9 * var(--vw)); width: max(320px, calc(33 * var(--vw))); padding: calc(1.2 * var(--vw)) calc(1.6 * var(--vw)); border-radius: calc(1.4 * var(--vw)); background: #13233f; box-shadow: 0 0 0 2px rgba(245, 249, 255, .2), 0 10px 30px rgba(0, 0, 0, .55); display: grid; gap: calc(.3 * var(--vw)); text-align: left; }
#soundpanel[hidden] { display: none; }
#soundpanel label { display: grid; grid-template-columns: minmax(0, 12fr) minmax(0, 13fr) minmax(0, 3fr); white-space: nowrap; align-items: center; gap: calc(.9 * var(--vw)); min-height: 44px; color: #f5f9ff; font-weight: 700; font-size: max(15px, calc(1.45 * var(--vw))); }
#soundpanel input { width: 100%; height: 28px; margin: 0; accent-color: #ffc94d; cursor: pointer; }
#soundpanel b { text-align: right; font-weight: 600; color: #a9bcd9; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { #corner { transition: none; } }
#toast { position: fixed; left: 50%; bottom: calc(5 * var(--vh)); transform: translateX(-50%); z-index: 9; background: #fff; color: var(--night); font-weight: 700; font-size: calc(1.6 * var(--vw)); padding: calc(1 * var(--vw)) calc(2 * var(--vw)); border-radius: calc(1 * var(--vw)); }
#offline { display: none; position: fixed; inset: auto 0 0 0; z-index: 9; background: var(--red); text-align: center; font-size: calc(1.5 * var(--vw)); padding: calc(.5 * var(--vw)); font-weight: 700; }
.offline #offline { display: block; }

/* The baked cookie, small, beside a score. */
.ck { width: 1.1em; height: 1.1em; vertical-align: -.2em; }

/* ---------- the spotlight on the last two (Darren, 2026-11-30) ---------- */
/* Sized in em, so each podium sets one font size and the whole thing follows. */
.spot { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4em; background: rgb(3, 7, 18); opacity: 0; transition: opacity .5s; overflow: hidden; }
.spot.on { opacity: 1; }
.spottitle { position: relative; font-family: var(--round, 'Fredoka', sans-serif); font-weight: 700; font-size: 3.6em; line-height: 1; color: #a9bcd9; }
.spotcards { display: flex; align-items: center; gap: 6em; }
.spotcard { position: static; min-width: 5.2em; padding: .5em .8em; border-radius: .5em; background: #1e3357; color: #f5f9ff; font-family: var(--round, 'Fredoka', sans-serif); font-weight: 700; font-size: 3.4em; line-height: 1.1; text-align: center; white-space: nowrap; opacity: .22; transition: opacity .14s, transform .45s cubic-bezier(.2, 1.4, .3, 1), background .3s, color .3s, box-shadow .45s; }
.spotcard.lit { opacity: 1; }
.spotcard.won { background: linear-gradient(#ffe391, #f0b429); color: #2a1a10; transform: scale(1.16); box-shadow: 0 0 1.2em rgba(255, 201, 77, .6); }
.spotbeam { position: absolute; left: 0; top: 50%; width: 34em; height: 34em; border-radius: 50%; background: radial-gradient(circle, rgba(255, 246, 214, .36) 0, rgba(255, 246, 214, .17) 36%, rgba(255, 246, 214, 0) 68%); pointer-events: none; will-change: transform; transition: width .5s, height .5s; }
.spotbeam.wide { width: 70em; height: 70em; }
