/* Historicle: a museum label crossed with a yard sale. */
:root {
  --paper: #f6efe3;
  --paper-2: #ede2cf;
  --card: #fffaf1;
  --ink: #241a12;
  --ink-2: #6e6052;
  --ink-3: #a3937f;
  --line: #dccdb6;
  --tag: #f3d497;
  --tag-ink: #4a3410;
  --accent: #ff5a2c;
  --accent-ink: #ffffff;
  --accent-dark: #c63d16;
  --green: #2c9a5a;
  --yellow: #e5ad17;
  --red: #d4442a;
  --photo-bg: #ffffff;
  --shadow: 0 1px 0 rgba(36, 26, 18, .06), 0 10px 30px -12px rgba(36, 26, 18, .35);
  --radius: 16px;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--paper); color: var(--ink);
  font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.app {
  max-width: 480px; margin: 0 auto; padding: 0 16px calc(28px + env(safe-area-inset-bottom));
  padding-top: env(safe-area-inset-top);
}

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 8px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-box svg { width: 30px; height: 30px; display: block; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover .brand-box svg { transform: rotate(-8deg) scale(1.08); }
.brand-word { font: 900 23px/1 var(--display); letter-spacing: -.02em; font-variation-settings: 'opsz' 144; }
.top-right { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; border-radius: 12px;
  transition: background .15s, transform .15s;
}
.icon-btn:hover { background: var(--paper-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .snd-off { display: none; }
.icon-btn[aria-pressed='false'] .snd-on { display: none; }
.icon-btn[aria-pressed='false'] .snd-off { display: block; }
.streak-chip {
  display: inline-flex; align-items: center; gap: 3px; height: 32px; padding: 0 10px 0 7px; margin-right: 4px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--card); font: 500 15px/1 var(--mono);
  transition: transform .2s;
}
.streak-chip .flame { font-size: 15px; filter: grayscale(1) opacity(.5); transition: filter .3s; }
.streak-chip.lit .flame { filter: none; }
.streak-chip.bump { animation: bump .7s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.35) rotate(-6deg); } 100% { transform: scale(1); } }

.pastbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px;
  padding: 9px 14px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: 14px;
}
.pastbar-link { font-weight: 700; text-decoration: none; white-space: nowrap; }

