/* The web daily (https://onezillion.app/daily): the app's round drawn in its own house style.
   Panels, chips and buttons port the app's OneZillion/Theme (PixelKit.swift, ChunkyButtonStyle.swift):
   stepped corners (never rounded), black outlines, hard shadows, no blur.  Sizes are in --u, the
   round's scale (1 on a phone, as the app's Metrics and RoundFit work it out), set by daily.js. */

:root {
  --outline: rgb(10, 5, 20);
  --night: rgb(36, 26, 69);
  --night-light: rgb(69, 54, 115);
  --night-dark: rgb(18, 13, 38);
  --paper: rgb(247, 240, 217);
  --paper-shade: rgb(214, 201, 171);
  --paper-ink: rgb(43, 31, 26);
  --brass0: rgb(255, 224, 115);
  --brass1: rgb(224, 158, 41);
  --brass2: rgb(117, 71, 13);
  --steel0: rgb(168, 184, 204);
  --steel1: rgb(107, 122, 145);
  --steel2: rgb(51, 59, 74);
  --stamp-red: rgb(224, 38, 36);
  --led: rgb(255, 140, 31);
  --led-red: rgb(255, 56, 51);
  --hero-red: rgb(219, 36, 41);
  --hazard: rgb(255, 204, 31);
  --u: 1;
  --s: 3px;
  color-scheme: dark;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--outline); color: var(--paper); }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Stepped corners, as SteppedRect cuts them: two steps of --s at each corner. */
.panel::before, .panel::after, .panel > .face, .chunky .lip, .chunky .lip::after, .chunky .face, .chunky .face::before,
.chip::before, .chip::after, .window, .window > .scene, .window-wrap::before, .field, .field::before, .pip, .swatch {
  clip-path: polygon(calc(var(--s) * 2) 0, calc(100% - var(--s) * 2) 0, calc(100% - var(--s) * 2) var(--s),
    calc(100% - var(--s)) var(--s), calc(100% - var(--s)) calc(var(--s) * 2), 100% calc(var(--s) * 2),
    100% calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s)),
    calc(100% - var(--s) * 2) calc(100% - var(--s)), calc(100% - var(--s) * 2) 100%, calc(var(--s) * 2) 100%,
    calc(var(--s) * 2) calc(100% - var(--s)), var(--s) calc(100% - var(--s)), var(--s) calc(100% - var(--s) * 2),
    0 calc(100% - var(--s) * 2), 0 calc(var(--s) * 2), var(--s) calc(var(--s) * 2), var(--s) var(--s), calc(var(--s) * 2) var(--s));
}

/* MARK: Panels (PixelPanel): a face with a pixel bevel, a black outline and a hard shadow. */
.panel { position: relative; isolation: isolate; --face: var(--night); --light: var(--night-light); --dark: var(--night-dark); --sh: 4px; }
.panel::before { content: ""; position: absolute; inset: 0; transform: translate(var(--sh), var(--sh)); background: rgba(10, 5, 20, 0.75); z-index: -3; }
.panel::after { content: ""; position: absolute; inset: 0; background: var(--outline); z-index: -2; }
.panel > .face { position: absolute; inset: 2.5px; --s: 2px; background: var(--face); z-index: -1;
  box-shadow: inset 2.4px 2.4px 0 var(--light), inset -2.4px -2.4px 0 var(--dark); }
