/* Underhill Maths (early version). Tokens, buttons and the Year/Challenge picker are copied from the reading site
   (/workspace/underhill-adventures/css/style.css + adventure.css) so the two products look the same. Self-hosted fonts only. */
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url("../assets/fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600 700; font-display: swap; src: url("../assets/fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("../assets/fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("../assets/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../assets/fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "OpenDyslexic"; font-weight: 300 550; font-display: swap; src: url("../assets/fonts/OpenDyslexic-Regular.woff2") format("woff2"); }
@font-face { font-family: "OpenDyslexic"; font-weight: 551 900; font-display: swap; src: url("../assets/fonts/OpenDyslexic-Bold.woff2") format("woff2"); }

:root {
  --forest: #24503A; --forest-deep: #183829; --forest-soft: #3E7350; --moss: #7FA36B;
  --gold: #E3A72F; --amber: #C9821B; --amber-deep: #8F5A0E; --cream: #FBF5E6; --paper: #FFFDF7; --parchment: #F4E8CC;
  --bark: #6B4C3B; --ink: #2B2A22; --muted: #5B574A; --berry: #B4533A;
  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --text-scale: 1;
}
* { box-sizing: border-box; }
html { font-size: calc(100% * var(--text-scale)); }
body { margin: 0; font-family: var(--font-body); font-size: 1.125rem; line-height: 1.6; color: var(--ink); background: #F7EEDA; }
body.dyslexia, body.dyslexia button, body.dyslexia input { font-family: "OpenDyslexic", var(--font-body) !important; letter-spacing: .02em; word-spacing: .12em; line-height: 1.8; }
body.dyslexia h1, body.dyslexia h2, body.dyslexia h3 { font-family: "OpenDyslexic", var(--font-body) !important; }
h1, h2, h3 { font-family: var(--font-display); color: var(--forest); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; box-shadow: 0 0 0 6px #FBE7B6; border-radius: 10px; }
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible, main[tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--forest); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 99; font-weight: 800; }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }

/* Header, early-version banner and footer: markup, colours and spacing match the reading site (css/style.css).
   The header is not sticky here so it never covers a focused question. */
.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.site-header { background: rgba(255, 253, 247, .96); border-bottom: 1px solid rgba(201, 130, 27, .25); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; min-height: 76px; flex-wrap: wrap; padding-block: 8px; }
.brand-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand { display: flex; align-items: center; text-decoration: none; border-radius: 10px; min-height: 44px; }
.title-xl { font-size: 2em; }
.brand img { height: 52px; width: auto; }
.maths-mark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--forest); white-space: nowrap; }
.early-pill { font-family: var(--font-body); font-size: .8rem; font-weight: 800; color: var(--amber-deep); background: #FBE7B6; padding: 3px 10px; border-radius: 999px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { font-weight: 700; color: var(--forest); text-decoration: none; padding: 10px 12px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: var(--parchment); }
.comfort-btn { background: var(--paper); color: var(--forest); border: 2px solid var(--forest); border-radius: 999px; padding: 6px 16px; font: inherit; font-weight: 800; cursor: pointer; min-height: 44px; min-width: 44px; }
.comfort-btn:hover, .comfort-btn[aria-expanded="true"] { background: var(--parchment); }
.early-banner { background: #FBE7B6; color: var(--ink); border-bottom: 1px solid rgba(201, 130, 27, .25); font-size: .95rem; }
.early-banner p { margin: 0; padding: 8px 0; }
.early-banner a { color: var(--forest-deep); font-weight: 800; }
.site-footer { background: var(--forest-deep); color: #E9E2CC; padding: 0 0 36px; position: relative; margin-top: 110px; font-size: 1rem; }
.site-footer .treeline { display: block; width: 100%; height: 70px; margin-top: -69px; color: var(--forest-deep); }
.site-footer a { color: #F5D58A; display: inline-block; padding-block: 10px; }
.site-footer :focus-visible { outline-color: #F5D58A; box-shadow: none; }
.footer-grid > div { min-width: 0; overflow-wrap: anywhere; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-top: 30px; }
.footer-h { color: #F5D58A; font-size: 1.15rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid p { margin-bottom: 8px; }
.footer-mail { margin-bottom: 6px; }
.footer-logo { background: var(--cream); border-radius: 16px; padding: 10px 14px; display: inline-block; margin-bottom: 14px; }
.footer-logo img { height: 46px; width: auto; }
.footer-note { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; font-size: .9rem; color: #BFC9B8; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } .nav a.nav-link { display: none; } }
@media (max-width: 600px) { .early-pill { display: none; } .site-header .bar { flex-wrap: nowrap; } }
@media (max-width: 420px) { .brand img { height: 40px; } .maths-mark { font-size: 1.1rem; } .comfort-btn { padding: 6px 12px; } }

main { width: min(1000px, 100% - 32px); margin: 22px auto 60px; }
.card { background: var(--paper); border-radius: 26px; padding: 26px 28px; box-shadow: 0 10px 30px rgba(36,80,58,.12), 0 2px 6px rgba(43,42,34,.06); border: 2px solid #EADFC4; }

/* Comfort panel */
.comfort { margin: 0 0 16px; }
.comfort h2 { font-size: 1.3rem; }
.toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; border: 3px solid #E6D3A6; background: #FFFCF3; font: inherit; font-weight: 800; color: var(--forest); cursor: pointer; text-align: left; min-height: 56px; }
.toggle[aria-pressed="true"] { border-color: var(--forest); background: #E2EFD9; }
.toggle .sw { width: 40px; height: 24px; border-radius: 12px; background: #CDB78A; position: relative; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle[aria-pressed="true"] .sw { background: var(--forest); }
.toggle[aria-pressed="true"] .sw::after { left: 19px; }
.note { font-size: .95rem; color: var(--muted); }

/* Buttons (from the reading site) */
.gbtn { --bg: #F2B53A; --bg2: #E3A72F; --fg: #3B2A08; --edge: #A86C0F; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; min-height: 58px; padding: .6em 1.5em; border: 0; border-radius: 18px; cursor: pointer; color: var(--fg); background: linear-gradient(180deg, var(--bg), var(--bg2)); box-shadow: 0 6px 0 var(--edge), 0 12px 22px rgba(60,40,10,.22), inset 0 2px 0 rgba(255,255,255,.45); transition: transform .08s, box-shadow .08s; }
.gbtn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--edge); }
.gbtn.green { --bg: #3E7A52; --bg2: #2C6040; --fg: #fff; --edge: #183829; }
.gbtn.cream { --bg: #FFFDF7; --bg2: #F4E8CC; --fg: var(--forest); --edge: #CDB78A; }
.gbtn.big { font-size: 1.45rem; min-height: 68px; padding: .6em 2em; border-radius: 22px; }
.gbtn.small { font-size: 1rem; min-height: 46px; padding: .4em 1.1em; border-radius: 14px; box-shadow: 0 4px 0 var(--edge); }
body.dyslexia .gbtn { font-family: "OpenDyslexic", var(--font-body); }

/* Setup (picker copied from the reading site) */
.setup-step { margin-top: 22px; }
.setup-step > .label { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--forest); margin-bottom: 10px; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-size: 1rem; flex: none; }
.guide-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pick { position: relative; display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; text-align: left; padding: 10px 16px 10px 8px; border-radius: 22px; cursor: pointer; background: #FFFCF3; border: 3px solid #E6D3A6; box-shadow: 0 5px 0 #E6D3A6; font: inherit; color: inherit; }
.pick img { width: 110px; height: 110px; object-fit: contain; }
.pick strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--forest); line-height: 1.1; }
.pick span { color: var(--muted); font-weight: 700; }
.pick[aria-checked="true"] { border-color: var(--gold); background: #FFF4D6; box-shadow: 0 5px 0 var(--amber); }
.level { padding: 12px 10px; border-radius: 18px; border: 3px solid #E6D3A6; background: #FFFCF3; cursor: pointer; text-align: center; font: inherit; color: var(--forest); }
.level strong { display: block; font-family: var(--font-display); font-size: 1.2rem; }
.level span { font-size: .9rem; color: var(--muted); font-weight: 700; }
.year-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.diff-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.setup-step > .sub-label { margin-top: 18px; font-size: 1.15rem; }
.year-tile, .diff-tile { position: relative; min-height: 88px; padding: 14px 10px 12px; border-width: 4px; border-radius: 22px; box-shadow: 0 6px 0 #D9C08A; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.year-tile strong { font-size: 1.55rem; line-height: 1.05; }
.diff-tile strong { font-size: 1.5rem; line-height: 1.05; }
.year-tile[data-year="3"] { border-top-color: #2F7C8C; } .year-tile[data-year="4"] { border-top-color: #8A5A9E; }
.year-tile[data-year="5"] { border-top-color: #B4533A; } .year-tile[data-year="6"] { border-top-color: #3F5E8C; }
.diff-easy { background: #F1F8EC; } .diff-medium { background: #FFF6DE; } .diff-hard { background: #FDEDE6; }
.year-tile[aria-checked="true"], .diff-tile[aria-checked="true"] { border-color: var(--forest); background: #E2EFD9; box-shadow: 0 6px 0 var(--forest); transform: translateY(-2px) scale(1.03); }
.year-tile[aria-checked="true"]::after, .diff-tile[aria-checked="true"]::after { content: "✓" / ""; position: absolute; top: -12px; right: -10px; width: 32px; height: 32px; border-radius: 50%; background: var(--forest); color: #fff; font: 800 1.1rem/32px var(--font-body); text-align: center; }
.level-summary { margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; background: #FFFCF3; border: 2px dashed #D9C08A; font-weight: 700; font-size: 1rem; }
.setup-go { margin-top: 26px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.trail { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 6px; margin-top: 8px; font-size: .95rem; }
.trail div { padding: 6px 8px; border-radius: 10px; background: #FFFCF3; border: 2px solid #EADFC4; text-align: center; font-weight: 700; }
.trail .hd { background: transparent; border: 0; color: var(--forest); }
.trail .done { background: #E2EFD9; border-color: var(--forest-soft); color: var(--forest-deep); }

/* Adventure */
.quest { display: flex; gap: 6px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.quest .dot { width: 14px; height: 14px; border-radius: 50%; background: #E6D3A6; }
.quest .dot.on { background: var(--gold); box-shadow: 0 0 0 3px #FBE7B6; }
.quest .dot.done { background: var(--forest-soft); }
.quest .chip { margin-left: auto; font-weight: 800; font-size: .9rem; color: var(--forest); background: #E8F0E1; border-radius: 999px; padding: 6px 12px; }
.scene { display: grid; grid-template-columns: 1fr 170px; gap: 18px; align-items: start; }
.scene .guide img { width: 170px; height: 170px; object-fit: contain; }
.wash { height: 10px; border-radius: 10px; background: linear-gradient(90deg, #DCE9D3, #FFF4D6, #DCE9D3); margin: 4px 0 16px; opacity: .9; }
.story p { font-size: 1.15rem; }
.after { font-style: italic; color: var(--forest-deep); background: #F1F8EC; border-radius: 14px; padding: 10px 14px; }
.listen { margin: 0 0 12px; }
.qpanel { margin-top: 16px; padding: 20px; border-radius: 22px; background: #FFFCF3; border: 3px solid #E6D3A6; }
.qpanel h3 { font-size: 1.3rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cpa { font-family: var(--font-body); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--forest); color: #fff; padding: 3px 10px; border-radius: 999px; }
.prompt { font-size: 1.2rem; font-weight: 700; }
.visual { overflow-x: auto; margin: 10px 0 14px; padding: 8px; background: #fff; border-radius: 14px; border: 2px dashed #E6D3A6; }
.vis { max-width: 100%; height: auto; display: block; margin: auto; font-family: var(--font-body); }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 10px 0; }
.opt { font: inherit; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--forest); padding: 14px; min-height: 64px; border-radius: 18px; border: 3px solid #E6D3A6; background: #fff; box-shadow: 0 5px 0 #E6D3A6; cursor: pointer; }
.opt[aria-checked="true"] { border-color: var(--forest); background: #E2EFD9; box-shadow: 0 5px 0 var(--forest); }
.opt.wrongpick { border-color: var(--berry); background: #FDEDE6; text-decoration: line-through; text-decoration-thickness: 2px; }
.answer-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.answer-row label { font-weight: 800; color: var(--forest); }
.answer { font: inherit; font-size: 1.5rem; font-weight: 700; padding: 10px 14px; width: 220px; max-width: 100%; border-radius: 14px; border: 3px solid #CDB78A; background: #fff; color: var(--ink); }
.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.hints { margin: 14px 0 0; padding: 0; list-style: none; }
.hints li { display: flex; gap: 12px; align-items: flex-start; background: #FFF4D6; border: 2px solid #F2D58A; border-radius: 16px; padding: 10px 14px; margin-bottom: 8px; }
.hints li img { width: 44px; height: 44px; flex: none; }
.hints li b { color: var(--amber-deep); display: block; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.feedback { margin-top: 14px; border-radius: 16px; padding: 12px 16px; font-weight: 700; display: flex; gap: 12px; align-items: flex-start; }
.feedback:empty { display: none; }
.feedback img { width: 54px; height: 54px; flex: none; }
.feedback.right { background: #E2EFD9; border: 3px solid var(--forest-soft); color: var(--forest-deep); }
.feedback.why, .feedback.form { background: #FDF1E8; border: 3px solid #E7B79F; color: #6A2C18; }
.feedback b { display: block; }
.feedback > div { min-width: 0; flex: 1 1 auto; }
.mini-array svg { max-width: 100%; height: auto; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.choices .gbtn { min-height: 90px; }
.refs { font-size: .85rem; color: var(--muted); margin-top: 14px; }
.cert { text-align: center; border: 6px double var(--gold); background: #FFFCF3; }
.cert .stars { font-size: 2.2rem; color: var(--amber); letter-spacing: .1em; }
.cert .duo { display: flex; justify-content: center; gap: 10px; }
.cert .duo img { width: 150px; height: 150px; object-fit: contain; }

@keyframes pop { 0% { transform: scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
.feedback, .hints li { animation: pop .25s ease-out; }
body.calm *, body.calm *::before, body.calm *::after { animation: none !important; transition: none !important; }
body.calm .year-tile[aria-checked="true"], body.calm .diff-tile[aria-checked="true"] { transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .year-tile[aria-checked="true"], .diff-tile[aria-checked="true"] { transform: none; } }
@media (max-width: 700px) { .scene { grid-template-columns: 1fr; } .scene .guide { display: none; } .year-pick { grid-template-columns: repeat(2, 1fr); } .guide-pick, .choices { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .diff-pick { grid-template-columns: 1fr; } .card { padding: 18px; } }
.setup-go.center { justify-content: center; } .cert .stars .dim { opacity: .3; }

/* ---------- Adventure picker ---------- */
.adv-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.adv-tile { position: relative; min-height: 96px; padding: 14px 10px 12px; border-width: 4px; border-radius: 22px; box-shadow: 0 6px 0 #D9C08A; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.adv-tile strong { font-size: 1.3rem; line-height: 1.1; }
.adv-fernford { background: #EEF5F7; } .adv-maze { background: #F1F8EC; } .adv-tables { background: #FFF6DE; }
.adv-tile[aria-checked="true"] { border-color: var(--forest); background: #E2EFD9; box-shadow: 0 6px 0 var(--forest); }
.adv-tile[aria-checked="true"]::after { content: "✓" / ""; position: absolute; top: -12px; right: -10px; width: 32px; height: 32px; border-radius: 50%; background: var(--forest); color: #fff; font: 800 1.1rem/32px var(--font-body); text-align: center; }

/* ---------- Tables Tower hub ---------- */
.tower-head { display: grid; grid-template-columns: 1fr 140px; gap: 16px; align-items: center; }
.tower-guide { width: 140px; height: 140px; object-fit: contain; }
.known { font-weight: 800; color: var(--forest); margin-bottom: 6px; }
.meter { height: 16px; border-radius: 10px; background: #EADFC4; overflow: hidden; margin-bottom: 18px; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--forest-soft), var(--moss)); }
.floor { border: 3px solid #D9C08A; border-bottom-width: 0; background: #FBF2DD; padding: 12px; display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.floor:first-child { border-radius: 22px 22px 0 0; }
.floor:last-child { border-bottom-width: 3px; border-radius: 0 0 22px 22px; }
.floor-name { font-family: var(--font-display); font-weight: 600; color: var(--bark); }
.floor-tables { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tt { font: inherit; color: var(--forest); background: #FFFCF3; border: 3px solid #E6D3A6; border-radius: 18px; box-shadow: 0 5px 0 #E6D3A6; padding: 10px 8px; min-height: 84px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tt strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.tt span { font-size: .9rem; font-weight: 700; color: var(--muted); }
.tt em { font-style: normal; font-size: .8rem; font-weight: 800; }
.tt.next { border-color: var(--gold); background: #FFF4D6; box-shadow: 0 5px 0 var(--amber), 0 0 0 4px #FBE7B6; }
.tt.next em { color: var(--amber-deep); }
.tt.done { border-color: var(--forest-soft); background: #E2EFD9; }
.tt.done em { color: var(--forest-deep); }
.tt:focus-visible, .adv-tile:focus-visible, .toggle:focus-visible { outline: 4px solid #1F6FEB; outline-offset: 3px; }
.toggle:disabled { opacity: .55; cursor: not-allowed; }
.check-box { background: #FFFCF3; border: 2px dashed #D9C08A; border-radius: 18px; padding: 14px 16px; }

/* ---------- Tables Tower drill ---------- */
.quest .count { font-weight: 800; color: var(--forest); }
.timer { position: relative; height: 22px; border-radius: 12px; background: #EADFC4; overflow: hidden; margin-bottom: 14px; }
.timer .fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #8FBF9F, #3E7350); transition: width .1s linear; }
.timer.out { background: #FFF4D6; }
.timer .tlabel { position: relative; display: block; text-align: center; font-size: .85rem; font-weight: 800; line-height: 22px; color: var(--amber-deep); }
.drill-main { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 18px; align-items: start; }
.drill-main .guide img { width: 160px; height: 160px; object-fit: contain; }
.drill-kicker { font-weight: 800; color: var(--muted); margin: 0; }
.drill-q { font-family: var(--font-display); font-size: 3.2rem; line-height: 1.1; margin: 4px 0 8px; color: var(--forest-deep); }
.drill-q .qmark { color: var(--amber); }
.mini-array { margin-top: 8px; background: #fff; border-radius: 12px; padding: 6px; display: block; width: fit-content; max-width: 100%; overflow-x: auto; }
.mini-array .vis { max-width: min(320px, 100%); }
.drill-end { text-align: center; }
.drill-end .duo { display: flex; justify-content: center; gap: 10px; }
.drill-end .duo img { width: 130px; height: 130px; object-fit: contain; }
body.calm .timer .fill { transition: none; }
@media (max-width: 700px) { .adv-pick { grid-template-columns: 1fr; } .tower-head, .drill-main { grid-template-columns: minmax(0, 1fr); } .tower-guide, .drill-main .guide { display: none; } .floor { grid-template-columns: 1fr; } .drill-q { font-size: 2.6rem; } }
.gbtn:disabled { opacity: .55; cursor: not-allowed; box-shadow: 0 2px 0 var(--edge); }

/* Guest cast: Professor Harlen and Brog appear as a smaller card under the guide's feedback (one at a time). */
.guest { text-align: left; margin-top: 14px; border-radius: 18px; padding: 12px 16px; display: flex; gap: 14px; align-items: flex-start; animation: pop .25s ease-out; }
.guest > img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.guest b { display: block; font-family: var(--font-display); font-weight: 600; color: var(--forest); }
.guest.brog { background: #F6EEE3; border: 3px solid #D9C3A5; color: var(--bark); font-weight: 700; }
.guest.brog b { color: var(--bark); }
.guest.harlen { background: #FFF8E8; border: 3px solid var(--gold); }
.guest.harlen > img { width: 110px; height: 110px; }
.guest-body { flex: 1; min-width: 0; }
.guest.harlen h3 { font-size: 1.2rem; color: var(--amber-deep); margin-bottom: .3em; }
.guest.harlen p { margin: .3em 0; }
.reasons { grid-template-columns: 1fr; }
.reasons .opt { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; text-align: left; min-height: 52px; padding: 10px 14px; }
.keeper-art { width: 120px; height: 120px; object-fit: contain; }
@media (max-width: 700px) { .guest { padding: 10px 12px; } .guest > img, .guest.harlen > img { width: 60px; height: 60px; } .guest.harlen { flex-wrap: wrap; } .guest.harlen .guest-body { flex-basis: 100%; } }

/* Teacher settings and the grown-up gate */
.teacher h3 { font-size: 1.15rem; color: var(--forest); margin: .2em 0 .4em; }
.teacher .gate-q { display: block; font-size: 1.3rem; font-weight: 800; color: var(--forest); margin: .6em 0 .2em; }
.teacher #gate .answer { width: min(260px, 100%); }
.tset { border: 3px solid #E8DCC4; border-radius: 18px; padding: 14px 18px; margin: 16px 0; background: #FFFDF7; }
.tset legend { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--forest); padding: 0 6px; }
.tradio { display: flex; align-items: center; gap: 10px; margin: 8px 0; min-height: 44px; }
.tradio input { width: 26px; height: 26px; accent-color: var(--forest); flex: none; margin: 0; }
.tradio label { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; flex: 1; }
.tradio input:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.class-code .code { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .08em; color: var(--forest); background: #EAF3EC; padding: 2px 10px; border-radius: 8px; }
.class-code code { word-break: break-all; background: #F4EEE2; padding: 2px 6px; border-radius: 6px; font-size: .95rem; }
.class-code .answer-row { flex-wrap: wrap; gap: 10px; }
.class-code #code-in { width: 150px; text-transform: uppercase; }

/* Print: only the certificate (or the current screen) on plain paper. */
@media print {
  body { background: #fff; }
  .site-header, .early-banner, .site-footer, .skip-link, #comfort, .setup-go, .gbtn, #announcer { display: none !important; }
  main { width: 100%; margin: 0; }
  .card { box-shadow: none; border: 2px solid #8F5A0E; break-inside: avoid; }
  .cert { border: 6px double #C9821B; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cert .duo img { max-height: 160px; width: auto; }
}
