/* House Hunt. Copyright (C) 2026 B7 Collective LLC.
   Its own feel inside The Imagination Space: a lamplit house at night, cream clue cards tied with twine, kraft tags for
   the grown-up, and an ink stamp when something's found. The paintings are the color; the paper is the interface. */

@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --night: #14100C; --night-2: #1C1611; --ink: #221A12; --ink-2: #4A3D2F; --muted: #6E604F;
  --paper: #F6EEDC; --paper-2: #EFE3CA; --kraft: #CDAA78; --kraft-ink: #4A3418; --twine: #A97C45; --twine-2: #7E5A2C;
  --amber: #F2B544; --amber-lip: #C88D21; --stamp: #2E4A7A;
  --on-night: #F4EBDB; --on-night-2: rgba(244, 235, 219, .78); --hair: rgba(244, 235, 219, .2);
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1); --spring: cubic-bezier(.34, 1.4, .5, 1);
  --pad: clamp(16px, 4vw, 40px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .14 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; min-height: 100%; min-height: 100dvh; background: var(--night); color: var(--on-night); font: 400 18px/1.55 var(--sans); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }
/* On paper, amber alone is too faint: an ink ring with an amber halo */
.slip :focus-visible, .card :focus-visible, .bundle :focus-visible, .empty :focus-visible, .checks :focus-visible, .treasure-box :focus-visible, .cream:focus-visible { outline: 3px solid var(--ink); box-shadow: 0 0 0 7px var(--amber); }
.opt input:focus-visible + span { outline: 3px solid var(--ink) !important; box-shadow: 0 0 0 7px var(--amber) !important; }
[tabindex="-1"]:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 50; padding: 12px 16px; border-radius: 10px; background: var(--paper); color: var(--ink); font-weight: 700; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }
.noscript { margin: 30vh auto 0; max-width: 30em; padding: 24px; text-align: center; }

/* ---------------------------------------------------------------- the painted room behind everything */
.room { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--night); }
.room img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 42% 62%; }
.room .room-out { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease); }
.room .room-out img { object-position: 34% 50%; }
body[data-place="out"] .room .room-out { opacity: 1; }
/* A warm vignette so words on the room stay easy to read, heavier where the words sit */
.room::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 70% 45%, transparent 30%, rgba(14, 10, 6, .55) 100%), linear-gradient(90deg, rgba(14, 10, 6, .72) 0%, rgba(14, 10, 6, .35) 38%, transparent 62%); }
body[data-view="play"] .room::after, body[data-view="saved"] .room::after, body[data-view="list"] .room::after, body[data-view="hunt"] .room::after {
  background: radial-gradient(110% 85% at 50% 40%, rgba(14, 10, 6, .35), rgba(14, 10, 6, .82)); }
@media (max-aspect-ratio: 3/4) {
  .room img { object-position: 50% 70%; }
  .room::after { background: linear-gradient(180deg, rgba(14, 10, 6, .78) 0%, rgba(14, 10, 6, .2) 38%, rgba(14, 10, 6, .1) 60%, rgba(14, 10, 6, .5) 100%); }
}

/* Three cards are tucked into the living room painting. Find them. (Wide screens, just for fun.) */
.spots { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.spot { position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; pointer-events: auto; }
.spot::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(242, 181, 68, 0); transition: box-shadow .3s, transform .3s var(--spring); }
.spot:hover::after { box-shadow: 0 0 0 2px rgba(242, 181, 68, .85), 0 0 24px 6px rgba(242, 181, 68, .35); transform: scale(1.15); }
.spot.got::after { box-shadow: 0 0 0 2px rgba(242, 181, 68, .9); }
.spot.got { cursor: default; }
.egg { position: fixed; z-index: 30; max-width: 300px; padding: 14px 16px; border-radius: 6px; background: var(--paper) var(--grain); color: var(--ink); font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.4;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.7); transform: rotate(-2deg); animation: drop .5s var(--spring); }
.egg b { display: block; font-style: normal; font-weight: 600; }