/* ---------- week strip ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 2px 0 14px; }
.wd {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 7px; border-radius: 12px;
  border: 0; background: none; color: var(--ink-2);
}
button.wd:hover { background: var(--paper-2); }
.wd-letter { font: 500 11px/1 var(--mono); letter-spacing: .08em; }
.wd-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed var(--line); font: 700 13px/1 var(--sans); color: #fff;
}
.wd-bars { display: flex; gap: 2px; height: 6px; align-items: flex-end; }
.wd-bars i { width: 3px; border-radius: 1px; background: var(--line); }
.wd-bars i:nth-child(1) { height: 2px; } .wd-bars i:nth-child(2) { height: 3px; } .wd-bars i:nth-child(3) { height: 4px; }
.wd-bars i:nth-child(4) { height: 5px; } .wd-bars i:nth-child(5) { height: 6px; }
.wd-bars i.on { background: var(--ink-2); }
.wd.won .wd-dot { background: var(--green); border: 0; }
.wd.lost .wd-dot { background: var(--red); border: 0; }
.wd.missed .wd-dot { border-style: solid; color: var(--ink-3); }
.wd.today { color: var(--ink); }
.wd.today .wd-dot { border: 2px solid var(--ink); animation: breathe 2.4s ease-in-out infinite; }
.wd.today.won .wd-dot, .wd.today.lost .wd-dot { animation: none; border: 0; }
.wd.future { opacity: .45; }
.wd.selected { background: var(--paper-2); }
@keyframes breathe { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ink) 10%, transparent); } }

/* ---------- prompt + specimen card ---------- */
.prompt { text-align: center; margin: 0 0 10px; font: 600 17px/1.3 var(--display); font-variation-settings: 'opsz' 30; }
.prompt b { font-weight: 800; color: var(--accent-dark); }
.specimen {
  position: relative; margin: 4px auto 0; padding: 8px;
  width: min(100%, 448px, max(240px, calc(100vh - 290px)));
  width: min(100%, 448px, max(240px, calc(100dvh - 290px))); /* keep the guess box above the fold */
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.specimen-label {
  display: flex; align-items: center; gap: 7px; padding: 0 4px 8px; font: 500 11px/1 var(--mono);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.specimen-label .dot { opacity: .5; }
.frame {
  position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 9px; background: var(--photo-bg);
  box-shadow: inset 0 0 0 1px rgba(36, 26, 18, .08); isolation: isolate; touch-action: manipulation;
}
.frame-inner { position: absolute; inset: 0; }
.frame-inner img {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform, opacity;
  user-select: none; -webkit-user-drag: none; pointer-events: none; max-width: none;
}
.corner { position: absolute; width: 18px; height: 18px; pointer-events: none; z-index: 2; }
.corner::before { content: ''; position: absolute; inset: 0; background: var(--paper-2); opacity: .95; }
.corner.tl { left: 6px; top: 25px; } .corner.tl::before { clip-path: polygon(0 0, 100% 0, 0 100%); }
.corner.tr { right: 6px; top: 25px; } .corner.tr::before { clip-path: polygon(0 0, 100% 0, 100% 100%); }
.corner.bl { left: 6px; bottom: 8px; } .corner.bl::before { clip-path: polygon(0 0, 0 100%, 100% 100%); }
.corner.br { right: 6px; bottom: 8px; } .corner.br::before { clip-path: polygon(100% 0, 0 100%, 100% 100%); }

.zoom-pill {
  position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: 4px;
  padding: 5px 9px 5px 7px; border-radius: 999px; background: rgba(20, 14, 9, .72); color: #fff;
  font: 500 12px/1 var(--mono); backdrop-filter: blur(6px); transition: opacity .4s;
}
.zoom-pill svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.zoom-pill.gone { opacity: 0; }

.loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; background: var(--photo-bg); transition: opacity .3s; }
.loading span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.loading.done { opacity: 0; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.frame.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); }
}

/* the rubber stamp on the reveal */
.stamp { position: absolute; inset: 0; display: grid; place-items: center; z-index: 5; pointer-events: none; }
.stamp span {
  display: none; max-width: 86%; padding: 8px 18px 6px; border: 5px double currentColor; border-radius: 10px;
  color: var(--red); font: 900 clamp(26px, 9vw, 44px)/1 var(--display); text-transform: uppercase; letter-spacing: .03em;
  text-align: center; transform: rotate(-9deg); mix-blend-mode: multiply; background: rgba(255, 255, 255, .55);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp.win span { color: var(--green); }
.stamp.lose span { color: #3b2c20; }
.stamp.show span { display: block; animation: stampIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.stamp.rest span { display: block; animation: none; opacity: .92; }
@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-16deg) scale(2.4); }
  60% { opacity: 1; transform: rotate(-8deg) scale(.94); }
  100% { opacity: .92; transform: rotate(-9deg) scale(1); }
}

