/* Palettle: a bright photo studio. Today's prints hang on a drying line;
   one accent per print, borrowed from its palette. */

:root {
  --paper: #fbfbf9;
  --ink: #1e1d1b;
  --on-ink: #fbfbf9;
  --ink-soft: #5f5d58;
  --rule: rgba(30, 29, 27, 0.18);
  --field: #ffffff;
  --wrong: #a3301f;
  --accent: #1e1d1b;
  --amber: #e8962e;
  --string: #7a6650;
  --tape: rgba(249, 230, 160, 0.94);
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #e9e7e2; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- backdrop: the studio ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

/* A soft light haze where the content sits, darker toward the edges. */
.haze {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 72% 78% at 50% 42%,
    rgba(251, 251, 249, 0.9) 0%, rgba(251, 251, 249, 0.72) 50%, rgba(251, 251, 249, 0.3) 100%);
  transition: background 0.8s;
}

.tint {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: multiply;
  transition: opacity 1.2s;
}

/* Overtime: the studio lights go warm. */
body.overtime .haze {
  background: radial-gradient(ellipse 72% 78% at 50% 42%,
    rgba(255, 236, 205, 0.92) 0%, rgba(250, 205, 140, 0.72) 55%, rgba(214, 140, 60, 0.45) 100%);
}

/* ---------- header ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 0.7rem) 1.25rem 0.7rem;
  background: rgba(251, 251, 249, 0.86);
  border-bottom: 1px solid rgba(30, 29, 27, 0.08);
}

.mark {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  transition: font-size 0.4s;
}

body[data-screen="start"] .mark { font-size: clamp(1.9rem, 8vw, 2.6rem); }
.mark a { color: inherit; text-decoration: none; }
.mark .version {
  margin-left: 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-soft);
  opacity: 0.6;
  vertical-align: 0.15em;
}

/* Dev server on a branch other than main */
.dev-branch {
  display: inline-block;
  margin: 0.35rem 0 0;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: #1c1c1b;
  color: #f3f2ef;
  font: 600 0.7rem/1.4 ui-monospace, Menlo, Consolas, monospace;
}

.meta {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tools { display: flex; gap: 0.4rem; }

.icon {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  font: 700 1rem var(--font);
  cursor: pointer;
}
.icon svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon[aria-pressed="true"] .off,
.icon[aria-pressed="false"] .wave { display: none; }

/* ---------- the drying line ---------- */

.line {
  position: relative;
  width: 100%;
  height: 16rem;
  margin-top: 0.4rem;
  overflow-x: clip;
  overflow-y: visible;
}

.string {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}
.string path { fill: none; stroke: var(--string); stroke-width: 1.6; stroke-linecap: round; }

.hang {
  position: absolute;
  margin: 0;
  transform-origin: 50% 0;
  will-change: transform, left, top;
}

/* Wooden clothes-peg */
.clip {
  position: relative;
  z-index: 3;
  display: block;
  width: 13px;
  height: 30px;
  margin: 0 auto -12px;
  border-radius: 3px 3px 4px 4px;
  background: linear-gradient(90deg, #b98a55 0%, #e0bb88 45%, #c99a63 55%, #a87a47 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.clip::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 11px;
  height: 3px;
  border-radius: 2px;
  background: #9aa0a6;
}

.paper {
  position: relative;
  display: flex;
  gap: 4%;
  padding: 5% 5% 7%;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08), 0 20px 32px -20px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.4s;
}

.photo { position: relative; flex: 1; min-width: 0; }

.photo canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #efeeea;
}

