/* Quizillion — Dig Deeper look. The page scroll is the camera; every UI layer is fixed on top.
   Type: Crimson Pro (textbook serif) for reading, Silkscreen (pixel) for the title, buttons,
   tier names and labels; the background's depth labels keep DotGothic16. */
:root {
  --ink: #1c1d23; --ink2: #2a2b33; --ink3: #3a3c46; --line: #5a5c66;
  --cream: #f5efe4; --dim: #c8bfae; --orange: #ff8a3d; --orange-d: #a8501a; --red: #ff6b5a;
  --sky: #9cc3d6; --grass: #5c8a3a;
  --t0: #d8b48a; --t1: #c9c3ba; --t2: #5ee0c7; --t3: #f2c14e; --t4: #bfe9ff;
  --pixel: 'DotGothic16', ui-monospace, Menlo, monospace;            /* the background's own labels */
  --text: 'Crimson Pro', Georgia, 'Times New Roman', serif;          /* everything you read */
  --display: 'Silkscreen', 'DotGothic16', ui-monospace, monospace;   /* title, buttons, tiers, labels */
  --edge: 0 0 0 3px var(--ink), 6px 6px 0 3px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* The camera is the window scroll position, moved only by the game (window.scrollTo).
   overflow: hidden stops wheel, keyboard and touch scrolling by the player. */
html { overflow: hidden; overscroll-behavior: none; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { overflow: hidden; }
html, body { margin: 0; background: #0b0b0e; color: var(--cream); font: 21px/1.4 var(--text); }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--dim); }
.small { font-size: 15px; }
.tiericon { image-rendering: pixelated; display: block; }

/* ---------- background stage ---------- */
#stage { position: relative; width: 100%; overflow: hidden; }
#bg { display: block; width: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
#scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0,0,0,.10) 3px 4px); }
#overlay { position: absolute; inset: 0; pointer-events: none; font-family: var(--pixel); color: var(--cream); }
.dig-ruler { position: absolute; right: 22px; width: 14px; border-right: 2px solid rgba(245,239,228,.55);
  background:
    repeating-linear-gradient(to bottom, rgba(245,239,228,.75) 0 2px, transparent 2px calc(var(--tick) * 5)) right / 14px 100% no-repeat,
    repeating-linear-gradient(to bottom, rgba(245,239,228,.45) 0 2px, transparent 2px var(--tick)) right / 7px 100% no-repeat; }
.dig-ruler-num { position: absolute; right: 44px; transform: translateY(-50%); font-size: 14px; color: rgba(245,239,228,.8); text-shadow: 0 2px 0 rgba(0,0,0,.55); }
.dig-zone { position: absolute; left: 0; right: 110px; height: 0; border-top: 2px dashed rgba(245,239,228,.32); }
.dig-zone-name { position: absolute; left: 48px; top: 12px; font-size: 40px; letter-spacing: 10px; text-shadow: 4px 4px 0 rgba(0,0,0,.45); white-space: nowrap; }
.dig-zone-range { position: absolute; left: 52px; top: 62px; font-size: 15px; letter-spacing: 3px; color: rgba(245,239,228,.7); text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.dig-label { position: absolute; transform: translateY(-50%); font-size: 17px; letter-spacing: 1.5px; color: rgba(245,239,228,.9); text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 8px rgba(0,0,0,.35); white-space: nowrap; }
.dig-label-left { left: 40px; } .dig-label-right { right: 116px; text-align: right; }

/* ---------- drill ---------- */
#vehicle { position: fixed; z-index: 9; left: 50%; top: 0; transform: translateX(-50%); image-rendering: pixelated; pointer-events: none; }
#drillTag { position: fixed; z-index: 9; left: 50%; transform: translate(-50%, -100%); padding: 4px 12px; background: var(--cream); color: var(--ink);
  font-size: 23px; letter-spacing: 1px; box-shadow: 0 0 0 3px var(--ink), 4px 4px 0 3px rgba(0,0,0,.4); max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
#drillTag:empty { display: none; }
.screen-home #vehicle, .screen-results #vehicle { visibility: hidden; }
.theme-solar.screen-home #vehicle { visibility: visible; } /* the rocket stands on its pad */
.flying { position: fixed; z-index: 30; pointer-events: none; padding: 4px 12px; background: var(--cream); color: var(--ink); font-size: 23px; box-shadow: 0 0 0 3px var(--ink);
  transition: transform .42s cubic-bezier(.5,-0.2,.7,1), opacity .42s; white-space: nowrap; }

/* ---------- top bar and dropdowns ---------- */
#topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); pointer-events: none; }
#topbar > * { pointer-events: auto; }
.tb-left { display: flex; gap: 12px; align-items: flex-start; }
.dropwrap { position: relative; }
.iconbtn { width: 48px; height: 48px; border: 0; background: var(--cream); color: var(--ink); display: grid; place-items: center; box-shadow: var(--edge); }
.iconbtn svg { width: 24px; height: 24px; fill: currentColor; }
.iconbtn:active, .pillbtn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 3px var(--ink); }
.pillbtn { height: 48px; padding: 0 16px; border: 0; background: var(--cream); color: var(--ink); font-size: 18px; letter-spacing: 2px; box-shadow: var(--edge); }
.screen-home #homeBtn { display: none; }
.screen-play #aboutBtn, .screen-reveal #aboutBtn, .screen-results #aboutBtn { display: none; }
.dropdown { position: absolute; top: 60px; left: 0; width: 280px; padding: 14px; background: var(--ink); box-shadow: 0 0 0 3px var(--cream), 6px 6px 0 3px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 8px; animation: drop .14s steps(3); }
.dropdown.right { left: auto; right: 0; }
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } }
.dd-title { margin: 4px 0 0; font-size: 14px; letter-spacing: 3px; color: var(--t3); }
.dd-text { margin: 0; color: var(--dim); }
.dd-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: var(--ink2); color: var(--cream); text-decoration: none; font-size: 17px; }
.dd-item:hover { background: var(--ink3); }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 54px; height: 38px; border: 0; padding: 0; box-shadow: 0 0 0 3px var(--ink3); }
.swatches button[aria-pressed=true] { box-shadow: 0 0 0 3px var(--orange); }
.swatches button:disabled { opacity: .45; cursor: not-allowed; }

