/* Guess the Year — the app's "Darkroom" look: a red-lit darkroom, brass plaques, cream prints on a line. */
@font-face { font-family: "DM Serif"; src: url(/fonts/dmserif.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Urbanist"; src: url(/fonts/urbanist-600.woff2) format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url(/fonts/urbanist-800.woff2) format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  --night: #250709; --night-top: #3A0B10; --night-low: #140405;
  --cream: #F6E7C8; --paper: #FBF1DC; --ink: #3A160F; --muted: #7A4E33; --line: #D9B57A;
  --brass: #E8B54E; --brass-low: #B57A28; --red: #8E1218; --red-top: #D8343A; --lamp: #FFB347;
  --on-night: #FFF1DC; --on-night-muted: #E9CFA8;
  --display: "DM Serif", Georgia, serif; --body: "Urbanist", system-ui, sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font: 500 17px/1.55 var(--body); color: var(--on-night);
  background: radial-gradient(120% 70% at 50% 0%, var(--night-top), var(--night) 55%, var(--night-low)) fixed var(--night);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--lamp); }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 6px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; letter-spacing: .005em; margin: 0 0 .4em; }
h1 { font-size: clamp(2.3rem, 8.5vw, 4.1rem); }
h2 { font-size: clamp(1.55rem, 5vw, 2.1rem); }
h3 { font-size: 1.35rem; }
.eyebrow { font: 800 .78rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin: 0 0 14px; }
.lede { font-size: 1.12rem; color: var(--on-night-muted); max-width: 40ch; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

/* ---- header ---- */
.top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 14px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-night); }
.brand span { font: 400 1.35rem/1 var(--display); white-space: nowrap; }
.top nav { display: flex; gap: 4px; overflow-x: auto; }
.top nav a { white-space: nowrap; text-decoration: none; color: var(--on-night-muted); font-weight: 700; font-size: .92rem; padding: 8px 10px; border-radius: 999px; }
.top nav a[aria-current="page"], .top nav a:hover { color: var(--ink); background: var(--brass); }
@media (max-width: 720px) { .top nav a { display: none; } .top nav a:first-child:not([aria-current]), .home .top nav a:nth-child(2) { display: inline-block; } .brand span { font-size: 1.15rem; } .brand img { width: 36px; height: auto; } }

/* ---- home: the darkroom ---- */
.room { position: absolute; inset: 0 0 auto 0; height: 860px; z-index: 0; overflow: hidden; pointer-events: none; }
.room img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; opacity: .28; }
.room::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(37,7,9,.35), rgba(37,7,9,.75) 30%, var(--night) 80%); }
main { position: relative; z-index: 1; }
.hero, .notes, .app, .prose { position: relative; z-index: 1; }
.hero { max-width: 1180px; margin: 0 auto; padding: 8px 16px 32px; }
.intro { margin: 10px 0 18px; }