.hang.blank .photo canvas { background: linear-gradient(160deg, #f7f2ea, #efe7dc); }
.hang.live .paper { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08), 0 26px 40px -22px rgba(0, 0, 0, 0.6); }
.hang.missed .photo canvas { filter: grayscale(0.9); opacity: 0.7; }

.photo canvas.pulling { animation: pull 0.5s ease-out; }

@keyframes pull {
  from { opacity: 0.6; transform: scale(1.012); }
  to { opacity: 1; transform: none; }
}

/* Palette chips down the print's right margin, once the palette stages are done */
.chips {
  flex: 0 0 11%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateX(-30%);
  transition: opacity 0.45s, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.chips.in { opacity: 1; transform: none; }
.chips .group { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chips .group.main { flex: 1.6; }
.chips i { display: block; min-height: 3px; }
.chips i:first-child { border-radius: 2px 2px 0 0; }
.chips i:last-child { border-radius: 0 0 2px 2px; }

/* Masking-tape label */
.tape {
  position: absolute;
  left: 7%;
  bottom: -0.55em;
  z-index: 2;
  padding: 0.05em 0.55em 0.1em;
  transform: rotate(-4deg);
  background: var(--tape);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  color: #4a3f2a;
  font: 700 clamp(0.85rem, 3.4vw, 1.15rem) / 1.1 var(--hand);
  white-space: nowrap;
}

/* The subject standing out from its print: a white radiating shine over the
   real photo, the cut-out exactly in place on top. */
.shine-wrap {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}
.shine {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.88) 30%,
    rgba(255, 255, 255, 0.4) 52%, rgba(255, 255, 255, 0) 70%);
  transition: opacity 0.6s ease-out, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* Slowly turning rays */
.shine::before {
  content: "";
  position: absolute;
  inset: -25%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg,
    rgba(255, 255, 255, 0.6) 0deg 5deg, rgba(255, 255, 255, 0) 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%);
  mask: radial-gradient(circle, #000 18%, transparent 66%);
  animation: rays 40s linear infinite;
}
.shine.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@keyframes rays { to { transform: rotate(360deg); } }

.photo .pop {
  position: absolute;
  z-index: 4;
  transform-origin: 50% 50%;
  pointer-events: none;
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.75s;
}
.photo .pop.out {
  transform: scale(1.03);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.28));
}

.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.2rem;
  background: #efeeea;
  text-align: center;
}
.countdown:empty { display: none; }
.countdown .n { font-size: clamp(3rem, 16vw, 6rem); font-weight: 800; line-height: 0.9; letter-spacing: -0.05em; }
.countdown .c { font: 700 clamp(1.1rem, 4.5vw, 1.6rem) var(--hand); color: var(--ink-soft); }

/* Grease-pencil circle around the best print */
.hang .circle {
  position: absolute;
  left: -12%;
  top: 4%;
  width: 124%;
  height: auto;
  aspect-ratio: 300 / 230;
  pointer-events: none;
  overflow: visible;
}
.hang .circle path {
  fill: none;
  stroke: #e0442b;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1100;
  stroke-dashoffset: 1100;
  animation: draw 0.8s 0.2s ease-out forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- layout below the line ---------- */

main {
  max-width: 31rem;
  margin: 0 auto;
  padding: 0.6rem 1rem calc(env(safe-area-inset-bottom, 0px) + 3rem);
}

.screen { animation: screen-in 0.4s ease-out; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- buttons ---------- */

button { font-family: var(--font); }

.cta {
  display: block;
  width: 100%;
  padding: 1rem 1.2rem;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.08s;
}
.cta:active { transform: scale(0.99); }
/* Play again counting down to tomorrow's prints */
.cta:disabled {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--rule);
  cursor: default;
  font-variant-numeric: tabular-nums;
}
.cta:disabled:active { transform: none; }

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.ghost svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }

