/* Layout and components. Colors, fonts and texture come from the look (css/looks.css) through these tokens. */
:root {
  --bg: #f6f1e4; --surface: #ffffff; --ink: #2b2a27; --muted: #6f6a60; --line: #2b2a27;
  --accent: #e5383b; --accent-ink: #ffffff; --accent-2: #2f6fed;
  --pad-bg: #ffffff; --pad-border: #2b2a27;
  --font-display: 'Gaegu', 'Comic Sans MS', cursive; --font-body: 'Nunito', system-ui, sans-serif; --font-num: var(--font-display);
  --radius: 14px; --shadow: 0 2px 0 rgba(0,0,0,.08);
  --gutter: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100%; padding: max(12px, env(safe-area-inset-top)) var(--gutter) 64px; }
.screen { display: flex; flex-direction: column; gap: 14px; }
.screen[hidden] { display: none; }
h1, h2, p { margin: 0; }

.brand { text-align: center; padding-top: 18px; }
.brand.small { padding-top: 4px; }
.logo { font-family: var(--font-display); font-size: 64px; line-height: 1; letter-spacing: -1px; }
.logo-small { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.dayline { color: var(--muted); font-weight: 700; margin-top: 6px; }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.lede { font-size: 18px; font-weight: 700; }
.steps { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.kicker { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.title { font-family: var(--font-display); font-size: 36px; text-align: center; }

.btn { font: inherit; font-weight: 800; font-size: 17px; padding: 14px 18px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 52px; touch-action: manipulation; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.big { font-size: 22px; min-height: 64px; }
.btn.ghost { background: transparent; border-color: transparent; text-decoration: underline; min-height: 44px; padding: 8px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.streak-chip { align-self: center; font-weight: 800; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); }
.streak-chip[hidden] { display: none; }

/* round dots */
.rounds { display: flex; gap: 8px; justify-content: center; }
.rounds i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); display: block; }
.rounds i.done { background: var(--ink); }
.rounds i.now { background: var(--accent); }
.rounds.small { justify-content: flex-start; gap: 5px; }
.rounds.small i { width: 9px; height: 9px; border-width: 1.5px; }

.prompt-card { text-align: center; padding: 28px 16px; margin-top: 24px; }
.prompt { font-family: var(--font-display); font-size: 40px; line-height: 1.05; margin-top: 8px; }
.credit { margin-top: 10px; color: var(--muted); font-weight: 700; }
.credit[hidden] { display: none; }

/* drawing screen */
.draw { gap: 10px; }
.drawbar { display: flex; align-items: center; gap: 12px; }
.drawbar-text { flex: 1; min-width: 0; }
.draw-prompt { font-family: var(--font-display); font-size: 24px; line-height: 1.05; margin-top: 4px; }
.timer { font-family: var(--font-num); font-size: 34px; font-weight: 700; min-width: 86px; text-align: center; padding: 4px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-variant-numeric: tabular-nums; }
.timer.hurry { background: var(--accent); color: var(--accent-ink); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.pad-wrap { position: relative; }
#pad { width: 100%; aspect-ratio: 1; display: block; background: var(--pad-bg); border: 2px solid var(--pad-border); border-radius: var(--radius); cursor: crosshair; }
.palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.swatch { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); padding: 0; cursor: pointer; min-height: 34px; }
.swatch[aria-checked="true"] { outline: 3px solid var(--ink); outline-offset: 2px; transform: scale(1.08); }
.tools { display: flex; gap: 8px; align-items: center; }
.sizes { display: flex; gap: 6px; flex: 1; }
.size, .tool { height: 48px; min-width: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.size { flex: 1; }
.size i { display: block; border-radius: 50%; background: var(--ink); }
.size[aria-checked="true"], .tool[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.size[aria-checked="true"] i { background: var(--surface); }
.tool svg { width: 24px; height: 24px; }

/* judging */
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.thumbs img, .res-card img, .reveal-card img { width: 100%; aspect-ratio: 1; display: block; background: #fff; border: 2px solid var(--line); border-radius: 10px; }
.bar { height: 12px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.bar div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* reveal */
#reveal { min-height: 80vh; cursor: pointer; }
.reveal-stage { display: flex; flex-direction: column; gap: 12px; }
.reveal-card { display: grid; grid-template-columns: 38% 1fr; gap: 12px; align-items: center; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; animation: pop .35s ease-out both; }
.reveal-card .rc-prompt { font-family: var(--font-display); font-size: 20px; line-height: 1.05; }
.reveal-card .rc-score { font-family: var(--font-num); font-size: 44px; font-weight: 700; line-height: 1; margin-top: 6px; }
.reveal-card .rc-comment { font-size: 14px; color: var(--muted); margin-top: 4px; min-height: 2.8em; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.reveal-total, .total { text-align: center; font-family: var(--font-num); font-size: 72px; font-weight: 700; line-height: 1; }
.reveal-total .of, .total .of { font-size: 28px; color: var(--muted); }
.tap-hint { text-align: center; }

/* results */
.archive-badge { text-align: center; font-weight: 800; background: var(--surface); border: 2px dashed var(--line); border-radius: 10px; padding: 8px; }
.archive-badge[hidden] { display: none; }
.res-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.res-card { text-align: center; }
.res-card .s { font-family: var(--font-num); font-size: 30px; font-weight: 700; line-height: 1; margin-top: 6px; }
.res-card .p { font-size: 12px; color: var(--muted); line-height: 1.2; margin-top: 2px; }
.res-card .c { font-size: 12px; line-height: 1.2; margin-top: 4px; }
.share-box { display: flex; flex-direction: column; gap: 8px; }
.share-text { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; white-space: pre-wrap; }
.suggest { display: flex; flex-direction: column; gap: 8px; }
.suggest input { font: inherit; font-size: 16px; padding: 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); width: 100%; }

/* archive */
.archive-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.archive-list li { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.archive-list .a-day { font-weight: 800; min-width: 64px; }
.archive-list .a-info { flex: 1; color: var(--muted); font-size: 14px; }
.archive-list .btn { min-height: 40px; padding: 6px 14px; font-size: 15px; }

/* look switcher (prototype only) */
.lookbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; justify-content: center; align-items: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); font: 600 12px var(--font-body); background: var(--bg); border-top: 1px solid var(--line); color: var(--muted); }
.lookbar button { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.lookbar button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
body.drawing .lookbar, body.shot .lookbar { display: none; }
.reveal-card .tier { font-size: 22px; vertical-align: middle; }
body.shot #app { max-width: 390px; margin: 0; }  /* screenshots only (?demo=...) */

/* model download bar (first play) */
.dl { position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: 26px; background: var(--surface); border-bottom: 2px solid var(--line); font: 700 12px var(--font-body); color: var(--ink); display: flex; align-items: center; justify-content: center; padding-top: env(safe-area-inset-top); }
.dl[hidden] { display: none; }
.dl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); opacity: .28; transition: width .25s; }
.dl span { position: relative; }
body:has(.dl:not([hidden])) #app { padding-top: 38px; }

/* rubric sub-scores */
.parts { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; }
.parts li { display: flex; justify-content: space-between; gap: 6px; border-top: 1px dashed rgba(0,0,0,.15); padding: 2px 0; }
.parts li b { font-variant-numeric: tabular-nums; }
.parts li.pending { color: var(--muted); }
.parts li.pending b { font-weight: 600; font-style: italic; }
.lookbar[hidden] { display: none; }

/* get-ready countdown over the canvas: the canvas still takes touches (drawing starts the clock) */
.countdown { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px; background: rgba(255,255,255,.82); border-radius: var(--radius); pointer-events: none; }
.countdown[hidden] { display: none; }
.countdown .btn { pointer-events: auto; min-height: 44px; padding: 8px 22px; }
.cd-label { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.cd-prompt { font-family: var(--font-display); font-size: 32px; line-height: 1.05; color: var(--ink); }
.cd-credit { font-size: 13px; color: var(--muted); }
.cd-num { font-family: var(--font-num); font-size: 64px; font-weight: 700; line-height: 1; color: var(--accent); }
.cd-hint { font-size: 12px; color: var(--muted); }
.timer.ready { color: var(--muted); }
/* your drawing */
.drawn-prompt { font-family: var(--font-display); font-size: 30px; line-height: 1.05; text-align: center; }
.drawn-img { width: 100%; aspect-ratio: 1; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); display: block; }
.tools .tool { min-width: 44px; }

/* tool row: 3 sizes + eraser, fill, undo, clear must fit a 343 px-wide phone column */
.tools { gap: 6px; }
.sizes { gap: 6px; min-width: 0; }
.size { min-width: 0; }
.tools .tool { min-width: 42px; width: 42px; flex: none; }

/* ---- one-prompt result screen (judging, reveal, results in one place) ---- */
.result { gap: 12px; }
.res-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.res-head .dayline { margin: 0; font-size: 14px; }
.res-prompt { font-family: var(--font-display); font-size: 32px; line-height: 1.02; text-align: center; }
.res-credit { text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; margin-top: -6px; }
.res-credit[hidden] { display: none; }
.frame { position: relative; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.res-img { width: 100%; aspect-ratio: 1; display: block; border-radius: calc(var(--radius) - 2px); }
.frame.judging { animation: peer 1.6s ease-in-out infinite; }
@keyframes peer { 0%, 100% { transform: none; } 30% { transform: scale(1.015) rotate(-.4deg); } 60% { transform: scale(1.01) rotate(.4deg); } }
.stamp { position: absolute; right: -6px; bottom: -14px; min-width: 104px; padding: 6px 12px 4px; text-align: center; background: var(--accent); color: var(--accent-ink); border: 3px solid var(--line); border-radius: 16px; font-family: var(--font-num); font-weight: 700; line-height: 1; transform: rotate(-6deg); box-shadow: 3px 3px 0 rgba(0,0,0,.18); font-variant-numeric: tabular-nums; }
.stamp[hidden] { display: none; }
.stamp-n { font-size: 56px; }
.stamp-of { font-size: 20px; opacity: .85; margin-left: 2px; }
.stamp.counting { animation: none; }
.stamp.landed { animation: thunk .42s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes thunk { 0% { transform: rotate(-6deg) scale(1.35); } 100% { transform: rotate(-6deg) scale(1); } }
.frame[data-tier="0"] .stamp { background: #2a9d4f; }
.frame[data-tier="1"] .stamp { background: #f4b400; color: var(--ink); }
.frame[data-tier="2"] .stamp { background: #f48c06; }
.frame[data-tier="3"] .stamp { background: #e5383b; }
.judging { text-align: center; padding-top: 6px; }
.judging[hidden] { display: none; }
.judging-line { font-family: var(--font-display); font-size: 24px; }
.dots i { font-style: normal; animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .15; } 40% { opacity: 1; } }
.judging .bar { margin: 8px auto 0; max-width: 260px; }
.judging .bar[hidden] { display: none; }
.verdict { padding-top: 12px; animation: rise .35s ease-out both; }
.verdict[hidden], .after[hidden] { display: none; }
.tier-label { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; }
.res-comment { font-size: 17px; font-weight: 700; margin-top: 4px; }
.verdict .parts { font-size: 14px; margin-top: 10px; }
.after { display: flex; flex-direction: column; gap: 12px; animation: rise .4s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.next-line { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.row { display: flex; justify-content: center; gap: 8px; }
.tap-hint[hidden] { display: none; }
.archive-list .a-thumb { width: 44px; height: 44px; border-radius: 8px; border: 2px solid var(--line); background: #fff; flex: none; object-fit: cover; }
.archive-list .a-thumb.empty { background: transparent; border-style: dashed; opacity: .5; }

/* ---- spec v2 reveal: first-glance guess, sub-score bars, percentile ---- */
.sublede { color: var(--muted); font-weight: 700; margin-top: 2px; }
.verdict { display: flex; flex-direction: column; gap: 12px; }
.verdict-body[hidden], .glance[hidden], .beat[hidden], .hit[hidden] { display: none; }
.glance { text-align: center; padding-top: 6px; }
.glance .guess { font-family: var(--font-display); font-size: 28px; line-height: 1.05; margin-top: 4px; min-height: 1.05em; }
.hit { display: inline-block; vertical-align: middle; margin-left: 8px; font: 800 13px var(--font-body); padding: 3px 9px; border-radius: 999px; border: 2px solid var(--line); transform: rotate(-3deg); animation: thunk .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.hit.yes { background: #2a9d4f; color: #fff; }
.hit.no { background: #ffcc00; color: var(--ink); }
.verdict-body { animation: rise .35s ease-out both; }
.bars { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.bars li { display: grid; grid-template-columns: 9.5em 1fr 3.2em; align-items: center; gap: 8px; }
.bars .bl { font-weight: 700; white-space: nowrap; }
.bars .bt { height: 12px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.bars .bt i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .55s cubic-bezier(.3, 1.3, .5, 1); }
.bars.go .bt i { width: var(--w); }
.bars.go li:nth-child(2) .bt i { transition-delay: .12s; }
.bars.go li:nth-child(3) .bt i { transition-delay: .24s; }
.bars.go li:nth-child(4) .bt i { transition-delay: .36s; }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
.bars li.pending { color: var(--muted); }
.bars li.pending b { font-weight: 600; font-style: italic; }
.beat { font-weight: 800; text-align: center; margin-top: 8px; font-size: 17px; }
#res-missed[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .bars .bt i { transition: none; } .frame.judging { animation: none; } }
#res-freeze[hidden] { display: none; } #res-freeze { margin-top: -6px; }
.verdict-body .tier-label, .verdict-body .res-comment { text-align: center; }

/* prompt reveal: the card pops in like a flipped index card, the number ticks */
.countdown:not([hidden]) .cd-prompt { animation: flipin .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.countdown .cd-label { animation: rise .3s ease-out both; }
@keyframes flipin { 0% { opacity: 0; transform: perspective(600px) rotateX(70deg) scale(.9); } 100% { opacity: 1; transform: none; } }
.cd-prompt { font-size: 38px; max-width: 12em; }
.cd-num.tick { animation: tick .35s ease-out; }
@keyframes tick { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.countdown { background: rgba(255, 253, 247, .94); }
#res-pic-btn[hidden] { display: none; }
.res-replay { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: calc(var(--radius) - 2px); background: #fff; }
.res-replay[hidden] { display: none; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.stamp { z-index: 2; }
.steps[hidden], .last-line[hidden] { display: none; }
.last-line { margin-top: 10px; color: var(--muted); font-weight: 700; }
.cd-hint.fine-print { margin-top: 6px; max-width: 18em; opacity: .85; }
/* draining time bar above the canvas; red for the last 10 seconds */
.timebar { height: 8px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); margin-bottom: -4px; }
.timebar i { display: block; height: 100%; background: var(--ink); transform-origin: left center; }
.timebar i.hurry { background: var(--accent); }
#draw-submit.armed { background: var(--ink); color: var(--surface); }
.arch-head { position: relative; }
.back { position: absolute; left: 0; top: 0; font: 800 24px var(--font-body); width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
/* while the prompt card is up, it is the only place the prompt shows; the tools wait */
body.getready #draw-submit { visibility: hidden; }
body.getready .draw-prompt { opacity: 0; transform: translateY(6px); }
.draw-prompt { transition: opacity .35s, transform .35s; }
body.getready .palette, body.getready .tools { opacity: .45; }
.draw-prompt, .palette, .tools { transition: opacity .25s; }
.countdown { inset: 2px; border-radius: calc(var(--radius) - 2px); }
.hit.half { background: #f48c06; color: #fff; }
/* short phones (an iPhone SE with Safari's bars is ~560 px tall): the canvas shrinks so "I'm done" stays on screen */
.pad-wrap { width: 100%; max-width: calc(100vh - 292px); max-width: calc(100dvh - 292px); margin: 0 auto; min-width: 240px; }
body.drawing #app { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 12px; }
.frame { width: 100%; max-width: calc(100vh - 250px); max-width: calc(100dvh - 250px); min-width: 240px; margin: 0 auto; }
body.drawing, body.drawing button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* result, after the critique: share first, then tomorrow, then the breakdown; the suggestion box folds away */
.tier-label { display: inline-block; align-self: center; padding: 2px 14px 4px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-size: 26px; }
.verdict-body { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.share-box .btn.ghost { min-height: 40px; }
.share-text[hidden] { display: none; }
.tomorrow { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; }
.next-line { font-size: 18px; color: var(--ink); }
.next-line b { font-family: var(--font-num); font-size: 26px; }
.breakdown .bars { margin-top: 8px; }
.suggest-wrap summary { font-weight: 800; cursor: pointer; list-style: none; }
.suggest-wrap summary::-webkit-details-marker { display: none; }
.suggest-wrap summary::after { content: ' +'; color: var(--muted); }
.suggest-wrap[open] summary::after { content: ' \2212'; }
.suggest-wrap .suggest { margin-top: 10px; }
body.getready .timer, body.getready .timebar { visibility: hidden; }
.archive-list .a-thumb.empty { visibility: hidden; }
.breakdown[hidden] { display: none; }
.brand { position: relative; }
.sound-toggle { position: absolute; right: 0; top: 4px; width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
/* the stamp stays ink-dark while counting, so the tier color is a surprise when it lands */
.frame .stamp.counting { background: var(--ink); color: var(--surface); }
.frame .stamp { transition: background-color .15s, color .15s; }
.week { list-style: none; display: flex; gap: 8px; margin: 2px 0 0; padding: 0; }
.week[hidden] { display: none; }
.week li { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 800 11px var(--font-body); color: var(--muted); }
.week i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 14px; background: var(--surface); }
.week .done i { background: var(--accent); color: var(--accent-ink); }
.week .now i { border-style: dashed; }
.week .later i { opacity: .35; }
.week .miss i { opacity: .6; }
/* first five seconds: the squiggle under the name draws itself */
.logo-squiggle { display: block; width: 180px; height: 22px; margin: 2px auto 0; }
.logo-squiggle path { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 300; stroke-dashoffset: 300; animation: drawline 1.1s .25s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes drawline { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .logo-squiggle path { animation: none; stroke-dashoffset: 0; } }
#tool-clear.armed { background: var(--accent); color: var(--accent-ink); }
#tool-clear.armed::after { content: 'Tap again'; position: absolute; transform: translate(-50%, -150%); left: 50%; font: 800 11px var(--font-body); background: var(--ink); color: var(--surface); padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
#tool-clear { position: relative; }
body.getready .palette, body.getready .tools { visibility: hidden; }
.week[hidden], #res-missed[hidden] { display: none; }
.archive-list .a-info i { font-style: normal; color: var(--ink); font-weight: 700; }
.a2hs { font-size: 13px; color: var(--muted); text-align: center; max-width: 22em; } .a2hs[hidden] { display: none; }
.bars .bt i.hi { background: #2a9d4f; }
.bars .bt i.mid { background: #f4b400; }
.bars .bt i.lo { background: #e5383b; }
.tomorrow { padding-top: 0; }
.boot { text-align: center; padding-top: 30vh; } .boot[hidden] { display: none; } .boot .logo-squiggle path { animation-iteration-count: infinite; animation-direction: alternate; }
.yesterday { text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; } .yesterday[hidden] { display: none; }
.size, .tool, .swatch { touch-action: manipulation; }
.stamp.landed.droop { animation: thunk .42s cubic-bezier(.2, 1.6, .4, 1) both, droop .6s .45s ease-in-out both; }
@keyframes droop { 0% { transform: rotate(-6deg); } 60% { transform: rotate(4deg) translateY(4px); } 100% { transform: rotate(2deg) translateY(3px); } }
/* Home: one-line pitch up top, the big button down in the thumb zone */
#home { min-height: calc(100dvh - 90px); }
.home-actions { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.sound-toggle { display: grid; place-items: center; color: var(--ink); }
.sound-toggle svg { width: 22px; height: 22px; }
.a2hs .x { border: 0; background: none; font: 800 18px var(--font-body); color: var(--muted); cursor: pointer; padding: 0 4px; vertical-align: middle; }
.home-figure { margin: 4px auto 0; text-align: center; }
.mini-frame { position: relative; width: min(190px, 46vw); margin: 0 auto; transform: rotate(-2deg); }
.mini-frame img { width: 100%; aspect-ratio: 1; display: block; background: #fff; border: 2px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.mini-stamp { position: absolute; right: -14px; bottom: -10px; font: 700 30px var(--font-num); padding: 2px 10px; border: 2px solid var(--line); border-radius: 10px; background: #f4b400; color: var(--ink); transform: rotate(-6deg); }
.mini-stamp[data-tier="0"] { background: #2a9d4f; color: #fff; }
.mini-stamp[data-tier="2"] { background: #f48c06; color: #fff; }
.mini-stamp[data-tier="3"] { background: #e5383b; color: #fff; }
.home-figure figcaption { margin-top: 14px; font-family: var(--font-display); font-size: 20px; color: var(--muted); }
@media (max-height: 700px) { .mini-frame { width: 120px; } .home-figure figcaption { font-size: 16px; margin-top: 10px; } .logo { font-size: 52px; } .brand { padding-top: 8px; } }
@media (max-height: 600px) { .home-figure { display: none; } }
.pencils { position: absolute; inset: 0; display: grid; place-items: center; font: 700 52px var(--font-display); color: var(--accent); text-shadow: 0 2px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff; pointer-events: none; animation: thunk .4s cubic-bezier(.2, 1.6, .4, 1) both; transform: rotate(-6deg); }
.pencils[hidden] { display: none; }
.btn.primary { font-size: 19px; }   /* white on the accent passes as large text (3:1) from 18.7 px bold */
#result .frame { cursor: pointer; }

/* Age screen and legal footer */
.age-form { display: flex; flex-direction: column; gap: 12px; }
.age-title { font-family: var(--font-display); font-size: 30px; line-height: 1.1; }
.age-field { display: flex; flex-direction: column; gap: 4px; font-weight: 800; }
.age-field select { font: inherit; font-weight: 700; min-height: 52px; padding: 8px 12px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.legal { max-width: 480px; margin: 0 auto; padding: 4px var(--gutter) 28px; text-align: center; font-size: 13px; color: var(--muted); }
.legal a, .legal button { color: var(--muted); text-decoration: underline; font: inherit; background: none; border: 0; padding: 8px 4px; cursor: pointer; }
body.drawing .legal { display: none; }
.doc { max-width: 640px; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.doc h1 { font-family: var(--font-display); font-size: 44px; line-height: 1.05; margin-bottom: 6px; }
.doc h2 { font-size: 20px; margin: 26px 0 6px; }
.doc p, .doc li { margin: 0 0 10px; }
.doc ul { padding-left: 22px; margin: 0 0 10px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 14px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border: 1px solid var(--line); }
.doc a { color: var(--accent-2); }
/* The score stamp's tilted box can push the page a few pixels wider than the screen when the fallback fonts are in use
   (players under 13 never load the web fonts). Clip sideways overflow on the app column; the stamp itself stays inside it. */
#app { overflow-x: clip; }