/* the newest clue, tied to the photo */
.clue-sticker {
  position: absolute; left: -6px; bottom: -14px; z-index: 6; max-width: 82%;
  display: flex; flex-direction: column; gap: 2px; padding: 9px 14px 9px 30px;
  background: var(--tag); color: var(--tag-ink); border-radius: 6px 14px 14px 6px;
  box-shadow: 0 8px 18px -8px rgba(40, 25, 5, .55); transform: rotate(-2.5deg); transform-origin: 0 50%;
}
.clue-sticker::before {
  content: ''; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 2px rgba(74, 52, 16, .35);
}
.clue-sticker.flip { animation: tagIn .65s cubic-bezier(.2, 1.5, .45, 1) both; }
@keyframes tagIn {
  0% { opacity: 0; transform: rotate(-30deg) translateY(-30px) scale(.7); }
  100% { opacity: 1; transform: rotate(-2.5deg); }
}
.sticker-label { font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.sticker-text { font: 600 15.5px/1.25 var(--display); font-variation-settings: 'opsz' 24; }

/* ---------- guess pips ---------- */
.pips { display: flex; justify-content: center; gap: 6px; margin: 14px 0 12px; }
.pip { width: 26px; height: 9px; border-radius: 5px; background: var(--line); transition: background .3s, transform .3s; }
.pip.now { background: var(--ink); animation: pipPulse 1.6s ease-in-out infinite; }
.pip.wrong { background: var(--red); } .pip.close { background: var(--yellow); } .pip.right { background: var(--green); }
.pip.pop { animation: pipPop .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pipPulse { 50% { opacity: .45; } }
@keyframes pipPop { 40% { transform: scaleY(1.9) scaleX(1.15); } }

/* ---------- guess box + suggestions ---------- */
.guess { margin: 0 0 16px; }
.combo { position: relative; display: flex; }
#guessInput {
  flex: 1; min-width: 0; height: 56px; padding: 0 112px 0 18px; border: 2.5px solid var(--ink); border-radius: 16px;
  background: var(--card); color: var(--ink); font: 500 18px/1 var(--sans); outline: none;
  box-shadow: 0 4px 0 var(--ink); transition: box-shadow .15s, transform .15s;
}
#guessInput::placeholder { color: var(--ink-3); }
#guessInput:focus { box-shadow: 0 4px 0 var(--ink), 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); }
.combo.shake #guessInput { animation: shake .42s; }
.guess-btn {
  position: absolute; right: 7px; top: 7px; height: 42px; padding: 0 14px 0 16px; display: flex; align-items: center; gap: 6px;
  border: 0; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font: 700 16px/1 var(--sans);
  box-shadow: 0 3px 0 var(--accent-dark); transition: transform .1s, box-shadow .1s, filter .2s;
}
.guess-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.guess-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--accent-dark); }
.guess-btn.ready { animation: ready 1.2s ease-in-out infinite; }
@keyframes ready { 50% { filter: brightness(1.12); transform: scale(1.04); } }
.coach { margin: 12px 0 0; text-align: center; font-size: 14px; color: var(--ink-2); min-height: 20px; transition: opacity .3s; }