.panel.paper { --face: var(--paper); --light: #fff; --dark: var(--paper-shade); color: var(--paper-ink); }
.panel.steel { --face: var(--steel1); --light: var(--steel0); --dark: var(--steel2); }
.panel.flat { --sh: 3px; --face: var(--night-dark); --light: var(--night); --dark: var(--outline); }

/* MARK: Chunky buttons (ChunkyButtonStyle): a face on a lip that sinks when pressed. */
.chunky { --h: calc(50px * var(--u)); --depth: 6px; position: relative; display: block; width: 100%; height: calc(var(--h) + var(--depth));
  padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  --top: rgb(255, 128, 56); --bottom: var(--hero-red); --lip: rgb(117, 15, 18); --ink: rgb(255, 245, 214); --ink-shadow: rgb(128, 13, 15); }
.chunky.tool { --top: rgb(140, 158, 184); --bottom: rgb(84, 99, 122); --lip: rgb(33, 38, 48); --ink: rgb(245, 247, 252); --ink-shadow: rgb(36, 43, 56); }
.chunky .lip { position: absolute; left: 0; right: 0; top: var(--depth); height: var(--h); background: #000; }
.chunky .lip::after { content: ""; position: absolute; inset: 2.5px; --s: 2px; background: var(--lip); }
.chunky .face { position: absolute; left: 0; right: 0; top: 0; height: var(--h); background: #000; display: flex; align-items: center;
  justify-content: center; gap: calc(6px * var(--u)); transition: transform 0.09s; }
.chunky .face::before { content: ""; position: absolute; inset: 2.5px; --s: 2px; z-index: 0;
  background: linear-gradient(var(--top) 0 38%, color-mix(in srgb, var(--top), var(--bottom)) 38% 70%, var(--bottom) 70%); }
.chunky .face::after { content: ""; position: absolute; left: calc(var(--s) * 2 + 2px); right: calc(var(--s) * 2 + 2px); top: 4px; height: 4px;
  background: rgba(255, 255, 255, 0.32); z-index: 0; }
.chunky .label { position: relative; z-index: 1; font-size: calc(17px * var(--u)); font-weight: 900; color: var(--ink); white-space: nowrap;
  text-shadow: 0 1.5px 0 var(--ink-shadow); padding: 0 12px 1px; overflow: hidden; text-overflow: clip; letter-spacing: 0.01em; }
.chunky .label canvas { display: inline-block; vertical-align: -0.05em; margin-right: calc(6px * var(--u)); }
.chunky.tool .label { padding-bottom: 5px; }
.chunky.tool .face > .hazard { position: absolute; left: 3.5px; right: 3.5px; bottom: 4.5px; height: 5px; z-index: 0;
  background: repeating-linear-gradient(-63deg, rgb(20, 20, 20) 0 2.2px, var(--hazard) 2.2px 4.5px); }
.chunky.tool .face > .rivet { position: absolute; top: 10px; width: 3px; height: 3px; background: var(--steel0); box-shadow: 1px 1px 0 var(--steel2); z-index: 0; }
.chunky.tool .face > .rivet.l { left: 9px; }
.chunky.tool .face > .rivet.r { right: 10px; }
.chunky:active:not(:disabled) .face, .chunky.pressed .face { transform: translateY(calc(var(--depth) - 1.5px)); }
.chunky:disabled { cursor: default; opacity: 0.6; filter: saturate(0.2); }
.chunky:focus-visible { outline: 3px solid var(--brass0); outline-offset: 3px; }

/* MARK: Chips (PixelChip) */
.chip { position: relative; isolation: isolate; display: inline-flex; flex: none; padding: var(--chip-pad-y) var(--chip-pad-x); --s: var(--chip-step); }
.chip::before { content: ""; position: absolute; inset: 0; background: var(--outline); z-index: -2; }
.chip::after { content: ""; position: absolute; inset: 1.5px; background: var(--chip-fill); z-index: -1; }
.chip-face { display: inline-flex; align-items: center; gap: var(--chip-gap); }

/* MARK: The page */
#root { position: fixed; left: 0; top: 0; width: 100%; height: var(--vvh, 100%); overflow: hidden; transform: translateY(var(--vvtop, 0px)); }
#stage { position: absolute; left: 0; top: 0; width: 100%; height: var(--stage-h, 100%); background: var(--outline); }
.stage-canvas { width: 100%; height: 100%; }
.column { width: min(calc(100% - 32px), calc(560px * var(--u))); margin: 0 auto; }

#hud { position: absolute; left: 0; right: 0; top: 0; background: rgba(10, 5, 20, 0.42);
  padding: max(calc(7px * var(--u)), env(safe-area-inset-top)) calc(10px * var(--u)) calc(7px * var(--u)); }
#hud .column { display: flex; flex-direction: column; gap: calc(7px * var(--u)); width: min(100%, calc(720px * var(--u))); }
.hud-row { display: flex; align-items: center; gap: calc(8px * var(--u)); min-height: calc(28px * var(--u)); }
.hud-row .where { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.track { position: relative; height: calc(12px * var(--u)); }
.track canvas.band { position: absolute; inset: 0; width: 100%; height: 100%; }
.track canvas.marker { position: absolute; top: 50%; transform: translate(-50%, -50%); transition: left 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); }
.pips { display: flex; gap: calc(4px * var(--u)); }
.pip { flex: 1 1 0; height: calc(8px * var(--u)); --s: calc(1.5px * var(--u)); background: var(--outline); position: relative; }
.pip::after { content: ""; position: absolute; inset: 1.5px; background: var(--pip, rgb(33, 28, 50)); clip-path: inherit; }
.pip.now { background: var(--brass0); }
.pip.now::after { inset: 2px; }

.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.title-row h1 { margin: 0; font-size: inherit; }
.title-row h1 canvas { display: block; }

#bottom { position: absolute; left: 0; right: 0; bottom: 0; transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }
.sheet { background: rgba(10, 5, 20, 0.72); border-top: 3px solid var(--outline);
  padding: calc(14px * var(--u)) 0 max(calc(12px * var(--u)), env(safe-area-inset-bottom)); }
.sheet.console { background: var(--night-dark); padding-top: calc(12px * var(--u)); padding-bottom: max(calc(10px * var(--u)), env(safe-area-inset-bottom)); }
.sheet.card { background: rgba(10, 5, 20, 0.78); }
.stack { display: flex; flex-direction: column; gap: calc(12px * var(--u)); align-items: center; }
.stack.left { align-items: stretch; }
.blurb { margin: 0; text-align: center; font-size: calc(16px * var(--u)); font-weight: 800; color: rgba(247, 240, 217, 0.85); line-height: 1.3; }
.blurb.small { font-size: calc(13px * var(--u)); font-weight: 700; color: rgba(247, 240, 217, 0.7); }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; font-size: calc(13px * var(--u)); font-weight: 800; }
.links a { color: var(--brass0); text-decoration: none; }
.links a:hover, .links a:focus-visible { text-decoration: underline; }
.lobby-actions { display: grid; gap: 12px; width: 100%; }