/* ---- the game ---- */
.game { position: relative; display: grid; gap: 22px; }
.line { position: absolute; left: -16px; right: -16px; top: 12px; height: 2px; background: linear-gradient(90deg, transparent, #8a5a33 8%, #c9935a 50%, #8a5a33 92%, transparent); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.print { position: relative; margin: 0 auto; width: min(100%, calc(var(--mh) * var(--ar) + 24px)); max-width: 560px; padding: 12px 12px 14px; background: var(--paper);
  border-radius: 4px; transform: rotate(-1.2deg); box-shadow: 0 18px 40px -12px #000, 0 2px 0 rgba(255,255,255,.4) inset; margin-top: 4px; }
.pin { position: absolute; top: -18px; width: 14px; height: 44px; border-radius: 3px; background: linear-gradient(90deg, #8b5a2b, #c88a4a 45%, #7a4a22); box-shadow: 0 3px 6px rgba(0,0,0,.45); }
.pin::after { content: ""; position: absolute; left: 3px; right: 3px; top: 16px; height: 4px; background: #5a3818; border-radius: 2px; }
.pin.l { left: 22%; transform: rotate(-4deg); } .pin.r { right: 22%; transform: rotate(5deg); }
.game { --ar: 1.333; --mh: min(54vh, 580px); }
.frame { position: relative; overflow: hidden; background: #1b0806; aspect-ratio: var(--ar); width: 100%; }
.frame img { display: block; width: 100%; height: 100%; object-fit: contain; filter: sepia(1) saturate(2.2) hue-rotate(-28deg) brightness(.35) blur(6px); transform: scale(1.04);
  transition: filter 1.8s cubic-bezier(.2,.7,.2,1), transform 1.8s cubic-bezier(.2,.7,.2,1); }
.frame .safelight { position: absolute; inset: 0; background: radial-gradient(80% 70% at 50% 40%, rgba(255,59,47,.18), rgba(142,18,24,.55)); mix-blend-mode: multiply; transition: opacity 1.8s ease; }
.frame.dev img { filter: none; transform: none; }
.frame.dev .safelight { opacity: 0; }
.cap { margin: 10px 2px 0; color: var(--muted); font: 700 .85rem/1.3 var(--body); letter-spacing: .04em; text-align: center; }
@media (prefers-reduced-motion: reduce) { .frame img, .frame .safelight { transition: none; } }

.desk { width: 100%; max-width: 560px; margin: 0 auto; }
.rounds { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 14px; justify-content: center; }
.rounds li { min-width: 54px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 2px solid rgba(232,181,78,.35);
  color: var(--on-night-muted); font-weight: 800; font-size: .95rem; background: rgba(255,217,160,.06); }
.rounds li.now { border-color: var(--brass); color: var(--ink); background: var(--brass); }
.rounds li.done { border-color: transparent; background: rgba(255,241,220,.1); color: var(--on-night); gap: 0; grid-auto-flow: column; padding: 0 8px; }
.rounds .sq { font-size: .8rem; margin-right: 4px; }

.dial { background: linear-gradient(180deg, #F7D58A, #C8923A); color: var(--ink); border-radius: 22px; padding: 16px 16px 18px;
  box-shadow: 0 14px 30px -14px #000, inset 0 2px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(90,26,10,.25); }
.yearrow { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 6px; }
#yearOut { text-align: center; font: 400 clamp(3.2rem, 15vw, 4.6rem)/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 rgba(255,255,255,.35); }
.nudge { min-width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(58,22,15,.12); color: var(--ink); font: 800 .95rem var(--body); cursor: pointer; }
.nudge:hover { background: rgba(58,22,15,.22); }
#year { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 10px 0 0; background: transparent; cursor: pointer; --pos: 50%; }
#year::-webkit-slider-runnable-track { height: 14px; border-radius: 8px; background:
  repeating-linear-gradient(90deg, rgba(58,22,15,.55) 0 2px, transparent 2px calc(100% / 35)),
  linear-gradient(90deg, var(--red) var(--pos), rgba(58,22,15,.16) var(--pos)); }
#year::-moz-range-track { height: 14px; border-radius: 8px; background: rgba(58,22,15,.16); }
#year::-moz-range-progress { height: 14px; border-radius: 8px; background: var(--red); }
#year::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1dc, #d8343a 45%, #8e1218); border: 3px solid #fff1dc; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
#year::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #d8343a; border: 3px solid #fff1dc; }
#year:disabled { opacity: .5; cursor: default; }
.ticks { position: relative; height: 16px; margin: 0 17px; font: 800 .75rem var(--body); color: rgba(58,22,15,.7); }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  font: 800 1.05rem/1 var(--body); text-decoration: none; color: var(--on-night); background: linear-gradient(180deg, var(--red-top), var(--red));
  box-shadow: 0 8px 20px -8px rgba(216,52,58,.8), inset 0 2px 0 rgba(255,255,255,.25); }
.btn:hover { color: #fff; filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px rgba(58,22,15,.35); }
.btn.lock { width: 100%; margin-top: 14px; }

.reveal, .result { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 18px 18px 20px; box-shadow: 0 14px 30px -14px #000; }
.reveal p { margin: 0 0 8px; }
.verdict { font: 800 .8rem var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.years { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.years .real { font: 400 3.4rem/1 var(--display); }
.years .yours { color: var(--muted); font-weight: 700; }
.pts { font: 800 1.2rem var(--body); color: #2E8B4E; } .pts.zero { color: var(--red); }
.place { font-weight: 800; }
.clue { color: var(--muted); }
.cr { font-size: .82rem; color: var(--muted); }
.cr a { color: var(--red); }
.reveal .btn { width: 100%; margin-top: 8px; }
.result { text-align: center; }
.result img { margin: -4px auto 0; display: block; }
.total { margin: 4px 0 2px; } .total b { font: 400 3.6rem/1 var(--display); display: block; } .total span { color: var(--muted); font-weight: 700; }
.result .say { font: 400 1.35rem var(--display); margin: 8px 0; }
.squares { font-size: 1.7rem; letter-spacing: .1em; margin: 6px 0 14px; }
.result .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.result .more { color: var(--muted); font-size: .95rem; margin: 14px 0 10px; }
.store.wide { display: block; padding: 14px; border-radius: 14px; background: var(--ink); color: var(--cream); font-weight: 800; text-decoration: none; }

@media (min-width: 940px) {
  .home .hero { display: grid; grid-template-columns: minmax(0, 1fr); }
  .game { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 40px; }
  .print { max-width: none; margin-top: 8px; }
  .game { --mh: min(64vh, 620px); }
  .desk { max-width: none; padding-top: 18px; }
  .intro { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: end; }
  .intro .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
  .intro h1 { margin: 0; }
  .intro .lede { margin: 0 0 6px; }
}

/* ---- sections ---- */
.notes { max-width: 1180px; margin: 0 auto; padding: 18px 16px 8px; display: grid; gap: 16px; }
.notes article { background: rgba(255,217,160,.06); border: 1px solid rgba(224,176,98,.25); border-radius: var(--r); padding: 20px; }
.notes img { display: block; margin-bottom: 8px; }
.notes p { color: var(--on-night-muted); margin: 0 0 8px; }
@media (min-width: 760px) { .notes { grid-template-columns: repeat(3, 1fr); } }

.app { max-width: 1180px; margin: 30px auto 10px; padding: 0 16px; display: grid; gap: 20px; align-items: center; }
.app-copy { background: linear-gradient(180deg, #F7D58A, #C8923A); color: var(--ink); border-radius: 24px; padding: 22px; }
.app-copy p { color: var(--ink); }
.app-icon { border-radius: 14px; display: block; margin-bottom: 10px; box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.stores { display: flex; gap: 10px; flex-wrap: wrap; }
.store { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 16px; border-radius: 14px; background: var(--ink); color: var(--cream); text-decoration: none; font-weight: 800; }
.store small { display: block; font-size: .7rem; font-weight: 600; opacity: .8; }
.store.soon { opacity: .6; }
.shots { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 10px; }
.shots img { width: 150px; flex: none; border-radius: 18px; box-shadow: 0 14px 26px -12px #000; border: 3px solid rgba(255,241,220,.15); }
@media (min-width: 900px) { .app { grid-template-columns: 1fr 1fr; } .shots { justify-content: center; } .shots img { width: 170px; } .shots img:nth-child(2) { transform: translateY(-14px); } }

/* ---- inner pages ---- */
.inner { max-width: 1180px; margin: 0 auto; padding: 6px 0 0; }
.inner .hero { padding-top: 0; }
.prose { max-width: 760px; margin: 0 auto; padding: 8px 16px 10px; }
.prose.wide { max-width: 1100px; }
.prose h2 { margin-top: 1.4em; }
.prose p, .prose li { color: var(--on-night-muted); }
.prose ul { padding-left: 1.2em; }
.cta { margin: 28px 0 10px; }
.ex { margin: 22px 0; background: var(--paper); color: var(--ink); border-radius: 6px; padding: 12px 12px 16px; box-shadow: 0 16px 34px -16px #000; }
.ex:nth-of-type(odd) { transform: rotate(-.6deg); } .ex:nth-of-type(even) { transform: rotate(.5deg); }
.ex img { display: block; width: 100%; }
.ex figcaption { padding: 10px 4px 0; } .ex figcaption p { color: var(--ink); margin: 0 0 6px; }
.ex h3 { margin-bottom: 2px; } .ex .yr { font-weight: 800; color: var(--red); } .ex .cr { color: var(--muted); }
.score { width: 100%; max-width: 420px; border-collapse: collapse; background: var(--paper); color: var(--ink); border-radius: 14px; overflow: hidden; }
.score caption { text-align: left; color: var(--on-night-muted); font-weight: 700; padding-bottom: 6px; }
.score th, .score td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.score th { background: var(--cream); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.tile { margin: 0; background: var(--paper); color: var(--ink); border-radius: 6px; padding: 10px 10px 14px; box-shadow: 0 14px 28px -16px #000; }
.tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tile figcaption { padding-top: 8px; font-size: .92rem; }
.tile b { font: 400 1.6rem/1 var(--display); color: var(--red); margin-right: 6px; }
.tile span { display: block; color: var(--ink); margin-top: 6px; } .tile small { display: block; color: var(--muted); margin-top: 6px; }
.tile small a { color: var(--red); }
.days { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.days a { display: block; padding: 14px; border-radius: 14px; background: var(--paper); color: var(--ink); text-decoration: none; }
.days b { font: 400 1.7rem/1 var(--display); display: block; color: var(--red); } .days span { font-size: .88rem; color: var(--muted); font-weight: 700; }
.day { list-style: none; padding: 0; display: grid; gap: 18px; }
.dp { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 12px; box-shadow: 0 14px 28px -16px #000; display: grid; gap: 12px; }
.dp img { display: block; width: 100%; }
.dp p { color: var(--ink); margin: 0 0 8px; }
.dp .held { color: var(--muted); }
.dp h2 { color: var(--red); margin: 0 0 6px; }
.dp details { background: var(--cream); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.dp summary { cursor: pointer; font-weight: 800; color: var(--red); }
.dp .ans b { font: 400 2.2rem/1 var(--display); margin-right: 6px; }
@media (min-width: 760px) { .dp { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.pager { font-weight: 800; }

/* ---- footer ---- */
.foot { margin-top: 40px; background: var(--night-low); border-top: 1px solid rgba(224,176,98,.2); }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 26px 16px 34px; color: var(--on-night-muted); font-size: .92rem; }
.foot a { color: var(--on-night); }
.tools-h { font: 400 1.2rem var(--display); color: var(--brass); margin: 18px 0 4px; }
.fine { opacity: .75; font-size: .82rem; }