/* What the next hint costs, in points */
.ghost .cost {
  color: var(--wrong);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Keyboard shortcut hint; hidden on touch screens */
.ghost kbd {
  margin-left: 0.15rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #f4f3f0;
  color: var(--ink-soft);
  font: 600 0.72rem var(--font);
}
@media (hover: none) {
  .ghost kbd { display: none; }
}

/* Buttons that are links (Pick a day, Unlimited) look like buttons */
a.cta, a.ghost { text-decoration: none; text-align: center; }
a.ghost { justify-content: center; }

/* A row of secondary actions under a main one */
.more { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.7rem; }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

button:focus-visible, input:focus-visible, .speed:has(input:focus-visible), a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.lede {
  margin: 0.4rem 0 1.3rem;
  text-align: center;
  font-size: 1.08rem;
  line-height: 1.5;
  font-weight: 500;
}

.speeds { margin: 0 0 1.1rem; padding: 0; border: 0; }

.speeds legend {
  float: left;
  width: 100%;
  margin-bottom: 0.55rem;
  padding: 0;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.speed-options {
  clear: both;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

@media (min-width: 30rem) {
  .speed-options { grid-template-columns: repeat(4, 1fr); }
}

.speed {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.speed input { position: absolute; opacity: 0; pointer-events: none; }
.speed .name { font-weight: 700; font-size: 0.92rem; }
.speed .blurb { font-size: 0.78rem; color: var(--ink-soft); }
.speed:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.speed:has(input:checked) .blurb { color: rgba(251, 251, 249, 0.72); }

.locked { margin: 0 0 1rem; text-align: center; font-size: 0.92rem; color: var(--ink-soft); }

.sub {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.backdrop-credit {
  margin: 1.6rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.backdrop-credit a { color: inherit; }
.showcase-credit { margin-top: 0.4rem; }

/* ---------- round ---------- */

.clock-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.2rem 0 0.55rem;
}

.time-left {
  min-width: 2.8em;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
body.urgent .time-left { color: #c23b22; }
body.overtime .time-left { color: #a2560a; }

.clock {
  position: relative;
  flex: 1;
  height: 4px;
  margin: 0;
  background: var(--rule);
  border-radius: 4px;
}
.clock-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 4px;
  transform-origin: left center;
}
.notch {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 10px;
  background: var(--ink-soft);
  opacity: 0.45;
}
body.urgent .clock-fill { background: #c23b22; animation: blink 1s steps(2, start) infinite; }
body.overtime .clock-fill { background: var(--amber); }

@keyframes blink { 50% { opacity: 0.45; } }

.status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.4rem;
}

.clue { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }

/* Points you'd get for naming it right now */
.worth {
  margin: 0 0 0 auto;
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.worth b {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
body.overtime .worth b { color: #a2560a; }

.guess { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.guess input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: 500 1.15rem var(--font);
  box-shadow: 0 6px 16px -12px rgba(0, 0, 0, 0.4);
}
.guess input::placeholder { color: var(--ink-soft); opacity: 0.8; }

.guess button {
  padding: 0 1.2rem;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.shake { animation: shake 0.32s; }

@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.feedback { min-height: 1.45rem; margin: 0.55rem 0 0; font-size: 0.98rem; line-height: 1.4; }
.feedback.nope { color: var(--ink-soft); }
.feedback.wrong { color: var(--wrong); font-weight: 600; }
.feedback b { font-weight: 700; box-shadow: inset 0 -0.4em 0 color-mix(in srgb, var(--accent) 40%, transparent); }

.round-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.wrongs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--wrong);
  text-decoration: line-through;
}

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

.reveal { text-align: center; }

.points {
  margin: 0.2rem 0 0;
  font-size: clamp(2.4rem, 11vw, 3.3rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.points.missed { color: var(--ink-soft); font-size: 2rem; }

.answer { margin: 0.3rem 0 0.5rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }

.fact { max-width: 34ch; margin: 0 auto; font-size: 1rem; line-height: 1.5; }

.credit { margin: 0.7rem 0 1.3rem; font-size: 0.74rem; color: var(--ink-soft); }
.credit a, .catch a { color: inherit; }

/* Report a problem: a quiet link under Next, and its dialog. */
.report-link {
  display: block;
  margin: 0.9rem auto 0;
  padding: 0.2rem 0.4rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.74rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.report-link:hover { color: var(--ink); }
.report-link:disabled { text-decoration: none; cursor: default; }
.report-what { margin: -0.4rem 0 0.8rem; color: var(--ink-soft); font-size: 0.9rem; }
.report-reasons { margin: 0 0 0.9rem; padding: 0; border: 0; }
.report-reasons legend { margin-bottom: 0.4rem; font-weight: 600; }
.report-reasons label { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.25rem 0; font-size: 0.92rem; cursor: pointer; }
.report-note { display: block; font-size: 0.9rem; font-weight: 600; }
.report-note textarea {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--field);
  font: inherit; font-weight: 400; resize: vertical;
}
.report-status { min-height: 1.2em; margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--wrong); }
.report-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.6rem; }
.report-actions .cta { margin: 0; }

/* ---------- end of the day ---------- */

.score-head { text-align: center; }

.total {
  margin: 0.2rem 0 0;
  font-size: clamp(3.6rem, 17vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.total small { margin-left: 0.25rem; font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--ink-soft); }

.rank { margin: 0.35rem 0 0; font-size: 1.05rem; font-weight: 500; }

/* A handwritten one-liner under the points (web/js/quotes.js), like grease pencil */
.quip {
  margin: 0.2rem 0 0;
  font: 700 1.45rem/1.15 "Caveat", cursive;
  color: var(--ink-soft);
}

.curve { display: block; width: 100%; margin-top: 1rem; overflow: visible; }
.curve text { font-family: var(--font); font-size: 11px; fill: var(--ink-soft); }

.note { margin: 0.2rem 0 1.4rem; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }

.actions { display: grid; gap: 0.5rem; justify-items: center; }
.actions .more { margin-top: 0.2rem; }
.next-day { margin: 0.2rem 0 0; font-size: 0.88rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.copied { min-height: 1.3rem; margin: 0.5rem 0 0; text-align: center; font-size: 0.92rem; white-space: pre-line; }

.catch {
  margin-top: 1.6rem;
  padding: 0.9rem 1rem 0.3rem;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
}
.catch h3 {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.catch ol { margin: 0; padding: 0; list-style: none; }
.catch li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}
.catch .chip { display: flex; height: 2.2rem; border-radius: 3px; overflow: hidden; }
.catch .what { margin: 0; font-weight: 700; }
.catch .what span { font-weight: 500; color: var(--ink-soft); }
.catch .fact { max-width: none; margin: 0.2rem 0 0; font-size: 0.92rem; }
.catch .credit { margin: 0.25rem 0 0; }

/* Bonus prints: extra categories after the five, scored on their own */
.bonus {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
}
.bonus h3 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.bonus p { margin: 0.25rem 0 0.7rem; font-size: 0.9rem; color: var(--ink-soft); }
.bonus-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bonus-list .done {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--rule);
  font-size: 0.95rem;
}
.bonus-list .done b { font-variant-numeric: tabular-nums; }

/* ---------- flash, dialog ---------- */

.flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.flash.go { animation: flash 0.55s ease-out; }

@keyframes flash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

.howto {
  width: calc(100% - 2rem);
  max-width: 27rem;
  padding: 1.5rem;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45);
}
.howto::backdrop { background: rgba(20, 20, 20, 0.45); }
/* Mid-print the clock pauses, so the print is covered. */
.howto.covering::backdrop { background: #e9e7e2; }
.howto h2 { margin: 0 0 0.8rem; font-size: 1.35rem; letter-spacing: -0.02em; }
.howto ol { margin: 0 0 1rem; padding-left: 1.2rem; }
.howto .privacy { margin: 0 0 1rem; font-size: 0.78rem; color: var(--ink-soft); }
.howto li { margin-bottom: 0.55rem; line-height: 1.5; }
.howto .backdrop-credit { margin: 0 0 1rem; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hang .circle path { stroke-dashoffset: 0; }
}

/* ---------- pick a day ---------- */

/* No prints to hang while choosing a day */
body[data-screen="days"] .line { display: none; }
body[data-screen="days"] main { padding-top: 1.4rem; }

.days-head { text-align: center; }
.days-head h2 { margin: 0; font-size: 1.6rem; letter-spacing: -0.03em; }
.days-head p { margin: 0.35rem auto 1rem; max-width: 30ch; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.45; }

.day-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.6rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}
.day-list a {
  display: block;
  height: 100%;
  padding: 0.7rem 0.75rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 0 0 1px var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s;
}
.day-list a:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--rule); }
.day-list a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.day-list .today a { box-shadow: inset 0 0 0 2px var(--ink); }
.day-list .no { display: block; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.day-list .date { display: block; font-size: 0.8rem; color: var(--ink-soft); }
.day-list .state { display: block; margin-top: 0.45rem; font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.day-list .state.open { color: var(--ink-soft); font-weight: 500; }
/* A finished day shows its five palettes: nothing left to spoil */
.day-list .chips { display: flex; gap: 2px; height: 0.55rem; margin-top: 0.45rem; border-radius: 2px; overflow: hidden; }
.day-list .chips span { flex: 1; display: flex; }
.day-list .chips i { display: block; }