.suggest {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 20; margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 0 -12px 30px -14px rgba(36, 26, 18, .5);
  max-height: min(320px, 48vh); overflow-y: auto; animation: rise .16s ease-out;
}
.suggest li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 10px;
  font-size: 17px; cursor: pointer;
}
.suggest li b { font-weight: 700; background: color-mix(in srgb, var(--tag) 70%, transparent); border-radius: 3px; }
.suggest li small { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.suggest li.active { background: var(--ink); color: var(--paper); }
.suggest li.active b { background: var(--accent); color: #fff; }
.suggest li.active small { color: var(--paper); opacity: .7; }
.suggest li.active::after { content: '↵'; font-size: 14px; opacity: .7; }
.stamp span.long { font-size: clamp(22px, 7vw, 34px); }
.stamp span.xlong { font-size: clamp(18px, 5.6vw, 27px); }
@media (hover: hover) { .suggest li:not(.active):not(.used):not(.empty):hover { background: var(--paper-2); } }
.suggest li.used { opacity: .45; cursor: default; }
.suggest li.empty { color: var(--ink-2); cursor: default; font-size: 15px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- clues ---------- */
.clues { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.clue {
  position: relative; display: flex; gap: 12px; align-items: center; padding: 11px 14px 11px 32px;
  background: var(--tag); color: var(--tag-ink); border-radius: 6px 14px 14px 6px;
}
.clue::before {
  content: ''; position: absolute; left: 12px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px rgba(74, 52, 16, .3);
}
.clue-label { flex: 0 0 74px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
.clue-text { font: 600 16px/1.3 var(--display); font-variation-settings: 'opsz' 24; }
.clue.locked { background: none; color: var(--ink-3); border: 2px dashed var(--line); padding-top: 9px; padding-bottom: 9px; }
.clue.locked::before { background: none; box-shadow: inset 0 0 0 2px var(--line); }
.clue.locked .clue-text { font: 500 14px/1.3 var(--sans); }
.clue.fresh { animation: tagIn .6s cubic-bezier(.2, 1.5, .45, 1) both; }

/* ---------- guess history ---------- */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.row.fresh { animation: rowIn .45s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.sq { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.sq.wrong { background: var(--red); } .sq.close { background: var(--yellow); } .sq.right { background: var(--green); }
.sq.wrong::after { content: '×'; } .sq.close::after { content: '~'; } .sq.right::after { content: '✓'; }
.row-name { font-weight: 700; }
.row-why { display: block; font-size: 13.5px; color: var(--ink-2); }

/* ---------- reveal ---------- */
.reveal { margin-top: 26px; animation: rise .5s cubic-bezier(.2, 1, .4, 1) both; }
.rv-head { text-align: center; margin-bottom: 16px; }
.rv-kicker { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.rv-name { margin: 8px 0 4px; font: 900 clamp(34px, 10vw, 46px)/1 var(--display); letter-spacing: -.02em; font-variation-settings: 'opsz' 144; }
.rv-model { color: var(--ink-2); font-size: 15px; }
.rv-result { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 700; }
.rv-squares { letter-spacing: 2px; }

.pricetag {
  position: relative; margin: 18px auto 14px; max-width: 360px; padding: 16px 20px 16px 46px; border-radius: 10px 22px 22px 10px;
  background: var(--tag); color: var(--tag-ink); transform: rotate(-1.5deg); box-shadow: 0 14px 26px -16px rgba(60, 35, 5, .7);
}
.pricetag::before {
  content: ''; position: absolute; left: 17px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2.5px rgba(74, 52, 16, .35);
}
.pricetag::after {
  content: ''; position: absolute; left: -46px; top: calc(50% - 1px); width: 66px; height: 2px; background: var(--tag-ink);
  opacity: .35; transform: rotate(-14deg); transform-origin: 100% 50%;
}
.pt-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.pt-label { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.pt-then { font: 800 24px/1.1 var(--display); text-decoration: line-through; text-decoration-thickness: 2px; opacity: .8; }
.pt-now { font: 900 40px/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pt-divider { height: 0; border-top: 2px dashed rgba(74, 52, 16, .3); margin: 10px 0; }
.pt-note { margin-top: 6px; font-size: 13px; opacity: .8; }

.fact { margin: 18px 4px; font: 600 20px/1.35 var(--display); font-variation-settings: 'opsz' 40; text-align: center; text-wrap: balance; }
.fact::before { content: '“'; color: var(--accent); }
.fact::after { content: '”'; color: var(--accent); }

.rv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.rv-card { padding: 14px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); text-align: center; }
.rv-card b { display: block; font: 900 28px/1.1 var(--display); }
.rv-card span { font-size: 13px; color: var(--ink-2); }
.rv-card.milestone { background: var(--ink); color: var(--paper); box-shadow: none; animation: bump .8s .6s both; }
.rv-card.milestone span { color: var(--tag); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 54px; padding: 0 22px;
  border: 2.5px solid var(--ink); border-radius: 16px; background: var(--card); color: var(--ink);
  font: 700 17px/1 var(--sans); text-decoration: none; box-shadow: 0 4px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.wide { width: 100%; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn.copied { background: var(--green); color: #fff; }
.rv-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 8px 0 18px; }

.next {
  margin: 0 0 16px; padding: 16px; border-radius: 16px; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.next small { display: block; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-bottom: 6px; }
.next b { font: 700 16px/1.3 var(--display); }
.next .bars { letter-spacing: 2px; color: var(--tag); }
.countdown { font: 500 26px/1 var(--mono); font-variant-numeric: tabular-nums; }

.more { margin: 0 0 16px; padding: 16px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.more h3 { margin: 0 0 4px; font: 800 18px/1.2 var(--display); }
.more p { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }
.mini-shelf { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.credit { font-size: 12px; color: var(--ink-3); text-align: center; margin: 8px 0 0; }
.credit a { color: inherit; }

/* ---------- shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot {
  position: relative; display: flex; flex-direction: column; border: 0; padding: 0; background: none; text-align: left;
  text-decoration: none; color: inherit;
}
.slot-img {
  aspect-ratio: 1; border-radius: 12px; background: var(--photo-bg) center / contain no-repeat; box-shadow: inset 0 0 0 1.5px var(--line);
  display: grid; place-items: center;
}
.slot-img.q { background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--line); font: 900 34px/1 var(--display); color: var(--ink-3); }
.slot-img.today { background: var(--ink); color: var(--paper); box-shadow: none; }
.slot:hover .slot-img.q { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.slot-name { margin-top: 6px; font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.slot-meta { font: 500 11px/1.3 var(--mono); color: var(--ink-2); }
.slot-tag {
  position: absolute; top: 6px; right: 6px; padding: 3px 6px 3px 9px; border-radius: 3px 7px 7px 3px; background: var(--tag);
  color: var(--tag-ink); font: 700 11px/1 var(--mono);
}
.mini-shelf .slot { flex: 0 0 64px; }
.mini-shelf .slot-img { width: 64px; border-radius: 10px; font-size: 22px; }

/* ---------- dialogs ---------- */
.sheet {
  width: min(440px, calc(100% - 24px)); max-height: min(86vh, 760px); padding: 26px 22px 22px; border: 0; border-radius: 22px;
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow-y: auto;
}
.sheet::backdrop { background: rgba(26, 18, 10, .45); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheetIn .32s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@media (max-width: 520px) {
  .sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .sheet[open] { animation: sheetUp .34s cubic-bezier(.2, 1, .4, 1); }
  @keyframes sheetUp { from { transform: translateY(100%); } }
}
.sheet h2 { margin: 0 0 6px; font: 900 28px/1.1 var(--display); letter-spacing: -.01em; }
.sheet .lede { margin: 0 0 14px; color: var(--ink-2); }
.sheet-x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--paper-2); font-size: 22px; line-height: 1; }
.rules { padding-left: 20px; margin: 0 0 16px; }
.rules li { margin-bottom: 8px; }
.examples { display: grid; gap: 8px; margin-bottom: 16px; }
.ex { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.ex small { display: block; color: var(--ink-2); font-size: 13.5px; }
.small { font-size: 14px; } .muted { color: var(--ink-2); }
.mini-h { margin: 18px 0 10px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; text-align: center; }
.stat-grid b { display: block; font: 900 30px/1.1 var(--display); }
.stat-grid span { font-size: 12px; color: var(--ink-2); line-height: 1.2; display: block; }
.dist { display: grid; gap: 5px; }
.dist-row { display: flex; align-items: center; gap: 8px; font: 500 13px/1 var(--mono); }
.dist-bar { min-width: 26px; padding: 4px 8px; border-radius: 6px; background: var(--ink-3); color: #fff; text-align: right; transition: width .6s cubic-bezier(.2, 1, .4, 1); }
.dist-bar.me { background: var(--green); }

/* ---------- toasts, confetti, footer ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; top: calc(70px + env(safe-area-inset-top)); z-index: 50; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px; box-shadow: var(--shadow); animation: toastIn .25s ease-out; }
.toast.out { animation: toastOut .25s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
.foot { margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  .app { padding-top: 12px; }
}

/* simple clue list: older clues quiet, newest one stands out */
.clue { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); border-radius: 12px; padding: 10px 14px; }
.clue::before { display: none; }
.clue .clue-label { flex-basis: 84px; color: var(--ink-2); opacity: 1; }
.clue.newest { background: var(--tag); color: var(--tag-ink); box-shadow: none; }
.clue.newest .clue-label { color: var(--tag-ink); opacity: .75; }
.clues { margin: 0 0 12px; }
.guess { margin-bottom: 12px; }
.foot { margin-top: 24px; }

/* guesses left, above the photo */
.guessbar { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 10px; }
.guessbar-text { font: 700 15px/1 var(--sans); }
.guessbar.last .guessbar-text { color: var(--red); }
.guessbar .pips { margin: 0; gap: 5px; }
.guessbar .pip { width: 22px; height: 8px; }

/* clean reveal */
.reveal { margin-top: 22px; text-align: center; }
.rv-name { margin: 0; font: 900 clamp(34px, 9vw, 44px)/1.05 var(--display); letter-spacing: -.02em; font-variation-settings: 'opsz' 144; }
.rv-model { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.rv-score { margin: 14px 0 0; font-weight: 700; font-size: 16px; }
.rv-squares { letter-spacing: 2px; margin-right: 6px; }
.rv-fact { margin: 18px auto 22px; max-width: 400px; font: 400 18px/1.45 var(--display); font-variation-settings: 'opsz' 24; text-wrap: pretty; }
.rv-meta { margin: 14px 0 0; color: var(--ink-2); font-size: 14.5px; }
.rv-next { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; }
.rv-next a { color: var(--ink); font-weight: 700; }
#countdown { font: 500 14.5px/1 var(--mono); color: var(--ink); }
.reveal .credit { margin-top: 22px; }
.play { margin-top: 14px; }

/* the photo starts in black and white; color is the first thing a wrong guess unlocks */
.frame-inner { transition: filter 1.1s ease; }
.frame.bw .frame-inner { filter: grayscale(1) contrast(1.08); }
.clue .clue-label { flex-basis: 108px; white-space: nowrap; }

/* ---------- phones ---------- */
button, a, input { touch-action: manipulation; }
@media (max-width: 520px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .top { height: 52px; }
  .brand-box svg { width: 26px; height: 26px; }
  .brand-word { font-size: 21px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 21px; height: 21px; }
  .streak-chip { height: 30px; padding: 0 9px 0 6px; font-size: 14px; margin-right: 2px; }
  .guessbar { margin: 0 2px 8px; }
  .specimen { width: 100%; padding: 6px; border-radius: 14px; }
  .frame { border-radius: 9px; }
  .zoom-pill { right: 8px; bottom: 8px; }
  .play { margin-top: 12px; }
  #guessInput { height: 54px; font-size: 17px; padding-right: 104px; border-radius: 14px; }
  .guess-btn { height: 40px; top: 7px; right: 7px; padding: 0 12px 0 14px; font-size: 15px; }
  /* tips: small label on its own line, text full width */
  .clue { flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 12px; }
  .clue .clue-label { flex-basis: auto; font-size: 10px; }
  .clue-text { font-size: 15.5px; }
  .row { padding: 9px 10px; }
  .suggest { max-height: 42vh; }
  .suggest li { padding: 12px 12px; font-size: 16.5px; }
  .rv-name { font-size: 34px; }
  .rv-fact { font-size: 17px; margin: 14px auto 18px; }
  .btn { height: 52px; }
  .toast-wrap { top: calc(58px + env(safe-area-inset-top)); }
}
@media (max-width: 360px) {
  .brand-word { font-size: 19px; }
  .icon-btn { width: 32px; }
}

/* phones: suggestions open downward under the guess box */
.coarse .suggest { top: calc(100% + 8px); bottom: auto; max-height: var(--sugh, 40vh); box-shadow: 0 14px 30px -14px rgba(36, 26, 18, .5); }
.coarse.typing .app { padding-bottom: 70vh; } /* room to pin the box near the top while typing */
.coarse.typing .specimen { width: 132px; padding: 4px; border-radius: 10px; }
.coarse.typing .zoom-pill, .coarse.typing .foot { display: none; }
.coarse.typing .play { margin-top: 10px; }