/* The console: the question on paper, the clock, the answer field. */
.console-parts { display: flex; flex-direction: column; gap: calc(10px * var(--u)); }
.question { padding: calc(14px * var(--u)); min-height: calc(104px * var(--u)); display: flex; flex-direction: column; gap: calc(10px * var(--u)); }
.question .top { display: flex; align-items: center; gap: calc(8px * var(--u)); min-height: calc(20px * var(--u)); }
.question .top .grow { flex: 1; }
.prompt { margin: 0; font-size: calc(25px * var(--u)); line-height: 1.12; font-weight: 900; color: var(--paper-ink); overflow-wrap: anywhere;
  animation: push 0.35s cubic-bezier(0.2, 0.9, 0.3, 1); }
.prompt.long { font-size: calc(21px * var(--u)); }
@keyframes push { from { transform: translateX(40%); opacity: 0; } to { transform: none; opacity: 1; } }
.stamp-wrap { position: absolute; right: calc(10px * var(--u)); bottom: calc(10px * var(--u)); display: flex; flex-direction: column; align-items: flex-end;
  gap: calc(4px * var(--u)); pointer-events: none; animation: thump 0.22s cubic-bezier(0.3, 1.6, 0.5, 1); z-index: 2; }
.stamp-wrap .typed { color: var(--stamp-red); font-weight: 800; font-size: calc(15px * var(--u)); max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes thump { from { transform: scale(1.4); opacity: 0; } to { transform: none; opacity: 1; } }
.huh { position: absolute; right: calc(2px * var(--u)); top: 0; transform: translateY(calc(-100% + 13px * var(--u))); padding: calc(8px * var(--u));
  background: none; border: 0; cursor: pointer; animation: pop 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); transform-origin: bottom right; z-index: 3; }
@keyframes pop { from { transform: translateY(calc(-100% + 13px * var(--u))) scale(0.3); opacity: 0; } }
.rot-4 { transform: rotate(-4deg); }
.rot6 { transform: rotate(6deg); }
.clock-row { display: flex; align-items: center; gap: calc(12px * var(--u)); }
.clock { display: flex; align-items: center; gap: calc(12px * var(--u)); flex: 1; min-width: 0; }
.clock .meter { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(6px * var(--u)); }
.clock.dead { opacity: 0.35; }
.tool-btn { width: max(calc(112px * var(--u)), 116px); flex: none; }
.tool-btn .chunky { --h: calc(44px * var(--u)); }
.compact .tool-btn .chunky { --h: calc(50px * var(--u)); }
.answer-row { display: flex; align-items: flex-start; gap: calc(10px * var(--u)); }
.answer-row .go { width: calc(76px * var(--u)); flex: none; }
.field { position: relative; flex: 1; min-width: 0; height: calc(50px * var(--u)); --s: 3px; background: var(--outline); }
.field::before { content: ""; position: absolute; inset: 2.5px; --s: 2px; background: var(--night-dark); box-shadow: inset 2.4px 2.4px 0 var(--night); }
#answer { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: #fff;
  font: inherit; font-size: max(16px, calc(22px * var(--u))); font-weight: 800; padding: 0 calc(14px * var(--u)); caret-color: var(--brass0); }
