/* Coat, Ears & Tail — field-notebook look: cream paper, kennel green, ribbon rust. */
:root {
  --paper: #f3ecdf;
  --paper-2: #ebe1cf;
  --card: #fbf8f1;
  --ink: #1e2a21;
  --ink-2: #47534a;
  --muted: #6b7166;
  --line: #d9cdb6;
  --green: #2d5a3b;
  --green-2: #23482f;
  --green-tint: #dfe9dc;
  --rust: #a3432a;
  --rust-tint: #f3dcd2;
  --gold: #a87a1c;
  --gold-tint: #f2e4bf;

  --font-display: 'Zodiak', 'Iowan Old Style', Georgia, serif;
  --font-body: 'General Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --text-xl: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --text-2xl: clamp(2.1rem, 1.6rem + 2.4vw, 3.6rem);

  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(30, 42, 33, .06), 0 6px 20px rgba(30, 42, 33, .07);
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--paper);
  background-image: radial-gradient(rgba(30,42,33,.035) 1px, transparent 1px);
  background-size: 18px 18px;
  color: var(--ink);
  font: 400 var(--text-base)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-2); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* ---------- header ---------- */
.top {
  width: 100%; max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 6px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 1.2rem/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.wordmark em { color: var(--rust); font-style: italic; }
.wordmark__mark { width: 26px; height: 26px; color: var(--green); }
.top__streak {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green); background: var(--green-tint); padding: 5px 10px; border-radius: 999px;
}

main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 8px 20px 40px; }
.screen { animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } * { scroll-behavior: auto !important; } }

.eyebrow { margin: 0 0 10px; font-size: var(--text-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--rust); }
.display { font: 500 var(--text-2xl)/1.05 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.display em { font-style: italic; color: var(--rust); }
.display--sm { font-size: var(--text-xl); line-height: 1.15; }
.lede { margin: 14px 0 0; color: var(--ink-2); font-size: var(--text-lg); max-width: 34em; text-wrap: pretty; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: var(--text-base); text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-2); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-2); }
.back { background: none; border: 0; padding: 6px 0; margin-bottom: 14px; color: var(--ink-2); font-weight: 500; }
.back:hover { color: var(--ink); }
.link { font-weight: 500; }

/* ---------- home ---------- */
.home { display: grid; gap: 36px; align-items: center; padding-top: 18px; }
@media (min-width: 860px) { .home { grid-template-columns: 1.05fr .95fr; padding-top: 40px; } }
.daily-card {
  margin: 28px 0 14px; padding: 18px 20px 16px; max-width: 30rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.daily-card__date { margin: 0 0 12px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); }
.daily-card .btn { width: 100%; }
.daily-card__status { margin: 10px 0 0; font-size: var(--text-sm); color: var(--muted); }
.home__art { position: relative; margin: 0; aspect-ratio: 5 / 4; max-width: 520px; width: 100%; justify-self: center; }
.snap {
  position: absolute; width: 62%; aspect-ratio: 4 / 3; object-fit: cover;
  border: 8px solid #fff; border-bottom-width: 26px; border-radius: 4px;
  box-shadow: 0 10px 30px rgba(30,42,33,.18);
}
.snap--a { left: 0; top: 4%; transform: rotate(-5deg); z-index: 2; }
.snap--b { right: 0; top: 0; transform: rotate(4deg); }
.snap--c { left: 22%; bottom: 0; transform: rotate(-1deg); z-index: 3; }
@media (max-width: 859px) { .home__art { max-width: 420px; order: -1; aspect-ratio: 16 / 10; } .snap { width: 54%; } }

