/* style.css — The Daily Prezle. Colors and fonts are defined once here. */
:root {
  --paper: #EFE8D8;        /* newsprint */
  --paper-deep: #E7DFCB;   /* inside the cameos */
  --ink: #1B1A17;
  --ink-soft: #2E2B25;
  --muted: #5B564C;
  --faint: #8A8374;
  --red: #A8322A;          /* the one accent ink */
  --masthead: 'UnifrakturMaguntia', serif;
  --head: 'Old Standard TT', Georgia, serif;
  --body: 'IM Fell English', Georgia, serif;
  --sc: 'IM Fell English SC', Georgia, serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Paper: a light center, darker aged edges, and a grain layer over everything. */
.paper {
  max-width: 440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 18px calc(28px + env(safe-area-inset-bottom));
  background-image:
    radial-gradient(ellipse at 50% 35%, rgba(255,250,236,.55) 0%, rgba(255,250,236,0) 55%, rgba(110,84,40,.18) 100%),
    url("mottle.png");
  background-size: 100% 100%, 512px 512px;
}
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background-image: url("grain.png");
  background-size: 160px 160px;
  mix-blend-mode: multiply;
  opacity: .55;
}
.ink { text-shadow: 0 0 .6px rgba(27,26,23,.55); }
.rough { filter: url(#rough); }

/* ---------- Masthead ---------- */
.ears { display: flex; gap: 10px; }
.ear { flex: 1; border: 1px solid var(--ink); padding: 4px 6px; text-align: center; }
.ear-title { font-family: var(--sc); font-size: 11px; letter-spacing: .08em; }
.ear-text { font-size: 12px; font-style: italic; line-height: 1.2; }
.masthead {
  margin: 10px 0 4px; text-align: center;
  font-family: var(--masthead); font-weight: 400; font-size: clamp(36px, 11vw, 46px); line-height: 1;
}
.dateline {
  border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink);
  padding: 2px 2px; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--sc); font-size: 12px; letter-spacing: .06em;
}
.sound {
  width: 32px; height: 26px; border: 0; background: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.sound .mute { display: none; }
.sound[aria-pressed="false"] .mute { display: inline; }
.sound[aria-pressed="false"] .waves { display: none; }

/* ---------- Progress ---------- */
.progress { display: flex; justify-content: center; gap: 22px; margin: 14px 0 10px; font-family: var(--head); }
.progress .step { display: flex; flex-direction: column; align-items: center; min-width: 22px; color: var(--faint); }
.progress .numeral { font-size: 15px; font-weight: 700; padding: 0 3px; }
.progress .pts { font-family: var(--sc); font-size: 11px; height: 13px; color: var(--red); }
.progress .done { color: var(--ink); }
.progress .now { color: var(--ink); }
.progress .now .numeral { border-bottom: 2px solid var(--ink); }
.progress .now .pts { color: var(--muted); }

/* ---------- Question ---------- */
.kicker-row {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--ink); padding-top: 8px;
  font-family: var(--sc); font-size: 13px; letter-spacing: .1em;
}
.kicker { color: var(--red); }
.muted-sc { font-family: var(--sc); color: var(--muted); letter-spacing: .08em; font-size: 13px; }
.headline {
  margin: 8px 4px 0; text-align: center;
  font-family: var(--head); font-weight: 700; line-height: 1.08;
}
.headline.caps { text-transform: uppercase; letter-spacing: .01em; }
.rule-short { width: 64px; margin: 10px auto 8px; border-top: 1px solid var(--ink); }
.deck { margin: 0 10px; text-align: center; font-style: italic; font-size: 17px; line-height: 1.3; color: var(--ink-soft); }

/* ---------- Cameos (engraved ovals) ---------- */
.cameo {
  display: block; border-radius: 50%; overflow: hidden; flex: none;
  background-color: var(--paper-deep);
  background-image: repeating-linear-gradient(135deg, rgba(27,26,23,.16) 0 1px, transparent 1px 3px);
  border: 1.5px solid var(--ink);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4.5px var(--ink);
}
.cameo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cameo-xl { width: 150px; height: 190px; margin: 12px auto 0; }
.cameo-lg { width: 112px; height: 142px; }