#answer::placeholder { color: rgba(247, 240, 217, 0.35); }
.field:focus-within { box-shadow: none; }
/* Autocomplete: the answers what is typed could be finishing, stacked upward from the field over
   the card, the most familiar nearest.  Paper rows on an outline, stepped like a panel. */
.answer-row { position: relative; }
.offers { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px * var(--u)); margin: 0; padding: 2.5px; list-style: none;
  display: flex; flex-direction: column-reverse; gap: 2px; background: var(--outline); z-index: 4; --s: 3px; }
.offers::after { content: ""; position: absolute; inset: 0; transform: translate(4px, 4px); background: rgba(10, 5, 20, 0.6); z-index: -1; }
.offers, .offer { clip-path: polygon(calc(var(--s) * 2) 0, calc(100% - var(--s) * 2) 0, calc(100% - var(--s) * 2) var(--s),
    calc(100% - var(--s)) var(--s), calc(100% - var(--s)) calc(var(--s) * 2), 100% calc(var(--s) * 2),
    100% calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s)),
    calc(100% - var(--s) * 2) calc(100% - var(--s)), calc(100% - var(--s) * 2) 100%, calc(var(--s) * 2) 100%,
    calc(var(--s) * 2) calc(100% - var(--s)), var(--s) calc(100% - var(--s)), var(--s) calc(100% - var(--s) * 2),
    0 calc(100% - var(--s) * 2), 0 calc(var(--s) * 2), var(--s) calc(var(--s) * 2), var(--s) var(--s), calc(var(--s) * 2) var(--s)); }