/* ---------- pick ---------- */
.cats { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
@media (min-width: 700px) { .cats { grid-template-columns: 1fr 1fr; } }
.cat {
  width: 100%; text-align: left; display: grid; gap: 4px; padding: 18px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat:hover { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-1px); }
.cat__name { font: 500 var(--text-lg)/1.2 var(--font-display); }
.cat__blurb { color: var(--ink-2); font-size: var(--text-sm); }
.cat__meta { color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-top: 4px; }

/* ---------- play ---------- */
.play__bar {
  display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 4px 16px;
  padding: 6px 0 12px;
}
.play__label { font: 500 var(--text-lg)/1.2 var(--font-display); }
.play__progress, .play__score { font-size: var(--text-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.play__score { font-weight: 600; color: var(--ink); }
.play__track { grid-column: 1 / -1; height: 4px; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.play__track span { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s ease; }

.play__grid { display: grid; gap: 18px; }
@media (min-width: 900px) { .play__grid { grid-template-columns: 1.35fr 1fr; align-items: start; } }

.photo { margin: 0; position: relative; }
.photo img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg);
  background: var(--paper-2); box-shadow: var(--shadow); opacity: 0; transition: opacity .25s;
}
.photo img.is-loaded { opacity: 1; }
.photo__credit { margin-top: 6px; font-size: var(--text-xs); color: var(--muted); }
.photo__credit a { color: inherit; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 10px; text-align: left;
  min-height: 60px; padding: 10px 14px; border-radius: var(--r);
  background: var(--card); border: 1.5px solid var(--line);
  font-weight: 500; line-height: 1.25;
  transition: border-color .15s, background .15s;
}
.choice:hover:not(:disabled) { border-color: var(--green); }
.choice__key {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 6px; background: var(--paper-2); color: var(--ink-2); font-size: var(--text-xs); font-weight: 600;
}
.choice:disabled { cursor: default; opacity: .6; }
.choice.is-right { opacity: 1; border-color: var(--green); background: var(--green-tint); }
.choice.is-right .choice__key { background: var(--green); color: #fff; }
.choice.is-wrong { opacity: 1; border-color: var(--rust); background: var(--rust-tint); }
.choice.is-wrong .choice__key { background: var(--rust); color: #fff; }

.marks { margin-top: 16px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.marks__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.marks__head h3 { font: 500 var(--text-base)/1.2 var(--font-display); }
.marks__worth { font-size: var(--text-sm); font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.clues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.clue { display: flex; gap: 10px; align-items: flex-start; font-size: var(--text-sm); color: var(--ink-2); line-height: 1.45; }
.clue__n {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
  border: 1.5px solid var(--line); color: var(--muted);
}
.clue.is-open .clue__n { border-color: var(--gold); background: var(--gold-tint); color: var(--ink); }
.clue.is-locked { color: var(--muted); opacity: .7; }
.clue__open {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px 6px 0;
  background: none; border: 0; text-align: left; font-weight: 600; color: var(--green); font-size: var(--text-sm);
}
.clue__open .clue__n { border-color: var(--green); color: var(--green); }
.clue__open:hover { color: var(--green-2); }
.clue__cost { margin-left: auto; font-weight: 600; color: var(--rust); font-variant-numeric: tabular-nums; }

.reveal {
  margin-top: 18px; padding: 20px 22px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--green); box-shadow: var(--shadow);
  display: grid; gap: 6px; justify-items: start;
}
.reveal[data-result="wrong"] { border-left-color: var(--rust); }
.reveal__verdict { margin: 0; font-size: var(--text-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.reveal[data-result="wrong"] .reveal__verdict { color: var(--rust); }
.reveal__name { margin: 0; }
.reveal__meta { margin: 0; color: var(--ink-2); font-size: var(--text-sm); }
.reveal__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; font-size: var(--text-sm); }

/* ---------- results ---------- */
.results { max-width: 640px; padding-top: 18px; }
.score { margin: 14px 0 0; font: 500 clamp(3.4rem, 2.4rem + 4vw, 5rem)/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.score__of { font-size: var(--text-lg); color: var(--muted); letter-spacing: 0; }
.sqs { display: flex; gap: 6px; margin: 16px 0 0; flex-wrap: wrap; }
.sq { display: inline-block; width: 22px; height: 22px; border-radius: 5px; vertical-align: -5px; }
.sq--g { background: var(--green); }
.sq--y { background: var(--gold); }
.sq--r { background: var(--rust); }
.key { margin: 12px 0 0; font-size: var(--text-xs); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.key .sq { width: 12px; height: 12px; border-radius: 3px; vertical-align: 0; margin-left: 8px; }
.key .sq:first-child { margin-left: 0; }
.results__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.share-status { min-height: 1.4em; margin: 10px 0 0; font-size: var(--text-sm); color: var(--green); }
.share-fallback { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); font: inherit; font-size: var(--text-sm); background: var(--card); }
.results__note { margin: 4px 0 0; font-size: var(--text-sm); color: var(--muted); }
.sponsor { margin: 18px 0 0; padding: 12px 16px; border: 1px dashed var(--line); border-radius: var(--r); font-size: var(--text-sm); color: var(--ink-2); }
.sponsor__tag { display: block; color: var(--muted); }
.rows { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 6px 12px 6px 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); border-left: 4px solid var(--green); }
.row--y { border-left-color: var(--gold); }
.row--r { border-left-color: var(--rust); }
.row img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.row__name { font-weight: 500; }
.row__pts { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- footer ---------- */
.foot { width: 100%; max-width: var(--max); margin: 0 auto; padding: 22px 20px 34px; border-top: 1px solid var(--line); font-size: var(--text-xs); color: var(--muted); }
.foot p { margin: 0 0 6px; max-width: 60em; }
.foot a { color: var(--ink-2); }

.boot-error { padding: 16px; background: var(--rust-tint); border-radius: var(--r); }

/* about page */
.doc { max-width: 760px; padding-top: 18px; }
.doc h2 { font: 500 var(--text-lg)/1.2 var(--font-display); margin: 32px 0 8px; }
.doc p, .doc li { color: var(--ink-2); }
.credits { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin-top: 8px; }
.credits th, .credits td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.credits th { font-weight: 600; color: var(--ink); }
@media (max-width: 560px) { .credits .hide-sm { display: none; } }
[tabindex="-1"]:focus { outline: none; }