#hud { flex: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; max-width: 900px; margin: 0 auto; }
.hudbox { padding: 6px 14px; background: var(--ink); min-width: 110px; box-shadow: 0 0 0 3px var(--ink3), 4px 4px 0 3px rgba(0,0,0,.3); }
.hudbox.right { text-align: right; }
.hudbox small { display: block; font-size: 13px; letter-spacing: 3px; color: var(--dim); }
.hudbox b { font-weight: normal; font-size: 28px; font-variant-numeric: tabular-nums; }
#pips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
#pips i { width: 22px; height: 10px; background: rgba(28,29,35,.6); box-shadow: 0 0 0 2px rgba(245,239,228,.35); }
#pips i.now { background: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
#pips i.t0 { background: var(--t0); } #pips i.t1 { background: var(--t1); } #pips i.t2 { background: var(--t2); }
#pips i.t3 { background: var(--t3); } #pips i.t4 { background: var(--t4); } #pips i.miss { background: var(--ink3); }

/* ---------- shared panels and buttons ---------- */
.screen { position: fixed; inset: 0; z-index: 10; overflow-y: auto; overscroll-behavior: contain; padding: 84px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
.panel { width: 100%; max-width: 760px; margin: 0 auto; background: rgba(28,29,35,.95); padding: 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 0 0 3px var(--line), 8px 8px 0 3px rgba(0,0,0,.3); }
.panel.wide { max-width: 1000px; }
.panel h2 { margin: 0; font-weight: normal; font-size: 34px; letter-spacing: 2px; }
.panel h3 { margin: 8px 0 0; font-weight: normal; font-size: 15px; letter-spacing: 3px; color: var(--dim); }
.bigbtn { border: 0; background: var(--orange); color: var(--ink); font-size: 28px; letter-spacing: 3px; padding: 14px 28px; box-shadow: 0 0 0 3px var(--ink), 0 7px 0 3px var(--orange-d); }
.bigbtn:active { transform: translateY(4px); box-shadow: 0 0 0 3px var(--ink), 0 3px 0 3px var(--orange-d); }
.ghostbtn { border: 0; background: var(--ink); color: var(--cream); font-size: 21px; letter-spacing: 2px; padding: 14px 24px; box-shadow: 0 0 0 3px var(--line); }
.smallbtn { border: 0; background: var(--orange); color: var(--ink); font-size: 17px; padding: 8px 14px; box-shadow: 0 0 0 2px var(--ink); }
.linkbtn { border: 0; background: none; color: var(--t3); font-size: 17px; padding: 4px 0; text-decoration: underline; text-underline-offset: 4px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---------- home ---------- */
#home { display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.homepanel { flex: 1 1 auto; min-height: 0; max-width: 900px; margin-top: 22px; margin-bottom: 4vh; overflow: hidden; transform-origin: 0 0; }
.homepanel #menuBody { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px 4px 4px; margin: -4px -6px -4px -4px; }
.homepanel.morphing > * { opacity: 0; }
.homepanel > * { transition: opacity .16s steps(3); }
.rooms { display: flex; flex-direction: column; gap: 12px; color: var(--dim); }
#home .title { text-align: center; color: var(--ink); width: 100%; max-width: 760px; padding: 18px 24px 20px;
  background: rgba(186, 214, 227, .84); box-shadow: 0 0 0 3px var(--ink), 6px 6px 0 3px rgba(28,29,35,.3); }
#home h1 { margin: 0; font-weight: normal; font-size: clamp(64px, 9.77vw, 120px); line-height: 1; letter-spacing: 6px; text-shadow: 5px 5px 0 rgba(245,239,228,.6); }
.kicker { margin: 8px 0 0; font-size: 17px; letter-spacing: 8px; }
#home .tag { margin: 8px 0 0; font-size: 18px; }
.actions { margin-top: auto; margin-bottom: 4vh; width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 16px; }
.bigplay, .actbtn { border: 0; color: var(--cream); background: rgba(28,29,35,.95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 0 0 3px var(--line), 6px 6px 0 3px rgba(0,0,0,.35); transition: transform .08s steps(2); }
.bigplay { height: 92px; background: var(--orange); color: var(--ink); box-shadow: 0 0 0 3px var(--ink), 0 8px 0 3px var(--orange-d); }
.bigplay span { font-size: 46px; letter-spacing: 8px; }
.bigplay small, .actbtn small { font-size: 15px; letter-spacing: 2px; opacity: .8; }
/* All Classes is half as wide and always on the right; the other two share the rest. */
.actrow { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(0, 2fr); gap: 16px; }
#allBtn span { font-size: 15px; letter-spacing: 1px; line-height: 1.15; text-align: center; }
.actbtn { height: 78px; }
.actbtn span { font-size: 23px; letter-spacing: 3px; }
.bigplay:hover, .actbtn:hover { transform: translateY(-2px); }
.bigplay:active, .actbtn:active { transform: translateY(3px); }
.soon { opacity: .75; }
.homemsg { min-height: 24px; margin: 0; text-align: center; text-shadow: 0 2px 0 rgba(0,0,0,.6); }
.homemsg:empty { display: none; }
.homemsg { align-self: center; padding: 6px 12px; background: rgba(28,29,35,.9); }

/* ---------- class picker ---------- */
.menuhead { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.course { text-align: left; border: 0; background: var(--ink2); color: var(--cream); padding: 10px 12px; box-shadow: 0 0 0 3px var(--ink3); }
.course:hover { box-shadow: 0 0 0 3px var(--t3); }
.course b { display: block; font-weight: normal; font-size: 18px; }
.course small { font-size: 14px; color: var(--dim); }
.picklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pick { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--ink2); box-shadow: 0 0 0 3px var(--ink3); cursor: pointer; }
.pick input { width: 20px; height: 20px; accent-color: var(--orange); }
.units { display: flex; flex-direction: column; gap: 12px; }
.unit { background: var(--ink2); box-shadow: 0 0 0 3px var(--ink3); }
.unit > div { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.unit .ut { flex: 1; min-width: 180px; }
.unit .ut b { display: block; font-weight: normal; }
.unit .ut small { font-size: 14px; color: var(--dim); }
.unit details { border-top: 2px solid var(--ink3); padding: 6px 12px 10px; }
.unit summary { cursor: pointer; font-size: 15px; color: var(--dim); }
.sub { display: flex; align-items: center; gap: 8px; padding: 6px 0; flex-wrap: wrap; }
.sub span { flex: 1; min-width: 160px; font-size: 16px; }
.chip { border: 0; background: var(--ink); color: var(--cream); font-size: 16px; padding: 6px 12px; box-shadow: 0 0 0 2px var(--line); }
.chip.go { background: var(--orange); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.complete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; box-shadow: 0 0 0 2px var(--t3); }

/* ---------- play ---------- */
#play { overflow: hidden; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
#play > * { pointer-events: auto; }
#qcard { width: 100%; max-width: 900px; padding: 22px 26px; background: rgba(28,29,35,.94); display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 0 0 3px var(--line), 8px 8px 0 3px rgba(0,0,0,.3); }
#qMeta { font-size: 15px; letter-spacing: 2px; color: var(--t3); text-transform: uppercase; }
#qPrompt { margin: 0; font-weight: normal; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; }
#qHint { font-size: 16px; color: var(--dim); }
#ladder { position: fixed; left: max(16px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 10px 12px;
  background: rgba(28,29,35,.88); box-shadow: 0 0 0 3px var(--ink3); display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
#ladder li { display: flex; align-items: center; gap: 8px; }
#ladder li span:nth-child(2) { flex: 1; }
#ladder li span:last-child { color: var(--dim); }
#ladder canvas { width: 32px; height: 32px; }
#entry { margin-top: auto; width: 100%; max-width: 900px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#msg { min-height: 24px; margin: 0; padding: 8px 14px; background: rgba(28,29,35,.92); font-size: 18px; text-align: center; box-shadow: 0 0 0 2px var(--ink3); }
#msg:empty { background: none; box-shadow: none; }
#msg b { font-weight: normal; color: var(--t3); }
#msg.bad { color: #ffd0c9; box-shadow: 0 0 0 2px var(--red); }
#answerForm { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
#answer { min-width: 0; height: 66px; padding: 0 18px; border: 0; background: #121318; color: var(--cream); font-size: 25px;
  box-shadow: 0 0 0 3px var(--t3), 6px 6px 0 3px rgba(0,0,0,.35); transition: box-shadow .15s; }
#answer.shake { animation: shake .4s steps(8); box-shadow: 0 0 0 3px var(--red), 6px 6px 0 3px rgba(0,0,0,.35); }
#answer.nudge { animation: nudge .5s steps(4); }
#answer.sent { animation: sent .35s steps(4); }
@keyframes shake { 0%,100% { transform: translateX(0); } 12% { transform: translateX(-10px); } 25% { transform: translateX(10px); } 37% { transform: translateX(-8px); }
  50% { transform: translateX(8px); } 62% { transform: translateX(-5px); } 75% { transform: translateX(5px); } 87% { transform: translateX(-2px); } }
@keyframes nudge { 50% { box-shadow: 0 0 0 6px var(--t3), 6px 6px 0 3px rgba(0,0,0,.35); } }
@keyframes sent { 40% { transform: scaleY(.88); } 100% { transform: none; } }
#digBtn { height: 66px; padding: 0 34px; border: 0; background: var(--orange); color: var(--ink); font-size: 30px; letter-spacing: 3px;
  box-shadow: 0 0 0 3px var(--ink), 0 6px 0 3px var(--orange-d); }
#digBtn:active, #digBtn.pressed { transform: translateY(4px); box-shadow: 0 0 0 3px var(--ink), 0 2px 0 3px var(--orange-d); }
#passBtn { color: var(--dim); }

/* ---------- reveal ---------- */
#reveal { z-index: 15; display: flex; align-items: flex-start; justify-content: center; background: rgba(10,11,14,.35); }
.screen-reveal #qcard, .screen-reveal #entry, .screen-reveal #ladder, .screen-reveal #drillTag { visibility: hidden; }
.revealcard { width: 100%; max-width: 620px; margin: auto; background: rgba(28,29,35,.96); padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  box-shadow: 0 0 0 3px var(--line), 8px 8px 0 3px rgba(0,0,0,.35); animation: rise .3s steps(4); }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
#rGlyph { width: 112px; height: 112px; display: grid; place-items: center; filter: drop-shadow(0 0 22px var(--tc, transparent)); animation: pop .45s steps(5); }
#rGlyph canvas { width: 112px; height: 112px; }
#rGlyph.miss { filter: none; opacity: .5; }
@keyframes pop { 0% { transform: scale(.2) rotate(-20deg); } 60% { transform: scale(1.15) rotate(6deg); } 100% { transform: none; } }
#rTier { margin: 0; font-weight: normal; font-size: clamp(46px, 6.9vw, 69px); line-height: 1; letter-spacing: 2px; color: var(--tc, var(--cream)); text-shadow: 4px 4px 0 rgba(0,0,0,.45); }
#rAnswer { margin: 0; font-size: 28px; }
#rPoints { margin: 0; font-size: 21px; letter-spacing: 1px; color: var(--tc, var(--dim)); }
#rFact { margin: 0; max-width: 52ch; color: var(--dim); }
#rAll { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 8px 0; text-align: left; }
#rAll .h { font-size: 14px; letter-spacing: 3px; color: var(--dim); }
#rAll .a { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 8px 12px; background: var(--ink); box-shadow: 0 0 0 2px var(--ink3); }
#rAll .a canvas { width: 24px; height: 24px; }
#rAll .a.me { box-shadow: 0 0 0 2px var(--t3); }
#rAll .a span:nth-child(3) { font-size: 15px; }
#rAll .a small { grid-column: 2 / -1; color: var(--dim); font-size: 15px; }
.reports { display: flex; gap: 20px; }
#reportForm { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
#reportForm textarea { width: 100%; background: #121318; color: var(--cream); border: 0; padding: 8px; box-shadow: 0 0 0 2px var(--line); }

/* ---------- results ---------- */
.scoreline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
#resScore { font-size: 110px; line-height: 1; }
#resMax, #resDepth { font-size: 21px; color: var(--dim); }
#cores { height: 220px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; align-items: start; padding: 0 8px;
  border-top: 6px solid var(--grass);
  background: linear-gradient(180deg, #6b4a2e 0 22%, #7a736c 22% 46%, #3c3f4a 46% 70%, #2a2b33 70% 90%, #1c1d23 90%); }
#cores div { position: relative; min-height: 4px; }
#cores div canvas { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); width: 32px; height: 32px; }
#resList { display: flex; flex-direction: column; gap: 10px; }
#resList .r { padding: 10px 12px; background: var(--ink2); box-shadow: 0 0 0 2px var(--ink3); display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
#resList .r canvas { width: 24px; height: 24px; grid-row: span 2; }
#resList .r small { font-size: 14px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; }
#resList .r em { font-style: normal; font-size: 18px; }

/* ---------- modals: settings and how-to (background blurred) ---------- */
.modal { position: fixed; inset: 0; z-index: 25; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 84px 16px 32px;
  background: rgba(10,11,14,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal .panel { max-width: 520px; animation: rise .25s steps(4); }
.modal label, .modal legend { font-size: 14px; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); }
#setName { height: 46px; padding: 0 12px; border: 0; background: #121318; color: var(--cream); font-size: 20px; box-shadow: 0 0 0 2px var(--line); }
.modal fieldset { border: 0; box-shadow: 0 0 0 2px var(--ink3); padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.modal .radio { text-transform: none; letter-spacing: 0; font-size: 18px; color: var(--cream); display: flex; align-items: center; gap: 8px; }
.theme { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; background: var(--ink2); color: var(--cream); text-align: left; box-shadow: 0 0 0 2px var(--ink3); }
.theme[aria-pressed=true] { box-shadow: 0 0 0 3px var(--orange); }
.theme:disabled { opacity: .5; cursor: not-allowed; }
.theme i { width: 46px; height: 32px; flex: none; }
.theme b { display: block; font-weight: normal; } .theme small { font-size: 14px; color: var(--dim); }
.howlist { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.howtiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.howtiers li { display: flex; align-items: center; gap: 12px; }
.howtiers canvas { width: 32px; height: 32px; }

/* The background's landmark lines are sized for a 1440 px wide scene; below that they crowd, so only zone names stay. */
@media (max-width: 1100px) {
  .dig-label { display: none; }
  .dig-zone-name { font-size: 28px; letter-spacing: 6px; } .dig-zone-range { top: 46px; font-size: 13px; }
}
@media (max-width: 640px) {
  #answerForm { gap: 10px; }
  #answer, #digBtn { height: 56px; } #digBtn { padding: 0 18px; font-size: 23px; }
  #ladder { display: none; }
  .hudbox { min-width: 0; padding: 4px 8px; } .hudbox b { font-size: 21px; }
  #resScore { font-size: 74px; }
  .actrow { gap: 10px; } .actbtn span { font-size: 14px !important; letter-spacing: 1px !important; } .actbtn small { display: none; }
  #allBtn span { font-size: 12px !important; }
  .bigplay span { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- type roles ---------- */
#home h1, .kicker, .bigplay span, .actbtn span, .bigplay small, .actbtn small, .pillbtn, .hudbox small, .hudbox b,
#digBtn, .bigbtn, .ghostbtn, .smallbtn, .chip, .dd-title, #rTier, #rPoints, #qMeta, #qHint, .panel h2, .panel h3,
#resScore, #resMax, #resDepth, #rAll .h, #ladder, .swatches + .dd-text, #pips, .modal label, .modal legend,
#rAll .a span:nth-child(3), #resList .r small, #resList .r em, .linkbtn, .menuhead h2 { font-family: var(--display); }
#home h1 { font-size: clamp(44px, 7vw, 92px); letter-spacing: 2px; }
.kicker { font-size: 16px; letter-spacing: 6px; }
.bigplay span { font-size: 38px; letter-spacing: 6px; }
.actbtn span { font-size: 19px; letter-spacing: 2px; }
.bigplay small, .actbtn small { font-size: 12px; }
.panel h2, .menuhead h2 { font-size: 28px; letter-spacing: 1px; }
#rTier { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: 1px; }
#rPoints { font-size: 17px; }
#qMeta { font-size: 13px; letter-spacing: 1px; }
#qHint { font-size: 13px; }
#qPrompt { font-weight: 600; font-size: clamp(30px, 3.3vw, 42px); line-height: 1.18; }
#digBtn { font-size: 24px; }
.bigbtn { font-size: 22px; letter-spacing: 2px; }
.ghostbtn { font-size: 16px; }
.chip, .smallbtn { font-size: 13px; }
.linkbtn { font-size: 14px; }
.hudbox b { font-size: 22px; }
#resScore { font-size: 84px; }
#ladder { font-size: 12px; }
#drillTag, .flying { font-family: var(--text); font-weight: 700; font-size: 22px; }
#answer { font-family: var(--text); font-size: 24px; }
#rAnswer { font-size: 28px; font-weight: 600; }
#rFact { font-size: 20px; }
#home .tag { font-size: 19px; }
.course b, .unit .ut b { font-weight: 600; font-size: 19px; }
.course small, .unit .ut small { font-family: var(--display); font-size: 11px; }
@media (max-width: 640px) { .bigplay span { font-size: 28px; } #home h1 { font-size: 40px; } }

/* ---------- per-theme touches ---------- */
/* Simple and Sea are smooth vector art: no pixel scaling, no scanlines. */
.theme-simple #bg, .theme-sea #bg { image-rendering: auto; }
.theme-simple #scan, .theme-sea #scan { display: none; }
/* Title panel and the main accent follow each theme. */
.theme-simple { --orange: #f2c14e; --orange-d: #a8801a; }
.theme-simple #home .title { background: rgba(251,248,241,.94); }
.theme-sea { --orange: #ff8f70; --orange-d: #b24f37; }
.theme-sea #home .title { background: rgba(255,233,214,.88); }
.theme-solar #home .title { background: rgba(14,28,63,.9); color: var(--cream); }
.theme-solar #home h1 { text-shadow: 5px 5px 0 rgba(255,138,61,.45); }
/* Simple's ruled paper is light: give overlay text a dark ink. */
.theme-simple .dig-label { color: #262a35; }

/* Krill bank: one answer per tier first, then the rest on request */
#rAll .rows { display: flex; flex-direction: column; gap: 8px; }
#rAll .more { align-self: center; margin-top: 4px; border: 2px solid var(--ink3); background: var(--ink); color: var(--t3); font: 14px var(--display); letter-spacing: 2px; padding: 8px 16px; cursor: pointer; }
#rAll .more:hover { border-color: var(--t3); }

/* ---------- first visit ---------- */
.welcoming #home, .welcoming #topbar { visibility: hidden; }
.welcome { background: rgba(10,11,14,.25); backdrop-filter: none; -webkit-backdrop-filter: none; align-items: center; }
.welcome .panel { max-width: 760px; gap: 16px; }
#welTitle { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; }
#welName { flex: 1 1 220px; min-width: 0; border: 0; border-bottom: 4px solid var(--orange); background: transparent; color: var(--t3);
  font: inherit; font-family: var(--text); font-weight: 700; font-size: 1.15em; padding: 0 4px 2px; }
#welName:focus { outline: none; border-bottom-color: var(--t3); }
#welName::placeholder { color: var(--dim); opacity: .7; }
.welnote { margin: 0; font-size: 19px; line-height: 1.45; padding: 12px 14px; background: var(--ink2); box-shadow: 0 0 0 2px var(--ink3); }
.welnote b { color: var(--t3); font-weight: 600; }
.welmsg { margin: 0; color: #ffd0c9; min-height: 0; }
.welmsg:empty { display: none; }
.welcome .bigbtn { align-self: flex-end; }
.picklist.small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 42vh; overflow-y: auto; padding: 3px; }
.picklist.small .pick { padding: 7px 10px; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--cream); font-family: var(--text); }

/* ---------- daily timer ---------- */
#timer { position: relative; height: 26px; background: #121318; box-shadow: 0 0 0 2px var(--ink3); overflow: hidden; }
#timer i { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--t3); transition: width .25s linear; }
#timer.low i { background: var(--red); }
#timer b { position: relative; display: block; text-align: center; font: 13px/26px var(--display); letter-spacing: 2px; color: var(--cream); text-shadow: 0 1px 0 #000; }

/* ---------- daily leaderboard ---------- */
#board { margin: 4px 0 8px; }
#boardList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#boardList li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px; background: var(--ink2); box-shadow: 0 0 0 2px var(--ink3); }
#boardList li.me { box-shadow: 0 0 0 3px var(--orange); }
#boardList li.gap { background: none; box-shadow: none; padding: 0 12px; color: var(--dim); }
#boardList .rk { font-family: var(--display); color: var(--t3); }
#boardList .nm { font-weight: 600; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#boardList .sc { font-family: var(--display); }
.place { font-family: var(--display); font-size: 18px; letter-spacing: 1px; color: var(--t3); margin: 0; }
.pick input { flex: none; }
.welcome .picklist.small { max-height: 32vh; }
#allBtn small { display: none; }
#timer b { color: var(--ink); text-shadow: none; font-weight: bold; }
#board .place { margin: 2px 0 10px; }