.offer { --s: 2px; display: flex; align-items: center; min-height: calc(44px * var(--u)); padding: 0 calc(14px * var(--u));
  background: var(--paper); color: var(--paper-ink); cursor: pointer; box-shadow: inset 0 -3px 0 var(--paper-shade);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.offer .name { font-size: max(16px, calc(19px * var(--u))); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer:hover, .offer.at { background: var(--brass0); box-shadow: inset 0 -3px 0 var(--brass1); }
.offer:active { transform: translateY(1.5px); }

#park { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* The score card between questions. */
.score { display: flex; flex-direction: column; gap: calc(9px * var(--u)); }
.score .row { display: flex; align-items: center; gap: calc(8px * var(--u)); }
.score .row .grow { flex: 1; min-width: 0; }
.score .said { margin: 0; font-size: calc(28px * var(--u)); font-weight: 900; color: #fff; line-height: 1.1; overflow-wrap: anywhere; }
.score .next { width: calc(112px * var(--u)); flex: none; }
.score .next.last { width: calc(132px * var(--u)); }
.score .meter { display: flex; flex-direction: column; gap: calc(5px * var(--u)); }

/* Results */
#results { position: absolute; inset: 0; overflow-y: auto; background: rgba(10, 5, 20, 0.8); -webkit-overflow-scrolling: touch; }
.results { display: flex; flex-direction: column; gap: calc(16px * var(--u)); padding: max(calc(12px * var(--u)), env(safe-area-inset-top)) 0
  max(calc(24px * var(--u)), env(safe-area-inset-bottom)); }
.results.wide { display: grid; grid-template-columns: 1fr 1fr; gap: calc(24px * var(--u)); width: min(calc(100% - 32px), calc(1120px * var(--u))); align-items: start; }
.results.wide > .col { display: flex; flex-direction: column; gap: calc(16px * var(--u)); min-width: 0; }
.results:not(.wide) > .col { display: contents; }
.window { position: relative; height: calc(250px * var(--u)); background: var(--outline); --s: 3px; }
.window-wrap { position: relative; }
.window-wrap::before { content: ""; position: absolute; inset: 0; transform: translate(4px, 4px); background: rgba(10, 5, 20, 0.75); }
.window > .scene { position: absolute; inset: 2.5px; width: calc(100% - 5px); height: calc(100% - 5px); --s: 2px; }
.window .over { position: absolute; left: 0; right: 0; display: flex; justify-content: center; }
.window .over.top { top: calc(14px * var(--u)); }
.window .over.daily { top: calc(62px * var(--u)); left: calc(12px * var(--u)); justify-content: flex-start; }
.window .band { position: absolute; left: 0; right: 0; bottom: 0; padding: calc(10px * var(--u)); background: rgba(18, 13, 38, 0.82);
  border-top: 2px solid var(--outline); display: flex; flex-direction: column; align-items: center; gap: calc(6px * var(--u)); }
.answers { padding: calc(6px * var(--u)) calc(12px * var(--u)); }
.answers .r + .r, .answers .best + .r { border-top: 1.5px solid var(--paper-shade); }
.answers .tap { display: flex; align-items: center; gap: calc(10px * var(--u)); width: 100%; padding: calc(8px * var(--u)) 0; margin: 0;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
.answers .tap > canvas:last-child { flex: none; transition: transform 0.15s; }
.answers .r.open .tap > canvas:last-child { transform: rotate(180deg); }
.answers .tap:focus-visible { outline: 3px solid var(--brass1); outline-offset: 2px; }
@media (hover: hover) { .answers .tap:hover .a { text-decoration: underline; text-decoration-thickness: 2px; } }
.answers .hint { margin: calc(4px * var(--u)) 0 calc(2px * var(--u)); display: flex; justify-content: center; }
.answers .best { position: relative; margin: 0 0 calc(8px * var(--u)) calc(28px * var(--u)); padding: calc(10px * var(--u)) calc(12px * var(--u));
  background: rgba(214, 201, 171, 0.45); box-shadow: inset 3px 0 0 var(--paper-shade); display: flex; flex-direction: column; gap: calc(6px * var(--u));
  animation: open 0.18s ease-out; }
@keyframes open { from { opacity: 0; transform: translateY(-4px); } }
.answers .best .who { display: flex; align-items: center; gap: calc(8px * var(--u)); min-width: 0; }
.answers .best .who .a { flex: 1; min-width: 0; }
.answers .best p { margin: 0; font-size: calc(13px * var(--u)); font-weight: 700; color: rgba(43, 31, 26, 0.65); }
.answers .best .mine { position: absolute; right: calc(10px * var(--u)); top: calc(6px * var(--u)); }
.answers .n { width: calc(18px * var(--u)); display: flex; justify-content: flex-end; flex: none; }
.swatch { width: calc(12px * var(--u)); height: calc(12px * var(--u)); flex: none; --s: 1.5px; background: var(--outline); position: relative; }
.swatch::after { content: ""; position: absolute; inset: 1.5px; background: var(--tier); clip-path: inherit; }
.answers .what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.answers .a { font-size: calc(17px * var(--u)); font-weight: 900; color: var(--paper-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.answers .a.miss { color: rgba(43, 31, 26, 0.5); }
.answers .q { font-size: calc(12px * var(--u)); font-weight: 650; color: rgba(43, 31, 26, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.answers .g { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.share { padding: calc(14px * var(--u)); display: flex; flex-direction: column; gap: calc(12px * var(--u)); }
.share .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.share pre { margin: 0; padding: calc(10px * var(--u)); background: var(--outline); color: var(--paper); font: inherit; font-size: calc(14px * var(--u));
  font-weight: 700; white-space: pre-wrap; line-height: 1.35; }
.standing { padding: calc(12px * var(--u)) calc(14px * var(--u)); opacity: 0; transition: opacity 0.4s ease-out; }
.standing.shown { opacity: 1; }
.standing .in { display: flex; align-items: center; gap: calc(10px * var(--u)); min-width: 0; }
@media (prefers-reduced-motion: reduce) { .standing { transition: none; } }
.toast { position: absolute; left: 50%; bottom: calc(24px * var(--u)); transform: translateX(-50%); pointer-events: none; z-index: 10; }

.error { padding: calc(16px * var(--u)); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.loading-line { display: flex; justify-content: center; min-height: 22px; }

@media (prefers-reduced-motion: reduce) {
  .prompt, .stamp-wrap, .huh, .answers .best { animation: none; }
  #bottom, .track canvas.marker, .chunky .face { transition: none; }
}