/* ---------- The dial ---------- */
.dial-row { margin-top: 14px; display: flex; align-items: center; gap: 4px; }
.round-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.wheel {
  position: relative; flex: 1; height: 150px; overflow: hidden;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; outline: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.wheel:active { cursor: grabbing; }
.wheel:focus-visible { box-shadow: 0 0 0 2px var(--red); border-radius: 8px; }
.wheel .item {
  position: absolute; left: 50%; top: 50%;
  width: 104px; height: 132px; margin: -66px 0 0 -52px;
  padding: 0; border: 0; background: none; cursor: pointer;
  will-change: transform, opacity;
}
.wheel .item .cameo { width: 100%; height: 100%; }
.wheel .item img { pointer-events: none; -webkit-user-drag: none; }
.wheel .token {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 700; font-size: 30px; color: var(--ink);
}
.wheel .token small { font-family: var(--sc); font-weight: 400; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.pick { text-align: center; margin-top: 6px; }
.pick-num { font-family: var(--head); font-weight: 700; font-size: 34px; line-height: 1; }
.pick-name { font-family: var(--sc); font-size: 17px; letter-spacing: .08em; margin-top: 3px; min-height: 22px; }

/* ---------- Buttons ---------- */
.press {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; margin-top: 16px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4px var(--paper);
  font-family: var(--head); font-weight: 700; font-size: 17px; letter-spacing: .14em; text-transform: uppercase;
}
.press:active { transform: translateY(1px); }
.hint { margin: 8px 0 0; text-align: center; font-size: 14px; font-style: italic; color: var(--muted); }

/* ---------- Answer ---------- */
#reveal { margin-top: 6px; }
.quip { margin: 14px 12px 0; text-align: center; font-style: italic; font-size: 21px; line-height: 1.25; color: var(--ink-soft); }
.section-rule {
  margin: 16px 0 6px; display: flex; align-items: center; gap: 10px;
  font-family: var(--sc); font-size: 13px; letter-spacing: .12em;
}
.section-rule::before, .section-rule::after { content: ""; flex: 1; border-top: 1px solid var(--ink); }
#reveal .section-rule { color: var(--red); }
.headline-answer { text-transform: uppercase; }
.answer-row { margin-top: 14px; display: flex; gap: 14px; align-items: center; }
.answer-num { font-family: var(--head); font-weight: 700; font-size: 40px; line-height: 1; }
.answer-name { font-family: var(--sc); font-size: 18px; letter-spacing: .06em; line-height: 1.15; margin-top: 2px; }
.answer-years { font-size: 15px; color: var(--muted); margin-top: 2px; }
.guess-row {
  margin-top: 16px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: 10px 2px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.guess-text { font-size: 16px; line-height: 1.3; }
.stamp {
  flex: none; transform: rotate(-7deg); filter: url(#stamp);
  border: 2.5px solid var(--red); color: var(--red); padding: 4px 10px; text-align: center;
  font-family: var(--head); font-weight: 700; line-height: 1; font-size: 24px; opacity: .9;
}
.stamp-label { font-size: 10px; letter-spacing: .18em; margin-top: 2px; }
.fact-block { margin-top: 14px; }
.dropcap { margin: 4px 0 0; font-size: 16.5px; line-height: 1.38; text-align: justify; hyphens: auto; }
.dropcap::first-letter { float: left; font-family: var(--head); font-weight: 700; font-size: 46px; line-height: .85; padding: 4px 6px 0 0; }

/* ---------- Final edition ---------- */
.final-head { text-align: center; margin-top: 18px; }
.final-kicker { font-family: var(--head); font-weight: 700; font-size: 24px; letter-spacing: .08em; text-transform: uppercase; line-height: 1; }
.final-score { font-family: var(--head); font-weight: 700; font-size: 108px; line-height: .92; color: var(--red); margin: 4px 0; }
.review { list-style: none; margin: 0; padding: 0; }
.review li {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 64px; column-gap: 10px;
  padding: 9px 0; border-bottom: 1px solid rgba(27,26,23,.35);
}
.review .num { font-family: var(--head); font-weight: 700; font-size: 16px; line-height: 1.2; }
.review .q { font-size: 15.5px; line-height: 1.25; }
.review .d { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.review .p { text-align: right; font-family: var(--head); line-height: 1.1; }
.review .p b { font-size: 18px; }
.review .p.exact b { color: var(--red); }
.review .p small { display: block; font-size: 11px; color: var(--muted); }
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ink); }
.numbers div { text-align: center; padding: 8px 2px; border-right: 1px solid var(--ink); }
.numbers div:last-child { border-right: 0; }
.numbers b { display: block; font-family: var(--head); font-size: 24px; line-height: 1; }
.numbers span { font-family: var(--sc); font-size: 11.5px; letter-spacing: .06em; }
.slip {
  margin-top: 10px; padding: 10px 12px; transform: rotate(-.6deg);
  background-color: #F5EFDF; border: 1px solid rgba(27,26,23,.45); box-shadow: 0 1px 0 rgba(27,26,23,.15);
  background-image: repeating-linear-gradient(0deg, transparent 0 23px, rgba(27,26,23,.07) 23px 24px);
  font-family: var(--sc); font-size: 14px; letter-spacing: .05em; line-height: 1.5; word-break: break-word;
}
.slip-emoji { font-size: 22px; letter-spacing: 3px; margin-top: 4px; }
.next-edition { margin: 16px 0 0; text-align: center; font-style: italic; font-size: 14px; color: var(--muted); }

footer { margin-top: 28px; text-align: center; font-family: var(--sc); font-size: 12px; letter-spacing: .06em; }
footer a { color: var(--muted); }
