:root {
  font-family: 'DM Sans', Arial, sans-serif;
  color: #30382f;
  background: #f5efdf;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #30382f;
  --muted: #77786d;
  --rust: #bd6243;
  --green: #637d65;
  --paper: #fffdf5;
  --line: #e5decb;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 90% 9%, rgba(219,204,168,.25), transparent 32%), #f5efdf;
}
body[data-paper-theme="light"] { --paper: #fff; --line: #e3e1d8; background: radial-gradient(ellipse at 90% 9%, rgba(226,222,208,.25), transparent 32%), #f7f6f0; }
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
.app-shell {
  width: 100%;
  max-width: 1180px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  padding: env(safe-area-inset-top) max(18px, calc(env(safe-area-inset-right) + 18px)) env(safe-area-inset-bottom) max(18px, calc(env(safe-area-inset-left) + 18px));
  display: flex;
  flex-direction: column;
}
.topbar { height: 76px; flex: 0 0 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(75,77,59,.13); }
.wordmark { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--rust); color: var(--paper); font: 17px 'DM Serif Display', Georgia, serif; }
.tagline { color: var(--muted); font: italic 15px 'DM Serif Display', Georgia, serif; }
.screen { flex: 1 0 auto; }
.eyebrow { margin: 0 0 16px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .2em; }
.home-screen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); align-items: center; gap: clamp(28px, 5vw, 64px); padding: 38px 0 44px; }
.home-copy h1 { margin: 0; color: var(--ink); font: 400 clamp(52px, 6vw, 76px)/.98 'DM Serif Display', Georgia, serif; letter-spacing: -.035em; }
.title-branding { position: relative; display: flex; align-items: center; gap: clamp(8px, 2vw, 18px); width: 100%; max-width: 700px; }
.title-branding h1 { flex: 1 1 auto; min-width: 0; line-height: 0; }
.title-logo { display: block; width: 100%; max-width: 640px; height: auto; }
.qa-emblem-trigger { flex: 0 0 auto; width: clamp(42px, 5vw, 58px); height: clamp(42px, 5vw, 58px); padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.qa-emblem-trigger img { display: block; width: 100%; height: 100%; pointer-events: none; }
.qa-emblem-trigger:focus-visible { outline: 3px solid #bd8d34; outline-offset: 4px; }
.qa-emblem-trigger:active { transform: scale(.96); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
h1 em { color: var(--rust); font-weight: 400; }
.intro { max-width: 370px; margin: 20px 0 20px; color: #6f7166; font-size: 14px; line-height: 1.65; }
.hub-menu { width: 100%; max-width: 530px; }
.hub-primary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hub-secondary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.hub-card { width: 100%; min-width: 0; min-height: 56px; padding: 10px 13px; border: 1px solid #d8d1bf; border-radius: 4px; background: rgba(255,253,245,.72); text-align: left; cursor: pointer; transition: transform .16s, border-color .16s, background .16s; }
.hub-card strong, .hub-card span { display: block; }
.hub-card strong { font-size: 13px; line-height: 1.25; }
.hub-card span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.25; }
.hub-card.primary { min-height: 66px; padding: 12px 14px; border-color: #ba6347; background: var(--rust); color: #fffdf7; }
.hub-card.primary span { color: rgba(255,253,247,.82); }
.hub-card.adventure { border-color: #a8b8a0; background: #edf1e6; color: var(--ink); }
.hub-card.adventure span { color: #64715f; }
.hub-card:disabled { cursor: default; opacity: .7; }
.hub-card:not(:disabled):hover { transform: translateY(-1px); border-color: var(--rust); }
.home-links { display: flex; align-items: center; gap: 10px; margin-top: 13px; color: #aaa391; }
.text-button { min-height: 44px; padding: 7px 0; border: 0; background: none; color: var(--rust); font-size: 12px; cursor: pointer; }
.home-art { position: relative; width: 100%; height: min(460px, 42vw); min-height: 330px; display: grid; place-items: center; overflow: hidden; border-radius: 48% 48% 4px 4px; background: #e9e1cd; color: #586b55; }
.home-art::after { position: absolute; inset: 16px; border: 1px solid rgba(85,100,75,.2); border-radius: 48% 48% 2px 2px; content: ''; pointer-events: none; }
.art-caption { position: absolute; right: 0; bottom: 25px; left: 0; color: #7f806e; text-align: center; font-size: 9px; letter-spacing: .17em; }
.art-caption span { padding: 0 5px; color: var(--rust); }
.site-footer { height: 48px; flex: 0 0 48px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(75,77,59,.13); color: #8a897e; font-size: 9px; letter-spacing: .13em; }

.play-screen { width: 100%; max-width: 790px; margin: 0 auto; padding: 20px 0 16px; }
.play-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.back-button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-align: left; cursor: pointer; }
.play-heading .back-button { grid-column: 1; grid-row: 1; align-self: center; }
.play-heading .eyebrow { margin: 0 0 6px; }
.play-heading > div:nth-child(2) { grid-column: 2; grid-row: 1; padding-top: 0; }
.play-heading h1 { margin: 0; font: 400 clamp(21px, 3vw, 27px) 'DM Serif Display', Georgia, serif; }
.dot { padding: 0 4px; color: var(--rust); }
.timer-wrap { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.timer-label, .time-result span { color: #929083; font-size: 9px; letter-spacing: .17em; }
.timer-wrap output { font: 22px 'DM Serif Display', Georgia, serif; font-variant-numeric: tabular-nums; }
.play-hint { margin: 13px 0 10px; color: #737467; text-align: center; font: italic 14px 'DM Serif Display', Georgia, serif; }
.maze-paper { width: min(100%, 670px, calc(100dvh - 205px)); max-height: calc(100dvh - 220px); margin: 0 auto; padding: clamp(7px, 2vw, 14px); overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); box-shadow: 0 9px 30px rgba(78,70,50,.08); touch-action: none; }
.maze-paper svg { display: block; width: 100%; height: auto; overflow: hidden; touch-action: none; }
.wall { stroke: #384238; stroke-width: 2.5; stroke-linecap: round; }
.trail { fill: none; stroke: #c96d4b; stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; pointer-events: none; }
.player { fill: #bd6243; stroke: var(--paper); stroke-width: 3; pointer-events: none; }
.marker { font-family: 'DM Sans', Arial, sans-serif; font-weight: 700; letter-spacing: 1.2px; pointer-events: none; }
.marker-start { fill: #637d65; font-size: 9px; }
.marker-end { fill: #bd6243; font-size: 16px; }
.organic-walls .organic-boundary { stroke-width: 2.8; }
.organic-walls .organic-corridor-wall { stroke-width: 2.15; }
.organic-marker { letter-spacing: .8px; paint-order: stroke; stroke: var(--paper); stroke-width: 2px; stroke-linejoin: round; }
.qa-organic-actions { display: grid; grid-template-columns: minmax(90px, .4fr) minmax(145px, 1fr); gap: 10px; align-items: center; }
.qa-organic-actions input { width: 100%; min-height: 42px; border: 1px solid var(--theme-ink, #637d65); border-radius: 10px; padding: 8px; background: var(--paper); color: var(--theme-ink, #344a38); font: inherit; }
.qa-organic-tools[hidden] { display: none; }
.qa-organic-tools { margin: 12px 0; }
.qa-organic-tools h2 { margin: 3px 0 6px; }
.qa-organic-tools p { line-height: 1.45; }
.qa-organic-tools output { display: block; margin-top: 8px; color: var(--theme-ink, #344a38); font-size: 12px; }
.play-footer { max-width: 670px; margin: 9px auto 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: #88877d; font-size: 9px; letter-spacing: .1em; }
.game-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.small-button { min-height: 44px; padding: 8px 12px; border: 1px solid #d2cbb9; border-radius: 4px; background: transparent; color: #555b50; font-size: 11px; cursor: pointer; }
.small-button:hover { border-color: var(--green); background: rgba(255,253,245,.7); }
.qa-entry { min-height: 36px; padding: 5px 9px; font-size: 10px; }
.qa-active-mode-indicator { padding: 4px 6px; border: 1px solid var(--theme-line, #d9cfbe); border-radius: 999px; background: var(--theme-surface, #fbf7ef); color: var(--theme-ink, #3f5147); box-shadow: 0 2px 5px var(--theme-shadow, rgba(48,66,52,.09)); font-size: 8px; font-weight: 800; white-space: nowrap; }
.qa-active-input-mode { display: block; color: var(--theme-ink, #3f5147); font-size: 13px; font-weight: 800; }

.info-screen { width: min(100%, 720px); margin: 0 auto; padding: 30px 0 42px; }
.qa-config-screen { width: min(100%, 760px); min-height: 0; flex: 1 1 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 0 max(20px, env(safe-area-inset-bottom)); touch-action: pan-y; }
.qa-config-header { grid-template-columns: minmax(105px, .42fr) 1fr; gap: 10px; margin-bottom: 8px; }
.qa-config-header .back-button { min-width: 0; font-size: 11px; }
.qa-config-header h1 { font-size: clamp(25px, 5vw, 36px); }
.qa-config-notice { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--theme-accent, var(--rust)); background: color-mix(in srgb, var(--paper) 82%, transparent); color: var(--muted); font-size: 12px; line-height: 1.45; }
.view-header { display: grid; grid-template-columns: minmax(70px, .3fr) 1fr; align-items: center; gap: 14px; margin-bottom: 24px; }
.view-header .eyebrow { margin-bottom: 5px; }
.view-header h1 { margin: 0; font: 400 clamp(28px, 5vw, 42px) 'DM Serif Display', Georgia, serif; }
.difficulty-intro { max-width: 520px; margin: -8px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.category-card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.category-card { display: grid; min-width: 0; min-height: 174px; grid-template-columns: 42px minmax(0, 1fr) 18px; align-items: center; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--theme-pageInk, #3f5147) 14%, transparent), 0 12px 25px var(--theme-shadow, rgba(48,66,52,.09)); text-align: left; cursor: pointer; }
.category-card:disabled { cursor: default; opacity: .76; }
.category-card:not(:disabled):hover { border-color: var(--theme-accent, var(--green)); }
.category-card:focus-visible { outline: 3px solid var(--theme-focus, var(--green)); outline-offset: 3px; }
.category-card-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--theme-line, var(--line)); border-radius: 50%; color: var(--theme-accent, var(--rust)); font-size: 21px; }
.category-card-copy { display: grid; gap: 8px; min-width: 0; }
.category-card-copy strong { font: 400 23px/1.08 'DM Serif Display', Georgia, serif; }
.category-card-copy > span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.category-card-copy small { color: var(--theme-green, var(--green)); font-size: 10px; font-weight: 800; letter-spacing: .04em; line-height: 1.35; }
.category-card-arrow { align-self: start; color: var(--theme-accent, var(--rust)); font-size: 19px; }
.category-card-status { align-self: start; padding: 4px 5px; border: 1px dashed var(--theme-line, var(--line)); color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.shaped-action-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.shaped-action-card { min-height: 112px; }
.shape-option-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shape-option-card { display: grid; min-width: 0; min-height: 112px; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--theme-pageInk, #3f5147) 14%, transparent), 0 12px 25px var(--theme-shadow, rgba(48,66,52,.09)); text-align: left; cursor: pointer; }
.shape-option-card:focus-visible { outline: 3px solid var(--theme-focus, var(--green)); outline-offset: 3px; }
.shape-preview { display: grid; width: 60px; height: 60px; place-items: center; color: var(--theme-accent, var(--green)); }
.shape-preview svg { display: block; width: 100%; height: 100%; overflow: visible; }
.shape-option-copy { display: grid; gap: 5px; }
.shape-option-copy strong { font: 400 19px/1.1 'DM Serif Display', Georgia, serif; }
.shape-option-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.difficulty-card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.difficulty-card { display: flex; min-width: 0; min-height: 142px; flex-direction: column; align-items: stretch; gap: 8px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--theme-pageInk, #3f5147) 14%, transparent), 0 12px 25px var(--theme-shadow, rgba(48,66,52,.09)); text-align: left; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.difficulty-card:hover { transform: translateY(-2px); border-color: var(--theme-accent, var(--green)); }
.difficulty-card:active { transform: translateY(1px); }
.difficulty-card:focus-visible { outline: 3px solid var(--theme-focus, var(--green)); outline-offset: 3px; }
.difficulty-card-heading { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 9px; }
.difficulty-symbol { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--theme-line, var(--line)); border-radius: 50%; color: var(--theme-accent, var(--rust)); font-size: 18px; }
.difficulty-card-heading strong, .difficulty-card-heading small { display: block; }
.difficulty-card-heading strong { font: 400 22px/1.1 'DM Serif Display', Georgia, serif; }
.difficulty-card-heading small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.difficulty-card-arrow { color: var(--theme-accent, var(--rust)); font-size: 19px; }
.difficulty-description { flex: 1; color: var(--muted); font-size: 13px; line-height: 1.5; }
.difficulty-card-action { align-self: flex-start; padding-top: 10px; border-top: 1px solid var(--line); color: var(--theme-green, var(--green)); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.settings-panel { margin-bottom: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,253,245,.76); }
.settings-panel h2 { margin: 0 0 7px; font: 400 21px 'DM Serif Display', Georgia, serif; }
.settings-panel p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.settings-panel a { color: var(--rust); font-size: 13px; }
.settings-link { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; min-height: 48px; margin: 8px 0; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.settings-link strong { font-size: 13px; }
.settings-link span { color: var(--muted); font-size: 11px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; border-top: 1px solid var(--line); }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { font-size: 13px; }
.setting-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.setting-row input { width: 22px; height: 22px; accent-color: var(--green); }
.settings-panel > label { display: block; margin: 12px 0 6px; font-size: 12px; }
.settings-panel select { width: 100%; min-height: 44px; padding: 8px; border: 1px solid #d2cbb9; border-radius: 4px; background: var(--paper); }
.reset-settings { display: block; margin: 4px 20px; }
.help-panel ol { padding-left: 22px; color: var(--ink); font-size: 13px; line-height: 1.8; }
.about-panel p { margin: 8px 0; }
.button { min-height: 48px; padding: 13px 18px; border: 0; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; }
.button-primary { background: var(--rust); color: #fffdf7; }
.button-primary:hover { background: #a95137; }
.button-primary span { padding-left: 18px; font-size: 17px; }
#help-play { margin-top: 8px; }

.completion-panel {
  position: relative; display: flex; box-sizing: border-box; width: min(100%, 40dvh); aspect-ratio: 1;
  min-width: 0; min-height: 0; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; padding: clamp(16px, 4vw, 28px); text-align: center; animation: completion-arrive .2s ease-out both;
}
#completion-panel[hidden] { display: none; }
.completion-flower { color: var(--rust); font-size: 34px; line-height: 1; }
.completion-panel .eyebrow { margin: 2px 0 0; font-size: 9px; letter-spacing: .14em; }
.completion-panel h2 { max-width: 15ch; margin: 0; color: var(--ink); font: 400 clamp(25px, 6vw, 34px)/1.08 'DM Serif Display', Georgia, serif; }
.completion-copy { margin: 0; color: var(--muted); font: italic 14px 'DM Serif Display', Georgia, serif; }
.completion-message { display: grid; justify-items: center; gap: 8px; }
@keyframes completion-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.overlay { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); overflow-y: auto; background: rgba(37,40,33,.48); }
.dialog-card { position: relative; width: min(100%, 420px); padding: 27px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); box-shadow: 0 16px 60px rgba(25,29,21,.22); text-align: center; }
.dialog-card .eyebrow { margin-bottom: 8px; }
.dialog-card h2 { margin: 0 0 9px; font: 400 27px 'DM Serif Display', Georgia, serif; }
.dialog-card p:not(.eyebrow) { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dialog-card > button:not(.dialog-close) { width: 100%; margin-top: 7px; }
.dialog-close { position: absolute; top: 7px; right: 9px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.reset-settings { min-height: 44px; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, #maze:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

/* Gesture suppression stays on the game surfaces; the rest of the app keeps normal page and zoom gestures. */
.maze-paper,#maze { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: contain; }
body[data-screen="play"] .topbar, body[data-screen="play"] .site-footer { display: none; }
body[data-screen="qa-config"] { height: 100dvh; overflow: hidden; }
body[data-screen="qa-config"] .app-shell { height: 100dvh; min-height: 0; overflow: hidden; }
body[data-screen="qa-config"] .topbar { height: 50px; flex: 0 0 50px; }
body[data-screen="qa-config"] .site-footer { height: 30px; flex: 0 0 30px; }
@media (max-width: 760px) {
  .qa-organic-actions { grid-template-columns: minmax(86px, .35fr) minmax(132px, 1fr); }
  .app-shell { padding-right: max(14px, calc(env(safe-area-inset-right) + 14px)); padding-left: max(14px, calc(env(safe-area-inset-left) + 14px)); }
  .topbar { height: 62px; flex-basis: 62px; }
  .home-screen { grid-template-columns: 1fr; gap: 22px; padding: 28px 0; }
  .home-copy h1 { font-size: clamp(48px, 13vw, 64px); }
  .intro { margin: 13px 0 15px; }
  .hub-card { min-height: 51px; padding: 8px 10px; }
  .hub-card.primary { min-height: 60px; }
  .home-art { width: min(100%, 410px); height: 280px; min-height: 0; justify-self: center; }
  .play-screen { padding: 7px 0; }
  .play-heading .back-button { min-height: 44px; }
  .play-hint { margin: 8px 0; font-size: 13px; }
  .maze-paper { width: min(100%, calc(100dvh - 205px)); max-height: calc(100dvh - 205px); padding: 7px; }
  .play-footer { align-items: flex-start; margin-top: 8px; }
  .game-actions { gap: 5px; }
  .small-button { min-height: 44px; padding: 7px 9px; }
  .info-screen { padding: 18px 0 30px; }
  .category-card-list { gap: 10px; }
  .category-card { min-height: 154px; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 12px; }
  .category-card-icon { width: 34px; height: 34px; font-size: 18px; }
  .category-card-copy { gap: 6px; }
  .category-card-copy strong { font-size: 19px; }
  .category-card-copy > span { font-size: 12px; }
  .category-card-arrow,.category-card-status { grid-column: 2; justify-self: start; }
  .shape-option-list { gap: 9px; }
  .shape-option-card { min-height: 104px; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding: 9px; }
  .shape-preview { width: 48px; height: 48px; }
  .shape-option-copy strong { font-size: 17px; }
  .shape-option-copy small { font-size: 10px; }
  .difficulty-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .difficulty-card { min-height: 132px; gap: 7px; padding: 11px 10px; }
  .difficulty-card-heading { grid-template-columns: 30px minmax(0, 1fr); gap: 7px; }
  .difficulty-symbol { width: 30px; height: 30px; font-size: 16px; }
  .difficulty-card-heading strong { font-size: 20px; }
  .difficulty-card-heading small { font-size: 10px; }
  .difficulty-description { font-size: 11px; line-height: 1.35; }
}
@media (max-width: 420px) {
  .view-header { grid-template-columns: minmax(88px, .4fr) minmax(0, 1fr); gap: 8px; }
  .view-header .back-button { white-space: nowrap; font-size: 11px; }
  .title-branding { gap: 5px; }
  .qa-emblem-trigger { width: 38px; height: 38px; }
  .app-shell { padding-right: max(12px, calc(env(safe-area-inset-right) + 12px)); padding-left: max(12px, calc(env(safe-area-inset-left) + 12px)); }
  .tagline { font-size: 13px; }
  .hub-primary-grid { gap: 7px; }
  .hub-secondary-grid { gap: 6px; }
  .hub-card strong { font-size: 12px; }
  .hub-card span { font-size: 9px; }
  .play-heading h1 { font-size: 20px; }
  .timer-wrap output { font-size: 19px; }
  .play-footer { flex-direction: column; align-items: stretch; }
  .game-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-actions .small-button { padding: 6px 3px; font-size: 10px; }
  .maze-paper { width: min(100%, calc(100dvh - 205px)); }
  .completion-panel { width: min(100%, 40dvh); }
  .settings-panel { padding: 15px; }
  .qa-config-screen { padding-top: 12px; }
  .qa-config-header { grid-template-columns: minmax(88px, .36fr) 1fr; }
  .qa-config-header .back-button { font-size: 10px; }
}

/* Full maze above a dedicated, input-only steering field. */
body[data-screen="play"] { height: 100dvh; min-height: 0; overflow: hidden; }
body[data-screen="play"] .app-shell { height: 100dvh; min-height: 0; overflow: hidden; }
/* The app shell already reserves safe areas; avoid subtracting the bottom inset a second time here. */
body[data-screen="play"] .play-screen {
  display: flex; width: min(100%, 790px); min-height: 0; flex: 1 1 0; flex-direction: column;
  gap: 0; overflow: hidden; padding: 4px 0 4px;
}
body[data-screen="play"] .play-heading {
  display: flex; min-height: 48px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 10px;
}
body[data-screen="play"] .play-title-block { min-width: 0; }
body[data-screen="play"] .play-title-block .eyebrow { margin: 0 0 2px; font-size: 9px; }
body[data-screen="play"] .play-title-block h1 { overflow: hidden; font-size: clamp(17px, 4vw, 23px); line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.play-header-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
body[data-screen="play"] .timer-wrap { padding: 4px 9px; }
body[data-screen="play"] .timer-wrap output { font-size: 18px; }
.pause-tool { width: 44px; height: 44px; padding: 0; font-size: 17px; }
body[data-screen="play"] .play-hint { margin: 2px 0 5px; flex: 0 0 auto; font-size: 11px; line-height: 1.2; }
body[data-screen="play"] .play-hint { display: grid; place-items: center; text-wrap: pretty; }
.maze-workspace { --game-control-height: clamp(170px, 22dvh, 188px); display: grid; min-height: 0; flex: 1 1 auto; grid-template-rows: minmax(0, 1fr) var(--game-control-height); justify-items: center; align-content: stretch; gap: 8px; }
.maze-display-panel { position: relative; box-sizing: border-box; display: grid; width: min(100%, 60dvh, 620px); max-height: 100%; min-width: 0; min-height: 0; align-self: center; aspect-ratio: 1; padding: 7px; place-items: center; }
.maze-display-panel svg { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; }
/* The control row retains its compact allocation; the taller touch surface grows upward into the measured blank space below the width-limited maze. */
.steering-pad { position: relative; isolation: isolate; box-sizing: border-box; width: min(100%, 560px); min-height: 0; height: clamp(204px, 30dvh, 280px); align-self: end; margin: 0 auto; overflow: hidden; border: 1px solid color-mix(in srgb, var(--theme-line, var(--line)) 82%, transparent); border-radius: 24px; background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--theme-surface, var(--paper)) 94%, transparent) 0 28%, transparent 70%), linear-gradient(145deg, color-mix(in srgb, var(--theme-surface, var(--paper)) 73%, transparent), color-mix(in srgb, var(--theme-green, #64765f) 11%, transparent)); box-shadow: inset 0 1px rgba(255,255,255,.48), inset 0 -8px 20px color-mix(in srgb, var(--theme-pageInk, #334b3c) 5%, transparent), 0 5px 16px var(--theme-shadow, rgba(48,66,52,.12)); color: var(--theme-ink, var(--ink)); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: contain; }
.steering-pad::before { position: absolute; z-index: -1; inset: 8px; border: 1px dashed color-mix(in srgb, var(--theme-line, var(--line)) 70%, transparent); border-radius: 18px; content: ""; pointer-events: none; }
.steering-pad-label { position: absolute; top: 12px; left: 16px; color: var(--theme-muted, var(--muted)); font-size: 8px; font-weight: 800; letter-spacing: .16em; pointer-events: none; }
.steering-pad-mark { position: absolute; top: 50%; left: 50%; display: grid; width: 58px; aspect-ratio: 1; place-items: center; border: 1px solid color-mix(in srgb, var(--theme-accent, var(--rust)) 30%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--theme-surface, var(--paper)) 38%, transparent); transform: translate(-50%,-50%); pointer-events: none; }
.steering-pad-mark::before, .steering-pad-mark::after { position: absolute; background: color-mix(in srgb, var(--theme-accent, var(--rust)) 28%, transparent); content: ""; }
.steering-pad-mark::before { width: 1px; height: 72px; }
.steering-pad-mark::after { width: 72px; height: 1px; }
.steering-pad-mark span { z-index: 1; width: 8px; aspect-ratio: 1; border: 1px solid var(--theme-accent, var(--rust)); border-radius: 50%; background: var(--theme-surface, var(--paper)); }
.steering-pad-instruction { position: absolute; bottom: 11px; left: 50%; color: var(--theme-muted, var(--muted)); font: 600 8px/1 sans-serif; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; transform: translateX(-50%); pointer-events: none; }
.steering-indicator { position: absolute; z-index: 2; inset: 0; overflow: hidden; pointer-events: none; color: var(--theme-accent, var(--rust)); }
.steering-indicator[hidden] { display: none; }
.steering-indicator > span { position: absolute; display: block; border-radius: 50%; }
.steering-origin { left: var(--origin-x); top: var(--origin-y); width: 26px; height: 26px; border: 1.5px solid currentColor; background: color-mix(in srgb, var(--theme-surface, var(--paper)) 68%, transparent); transform: translate(-50%,-50%); box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 12%, transparent), 0 1px 5px #35261930; }
.steering-vector { left: var(--origin-x); top: var(--origin-y); width: var(--vector-length); height: 2px; border-radius: 2px !important; background: currentColor; transform: rotate(var(--vector-angle)); transform-origin: 0 50%; opacity: .72; }
.steering-finger { left: var(--finger-x); top: var(--finger-y); width: 12px; height: 12px; border: 2px solid currentColor; background: var(--theme-surface, var(--paper)); transform: translate(-50%,-50%); box-shadow: 0 1px 4px #35261930; }
.maze-panel-label { position: absolute; z-index: 1; top: 5px; left: 8px; padding: 2px 5px; border-radius: 3px; background: color-mix(in srgb, var(--paper) 88%, transparent); color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; line-height: 1.1; pointer-events: none; }
.game-actions { display: grid; width: min(100%, 390px); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
body[data-screen="play"] .play-footer { width: 100%; max-width: none; flex: 0 0 auto; justify-content: center; margin: 5px auto 0; }
body[data-screen="play"] .game-actions .small-button { min-width: 44px; min-height: 44px; padding: 5px 8px; font-size: 11px; }
.completion-panel { grid-row: 2; width: min(100%, 560px); min-height: 0; }
body[data-completed="true"] .completion-panel { display: flex; }
@media (max-width: 420px) {
  body[data-screen="play"] .app-shell { padding-right: max(10px, calc(env(safe-area-inset-right) + 10px)); padding-left: max(10px, calc(env(safe-area-inset-left) + 10px)); }
  body[data-screen="play"] .play-title-block h1 { font-size: 18px; }
  .maze-display-panel { width: min(100%, 60dvh); }
  .steering-pad { width: 100%; }
}
@media (orientation: portrait) {
  .completion-panel { height: min(100%, 128px); align-self: center; aspect-ratio: auto; flex-direction: row; justify-content: center; gap: 12px; padding: 8px 14px; }
  .completion-flower { flex: 0 0 auto; font-size: 27px; }
  .completion-message { min-width: 0; gap: 2px; }
  .completion-panel .eyebrow { margin: 0; font-size: 8px; }
  .completion-panel h2 { max-width: none; font-size: clamp(18px, 5vw, 24px); line-height: 1.05; }
  .completion-copy { font-size: 11px; line-height: 1.15; }
}
@media (orientation: landscape) and (max-height: 520px) {
  body[data-screen="play"] .play-screen { width: 100%; padding-top: 2px; }
  body[data-screen="play"] .play-hint { margin: 1px 0 3px; }
  .maze-workspace { grid-template-columns: minmax(0, 1fr) minmax(170px, 30vw); grid-template-rows: minmax(0, 1fr); gap: 12px; }
  .maze-display-panel { grid-column: 1; grid-row: 1; width: auto; height: min(100%, 80dvh); justify-self: center; }
  .steering-pad { grid-column: 2; grid-row: 1; width: 100%; height: min(100%, 190px); align-self: center; }
  .completion-panel { grid-column: 2; grid-row: 1; width: 100%; height: auto; min-height: 112px; aspect-ratio: 1; align-self: center; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .play-screen { max-width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 170px; grid-template-rows: auto auto 1fr; column-gap: 12px; align-items: center; padding-top: 6px; }
  .play-heading { position: relative; z-index: 1; }
  .play-heading, .play-hint { grid-column: 1 / -1; }
  .play-hint { margin: 4px 0; }
  .completion-panel { grid-column: 2; grid-row: 1; justify-self: stretch; width: 100%; height: auto; min-height: 0; aspect-ratio: 1; max-height: 100%; margin: 0; }
  .play-footer { position: static; grid-column: 2; grid-row: 3; width: 100%; margin: 0; transform: none; flex-direction: column; }
  .game-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* Title screen: one-screen composition with the selected illustrated journal scene. */
body[data-screen="home"] { height: 100dvh; overflow: hidden; }
body[data-screen="home"] .app-shell { height: 100dvh; min-height: 0; }
body[data-screen="home"] .topbar { height: 54px; flex-basis: 54px; }
body[data-screen="home"] .site-footer { height: 30px; flex-basis: 30px; }
.home-screen { min-height: 0; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) minmax(300px, .92fr); gap: clamp(24px, 5vw, 64px); padding: clamp(18px, 4vh, 40px) 0; overflow-y: auto; overscroll-behavior: contain; }
.home-copy { width: 100%; max-width: 520px; justify-self: end; }
.title-kicker { margin-bottom: 12px; }
.title-kicker span { padding: 0 4px; color: var(--rust); }
.home-copy h1 { font-size: clamp(50px, 6vw, 78px); line-height: .92; }
.intro { margin: 14px 0 18px; font-size: 14px; }
.hub-menu { max-width: 500px; display: grid; gap: 9px; }
.hub-primary-grid { display: contents; }
.hub-card { position: relative; min-height: 50px; padding: 9px 14px; border-radius: 9px; box-shadow: 0 2px 0 rgba(84,72,45,.12), 0 5px 14px rgba(78,70,50,.07); text-decoration: none; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease; }
.hub-card strong { font-size: 13px; }
.hub-card span { font-size: 10px; }
.hub-card.primary { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-items: center; min-height: 70px; padding: 10px 16px; border: 1px solid #a84f35; border-radius: 10px; background: linear-gradient(180deg, #c97352, #b95d40); box-shadow: 0 3px 0 #964832, 0 8px 18px rgba(125,66,43,.2); color: #fffdf7; text-align: left; }
.hub-card.primary .menu-icon { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.46); border-radius: 50%; font-size: 17px; }
.hub-card.primary strong { font-size: 16px; }
.hub-card.primary span { margin-top: 2px; color: rgba(255,253,247,.85); }
.hub-card.primary span b { float: right; padding-right: 2px; font-size: 15px; font-weight: 400; }
.hub-card.adventure { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-items: center; min-height: 58px; padding: 8px 16px; border: 1px solid #c9c6ad; border-radius: 10px; background: linear-gradient(180deg, #f8f4e8, #ebe6d6); color: #626556; text-align: left; }
.hub-card.adventure .menu-icon { grid-row: 1 / 3; color: var(--green); font-size: 21px; }
.hub-card.adventure span { color: #77786d; }
.hub-card:disabled { cursor: not-allowed; opacity: .78; }
.hub-card:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 4px 0 rgba(84,72,45,.13), 0 9px 18px rgba(78,70,50,.11); }
.hub-card:not(:disabled):active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(84,72,45,.12); }
.hub-secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 1px; }
.hub-card.secondary { min-height: 48px; border-color: #ded6c3; background: rgba(255,253,245,.85); }
.home-art.title-art { height: 100%; min-height: 330px; border: 1px solid rgba(139,120,79,.14); border-radius: 18px; background: linear-gradient(145deg, #eee7d4, #e3d9c0); box-shadow: 0 12px 34px rgba(78,70,50,.1), inset 0 1px rgba(255,255,255,.5); }
.home-art.title-art::after { inset: 13px; border-radius: 12px; }
.home-art.title-art .art-caption { bottom: 7%; }
.home-contact { display: block; color: inherit; }
.home-contact:hover strong { color: var(--rust); }
.trace-diagnostics { margin: 4px auto 12px; width: 100%; padding: 8px 10px; border: 1px dashed #a34d36; background: #fff7e9; color: #533c31; font: 10px/1.45 ui-monospace, monospace; overflow-wrap: anywhere; }
body[data-qa="true"] #qa-config .trace-diagnostics:not([hidden]) { display: block; }
body[data-qa="true"] #qa-config .trace-diagnostic-tools:not([hidden]) { display: grid; gap: 12px; width: 100%; margin: 8px auto; padding: clamp(12px, 3vw, 20px); border: 1px dashed #a34d36; border-radius: 10px; background: var(--paper); box-shadow: 0 5px 20px var(--theme-shadow, rgba(48,66,52,.09)); }
.diagnostic-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 8px; min-width: 0; }
.trace-diagnostic-tools,.trace-diagnostic-tools > * { min-width: 0; }
#trace-diagnostic-status { color: #533c31; font-size: 12px; }
#qa-retention-status,.qa-privacy-note { color: #533c31; font-size: 11px; margin: 2px 0; }
.qa-session-picker { font-size: 11px; color: #533c31; }
#qa-session-history { max-width: 100%; padding: 6px; border: 1px solid #b8aa96; border-radius: 6px; color: #3f5147; background: #fbf7ef; }
#trace-diagnostic-fallback { box-sizing: border-box; width: 100%; min-height: 120px; padding: 8px; font: 11px/1.4 ui-monospace, monospace; }
button:focus-visible, a:focus-visible { outline-offset: 4px; }
@media (max-width: 760px) {
  body[data-screen="home"] .topbar { height: 48px; flex-basis: 48px; }
  body[data-screen="home"] .site-footer { height: 27px; flex-basis: 27px; }
  .home-screen { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 9px; padding: 12px 0 10px; }
  .home-copy { max-width: none; justify-self: auto; }
  .title-kicker { margin-bottom: 7px; font-size: 9px; }
  .title-branding { gap: 6px; }
  .qa-emblem-trigger { width: 40px; height: 40px; }
  .home-copy h1 { font-size: clamp(38px, 10vw, 58px); line-height: .9; }
  .intro { margin: 9px 0 11px; font-size: 12px; line-height: 1.4; }
  .hub-menu { max-width: none; gap: 7px; }
  .hub-card.primary { min-height: 58px; }
  .hub-card.adventure { min-height: 49px; }
  .hub-secondary-grid { gap: 6px; }
  .hub-card.secondary { min-height: 44px; padding: 6px 10px; }
  .hub-card.secondary span { margin-top: 1px; }
  .home-art.title-art { flex: 1 1 100px; width: 100%; min-height: 96px; max-height: clamp(155px, 24dvh, 220px); border-radius: 13px; }
  .home-art.title-art::after { inset: 7px; border-radius: 8px; }
  .home-art.title-art .art-caption { bottom: 8px; font-size: 7px; }
}
@media (max-width: 420px) {
  .qa-emblem-trigger { width: 36px; height: 36px; }
  body[data-screen="home"] .app-shell { padding-right: max(12px, calc(env(safe-area-inset-right) + 12px)); padding-left: max(12px, calc(env(safe-area-inset-left) + 12px)); }
  .tagline { font-size: 12px; }
  .hub-card strong { font-size: 12px; }
  .hub-card span { font-size: 9px; }
}
@media (max-height: 700px) and (max-width: 760px) {
  .home-screen { gap: 5px; padding-top: 7px; padding-bottom: 5px; }
  .home-copy h1 { font-size: clamp(34px, 8.4vw, 46px); }
  .intro { margin: 6px 0 7px; }
  .hub-menu { gap: 5px; }
  .hub-card.primary { min-height: 52px; }
  .hub-card.adventure { min-height: 44px; }
  .hub-card.secondary { min-height: 44px; }
  .home-art.title-art { min-height: 76px; max-height: 100px; }
}
@media (max-height: 570px) {
  body[data-screen="home"] { height: auto; min-height: 100dvh; overflow-y: auto; }
  body[data-screen="home"] .app-shell { height: auto; min-height: 100dvh; }
  body[data-screen="home"] .home-screen { overflow-y: visible; }
}
@media (orientation: landscape) and (max-height: 570px) {
  body[data-screen="home"] { height: 100dvh; overflow: hidden; }
  body[data-screen="home"] .app-shell { height: 100dvh; min-height: 0; }
  body[data-screen="home"] .topbar { height: 40px; flex-basis: 40px; }
  body[data-screen="home"] .site-footer { height: 24px; flex-basis: 24px; }
  .home-screen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .88fr); align-items: center; gap: 16px; padding: 6px 0; }
  body[data-screen="home"] .home-screen { overflow-y: auto; }
  .home-copy { max-width: none; }
  .title-kicker { margin-bottom: 5px; font-size: 8px; }
  .home-copy h1 { font-size: clamp(31px, 8vh, 46px); line-height: .88; }
  .intro { margin: 6px 0 8px; font-size: 10px; line-height: 1.3; }
  .hub-menu { gap: 4px; }
  .hub-card.primary { min-height: 46px; padding: 5px 10px; grid-template-columns: 30px 1fr; }
  .hub-card.primary .menu-icon { width: 23px; height: 23px; font-size: 13px; }
  .hub-card.primary strong { font-size: 12px; }
  .hub-card.primary span { font-size: 8px; }
  .hub-card.adventure { min-height: 44px; padding: 4px 10px; grid-template-columns: 30px 1fr; }
  .hub-card.adventure .menu-icon { font-size: 17px; }
  .hub-card.adventure strong { font-size: 11px; }
  .hub-card.adventure span { font-size: 8px; }
  .hub-secondary-grid { gap: 4px; }
  .hub-card.secondary { min-height: 44px; padding: 4px 8px; }
  .hub-card.secondary strong { font-size: 10px; }
  .hub-card.secondary span { font-size: 8px; }
  .home-art.title-art { width: 100%; height: 100%; min-height: 0; max-height: 100%; border-radius: 12px; }
  .home-art.title-art .art-caption { font-size: 7px; bottom: 5%; }
}
@media (prefers-reduced-motion: reduce) { .hub-card { transition: none; } }

/* Garden journal palette and layered paper surfaces. */
:root {
  color: #33443a;
  background: #f2ebdc;
  --ink: #33443a;
  --muted: #66756b;
  --rust: #bd6145;
  --green: #42624e;
  --paper: #fbf7ef;
  --line: #d9cfbe;
}
body {
  background:
    radial-gradient(ellipse at 12% 4%, rgba(111,138,109,.22), transparent 34%),
    radial-gradient(ellipse at 92% 86%, rgba(200,111,74,.09), transparent 31%),
    #e6ebe2;
}
body[data-paper-theme="light"] {
  --paper: #fffefa;
  --line: #d9dfd5;
  background:
    radial-gradient(ellipse at 12% 4%, rgba(111,138,109,.15), transparent 34%),
    radial-gradient(ellipse at 92% 86%, rgba(200,111,74,.08), transparent 31%),
    #e4eae2;
}
.topbar { border-bottom-color: rgba(63,81,71,.18); }
.app-update-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 10px 13px; border: 1px solid #c8d0c2; border-radius: 10px; background: #edf1e8; color: #334b3c; font-size: .88rem; }
.app-update-notice[hidden] { display: none; }
.app-update-notice button { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 8px 12px; background: #42624e; color: #fffefa; font: inherit; font-weight: 700; }
.app-update-notice button:focus-visible { outline: 3px solid #c86f4a; outline-offset: 2px; }
.mark { background: #42624e; }
.eyebrow { color: #42624e; }
.home-art.title-art {
  border-color: rgba(63,81,71,.2);
  background:
    radial-gradient(circle at 72% 25%, rgba(244,194,123,.28), transparent 16%),
    linear-gradient(145deg, #d6e2d5, #e7dfce 76%);
  box-shadow: 0 18px 42px rgba(47,68,54,.12), inset 0 1px rgba(255,255,255,.72);
}
.home-art.title-art::after { border-color: rgba(63,81,71,.24); }
.art-caption { color: #536d59; }
.hub-card { border-color: #c8d0c2; background: rgba(251,247,239,.92); box-shadow: 0 2px 0 rgba(63,81,71,.07); }
.hub-card.primary {
  border-color: #994a36;
  background: linear-gradient(155deg, #cb7655, #b95b40);
  box-shadow: 0 3px 0 #984a35, 0 10px 22px rgba(111,66,48,.18);
}
.hub-card.adventure { border-color: #aab9a7; background: linear-gradient(155deg, #edf1e8, #dfe8dc); }
.hub-card.secondary { border-color: #cbd4c7; background: rgba(251,247,239,.94); }
.hub-card:not(:disabled):hover { border-color: #42624e; }
.hub-card:focus-visible, .small-button:focus-visible, .button:focus-visible {
  outline: 3px solid #42624e;
  outline-offset: 3px;
}
.play-heading h1 { color: #334b3c; }
.play-heading .eyebrow { color: #6f8a6d; }
.timer-wrap { padding: 6px 12px; border: 1px solid #cbd5c9; border-radius: 999px; background: rgba(251,247,239,.9); }
.timer-label, .time-result span { color: #52675a; }
.timer-wrap output { color: #334b3c; }
.play-hint { color: #536d59; }
.maze-paper {
  border-color: #c8d0c2;
  border-radius: 14px;
  background-color: #fbf7ef;
  background-image: repeating-linear-gradient(0deg, rgba(92,112,84,.018) 0, rgba(92,112,84,.018) 1px, transparent 1px, transparent 5px);
  box-shadow: 0 16px 38px rgba(48,66,52,.14), 0 2px 5px rgba(48,66,52,.07), inset 0 1px rgba(255,255,255,.9);
}
.wall { stroke: #3f5147; stroke-width: 2.7; }
.trail { stroke: #c86f4a; stroke-width: 4.5; opacity: .96; }
.player { fill: #c86f4a; }
.marker-start { fill: #42624e; }
.marker-end { fill: #bd6145; }
.play-footer { color: #52675a; }
.small-button { border-color: #c8d0c2; background: rgba(251,247,239,.68); color: #3f5147; }
.small-button:hover { border-color: #42624e; background: #edf1e8; }
.settings-panel, .completion-panel, .dialog-card {
  border-color: #d9cfbe;
  border-radius: 12px;
  background: #fbf7ef;
  box-shadow: 0 12px 30px rgba(48,66,52,.09);
}
.site-footer { border-top-color: rgba(63,81,71,.18); color: #66756b; }
@media (max-width: 420px) {
  .maze-paper { border-radius: 11px; }
  .timer-wrap { padding: 5px 9px; }
  .difficulty-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .difficulty-card { min-height: 136px; padding: 10px 9px; gap: 7px; }
  .difficulty-card-heading { grid-template-columns: 28px minmax(0, 1fr); gap: 6px; }
  .difficulty-symbol { width: 28px; height: 28px; font-size: 15px; }
  .difficulty-card-heading strong { font-size: 18px; }
  .difficulty-card-heading small { font-size: 10px; }
  .difficulty-description { font-size: 11px; line-height: 1.32; }
}

/* Curated storybook covers share the same screens and gameplay surfaces. */
body[data-visual-theme] {
  color: var(--theme-pageInk);
  background: var(--theme-background);
  --ink: var(--theme-ink);
  --muted: var(--theme-muted);
  --rust: var(--theme-accent);
  --green: var(--theme-green);
  --paper: var(--theme-surface);
  --line: var(--theme-line);
}
body[data-paper-theme="light"][data-visual-theme] { --paper: #fffefa; }
body[data-visual-theme] .topbar,
body[data-visual-theme] .site-footer { border-color: color-mix(in srgb, var(--theme-pageInk) 28%, transparent); }
body[data-visual-theme] .wordmark,
body[data-visual-theme] .tagline,
body[data-visual-theme] .site-footer { color: var(--theme-pageInk); }
body[data-visual-theme] .mark { background: var(--theme-accent); color: var(--theme-accentText); box-shadow: 0 2px 7px var(--theme-shadow); }
body[data-visual-theme] .eyebrow,
body[data-visual-theme] .intro,
body[data-visual-theme] .difficulty-intro,
body[data-visual-theme] .back-button,
body[data-visual-theme] .play-hint,
body[data-visual-theme] .play-footer,
body[data-visual-theme] .timer-label,
body[data-visual-theme] .timer-wrap output { color: var(--theme-pageInk); }
body[data-visual-theme] .home-art.title-art {
  border-color: color-mix(in srgb, var(--theme-pageInk) 28%, transparent);
  background: color-mix(in srgb, var(--theme-pageInk) 9%, transparent);
  box-shadow: 0 18px 42px var(--theme-shadow), inset 0 1px rgba(255,255,255,.24);
  color: var(--theme-pageInk);
}
body[data-visual-theme] .home-art.title-art::after { border-color: color-mix(in srgb, var(--theme-pageInk) 32%, transparent); }
.theme-artwork { position: relative; z-index: 0; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(30,35,30,.13)); }
.art-caption { z-index: 2; width: max-content; max-width: calc(100% - 24px); left: 50%; transform: translateX(-50%); padding: 4px 9px; border: 1px solid color-mix(in srgb, var(--theme-line) 80%, transparent); background: var(--theme-surface); color: var(--theme-ink); font-size: 8px; letter-spacing: .14em; box-shadow: 0 2px 4px var(--theme-shadow); }
body[data-theme-icon="compass"] .menu-icon { color: var(--theme-accent); }
body[data-theme-icon="lantern"] .menu-icon { color: var(--theme-accent); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--theme-accent) 42%, transparent)); }
body[data-visual-theme] .hub-card { border-color: var(--theme-line); background: var(--theme-surface); color: var(--theme-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--theme-pageInk) 13%, transparent), 0 7px 17px var(--theme-shadow); }
body[data-visual-theme] .hub-card span { color: var(--theme-muted); }
body[data-visual-theme] .hub-card.primary {
  border-color: var(--theme-accent-hover);
  background: linear-gradient(150deg, var(--theme-accent), var(--theme-accent-hover));
  color: var(--theme-accentText);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--theme-accent-hover) 83%, #17130e), 0 9px 20px var(--theme-shadow);
}
body[data-visual-theme] .hub-card.primary span { color: color-mix(in srgb, var(--theme-accentText) 82%, transparent); }
body[data-visual-theme] .hub-card.adventure { background: var(--theme-adventure); color: var(--theme-ink); }
body[data-visual-theme] .hub-card.adventure span { color: var(--theme-muted); }
body[data-visual-theme] .hub-card:not(:disabled):hover { border-color: var(--theme-accent); }
body[data-visual-theme] button:focus-visible,
body[data-visual-theme] a:focus-visible,
body[data-visual-theme] select:focus-visible,
body[data-visual-theme] input:focus-visible { outline-color: var(--theme-focus); }
body[data-visual-theme] .play-heading h1 { color: var(--theme-pageInk); }
body[data-visual-theme] .view-header h1 { color: var(--theme-pageInk); }
body[data-visual-theme] .timer-wrap { border-color: color-mix(in srgb, var(--theme-pageInk) 33%, transparent); background: color-mix(in srgb, var(--theme-surface) 14%, transparent); }
body[data-visual-theme] .maze-paper { border-color: var(--theme-line); background-color: var(--paper); box-shadow: 0 16px 38px var(--theme-shadow), 0 2px 5px var(--theme-shadow), inset 0 1px rgba(255,255,255,.76); }
body[data-visual-theme] .wall { stroke: var(--theme-ink); }
body[data-visual-theme] .trail { stroke: var(--theme-accent); }
body[data-visual-theme] .player { fill: var(--theme-accent); }
body[data-visual-theme] .marker-start { fill: var(--theme-green); }
body[data-visual-theme] .marker-end { fill: var(--theme-accent); }
body[data-visual-theme] .small-button { border-color: color-mix(in srgb, var(--theme-pageInk) 33%, transparent); background: color-mix(in srgb, var(--theme-surface) 13%, transparent); color: var(--theme-pageInk); }
body[data-visual-theme] .small-button:hover { border-color: var(--theme-focus); background: color-mix(in srgb, var(--theme-surface) 24%, transparent); }
body[data-visual-theme] .dialog-card .small-button { border-color: var(--theme-line); background: var(--paper); color: var(--theme-ink); }
body[data-visual-theme] .dialog-card .text-button { color: var(--theme-accent); }
body[data-visual-theme] .settings-panel,
body[data-visual-theme] .completion-panel,
body[data-visual-theme] .dialog-card { border-color: var(--theme-line); background: var(--paper); color: var(--theme-ink); box-shadow: 0 12px 30px var(--theme-shadow); }
body[data-visual-theme] .settings-panel h2,
body[data-visual-theme] .dialog-card h2 { color: var(--theme-ink); }
body[data-visual-theme] .settings-panel > label { color: var(--theme-ink); }
body[data-visual-theme] .settings-panel select { border-color: var(--theme-line); background: var(--paper); color: var(--theme-ink); }
body[data-visual-theme] .button-primary { background: linear-gradient(150deg, var(--theme-accent), var(--theme-accent-hover)); color: var(--theme-accentText); }
body[data-visual-theme] .button-primary:hover { background: var(--theme-accent-hover); }
body[data-visual-theme] .text-button { color: var(--theme-accent); }
body[data-visual-theme="traveler-map"] .theme-artwork { filter: drop-shadow(0 9px 9px rgba(68,54,27,.2)); }
body[data-visual-theme="camp-dusk"] .theme-artwork { filter: drop-shadow(0 12px 13px rgba(4,12,20,.28)); }

/* Traveler's Map: a cartographer's table, folded survey sheet, and forest-ink controls. */
body[data-visual-theme="traveler-map"] .topbar { border-bottom: 1px dashed #977848; }
body[data-visual-theme="traveler-map"] .site-footer { border-top: 1px dashed #977848; }
body[data-screen="home"][data-visual-theme="traveler-map"] .home-copy {
  position: relative; padding: 12px; border: 1px solid #aa8954; border-radius: 3px 12px 3px 3px;
  background: repeating-linear-gradient(0deg,transparent 0 23px,#72805d10 24px,#72805d10 25px,transparent 26px),linear-gradient(135deg,#fbf1d8,#ead9b1);
  box-shadow: inset 0 0 0 3px #f7e9c9, inset 0 0 0 4px #c8ad73, 0 4px 0 #715232, 0 11px 24px #46351e40;
}
body[data-visual-theme="traveler-map"] .home-art.title-art {
  height: min(460px, 42vw); min-height: 330px; padding: 8px; overflow: visible; border: 4px solid #72532f; border-radius: 3px;
  background: repeating-linear-gradient(3deg,#805d37 0 3px,#9d7848 4px 8px,#765431 9px 11px);
  box-shadow: inset 0 0 0 2px #d3b66e, 0 4px 0 #51381f, 0 14px 26px #39271052;
}
body[data-visual-theme="traveler-map"] .home-art.title-art::after { inset: 4px; border: 1px dashed #f6e4b6; border-radius: 0; }
body[data-visual-theme="traveler-map"] .home-art .art-caption { bottom: 7px; border-color: #997443; background: #f5e6c0; color: #4a5339; }
body[data-visual-theme="traveler-map"] .hub-card { border-radius: 3px 9px 3px 3px; border-color: #b49358; background: repeating-linear-gradient(0deg,#fff9e7 0 3px,#f8edcf 4px 6px); box-shadow: inset 0 0 0 2px #fff9e8, 0 3px 0 #8a6b3b, 0 6px 12px #54422228; }
body[data-visual-theme="traveler-map"] .hub-card.primary { border-color: #304b36; background: linear-gradient(150deg,#526d50,#304c39); box-shadow: inset 0 0 0 2px #718567, 0 3px 0 #203729, 0 8px 16px #34281842; }
body[data-visual-theme="traveler-map"] .hub-card.primary .menu-icon { border: 1px solid #d9c17d; border-radius: 50%; background: radial-gradient(circle,#d8bd78 0 2px,#304b36 3px); color: #fff1c9; }
body[data-visual-theme="traveler-map"] .hub-card.adventure { border-style: dashed; background: linear-gradient(112deg,#e5d7b1,#f7eccf); color: #45533e; }
body[data-visual-theme="traveler-map"] .hub-card.secondary { border-color: #c2a66e; background: linear-gradient(135deg,#fff5db,#ead7ac); }
body[data-visual-theme="traveler-map"] .difficulty-card { border: 1px solid #a98549; border-radius: 3px 14px 3px 3px; background: repeating-linear-gradient(0deg,transparent 0 25px,#64744e12 26px,#64744e12 27px,transparent 28px),linear-gradient(135deg,#fff5dc,#eadab5); box-shadow: inset 0 0 0 3px #fff8e7, inset 0 0 0 4px #cfb77d, 0 4px 0 #715232, 0 12px 24px #46351e38; }
body[data-visual-theme="traveler-map"] .difficulty-card-heading strong { color: #344632; }
body[data-visual-theme="traveler-map"] .difficulty-card-action { border-color: #c8b27b; color: #496344; }
body[data-visual-theme="traveler-map"] :is(.settings-panel,.completion-panel,.dialog-card) { border-radius: 3px 14px 3px 3px; background: repeating-linear-gradient(0deg,transparent 0 24px,#71805d0a 25px,#71805d0a 26px,transparent 27px),linear-gradient(135deg,#fbf1d8,#f0e2bf); box-shadow: inset 0 0 0 3px #fbf1d8, inset 0 0 0 4px #c5a86c, 0 4px 0 #745537, 0 12px 28px #36291738; }
body[data-visual-theme="traveler-map"] :is(.small-button,.settings-panel select) { border-radius: 2px; border-color: #aa8954; background: linear-gradient(#fff8e5,#ecddb9); color: #354a38; box-shadow: inset 0 1px #fffdf4, 0 2px 0 #a58a5e; }
body[data-visual-theme="traveler-map"] .button-primary { border: 1px solid #c6a560; border-radius: 3px; background: linear-gradient(#587452,#304c39); box-shadow: inset 0 0 0 2px #76906a, 0 4px 0 #203729, 0 8px 15px #3e302044; }
body[data-visual-theme="traveler-map"] .maze-paper { border: 5px solid #8a683c; border-radius: 3px; box-shadow: inset 0 0 0 2px #d9bd7a, 0 4px 0 #5b4328, 0 15px 30px #37271552; }
body[data-visual-theme="traveler-map"] .steering-pad { border: 2px solid #8a683c; border-radius: 4px 18px 4px 4px; background: radial-gradient(ellipse at 50% 48%, #fff5d8 0 27%, #f1e3c1 65%, #e4d2aa); box-shadow: inset 0 0 0 3px #f6ebcb, inset 0 0 0 4px #c8ad73, 0 4px 0 #715232, 0 11px 22px #46351e35; }
body[data-visual-theme="traveler-map"] .steering-pad::before { border-color: #92754988; border-radius: 2px 14px 2px 2px; }
body[data-visual-theme="traveler-map"] .steering-pad-mark { border-color: #99744388; background: #f7e9c980; }
body[data-visual-theme="traveler-map"] .steering-pad-instruction { color: #526348; }

/* Camp at Dusk: pine-shadowed sky, stitched canvas patches, and a lantern-lit trail marker. */
body[data-visual-theme="camp-dusk"] .topbar { border-bottom: 1px solid #d6ad6b77; }
body[data-visual-theme="camp-dusk"] .site-footer { border-top: 1px solid #d6ad6b77; color: #f2dfb8; }
body[data-screen="home"][data-visual-theme="camp-dusk"] .home-copy { position: relative; padding: 0; }
body[data-visual-theme="camp-dusk"] .home-art.title-art {
  height: min(460px, 42vw); min-height: 330px; padding: 7px; overflow: visible; border: 5px solid #60472f; border-radius: 9px;
  background: repeating-linear-gradient(0deg,#a78253 0 2px,#b99768 3px 5px),linear-gradient(145deg,#b8915f,#77583b);
  box-shadow: inset 0 0 0 2px #e3cb96, inset 0 0 0 4px #70563c, 0 4px 0 #392b20, 0 13px 26px #020b145c;
}
body[data-visual-theme="camp-dusk"] .home-art.title-art::after { inset: 4px; border: 1px dashed #f5e2b9; border-radius: 5px; }
body[data-visual-theme="camp-dusk"] .home-art .art-caption { bottom: 6px; border: 1px dashed #60472f; border-radius: 3px; background: #f5e7c7; color: #34494d; }
body[data-visual-theme="camp-dusk"] .hub-card { border: 1px dashed #92734c; border-radius: 5px; background: repeating-linear-gradient(0deg,#fff4da 0 3px,#f4e5c5 4px 6px); box-shadow: inset 0 0 0 3px #fff7e6a6, 0 3px 0 #695038, 0 7px 13px #07111d45; color: #293f50; }
body[data-visual-theme="camp-dusk"] .hub-card.primary { border: 2px solid #edbd69; border-radius: 5px; background: repeating-linear-gradient(0deg,#ffffff0b 0 2px,transparent 3px 7px),linear-gradient(110deg,#8a5433,#593b2a 54%,#344936); box-shadow: inset 0 0 0 2px #e5be7655, 0 4px 0 #34251b, 0 9px 18px #030b13a8; }
body[data-visual-theme="camp-dusk"] .hub-card.primary .menu-icon { border: 1px solid #f1cf81; border-radius: 50%; background: radial-gradient(circle,#ffda8a 0 22%,#ce873b 25% 40%,#53402d 43%); color: #fff0bf; filter: drop-shadow(0 0 7px #ffbf5488); }
body[data-visual-theme="camp-dusk"] .hub-card.adventure { border-style: dashed; background: linear-gradient(110deg,#e4d0aa,#c7b18a); color: #34483e; }
body[data-visual-theme="camp-dusk"] .hub-card.secondary { border: 1px dashed #987951; background: linear-gradient(135deg,#fff3d6,#e8d4aa); }
body[data-visual-theme="camp-dusk"] .difficulty-card { border: 2px dashed #987951; border-radius: 5px; background: repeating-linear-gradient(0deg,transparent 0 27px,#95764c12 28px,#95764c12 29px,transparent 30px),linear-gradient(135deg,#fff4dc,#e8d6b2); box-shadow: inset 0 0 0 3px #fff7e7a8, 0 4px 0 #392c21, 0 12px 25px #020a135c; }
body[data-visual-theme="camp-dusk"] .difficulty-card-heading strong { color: #293f50; }
body[data-visual-theme="camp-dusk"] .difficulty-card-action { border-color: #c6a773; color: #526f68; }
body[data-visual-theme="camp-dusk"] :is(.settings-panel,.completion-panel,.dialog-card) { border: 2px solid #76563a; border-radius: 6px; background: repeating-linear-gradient(0deg,transparent 0 25px,#95764c12 26px,#95764c12 27px,transparent 28px),linear-gradient(135deg,#fff3d7,#ead8b4); box-shadow: inset 0 0 0 2px #fff7e6, inset 0 0 0 4px #c3a16c, 0 4px 0 #34261c, 0 13px 28px #020a135c; }
body[data-visual-theme="camp-dusk"] :is(.small-button,.settings-panel select) { border: 1px dashed #92734c; border-radius: 4px; background: linear-gradient(#fff5dc,#ead8b5); color: #293f50; box-shadow: inset 0 0 0 2px #fff8e9, 0 3px 0 #4a3828; }
body[data-visual-theme="camp-dusk"] .button-primary { border: 1px solid #edbd69; border-radius: 4px; background: repeating-linear-gradient(0deg,#ffffff0b 0 2px,transparent 3px 7px),linear-gradient(110deg,#8a5433,#593b2a 54%,#344936); box-shadow: inset 0 0 0 2px #e5be7655, 0 4px 0 #34251b, 0 8px 15px #07111d66; }
body[data-visual-theme="camp-dusk"] .maze-paper { border: 5px solid #60472f; border-radius: 7px; box-shadow: inset 0 0 0 2px #e2c992, 0 4px 0 #34261b, 0 15px 28px #020a135c; }
body[data-visual-theme="camp-dusk"] .steering-pad { border: 2px solid #76563a; border-radius: 18px 18px 8px 8px; background: radial-gradient(ellipse at 50% 42%, #ffda8a77 0 8%, #fff0cb 11% 28%, #ead8b5 62%, #dfc79e); box-shadow: inset 0 0 0 2px #fff7e6, inset 0 0 0 4px #c3a16c, 0 4px 0 #34261c, 0 12px 24px #020a135c; }
body[data-visual-theme="camp-dusk"] .steering-pad::before { border: 1px dashed #8b6a43; border-radius: 12px 12px 5px 5px; }
body[data-visual-theme="camp-dusk"] .steering-pad-mark { border-color: #ba8644aa; background: #fff1d8a8; box-shadow: 0 0 22px #e9ad4d42; }
body[data-visual-theme="camp-dusk"] .steering-pad-instruction { color: #465c56; }
@media (max-width: 760px) {
  body[data-visual-theme="traveler-map"] .home-art.title-art,
  body[data-visual-theme="camp-dusk"] .home-art.title-art { flex: 0 1 auto; width: 100%; height: clamp(128px, 20dvh, 170px); min-height: 128px; max-height: 170px; }
  .home-art.title-art .art-caption { bottom: 3px; font-size: 7px; }
}
@media (prefers-reduced-motion: no-preference) {
  body[data-visual-theme] .hub-card { transition-duration: 180ms; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-artwork { filter: none !important; }
}

/* Organic journal pass: keep the shared layout, and let each world shape its surfaces. */
body[data-visual-theme] .home-copy {
  position: relative;
  z-index: 1;
  padding: clamp(10px, 1.6vw, 18px);
  border: 0;
  box-shadow: none;
}
body[data-visual-theme] .home-art.title-art {
  position: relative;
  isolation: isolate;
  height: 100%;
  min-height: 300px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-visual-theme] .home-art.title-art::after { content: none; }
body[data-visual-theme] .theme-artwork {
  position: relative;
  z-index: 0;
  width: 112%;
  max-width: none;
  height: 100%;
  object-fit: contain;
  overflow: visible;
  filter: none;
}
body[data-visual-theme] .home-art .art-caption {
  z-index: 2;
  right: auto;
  bottom: 4%;
  left: 50%;
  width: max-content;
  max-width: 90%;
  transform: translateX(-50%) rotate(-1.5deg);
  padding: 2px 8px 4px;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 8px;
  letter-spacing: .16em;
}
body[data-visual-theme] .hub-card,
body[data-visual-theme] .difficulty-card {
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
body[data-visual-theme] .hub-card:focus-visible,
body[data-visual-theme] .difficulty-card:focus-visible { outline-color: var(--theme-focus); }
body[data-visual-theme] :is(.settings-panel,.completion-panel,.dialog-card) {
  border-color: color-mix(in srgb, var(--theme-line) 70%, transparent);
  border-radius: 18px 12px 20px 13px;
  box-shadow: 0 12px 30px var(--theme-shadow);
}
body[data-visual-theme] :is(.small-button,.settings-panel select) { border-radius: 11px 8px 12px 8px; }

/* Traveler's Map: worn survey paper, wandering contour lines, and ink-led controls. */
body[data-screen="home"][data-visual-theme="traveler-map"] {
  background:
    radial-gradient(ellipse at 82% 13%, rgba(255,247,214,.7), transparent 25%),
    repeating-radial-gradient(ellipse at 76% 53%, transparent 0 49px, rgba(97,113,73,.07) 50px 51px, transparent 52px 78px),
    linear-gradient(135deg,#e9ddbd,#d7c89f 68%,#caba91);
}
body[data-screen="home"][data-visual-theme="traveler-map"] .home-copy {
  padding: clamp(16px, 2vw, 24px);
  border-radius: 22px 8px 18px 11px;
  background:
    linear-gradient(105deg, transparent 0 97%, rgba(158,126,69,.18) 97.2% 97.5%, transparent 97.7%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(91,111,74,.075) 28px, transparent 29px),
    linear-gradient(145deg,rgba(255,249,229,.78),rgba(242,229,192,.65));
  box-shadow: 0 12px 32px rgba(73,56,30,.12);
}
body[data-visual-theme="traveler-map"] .home-art.title-art { transform: rotate(-1deg); }
body[data-visual-theme="traveler-map"] .theme-artwork { transform: rotate(-1deg); }
body[data-visual-theme="traveler-map"] .art-caption { color: #506348; }
body[data-visual-theme="traveler-map"] .hub-card {
  border: 0;
  border-bottom: 1px solid rgba(132,101,51,.35);
  border-radius: 10px 3px 12px 4px;
  background: linear-gradient(105deg,rgba(255,250,230,.78),rgba(241,227,190,.62));
  box-shadow: 0 2px 7px rgba(78,59,32,.07);
  color: #344632;
}
body[data-visual-theme="traveler-map"] .hub-card.primary {
  border: 0;
  border-radius: 14px 5px 15px 6px;
  background: linear-gradient(112deg,#4f684a,#354d3a 76%,#2f4736);
  box-shadow: 0 3px 0 #263c2e, 0 9px 18px rgba(54,65,42,.2);
}
body[data-visual-theme="traveler-map"] .hub-card.primary .menu-icon {
  border-color: #d8bd78;
  background: radial-gradient(circle,#d8bd78 0 2px,#304b36 3px);
  color: #fff1c9;
}
body[data-visual-theme="traveler-map"] .hub-card.adventure {
  border: 1px dashed rgba(105,126,85,.65);
  border-radius: 8px 14px 7px 13px;
  background: rgba(234,226,198,.62);
}
body[data-visual-theme="traveler-map"] .hub-card.secondary { border-bottom-color: rgba(132,101,51,.24); }
body[data-visual-theme="traveler-map"] .difficulty-card {
  border: 0;
  border-bottom: 2px solid #b59861;
  border-radius: 19px 7px 18px 9px;
  background:
    repeating-linear-gradient(0deg,transparent 0 25px,rgba(91,111,74,.09) 26px,transparent 27px),
    linear-gradient(145deg,#fff7df,#ecddb8);
  box-shadow: 0 5px 18px rgba(69,52,29,.12);
}
body[data-visual-theme="traveler-map"] .difficulty-card:hover { transform: translateY(-3px) rotate(-.4deg); }
body[data-visual-theme="traveler-map"] .difficulty-symbol { border-style: dashed; }
body[data-visual-theme="traveler-map"] .difficulty-card-action { border-color: #c8b27b; }
body[data-visual-theme="traveler-map"] :is(.settings-panel,.completion-panel,.dialog-card) {
  border: 0;
  border-left: 3px solid #a9864c;
  background:
    repeating-linear-gradient(0deg,transparent 0 25px,rgba(91,111,74,.08) 26px,transparent 27px),
    linear-gradient(140deg,#fbf3dc,#f0e3c3);
}
body[data-visual-theme="traveler-map"] :is(.small-button,.settings-panel select) {
  border-color: #ad8f5b;
  background: linear-gradient(#fff8e5,#ecddb9);
  color: #354a38;
  box-shadow: 0 2px 0 #a58a5e;
}
body[data-visual-theme="traveler-map"] .button-primary {
  border-radius: 13px 5px 14px 6px;
  background: linear-gradient(110deg,#526e4e,#304c39);
  box-shadow: 0 4px 0 #203729, 0 8px 15px #3e302044;
}

/* Camp at Dusk: open twilight, soft lantern glow, and canvas-note controls. */
body[data-screen="home"][data-visual-theme="camp-dusk"] {
  background:
    radial-gradient(ellipse at 76% 48%,rgba(236,174,91,.2),transparent 28%),
    radial-gradient(circle at 14% 15%,#f4dfbc88 0 1px,transparent 2px),
    radial-gradient(circle at 85% 20%,#f4dfbc88 0 1px,transparent 2px),
    linear-gradient(155deg,#1a2c40,#253c50 67%,#314a51);
}
body[data-screen="home"][data-visual-theme="camp-dusk"] .home-copy {
  padding: clamp(15px, 1.9vw, 22px);
  border-radius: 10px 22px 9px 19px;
  background:
    radial-gradient(ellipse at 100% 0%,rgba(255,217,145,.28),transparent 33%),
    repeating-linear-gradient(0deg,transparent 0 30px,rgba(118,88,55,.08) 31px,transparent 32px),
    linear-gradient(135deg,#fff3d8,#eeddb8);
  box-shadow: 0 10px 26px rgba(3,12,20,.32), 0 0 30px rgba(244,184,94,.09);
}
body[data-visual-theme="camp-dusk"] .home-copy h1 { color: #293f50; }
body[data-visual-theme="camp-dusk"] .home-copy .intro { color: #53646b; }
body[data-visual-theme="camp-dusk"] .home-art.title-art { transform: translateY(3px); }
body[data-visual-theme="camp-dusk"] .theme-artwork { transform: scale(1.07); }
body[data-visual-theme="camp-dusk"] .art-caption { color: #f5dfb4; text-shadow: 0 1px 6px #07141dcc; }
body[data-visual-theme="camp-dusk"] .hub-card {
  border: 1px solid rgba(137,105,65,.42);
  border-radius: 12px 7px 14px 8px;
  background: linear-gradient(115deg,#fff4dc,#ead7b3);
  box-shadow: 0 3px 0 rgba(100,72,46,.4), 0 7px 12px rgba(9,21,28,.12);
  color: #293f50;
}
body[data-visual-theme="camp-dusk"] .hub-card.primary {
  border: 1px solid #e7b963;
  border-radius: 9px 15px 9px 14px;
  background: linear-gradient(110deg,#855333,#64432d 54%,#405044);
  box-shadow: 0 4px 0 #392b20, 0 0 20px rgba(238,178,85,.2);
}
body[data-visual-theme="camp-dusk"] .hub-card.primary .menu-icon {
  border: 1px solid #f0cd83;
  background: radial-gradient(circle,#ffdc8e 0 24%,#d78d40 27% 45%,#53402d 49%);
  color: #fff0bf;
  filter: drop-shadow(0 0 7px #ffbf5488);
}
body[data-visual-theme="camp-dusk"] .hub-card.adventure {
  border: 1px dashed #ac8959;
  border-radius: 15px 8px 12px 6px;
  background: linear-gradient(115deg,#e8d4af,#cfbc99);
}
body[data-visual-theme="camp-dusk"] .hub-card.secondary { border-style: solid; }
body[data-visual-theme="camp-dusk"] .difficulty-card {
  border: 1px solid #ab8655;
  border-bottom: 3px solid #73543a;
  border-radius: 13px 20px 11px 18px;
  background:
    radial-gradient(ellipse at 100% 0%,rgba(255,215,137,.24),transparent 38%),
    repeating-linear-gradient(0deg,transparent 0 29px,rgba(125,96,61,.08) 30px,transparent 31px),
    linear-gradient(140deg,#fff4dc,#ead8b6);
  box-shadow: 0 10px 22px rgba(2,10,19,.3);
}
body[data-visual-theme="camp-dusk"] .difficulty-card:hover { transform: translateY(-3px) rotate(.3deg); }
body[data-visual-theme="camp-dusk"] .difficulty-symbol { border-color: #c89958; background: rgba(255,220,153,.26); }
body[data-visual-theme="camp-dusk"] .difficulty-card-heading strong { color: #293f50; }
body[data-visual-theme="camp-dusk"] .difficulty-card-action { border-color: #c6a773; }
body[data-visual-theme="camp-dusk"] :is(.settings-panel,.completion-panel,.dialog-card) {
  border: 1px solid #ab8655;
  border-bottom: 3px solid #73543a;
  background:
    radial-gradient(ellipse at 100% 0%,rgba(255,215,137,.2),transparent 38%),
    repeating-linear-gradient(0deg,transparent 0 29px,rgba(125,96,61,.08) 30px,transparent 31px),
    linear-gradient(140deg,#fff4dc,#ead8b6);
}
body[data-visual-theme="camp-dusk"] :is(.small-button,.settings-panel select) {
  border-color: #aa8252;
  background: linear-gradient(#fff5dc,#ead8b5);
  color: #293f50;
  box-shadow: 0 3px 0 #695038;
}
body[data-visual-theme="camp-dusk"] .button-primary {
  border-radius: 9px 15px 9px 14px;
  background: linear-gradient(110deg,#8a5433,#593b2a 54%,#344936);
  box-shadow: 0 4px 0 #34251b, 0 0 18px rgba(238,178,85,.18);
}
@media (max-width: 760px) {
  body[data-visual-theme] .home-art.title-art {
    flex: 0 1 auto;
    height: clamp(128px, 20dvh, 170px);
    min-height: 128px;
    max-height: 170px;
  }
  body[data-visual-theme] .theme-artwork { width: 108%; }
  body[data-visual-theme] .home-art .art-caption { bottom: -2px; font-size: 7px; }
  body[data-screen="home"][data-visual-theme="traveler-map"] .home-copy { padding: 11px 12px; }
  body[data-screen="home"][data-visual-theme="camp-dusk"] .home-copy { padding: 11px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-visual-theme] .hub-card,
  body[data-visual-theme] .difficulty-card { transition: none; }
  body[data-visual-theme="traveler-map"] .home-art.title-art,
  body[data-visual-theme="traveler-map"] .theme-artwork,
  body[data-visual-theme="camp-dusk"] .home-art.title-art,
  body[data-visual-theme="camp-dusk"] .theme-artwork { transform: none; }
}