/* ---------------------------------------------------------------- top bar */
.bar { position: relative; z-index: 5; display: flex; align-items: center; gap: 16px; max-width: 1500px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) calc(max(var(--pad), env(safe-area-inset-right)) + 200px) 12px max(var(--pad), env(safe-area-inset-left)); }
.bar-base { position: absolute; width: 0; height: 0; } /* the Who's playing chip sits fixed at the top right; it lives here so it comes early in the tab order */
.bar-nav a { display: inline-flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--on-night); min-height: 44px; }
.brand b { display: block; font: 600 22px/1.05 var(--serif); letter-spacing: -.01em; }
.brand small { display: block; font-size: 13px; color: var(--on-night-2); }
.bar-nav { display: flex; gap: 4px; margin-left: auto; }
.bar-nav a { padding: 10px 14px; border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; color: var(--on-night-2); }
.bar-nav a:hover { color: var(--on-night); background: rgba(244, 235, 219, .08); }
.bar-nav a[aria-current="page"] { color: var(--on-night); box-shadow: inset 0 -2px 0 var(--amber); border-radius: 0; }
@media (max-width: 699px) { .bar-nav { margin-left: auto; } .bar-nav a[data-nav="make"] { display: none; } .bar-nav a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } .bar-nav a { min-width: 44px; min-height: 44px; justify-content: center; padding: 10px; } .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 22px; border: 0; border-radius: 14px; font-weight: 700; font-size: 17px;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .14s var(--ease), background .2s; touch-action: manipulation; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn svg { flex: none; }
.amber { background: var(--amber); color: #2A1D05; box-shadow: 0 3px 0 var(--amber-lip), 0 10px 24px -12px rgba(242, 181, 68, .6); }
.cream { background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 #CDBB98; }
.ghost { background: rgba(20, 16, 12, .5); color: var(--on-night); box-shadow: inset 0 0 0 1.5px var(--hair); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ghost:hover { background: rgba(20, 16, 12, .7); }
.textbtn { min-height: 44px; padding: 8px 6px; border: 0; background: none; font-weight: 700; font-size: 16px; text-decoration: underline; text-underline-offset: .22em; cursor: pointer; color: inherit; }
.big { min-height: 60px; padding: 14px 28px; font-size: 19px; border-radius: 16px; }

/* ---------------------------------------------------------------- layout of each view */
main { display: block; outline: none; }
.view { padding: 8px var(--pad) max(28px, env(safe-area-inset-bottom)); padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); }

/* ----- Make a hunt ----- */
.make { display: grid; gap: 22px; align-content: start; }
.make-hello h1 { white-space: nowrap; }
.make-hello h1 { font-size: clamp(44px, 11vw, 92px); line-height: .95; color: #fff; text-shadow: 0 2px 30px rgba(0,0,0,.45); }
.make-hello h1 em { font-weight: 400; color: var(--amber); }
.make-hello p { margin-top: 12px; max-width: 24em; font: italic 400 clamp(19px, 2.4vw, 24px)/1.35 var(--serif); color: var(--on-night); text-shadow: 0 1px 16px rgba(0,0,0,.6); }

/* The order slip: a sheet of paper you fill in */
.slip { position: relative; width: 100%; max-width: 560px; padding: 30px clamp(18px, 4vw, 30px) 24px; border-radius: 6px; color: var(--ink);
  background: var(--paper) var(--grain); box-shadow: 0 1px 0 #fff inset, 0 30px 60px -28px rgba(0,0,0,.85), 0 2px 0 #D9C8A6; }
.slip::before { content: ""; position: absolute; left: 50%; top: -14px; width: 120px; height: 30px; transform: translateX(-50%) rotate(-1.5deg); border-radius: 3px;
  background: rgba(236, 222, 190, .82); box-shadow: 0 2px 6px rgba(0,0,0,.18); } /* a strip of tape */
.slip fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.slip fieldset + fieldset { margin-top: 20px; }
.slip legend { padding: 0; font: 600 19px/1.2 var(--serif); }
.slip .hint { margin-top: 2px; font-size: 15px; color: var(--muted); }
.opts { margin-top: 10px; display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { position: relative; display: block; }
.opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.opt span { display: flex; flex-direction: column; justify-content: center; min-height: 64px; height: 100%; padding: 10px 12px; border-radius: 12px; background: #fff; font-weight: 700; font-size: 17px; line-height: 1.2;
  box-shadow: inset 0 0 0 1.5px #9C8763; transition: box-shadow .15s, background .15s, transform .15s var(--ease); }
.opt small { display: block; margin-top: 3px; font-weight: 400; font-size: 14px; color: var(--muted); }
.opt input:checked + span { background: var(--night-2); color: var(--on-night); box-shadow: 0 3px 0 #000; transform: translateY(-1px); }
.opt input:checked + span small { color: var(--on-night-2); }
.opt input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.opt.pic span { min-height: 92px; justify-content: flex-end; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.8); background-size: cover; background-position: center; overflow: hidden; isolation: isolate; }
.opt.pic span::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 12px; background: linear-gradient(180deg, transparent 30%, rgba(14,10,6,.78)); }
.opt.pic small { color: rgba(255,255,255,.86); }
.opt.pic input:checked + span { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--night-2); color: #fff; background-size: cover; }
.opt.pic.in span { background-image: url("art/indoor-800.webp"); background-position: 42% 62%; }
.opt.pic.out span { background-image: url("art/outdoor-800.webp"); background-position: 32% 60%; }
.note { margin-top: 12px; color: var(--ink); display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: #FFF6E2; box-shadow: inset 0 0 0 1.5px #EBCB86; font-size: 16px; line-height: 1.45; }
.note svg { flex: none; margin-top: 2px; color: #9A6420; }
.slip .go { position: static; background: var(--paper) !important; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 2; margin: 22px -8px 0; padding: 8px; border-radius: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; background: rgba(246, 238, 220, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.slip .go .btn { flex: 1 1 220px; }
.slip .go .textbtn { color: var(--ink-2); }

/* ----- The hunt, laid out on the table ----- */
.hunt-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.hunt-head h1 { font-size: clamp(32px, 6vw, 56px); color: #fff; }
.hunt-head h1 em { font-weight: 400; }
.hunt-head p { margin-top: 6px; color: var(--on-night-2); }
.under { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; justify-content: space-between; }
.under .note { margin-top: 0; }
.small-tools { display: flex; flex-wrap: wrap; gap: 4px 22px; color: var(--on-night); }
.tools { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 599px) {
  .hunt-head h1 { font-size: 34px; }
  .tools { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .tools .btn { min-height: 48px; padding: 10px 12px; font-size: 16px; }
  .tools .btn:first-child { grid-column: 1 / -1; }
  .under { margin-top: 12px; }
}
.table { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 40px 30px; align-items: flex-start; padding: 14px 0 30px; }
.table > * { flex: 1 1 270px; max-width: 400px; }
.table > :nth-child(3n+2) { flex-basis: 320px; margin-top: 26px; }
.table > :nth-child(4n+3) { flex-basis: 250px; margin-top: -8px; }
.table > :nth-child(5n+4) { margin-top: 44px; }
.table > :nth-child(7n) { flex-basis: 340px; }

/* A clue card */
.card { position: relative; padding: 34px 22px 20px; border-radius: 4px; color: var(--ink); background: var(--paper) var(--grain);
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 #D9C8A6, 0 22px 40px -22px rgba(0,0,0,.85); transform: rotate(var(--tilt, 0deg)); transition: transform .35s var(--spring); }
.card:hover { transform: rotate(0deg) translateY(-3px); }
.card::before, .bundle::before { content: ""; position: absolute; left: -3px; right: -3px; top: 16px; height: 5px; border-radius: 3px; pointer-events: none;
  background: repeating-linear-gradient(115deg, #B58A50 0 4px, #8C6431 4px 6px, #C79C60 6px 9px); box-shadow: 0 2px 2px rgba(60, 40, 15, .3); }
.card .tie, .bundle .tie { position: absolute; left: 50%; top: -12px; width: 92px; height: 50px; transform: translateX(-50%) rotate(-3deg); color: var(--twine); pointer-events: none; filter: drop-shadow(0 2px 1px rgba(60,40,15,.35)); }
.card { padding-top: 44px; }
.card .num { display: flex; align-items: baseline; gap: 8px; color: #8C5A1C; }
.card .num b { font: 600 40px/1 var(--serif); }
.card .num span { font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.card .rhyme { margin-top: 10px; font: italic 400 21px/1.42 var(--serif); }
.rhyme .ln { display: block; text-wrap: balance; }
.age-little .rhyme, .age-kid .rhyme { font-style: normal; }
.rhyme .ln + .ln { margin-top: .2em; }
.card .lead { margin-top: 10px; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.card .read { display: inline-block; margin-top: 12px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #F0E2C3; color: var(--kraft-ink); }
.card .row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.card .row .textbtn { color: var(--ink-2); font-size: 15px; display: inline-flex; gap: 6px; align-items: center; }
.card.start .rhyme, .card.end .rhyme { font-size: 20px; }
.card.end { background-color: #F9F1DF; }
.card.dealt { animation: deal .55s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 70ms); }

/* The grown-up's kraft tag under a card: where the next card is hidden */
.tag { position: relative; margin: 12px 0 0 auto; width: max-content; max-width: 92%; padding: 8px 14px 8px 26px; border-radius: 3px 10px 10px 3px; color: var(--kraft-ink); font-size: 15px; line-height: 1.35;
  background: var(--kraft) var(--grain); box-shadow: 0 8px 16px -10px rgba(0,0,0,.7); transform: rotate(1.2deg); }
.tag::before { content: ""; position: absolute; left: 9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--night); box-shadow: inset 0 0 0 2px #B48C55; }
.tag b { font-weight: 700; }

/* ----- Play, one clue at a time ----- */
.play { display: grid; gap: 18px; justify-items: center; align-content: start; min-height: calc(100dvh - 90px); }
.trail { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 2px; max-width: 640px; }
.trail { gap: 6px 6px; }
.trail svg { width: 22px; height: 34px; fill: rgba(244, 235, 219, .22); transition: fill .4s; }
.trail svg:nth-child(odd) { transform: rotate(-10deg) translateY(4px); }
.trail svg:nth-child(even) { transform: rotate(10deg) scaleX(-1); }
.trail svg.on { fill: var(--amber); }
.trail svg.now { fill: var(--on-night); }
.where { text-align: center; color: var(--on-night-2); font-weight: 700; }
.where .pill { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: rgba(242, 181, 68, .16); color: var(--amber); font-size: 14px; }
.stage { position: relative; width: min(100%, 760px); padding-top: 18px; }
.stage .card { padding: 56px clamp(22px, 5vw, 44px) 30px; --tilt: -1deg; }
.stage .card .rhyme { font-size: clamp(24px, 2.4vmin + 1rem, 42px); line-height: 1.38; }
.stage .card .num b { font-size: 52px; }
.answer { margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed #D6C29C; font: italic 400 20px/1.4 var(--serif); color: #7A4C14; }
.stamp { position: absolute; right: 8%; bottom: 14%; padding: 6px 16px; border: 4px solid var(--stamp); border-radius: 10px; color: var(--stamp); font: 700 34px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  transform: rotate(-12deg); opacity: .88; mix-blend-mode: multiply; animation: stamp .42s var(--spring); pointer-events: none;
}
.stage .card.leave { animation: leave .5s var(--ease) forwards; }
.stage .card.arrive { animation: arrive .5s var(--spring); }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: min(100%, 760px); }
.controls .btn.amber { flex: 1 1 100%; }
.controls .btn.ghost { flex: 1 1 0; }
@media (max-width: 599px) { .play { grid-template-rows: auto auto 1fr auto; } .play > .controls { align-self: end; } }
.side { display: none; }
.finish-meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.finish-meta span { padding: 4px 12px; border-radius: 999px; background: #F0E2C3; color: var(--kraft-ink); font-size: 15px; font-weight: 700; }
.card .kicker { font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8C5A1C; }
.card h2.title { margin-top: 4px; font-size: clamp(30px, 5vw, 42px); color: var(--ink); }
.card.end { padding-bottom: 96px; }
.stamp.done { right: 9%; bottom: 26px; font-size: clamp(26px, 5vw, 38px); animation-delay: .35s; animation-fill-mode: backwards; }

/* ----- Hiding list (for the grown-up) ----- */
.list { max-width: 720px; }
.list h1 { font-size: clamp(32px, 6vw, 52px); color: #fff; }
.list > p:not(.note) { margin-top: 8px; color: var(--on-night-2); max-width: 34em; }
.checks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.checks label { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 16px 10px 12px; border-radius: 4px; cursor: pointer; color: var(--kraft-ink);
  background: var(--kraft) var(--grain); box-shadow: 0 10px 20px -14px rgba(0,0,0,.8); transform: rotate(var(--tilt, 0deg)); }
.checks input { flex: none; width: 26px; height: 26px; accent-color: var(--night-2); }
.checks b { font-family: var(--serif); font-size: 20px; min-width: 4.6em; }
.checks .done { text-decoration: line-through; color: #5C4424; }

/* ----- Saved hunts: bundles tied with twine ----- */
.saved h1 { font-size: clamp(34px, 6vw, 56px); color: #fff; }
.saved > p { margin-top: 8px; color: var(--on-night-2); }
.bundles { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 36px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.bundle { position: relative; padding: 30px 20px 18px; border-radius: 4px; color: var(--ink); background: var(--paper) var(--grain); transform: rotate(var(--tilt, 0deg));
  box-shadow: 4px 5px 0 -1px #E6D6B4, 8px 10px 0 -2px #D8C49D, 0 26px 40px -22px rgba(0,0,0,.9); }
.bundle { padding-top: 44px; }
.bundle h2 { font-size: 24px; }
.bundle h2 em { font-weight: 400; }
.bundle .facts { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.bundle .first { margin-top: 12px; white-space: pre-line; font: italic 400 17px/1.45 var(--serif); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bundle .best { margin-top: 10px; font-size: 15px; font-weight: 700; color: var(--stamp); }
.bundle .row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.bundle .row .btn { min-height: 46px; padding: 8px 18px; font-size: 16px; }
.empty { margin-top: 28px; max-width: 520px; padding: 28px; border-radius: 6px; color: var(--ink); background: var(--paper) var(--grain); box-shadow: 0 26px 40px -22px rgba(0,0,0,.9); transform: rotate(-.6deg); }
.empty h2 { font-size: 28px; }
.empty p { margin-top: 8px; color: var(--ink-2); }
.empty .btn { margin-top: 18px; }

.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: max-content; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 18px 40px -14px rgba(0,0,0,.8); animation: drop .4s var(--spring); }

/* ---------------------------------------------------------------- motion */
@keyframes deal { from { opacity: 0; transform: translate(-40px, 60px) rotate(-14deg) scale(.9); } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) rotate(-4deg); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-4deg) scale(2.2); } 60% { opacity: .95; } }
@keyframes leave { to { opacity: 0; transform: translate(-60%, 20px) rotate(-16deg); } }
@keyframes arrive { from { opacity: 0; transform: translate(40%, 30px) rotate(10deg); } }
@keyframes tie { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .btn:hover { transform: rotate(var(--tilt, 0deg)); }
}

/* ---------------------------------------------------------------- medium: tablets, foldables, small laptops */
@media (min-width: 600px) {
  .opts { gap: 10px; }
  .table > * { flex-basis: 280px; }
}

/* ---------------------------------------------------------------- expanded: two panes */
@media (min-height: 760px) {
  .slip .go { position: sticky; box-shadow: 0 -18px 16px -6px var(--paper); }
  html:has(body[data-view="make"]) { scroll-padding-bottom: 120px; }
}

@media (min-width: 900px) {
  .make { grid-template-columns: minmax(380px, 500px) 1fr; gap: 26px 48px; align-items: start; min-height: calc(100dvh - 100px); pointer-events: none; }
  .make > * { pointer-events: auto; }
  .make-hello h1 { font-size: clamp(52px, 6vw, 84px); }
  .opt span { min-height: 56px; }
  .opt.pic span { min-height: 84px; }
  .make-hello { grid-column: 1; }
  .slip { grid-column: 1; }
  .hunt-wrap { display: grid; grid-template-columns: minmax(0, 1fr); }
  .play { grid-template-columns: minmax(0, 760px) minmax(240px, 320px); justify-content: center; align-items: start; column-gap: 48px; }
  .play > .trail, .play > .where { grid-column: 1 / -1; }
  .play > .stage { grid-column: 1; }
  .play > .controls { grid-column: 1; }
  .play > .side { display: block; grid-column: 2; grid-row: 3 / span 2; align-self: start; margin-top: 18px; padding: 20px; border-radius: 16px; background: rgba(20, 16, 12, .62); box-shadow: inset 0 0 0 1px var(--hair); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .side h2 { font-size: 22px; }
}
@media (min-width: 1400px) {
  .view { max-width: 1500px; margin: 0 auto; }
}

/* Phones held sideways: the card on the left, the buttons on the right */
@media (orientation: landscape) and (max-height: 520px) {
  .bar { padding-top: 6px; padding-bottom: 6px; }
  .play { grid-template-columns: minmax(0, 1.4fr) minmax(200px, 1fr); align-items: center; column-gap: 24px; min-height: 0; }
  .play > .trail, .play > .where { grid-column: 1 / -1; }
  .play > .stage { grid-column: 1; padding-top: 10px; }
  .play > .controls { grid-column: 2; grid-row: 3; }
  .stage .card { padding: 34px 22px 18px; }
  .stage .card .rhyme { font-size: 22px; }
  .make-hello h1 { font-size: 44px; }
  .make { grid-template-columns: 1fr; }
  .slip { max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
  .slip fieldset + fieldset { margin-top: 0; }
  .slip > .note, .slip > .go, .slip > .hint { grid-column: 1 / -1; }
  .play > .controls .btn.amber { flex-basis: 100%; }
  .play > .controls { flex-direction: column; }
}

/* A foldable half-open on the table (tabletop): the clue fills the top half, the buttons sit on the bottom half */
@media (vertical-viewport-segments: 2) {
  body[data-view="play"] .bar .brand, body[data-view="play"] .bar .bar-nav { display: none; }
  .play { position: fixed; inset: 0; z-index: 2; min-height: 0; padding: 0 max(var(--pad), env(safe-area-inset-left)); gap: 0;
    grid-template-columns: minmax(0, 720px); justify-content: center;
    grid-template-rows: env(viewport-segment-height 0 0, 50vh) calc(env(viewport-segment-top 0 1, 50vh) - env(viewport-segment-bottom 0 0, 50vh)) 1fr; }
  .play > .stage { grid-row: 1; align-self: center; width: 100%; max-height: calc(env(viewport-segment-height 0 0, 50vh) - 20px); overflow: auto; padding-top: 22px; }
  .play > .stage .card { padding-top: 42px; }
  .play > .stage .card .rhyme { font-size: clamp(20px, 4.2vmin, 36px); }
  .play > .controls { grid-row: 3; align-self: start; width: 100%; padding-top: 24px; }
  .play > .trail, .play > .where, .play > .side { display: none; }
}

/* ---------------------------------------------------------------- printing the cards */
.print-only { display: none; }
@page { size: letter; margin: .4in; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  body > *:not(#print) { display: none !important; }
  [data-tis] { display: none !important; }
  .print-only { display: block !important; }
  .sheet { break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet h1 { font: 600 22pt/1.1 var(--serif); color: #000; }
  .sheet .sub { margin-top: 4pt; font-size: 11pt; color: #333; }
  .sheet .safe { margin-top: 10pt; padding: 8pt 10pt; border: 1pt solid #999; border-radius: 6pt; font-size: 10.5pt; }
  .sheet ol.spots-list { margin: 12pt 0 0; padding-left: 0; list-style: none; columns: 1; }
  .sheet ol.spots-list li { display: flex; gap: 10pt; padding: 7pt 0; border-bottom: .75pt solid #ccc; font-size: 12pt; break-inside: avoid; }
  .sheet ol.spots-list li b { min-width: 7.5em; font-family: var(--serif); }
  .sheet ol.spots-list li i { margin-left: auto; color: #666; font-style: normal; }
  .grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 3.25in; }
  .pcard { position: relative; padding: .32in .3in .2in; border: 1pt dashed #9a9a9a; margin: -.5pt; break-inside: avoid; overflow: hidden; }
  .pcard .n { font: 600 22pt/1 var(--serif); color: #000; }
  .pcard .n small { margin-left: 6pt; font: 700 8pt/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #555; }
  .pcard .r { margin-top: 8pt; white-space: pre-line; font: italic 400 14pt/1.42 var(--serif); color: #000; }
  .pcard.little .r { font-size: 16pt; }
  .pcard .l { margin-top: 6pt; font-size: 10pt; color: #333; }
  .pcard .f { position: absolute; left: .3in; right: .3in; bottom: .16in; display: flex; justify-content: space-between; font-size: 8pt; color: #777; }
  .pcard .tw { position: absolute; right: .22in; top: .16in; width: .6in; color: #999; }
}
.card .hint { font-size: 15px; color: var(--ink-2); }
.card .hint b { color: #7A4C14; }
.safe-notes { max-width: 640px; }
.safe-notes .note { color: var(--ink); }

/* Story beats, the story switch and writing your own clue */
.card .lead.beat { font: italic 400 16px/1.45 var(--serif); color: #7A4C14; padding-left: 12px; border-left: 3px solid #E2C58C; }
.stage .card .lead.beat { font-size: clamp(16px, 2.4vw, 19px); margin-bottom: 4px; }
.toggle { position: relative; margin-top: 20px; display: flex; gap: 14px; align-items: center; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle::before { content: ""; flex: none; width: 52px; height: 30px; border-radius: 999px; background: #DCCDAE; box-shadow: inset 0 0 0 1.5px #CDBB98; transition: background .2s; }
.toggle::after { content: ""; position: absolute; left: 4px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s var(--spring); }
.toggle:has(input:checked)::before { background: var(--night-2); }
.toggle:has(input:checked)::after { transform: translateX(22px); background: var(--amber); }
.toggle:has(input:focus-visible)::before { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 7px var(--amber); }
.toggle b { display: block; font-size: 17px; }
.toggle small { display: block; font-size: 15px; color: var(--muted); }
.slip .met { font-style: italic; }
.card.editing { box-shadow: 0 0 0 3px var(--amber), 0 22px 40px -22px rgba(0,0,0,.85); }
.own-l { display: block; margin-top: 10px; font-weight: 700; }
.card textarea { width: 100%; margin-top: 6px; padding: 10px 12px; border: 0; border-radius: 8px; background: #fff; color: var(--ink); font: italic 400 19px/1.45 var(--serif); box-shadow: inset 0 0 0 1.5px #DCCDAE; resize: vertical; }
.own-hint { margin-top: 6px; font-size: 14px; color: var(--muted); }
.card .row .btn { min-height: 46px; padding: 8px 18px; font-size: 16px; }

.toggle::before { box-shadow: inset 0 0 0 1.5px #9C8763; }
.speak { margin-top: 12px; display: inline-flex; gap: 8px; align-items: center; color: #7A4C14; }
.treasure { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #FFF6E2; box-shadow: inset 0 0 0 1.5px #EBCB86; font-size: 17px; color: var(--ink); }
.treasure-box { margin-top: 6px; max-width: 620px; padding: 18px 20px; border-radius: 4px; background: var(--kraft) var(--grain); color: var(--kraft-ink); box-shadow: 0 14px 26px -16px rgba(0,0,0,.8); transform: rotate(-.6deg); }
.treasure-box label b { font-family: var(--serif); font-size: 20px; }
.treasure-box label span { display: block; font-size: 15px; margin-top: 2px; }
.treasure-box input { width: 100%; margin-top: 10px; min-height: 48px; padding: 10px 14px; border: 0; border-radius: 8px; background: #FFFBF2; color: var(--ink); box-shadow: inset 0 0 0 1.5px #8C6A3A; }
.side .found { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.side .found li { padding: 5px 12px; border-radius: 3px 8px 8px 3px; background: var(--kraft) var(--grain); color: var(--kraft-ink); font-size: 15px; font-weight: 700; transform: rotate(var(--tilt)); }
.side .quiet { margin-top: 10px; color: var(--on-night-2); font-style: italic; font-family: var(--serif); }
.opt.off { opacity: .55; }
.opt.off input { cursor: not-allowed; }
.opt.pic.park span { background-image: url("art/park-800.webp"); background-position: 40% 60%; }
.room .room-park { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease); }
.room .room-park img { object-position: 30% 55%; }
body[data-place="park"] .room .room-park { opacity: 1; }
/* The make screen: the painting under it stays clickable (three cards are hidden in the living room) */
body[data-view="make"] main, body[data-view="make"] .view { pointer-events: none; }
body[data-view="make"] .make > * { pointer-events: auto; }
.spots { z-index: 1; }
/* Paper scraps drift down once at the end */
.scraps { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.scraps i { position: absolute; top: -30px; left: var(--x); width: 12px; height: 16px; border-radius: 2px; background: var(--c); box-shadow: 0 2px 4px rgba(0,0,0,.3); transform: rotate(var(--r)); animation: scrap 3.2s var(--d) cubic-bezier(.3, .2, .6, 1) forwards; opacity: 0; }
@keyframes scrap { 0% { opacity: 0; transform: translateY(0) rotate(var(--r)); } 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(105vh) translateX(40px) rotate(calc(var(--r) + 300deg)); } }
/* 600 to 899 wide and at least square (unfolded foldables, small tablets sideways): two panes for play */
@media (min-width: 600px) and (max-width: 899px) and (min-aspect-ratio: 1/1) {
  .play { grid-template-columns: minmax(0, 1fr) minmax(200px, 260px); column-gap: 24px; align-items: start; min-height: 0; }
  .play > .trail, .play > .where { grid-column: 1 / -1; }
  .play > .stage { grid-column: 1; }
  .play > .controls { grid-column: 2; grid-row: 3; flex-direction: column; align-self: center; }
  .play > .side { display: none; }
  .stage .card .rhyme { font-size: clamp(22px, 4.4vmin, 34px); }
}
/* Phones sideways: no header or footprints during play, the card left and the buttons right */
@media (orientation: landscape) and (max-height: 520px) {
  body[data-view="play"] .bar { padding-top: 0; padding-bottom: 0; min-height: 0; }
  body[data-view="play"] .bar .brand, body[data-view="play"] .bar .bar-nav { display: none; }
  .play > .trail { display: none; }
  .play { padding-top: 6px; }
  .stage .card { max-height: calc(100dvh - 70px); overflow: auto; padding-top: 40px; }
  .stage .card .rhyme { font-size: clamp(19px, 5.6vh, 26px); }
  .stage .card.end { padding-bottom: 80px; }
  .play > .controls { align-self: center; gap: 8px; }
  .play > .controls .btn { min-height: 46px; padding: 8px 16px; font-size: 16px; }
  .play > .controls .btn.big { min-height: 54px; }
}

.safe-line { margin-top: 12px; font-size: 14px; line-height: 1.4; color: var(--muted); font-style: normal; }
.stage .card.start .rhyme { font-size: clamp(19px, 1.4vmin + 1rem, 28px); }
.stage .card.start h2.title { font-size: clamp(26px, 2vmin + 1.2rem, 40px); }
@media (orientation: landscape) and (max-height: 520px) { .play > .where { display: none; } .play > .controls { max-height: calc(100dvh - 60px); overflow: auto; } }

/* Words over the paintings stay readable over the bright parts too */
.room::before { content: ""; position: absolute; inset: 0 0 auto; height: 160px; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(14, 10, 6, .72), transparent); }
.hunt-head p, .saved > p, .small-tools, .where, .list > p:not(.note), .bar-nav a { text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 18px rgba(0,0,0,.7); }
.saved-tag { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 6px; font-weight: 700; color: var(--amber); }
.textbtn.on-night { color: var(--on-night); }
.card-tools { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.card-tools .speak { margin-top: 0; }
.slip .toggle + fieldset { margin-top: 20px; }
/* Phones: Found it on its own row, the rest as one tidy row */
@media (max-width: 599px) {
  .play > .controls .btn.ghost { flex: 1 1 0; min-height: 48px; padding: 8px 10px; font-size: 15px; white-space: normal; }
}
/* Phones sideways: buttons in a 2 by 2 grid beside the card; the stamp sits under the words */
@media (orientation: landscape) and (max-height: 520px) {
  .play > .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .play > .controls .btn.amber { grid-column: 1 / -1; }
  .stage .card .rhyme { font-size: clamp(17px, 4.6vh, 22px); }
  .stage .card.end { padding-bottom: 18px; }
  .stage .card.end .stamp.done { position: static; display: inline-block; margin-top: 10px; font-size: 22px; transform: rotate(-6deg); }
}
/* A foldable open like a book (hinge down the middle): the card on the left page, the buttons on the right */
@media (horizontal-viewport-segments: 2) {
  .play { grid-template-columns: env(viewport-segment-width 0 0, 50vw) calc(env(viewport-segment-left 1 0, 50vw) - env(viewport-segment-right 0 0, 50vw)) 1fr; column-gap: 0; padding: 0; }
  .play > .trail, .play > .where { grid-column: 1; }
  .play > .stage { grid-column: 1; padding: 18px; }
  .play > .controls { grid-column: 3; grid-row: 1 / span 3; align-self: center; padding: 24px; flex-direction: column; }
  .play > .side { display: none; }
}

/* Hiding list on narrow phones: the card number above its spot, so spots don't wrap to three lines */
@media (max-width: 420px) {
  .checks label { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 0; }
  .checks input { grid-row: 1 / span 2; }
  .checks b { min-width: 0; font-size: 17px; line-height: 1.2; }
}
/* Very short screens (phones sideways): the start card's story scrolls inside the card, the buttons sit beside it */
@media (orientation: landscape) and (max-height: 420px) {
  .play { grid-template-columns: minmax(0, 1.5fr) minmax(190px, 1fr); }
  .stage .card.start .rhyme { font-size: clamp(15px, 4.2vh, 18px); }
}
