:root {
  font-family: Inter, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-synthesis: none;
  --page: #f7f8f3;
  --surface: #fff;
  --surface-soft: #f0f3e8;
  --surface-raised: #fafbf7;
  --ink: #273e35;
  --muted: #6f7f68;
  --subtle: #879479;
  --line: #dce4d2;
  --accent: #284b3c;
  --accent-ink: #f7fff4;
  --accent-soft: #eaf1da;
  --focus: #6b9151;
  --danger: #a85f51;
  --gold: #ab7a20;
  --screen: #edf1e7;
  --green: #284b3c;
  --lime: #d8ed92;
  --wrap: 1220px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--page); }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, a, select, summary { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
button:disabled { opacity: .45; cursor: not-allowed; }
svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: auto; padding-left: 40px; padding-right: 40px; }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 100; background: var(--surface); padding: 12px 18px; border: 1px solid var(--accent); }
.skip-link:focus { top: 12px; }
.site-header { display: flex; align-items: center; min-height: 88px; border-bottom: 1px solid var(--line); gap: 52px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 25px; font-weight: 800; letter-spacing: -1.2px; white-space: nowrap; }
.brand i { font-weight: 400; color: var(--muted); font-style: normal; margin: 0 3px; }
.brand-dot { color: var(--accent); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); border-radius: 9px; color: var(--accent-ink); }
.brand-mark svg { width: 22px; height: 22px; fill: currentColor; }
.site-header nav { display: flex; gap: 30px; font-size: 12px; font-weight: 600; align-self: stretch; align-items: center; }
.site-header nav a { min-height: 44px; height: 100%; display: flex; align-items: center; gap: 8px; position: relative; color: var(--muted); }
.site-header nav a:hover, .site-header nav .nav-active { color: var(--ink); }
.nav-active:after { content: ""; position: absolute; height: 2px; bottom: 0; left: 0; right: 0; background: var(--accent); }
.header-note { margin-left: auto; display: flex; gap: 9px; align-items: center; font-size: 11px; color: var(--muted); }
.tiny-orbit { height: 7px; width: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: center; padding-top: 48px; padding-bottom: 44px; }
.intro-copy { min-width: 0; }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: 1.6px; display: flex; align-items: center; gap: 9px; color: var(--muted); line-height: 1.8; }
.eyebrow > span { height: 6px; width: 6px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }
h1 { font-size: 55px; line-height: 1.25; letter-spacing: -1.6px; font-weight: 800; margin-top: 20px; position: relative; overflow-wrap: anywhere; }
h1 > span { color: var(--accent); }
.intro-description { font-size: 14px; line-height: 2; color: var(--muted); margin-top: 23px; }
.intro-aside { min-width: 0; width: 100%; max-width: 480px; justify-self: end; }
.edition { font-size: 11px; letter-spacing: 1px; font-weight: 600; padding-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; color: var(--muted); }
.intro-aside > p { font-size: 12px; line-height: 2; color: var(--muted); margin: 20px 0; }
.text-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 44px; font-size: 12px; line-height: 1.7; font-weight: 650; background: none; border: 0; padding: 0; }
.text-link:hover { color: var(--accent); }
.text-link > span { font-size: 20px; font-weight: 400; }
.hero-play-link { display: inline-flex; align-items: center; gap: 14px; min-height: 48px; margin-top: 25px; padding: 12px 20px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800; }
.hero-play-link > span:last-child { margin-left: 18px; font-size: 19px; }
.hero-play-link:hover { filter: brightness(1.1); }
.hero-caption { font-size: 11px; line-height: 1.9; color: var(--muted); margin-top: 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 14px; }
.section-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.section-number { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.section-title h2 { font-size: 22px; line-height: 1.6; letter-spacing: -.3px; }
.tag { white-space: nowrap; font-size: 11px; color: var(--accent); border: 1px solid var(--line); padding: 5px 9px; border-radius: 5px; font-family: var(--mono); }
.local-badge { font-size: 11px; display: flex; align-items: center; gap: 8px; color: var(--muted); flex-shrink: 0; }
.local-badge > span { height: 6px; width: 6px; background: var(--accent); border-radius: 50%; }

.game-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0 24px; }
.game-card { --game-accent: var(--accent); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 17px 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 0 19px; min-width: 0; overflow: hidden; transition: border-color .18s, background .18s, transform .18s; }
.game-card:hover { background: var(--surface-raised); border-color: var(--game-accent); transform: translateY(-2px); }
.game-card.is-selected { border-color: var(--game-accent); box-shadow: 0 0 0 1px var(--game-accent), 0 8px 24px #0002; }
.game-card > span:nth-child(2) { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin-left: 18px; }
.game-card b { font-size: 15px; font-weight: 750; line-height: 1.4; overflow-wrap: anywhere; }
.game-card small { font-size: 12px; color: var(--muted); line-height: 1.6; }
.game-category { font-size: 11px; color: var(--game-accent); letter-spacing: 1.5px; font-family: var(--mono); line-height: 1.6; }
.game-art { display: block; grid-column: 1 / -1; width: 100%; height: auto; aspect-ratio: 240 / 110; border-bottom: 1px solid var(--line); background: var(--screen); }
.game-card-arrow { font-size: 22px; color: var(--game-accent); margin-right: 20px; }
#game-battle { --game-accent: var(--danger); }
#game-invaders { --game-accent: var(--gold); }
#game-platformer { --game-accent: #a4f1a4; }

.lab-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr) 320px; box-shadow: 0 16px 48px #00000014; overflow: hidden; }
.experiment-main { min-width: 0; padding: 0 24px; }
.screen-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 0 20px; border-bottom: 1px solid var(--line); }
.screen-caption { min-width: 0; }
.screen-mode { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--accent); border: 1px solid var(--line); background: var(--accent-soft); border-radius: 4px; padding: 5px 8px; }
#screen-title { font-size: 24px; font-weight: 800; line-height: 1.4; margin-top: 11px; letter-spacing: .6px; }
#screen-objective { font-size: 12px; line-height: 1.8; color: var(--muted); margin-top: 6px; }
.screen-readout { display: grid; justify-items: end; gap: 7px; flex-shrink: 0; min-width: 88px; max-width: 45%; }
.screen-phase { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: .8px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); border-radius: 5px; padding: 6px 9px; }
.screen-phase[data-phase="paused"] { color: var(--gold); }
.screen-phase[data-phase="error"], .screen-phase[data-phase="replay"] { color: var(--danger); }
.screen-counter-label { font-size: 11px; font-family: var(--mono); color: var(--muted); margin-top: 3px; }
#screen-round { font-size: 30px; line-height: 1.1; font-family: var(--mono); font-weight: 650; letter-spacing: -1.5px; max-width: 100%; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.experiment-toolbar { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.view-tabs { display: flex; gap: 23px; align-self: stretch; min-width: 0; }
.view-tab { position: relative; border: 0; background: none; font-size: 12px; min-height: 44px; padding: 0; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.view-tab.is-active { font-weight: 700; color: var(--accent); }
.view-tab.is-active:after { content: ""; position: absolute; bottom: 9px; height: 2px; background: var(--accent); left: 0; right: 0; }
.view-tab span { font-size: 14px; }
.status { display: flex; align-items: center; gap: 7px; font-size: 11px; line-height: 1.6; color: var(--muted); text-align: right; }
.status > span { height: 6px; width: 6px; border-radius: 50%; background: var(--subtle); flex-shrink: 0; }
.status.is-running { color: var(--accent); }
.status.is-running > span { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.board-area { background: var(--screen); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px 17px; position: relative; }
.board-coordinates { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; letter-spacing: 1px; color: var(--muted); font-family: var(--mono); margin-bottom: 17px; }
.grid { --grid-gap: 6px; display: grid; grid-template-columns: repeat(var(--grid-size, 6), minmax(0, 1fr)); grid-template-rows: repeat(var(--grid-size, 6), minmax(0, 1fr)); gap: var(--grid-gap); width: min(100%, 420px); aspect-ratio: 1; margin: auto; position: relative; }
.cell { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); display: grid; place-items: center; position: relative; min-width: 0; min-height: 0; transition: background .15s; }
.cell.is-wall { background: #c5d1b8; border-color: #bdcbb0; box-shadow: inset 0 -4px #b5c3a680; }
.cell.is-wall:after { content: ""; width: 25%; height: 1px; background: #a8b89a; transform: rotate(-40deg); }
.cell.is-start { border-style: dashed; border-color: var(--accent); color: var(--muted); font-size: 11px; font-family: var(--mono); }
.cell.is-goal { background: #ddecae; border-color: #d1e197; color: #5c7839; }
.cell.is-goal .goal-flag { font-size: 33px; line-height: 1; transform: translateY(-2px); }
.cell.is-hazard { color: var(--danger); background: #f4e4d5; border-color: #e8d2bd; font-size: 26px; }
.agent { position: absolute; width: 58%; height: 58%; background: var(--accent); border-radius: 25%; box-shadow: 0 4px 10px #0003; display: flex; justify-content: center; align-items: center; gap: 4px; z-index: 3; }
.agent:after, .agent:before { content: ""; width: 3px; height: 5px; border-radius: 2px; background: var(--accent-ink); margin-top: -2px; }
.agent.is-evaluating { box-shadow: 0 0 0 4px var(--accent-soft); }
.maze-agent-position { position: absolute; top: 0; left: 0; width: calc((100% - (var(--grid-size, 6) - 1) * var(--grid-gap)) / var(--grid-size, 6)); height: calc((100% - (var(--grid-size, 6) - 1) * var(--grid-gap)) / var(--grid-size, 6)); display: grid; place-items: center; transform: translate(calc(var(--agent-column, 0) * (100% + var(--grid-gap))), calc(var(--agent-row, 0) * (100% + var(--grid-gap)))); transition: transform 140ms linear; pointer-events: none; z-index: 3; }
.maze-agent-position > .agent { position: relative; }
.policy-arrow { font-size: 23px; color: var(--accent); }
.policy-unknown { font-size: 15px; color: var(--subtle); }
.cell.is-trail:not(.is-wall):not(.is-goal):not(.is-hazard) { background: var(--accent-soft); }
.board-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.legend i { height: 7px; width: 7px; margin-left: 5px; display: inline-block; border-radius: 2px; }
.legend i:first-child { margin-left: 0; }
.legend-agent { background: var(--accent); }
.legend-goal { background: var(--gold); }
.legend-wall { background: #72839c; }
.legend-hazard { background: var(--danger); }
.transition-note { font-size: 12px; line-height: 1.8; text-align: center; color: var(--muted); margin-top: 14px; min-height: 22px; }
.arcade-board { background: var(--screen); border: 1px solid var(--line); border-radius: 12px; padding: 22px; color: var(--ink); display: flex; flex-direction: column; gap: 18px; overflow: hidden; }
.comparison-heading h3 { font-size: 20px; font-weight: 750; line-height: 1.7; margin-top: 9px; }
.comparison-heading > p { font-size: 12px; line-height: 1.9; color: var(--muted); margin-top: 8px; }
.comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 15px; }
.comparison-card { min-width: 0; overflow: hidden; border: 1px solid #40506b; border-radius: 10px; background: #101c30; }
.comparison-card-heading { min-height: 69px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 15px; border-bottom: 1px solid #32425e; }
.comparison-card-heading > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 11px; min-width: 0; }
.comparison-card-heading h4 { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 750; }
.comparison-episode { font-size: 11px; line-height: 1.7; font-family: var(--mono); color: var(--muted); }
.comparison-badge { font-size: 11px; font-family: var(--mono); letter-spacing: .7px; color: #b9c5d9; background: #24314a; border: 1px solid #40506b; border-radius: 4px; padding: 5px 7px; }
.comparison-now { border-color: #629d87; box-shadow: 0 0 0 1px #a4f1a40c; }
.comparison-now .comparison-card-heading { background: #122a2c; border-bottom-color: #375e54; }
.comparison-now .comparison-card-heading h4 { color: #d6ffe1; }
.comparison-now .comparison-badge { color: #c4f7cd; background: #214837; border-color: #497760; }
.comparison-card > svg { display: block; width: 100%; height: auto; aspect-ratio: 480 / 315; background: #0a1528; border-bottom: 1px solid #32425e; }
.comparison-card-result { padding: 13px 15px 15px; }
.comparison-card-result > p { font-size: 12px; font-weight: 600; line-height: 1.8; min-height: 22px; color: #b9c5d9; }
.comparison-now .comparison-card-result > p { color: #d6ffe1; }
.comparison-progress { height: 5px; margin-top: 10px; border-radius: 5px; background: #26364e; overflow: hidden; }
.comparison-progress > span { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: #9aabc8; }
.comparison-now .comparison-progress > span { background: #a4f1a4; }
.arcade-board .comparison-change { font-size: 13px; line-height: 1.9; text-align: left; color: var(--ink); margin: 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.comparison-change[data-change="improved"] { border-color: #497760; }
.comparison-change[data-change="regressed"] { border-color: #8b5a62; }
.lesson-band { display: flex; align-items: flex-start; gap: 13px; padding: 14px 15px; border: 1px solid #365954; border-radius: 8px; background: #132b2c; }
.lesson-tag { flex-shrink: 0; font-size: 11px; line-height: 1.7; font-family: var(--mono); font-weight: 650; letter-spacing: .6px; color: #c4f7cd; }
.lesson-band > div { min-width: 0; }
.lesson-band b { font-size: 13px; line-height: 1.7; color: #e4f9ed; }
.lesson-band p { font-size: 12px; line-height: 1.9; color: var(--muted); margin-top: 4px; }
.arcade-hud { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.arcade-hud > span:last-child { color: var(--gold); }
.arcade-action-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; letter-spacing: .6px; font-family: var(--mono); color: var(--accent); }
.arcade-action-row > span:last-child { color: var(--muted); font-size: 11px; }
.arcade-board > p { font-size: 12px; line-height: 1.8; text-align: center; color: var(--muted); margin-top: 13px; min-height: 22px; }
.playback { display: grid; grid-template-columns: minmax(0, 1fr) 46px auto; align-items: center; gap: 12px; padding-top: 20px; }
.practice-controls { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; border: 1px solid #365954; border-radius: 8px; background: #142b2d; }
.practice-controls .practice-button { width: 100%; }
.practice-note { font-size: 12px; line-height: 1.9; color: var(--muted); margin: 0; }
.primary-button { border: 1px solid var(--accent); display: flex; align-items: center; justify-content: center; gap: 13px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800; border-radius: 7px; min-height: 52px; min-width: 0; padding: 12px 18px; transition: filter .15s, transform .15s; }
.primary-button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.primary-button > span:first-child { font-size: 15px; }
.icon-button { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; height: 46px; width: 46px; background: var(--surface-raised); font-size: 24px; color: var(--muted); }
.icon-button:hover { color: var(--accent); border-color: var(--accent); }
.speed-control { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.speed-control label { font-size: 11px; color: var(--muted); }
.speed-control select { font-size: 12px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--ink); max-width: 110px; }
.compute-note { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); padding: 16px 0 20px; }
.shield-icon { font-size: 20px; line-height: 1.5; color: var(--accent); }
.compute-note p { font-size: 11px; line-height: 1.8; }

.experiment-controls { background: var(--surface-soft); border-left: 1px solid var(--line); padding: 25px 23px; min-width: 0; }
.controls-heading { display: flex; justify-content: space-between; color: var(--muted); align-items: center; gap: 10px; margin-bottom: 25px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.small-eyebrow { font-size: 11px; letter-spacing: 1.2px; font-weight: 650; color: var(--muted); line-height: 1.6; }
.controls-heading > span:last-child { font-size: 17px; color: var(--accent); }
.control-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.select-wrap select, .reward-setting select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); background: var(--surface-raised); border-radius: 6px; padding: 11px 10px; font-size: 12px; color: var(--ink); }
.control-description { font-size: 11px; color: var(--muted); line-height: 1.9; margin-top: 11px; }
.random-settings { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 16px; }
.random-settings > label { font-size: 11px; color: var(--muted); }
.seed-row { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.seed-row input { width: 100%; min-width: 0; min-height: 42px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-raised); padding: 9px; font-size: 13px; color: var(--ink); font-family: var(--mono); }
.small-button { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 10px 13px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.small-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.seed-row .small-button { padding: 9px 11px; }
.random-settings > p { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 8px; }
.game-guide { padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.game-guide h3 { font-size: 20px; margin-top: 16px; line-height: 1.6; }
.game-guide p { font-size: 12px; line-height: 2; color: var(--muted); margin-top: 12px; }
.game-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.game-actions > span { background: var(--surface-raised); border: 1px solid var(--line); padding: 6px 8px; border-radius: 4px; color: var(--muted); font-size: 11px; }
.parameter { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-top: 24px; align-items: center; min-width: 0; }
.parameter label { font-size: 12px; font-weight: 700; }
.parameter-symbol { color: var(--accent); font-weight: 400; margin-left: 5px; font-family: serif; font-size: 16px; }
.parameter output { font-size: 23px; color: var(--accent); font-family: var(--mono); font-weight: 600; letter-spacing: -1px; }
.parameter output > span { font-size: 11px; margin-left: 4px; }
.parameter input { width: 100%; grid-column: 1 / -1; margin: 7px 0 0; height: 40px; accent-color: var(--accent); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; gap: 8px; grid-column: 1 / -1; font-size: 11px; line-height: 1.7; color: var(--muted); }
.range-labels > span:last-child { text-align: right; }
.reward-setting { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 21px; }
.reward-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.reward-chips > span { font-size: 11px; color: var(--muted); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; }
.reward-chips i { font-style: normal; }
.reward-chips b { margin-left: 5px; color: var(--gold); font-family: var(--mono); }
.reward-chips > span:last-child b { color: var(--danger); }
.insight { display: flex; gap: 10px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 7px; padding: 15px 13px; margin-top: 25px; }
.insight-icon { color: var(--accent); font-size: 20px; line-height: 1.3; }
.insight b { font-size: 12px; font-weight: 700; }
.insight p { font-size: 11px; line-height: 1.9; color: var(--muted); margin-top: 7px; }

.results-row { display: grid; grid-template-columns: .95fr 1.3fr; gap: 17px; margin-top: 19px; }
.stats-card, .chart-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 22px; min-width: 0; }
.stats-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.live-label { font-size: 11px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 23px; }
.metrics > div { min-width: 0; }
.metrics > div + div { padding-left: 17px; border-left: 1px solid var(--line); }
.metric-label { font-size: 11px; line-height: 1.7; color: var(--muted); }
.metric-label small { font-size: 11px; }
.metrics p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 11px; }
.metrics strong { font-size: clamp(25px, 2.3vw, 34px); color: var(--ink); font-weight: 700; font-family: var(--mono); letter-spacing: -1.5px; overflow-wrap: anywhere; min-width: 0; }
.metrics > div:nth-child(2) strong { color: var(--accent); }
.metrics p > span { font-size: 11px; color: var(--muted); }
.stats-footnote { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 17px; }
.chart-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.chart-heading h3 { font-size: 13px; font-weight: 700; }
.chart-heading > span { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chart-heading i { width: 16px; height: 2px; background: var(--accent); }
.chart-heading small { font-size: 11px; color: var(--muted); }
.chart-body { position: relative; height: 119px; margin-top: 19px; display: flex; gap: 12px; }
.chart-axis { width: 28px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--subtle); font-family: var(--mono); padding: 2px 0; }
.chart-body svg { height: 100%; width: calc(100% - 40px); overflow: visible; }
.chart-grid { stroke: var(--line); stroke-dasharray: 3 5; fill: none; stroke-width: 1; }
.chart-line { stroke: var(--accent); fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; line-height: 1.8; text-align: center; color: var(--muted); padding-left: 40px; }
.chart-x { display: flex; justify-content: space-between; gap: 10px; margin-left: 40px; font-family: var(--mono); font-size: 11px; color: var(--subtle); margin-top: 11px; }
.lab-below { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 20px; }
.lab-below > span { font-size: 11px; line-height: 1.8; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.keyboard-key { font-size: 13px; border: 1px solid var(--line); background: var(--surface); padding: 2px 6px; border-radius: 4px; color: var(--accent); }
.lab-below .text-link { font-size: 12px; gap: 15px; color: var(--accent); flex-shrink: 0; }
.announcement { font-size: 12px; line-height: 1.8; color: var(--accent); min-height: 22px; margin-top: 12px; }
.benchmark-card { display: grid; grid-template-columns: minmax(0, 1.6fr) auto auto; gap: 18px 25px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 26px 25px 18px; margin-top: 24px; }
.benchmark-card h3 { font-size: 18px; margin-top: 11px; font-weight: 750; line-height: 1.6; }
.benchmark-card > div > p { font-size: 12px; color: var(--muted); margin-top: 11px; line-height: 1.9; }
.benchmark-result { display: flex; align-items: center; gap: 18px; }
.benchmark-result > div { display: flex; flex-direction: column; gap: 12px; min-width: 70px; }
.benchmark-result > div > span { font-size: 11px; color: var(--muted); }
.benchmark-result strong { font-family: var(--mono); font-size: 36px; color: var(--accent); font-weight: 700; letter-spacing: -2px; }
.benchmark-result small { font-size: 12px; letter-spacing: 0; margin-left: 4px; color: var(--muted); }
.benchmark-result > div:last-child strong { color: var(--muted); }
.benchmark-vs { font-size: 28px; font-weight: 200; color: var(--subtle); margin-top: 17px; }
.benchmark-card > p { grid-column: 1 / -1; font-size: 11px; color: var(--muted); line-height: 1.8; border-top: 1px solid var(--line); padding-top: 13px; }
.benchmark-card > .small-button { padding: 13px 17px; background: var(--accent-soft); }
.benchmark-card > .small-button > span { font-size: 17px; }

.how-section { padding-top: 57px; }
.section-subtitle { font-size: 11px; letter-spacing: 1.1px; color: var(--muted); text-align: right; }
.learning-loop { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; margin-top: 23px; background: var(--surface); overflow: hidden; }
.learning-loop article { padding: 25px 29px 28px; position: relative; min-width: 0; }
.learning-loop article + article { border-left: 1px solid var(--line); }
.loop-number { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.loop-illustration { height: 88px; display: flex; align-items: center; justify-content: center; gap: 18px; color: var(--accent); }
.action-art i { font-style: normal; width: 33px; height: 33px; border-radius: 8px; background: var(--accent); color: transparent; position: relative; }
.action-art i:after { content: "··"; font-size: 20px; letter-spacing: 2px; color: var(--accent-ink); position: absolute; inset: 0; display: grid; place-items: center; margin-top: -5px; }
.action-art > span { font-size: 28px; }
.action-art > b { display: grid; place-items: center; width: 36px; height: 36px; border: 1px dashed var(--accent); border-radius: 5px; font-size: 20px; font-family: var(--mono); font-weight: 400; }
.reward-art > span { font-size: 30px; font-family: var(--mono); background: var(--accent-soft); color: var(--gold); padding: 4px 10px; border-radius: 6px; transform: rotate(-6deg); }
.reward-art > i { font-style: normal; color: var(--gold); font-size: 26px; align-self: flex-start; margin-top: 17px; }
.learn-art > span { font-size: 22px; letter-spacing: -2px; color: var(--accent); }
.learn-art > i { font-size: 35px; font-style: normal; }
.learning-loop h3 { font-size: 16px; font-weight: 750; margin-top: 8px; }
.learning-loop p { font-size: 12px; line-height: 2; color: var(--muted); margin-top: 12px; }
.loop-term { display: block; font-size: 11px; letter-spacing: 1px; color: var(--subtle); margin-top: 20px; }
.algorithm-details { border-bottom: 1px solid var(--line); margin-top: 14px; }
.algorithm-details summary { list-style: none; font-size: 12px; color: var(--muted); min-height: 48px; padding: 16px 3px; display: flex; justify-content: space-between; gap: 15px; cursor: pointer; }
.algorithm-details summary::-webkit-details-marker { display: none; }
.algorithm-details summary > span { font-size: 17px; }
.algorithm-details > div { padding: 10px 14px 24px; }
.algorithm-details code { font-size: 13px; color: var(--accent); line-height: 2; overflow-wrap: anywhere; }
.algorithm-details p { font-size: 12px; line-height: 2; color: var(--muted); margin-top: 12px; max-width: 850px; }
.resources-section { display: grid; grid-template-columns: 1fr 1.25fr; align-items: center; gap: 40px; padding-top: 58px; padding-bottom: 57px; }
.resources-section .eyebrow { font-size: 11px; color: var(--accent); letter-spacing: 1.3px; }
.resources-section h2 { font-size: 26px; letter-spacing: -.3px; margin-top: 14px; }
.resources-section > div > p:last-child { font-size: 12px; line-height: 2; color: var(--muted); margin-top: 15px; }
.ad-placeholder { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); display: flex; align-items: center; gap: 28px; padding: 27px; min-height: 170px; min-width: 0; }
.ad-placeholder > div { min-width: 0; }
.ad-label { font-size: 11px; letter-spacing: .7px; border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px; color: var(--accent); }
.ad-placeholder h3 { font-size: 15px; margin-top: 15px; font-weight: 700; line-height: 1.8; }
.ad-placeholder p { font-size: 12px; line-height: 1.8; color: var(--muted); margin-top: 10px; }
.ad-books { display: flex; flex-shrink: 0; align-items: flex-end; gap: 4px; transform: rotate(-6deg); }
.ad-books > span { height: 82px; width: 49px; background: var(--accent-soft); color: var(--accent); font-size: 11px; padding: 9px 7px; line-height: 1.7; box-shadow: 3px 2px var(--line); border: 1px solid var(--line); font-family: var(--mono); letter-spacing: .5px; }
.ad-books b { font-size: 25px; font-weight: 400; }
.ad-books > span:last-child { height: 72px; width: 43px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 11px; line-height: 1.6; transform: rotate(10deg); }
.site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 25px; border-top: 1px solid var(--line); padding-top: 26px; padding-bottom: 30px; }
.site-footer .brand { font-size: 21px; }
.site-footer > p { font-size: 11px; color: var(--muted); }
.footer-link { border: 0; background: none; min-height: 44px; font-size: 11px; color: var(--muted); margin-left: auto; padding: 7px 0; text-align: left; }
.copyright { font-size: 11px; letter-spacing: .3px; color: var(--subtle); white-space: nowrap; }
dialog { border: 1px solid var(--line); border-radius: 14px; max-width: 580px; width: calc(100% - 32px); max-height: calc(100dvh - 40px); overflow: auto; padding: 27px 30px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 70px #0004; }
dialog::backdrop { background: #07101e99; backdrop-filter: blur(4px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 16px; }
.dialog-header h2 { font-size: 18px; line-height: 1.6; }
.dialog-header .icon-button { flex-shrink: 0; }
dialog p { font-size: 13px; line-height: 2; color: var(--muted); margin-top: 15px; }
.noscript { position: fixed; bottom: 0; z-index: 10; background: var(--surface); color: var(--ink); width: 100%; padding: 20px; text-align: center; border-top: 1px solid var(--line); }

body.game-home, body.guide-page {
  --page: #f5f0df;
  --surface: #fffaf0;
  --surface-soft: #eee6d1;
  --surface-raised: #fff9e9;
  --ink: #26251f;
  --muted: #585347;
  --subtle: #675e50;
  --line: #c9c1a9;
  --accent: #a73723;
  --accent-ink: #fffaf0;
  --accent-soft: #f7ddce;
  --focus: #974123;
  --gold: #694c1b;
  --wrap: 1280px;
  color-scheme: light;
  color: var(--ink);
  background: var(--page);
}
.game-home #lab {
  --page: #070d1a;
  --surface: #101c30;
  --surface-soft: #0d172a;
  --surface-raised: #15233b;
  --ink: #e8efff;
  --muted: #a5b4cf;
  --subtle: #8d9fbc;
  --line: #283a56;
  --accent: #54e7ef;
  --accent-ink: #082130;
  --accent-soft: #133645;
  --focus: #54e7ef;
  --danger: #ff7190;
  --gold: #ffd166;
  --screen: #0a1528;
  --green: #54e7ef;
  --lime: #54e7ef;
  color: var(--ink);
  color-scheme: dark;
}
.game-home .site-header { border-bottom-color: #23334c; }
.game-home .intro h1 { font-size: clamp(44px, 4.8vw, 67px); line-height: 1.18; letter-spacing: -2px; }
.game-home .hero-console { border: 1px solid #32435e; border-radius: 16px; padding: 16px; background: linear-gradient(145deg, #17263d, #0c1527); box-shadow: 0 18px 60px #0003, inset 0 1px #ffffff08; }
.game-home .hero-console-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; font-family: var(--mono); letter-spacing: 1px; }
.game-home .hero-console-top > span:first-child { color: var(--accent); }
.game-home .hero-console-top > b { font-size: 11px; font-weight: 600; }
.game-home .hero-mini-stage { display: block; width: 100%; aspect-ratio: 360 / 190; background: #081220; border: 1px solid #283b56; border-radius: 9px; overflow: hidden; margin: 15px 0; }
.game-home .hero-mini-stage svg { width: 100%; height: 100%; }
.game-home .hero-console-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .3px; }
.game-home .hero-console-foot > span:last-child { color: var(--gold); }
.game-home .game-art { background: #0c1930; }
.game-home .battle-mini { background: #23172b; }
.game-home .invader-mini { background: #111e36; }
.game-home .platformer-mini { background: #143a35; }
.game-home #lab[data-game="platformer"] { --accent: #a4f1a4; --accent-soft: #173e38; --button-depth: #4c996c; }
.game-home .board-area { box-shadow: inset 0 1px 18px #0003; }
.game-home .cell { background: #12223a; border-color: #223a58; box-shadow: inset 0 1px #ffffff04; }
.game-home .cell.is-wall { background: #344961; border-color: #425a78; box-shadow: inset 0 -5px #203149; }
.game-home .cell.is-wall:after { background: #7892b0; }
.game-home .cell.is-goal { background: #4b3c20; border-color: #b58c34; color: var(--gold); box-shadow: inset 0 0 14px #ffd1660c; }
.game-home .cell.is-hazard { background: #402237; border-color: #85445c; color: var(--danger); }
.game-home .cell.is-start { border-color: #4c91a9; }
.game-home .cell.is-trail:not(.is-wall):not(.is-goal):not(.is-hazard) { background: #173d4b; }
.game-home .primary-button { box-shadow: 0 4px 0 var(--button-depth, #238e99), 0 8px 20px #54e7ef12; }
.game-home .primary-button:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--button-depth, #238e99); }
.game-home .experiment-controls { background: linear-gradient(160deg, #122039, #0c1729); }
.game-home #lab:not([data-game="maze"]) .lab-card { grid-template-columns: minmax(0, 1fr); }
.game-home #lab:not([data-game="maze"]) .experiment-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; border-left: 0; border-top: 1px solid var(--line); }
.game-home #lab:not([data-game="maze"]) .controls-heading, .game-home #lab:not([data-game="maze"]) .game-guide, .game-home #lab:not([data-game="maze"]) .insight { grid-column: 1 / -1; }
.game-home #lab:not([data-game="maze"]) .continuous-button { background: var(--surface-raised); color: var(--ink); border-color: var(--line); box-shadow: none; font-size: 12px; font-weight: 650; }
.game-home .public-links { font-size: 12px; gap: 12px 20px; color: var(--muted); }
.game-home .public-links a { color: var(--muted); min-height: 40px; display: inline-flex; align-items: center; }
.game-home .public-links a:hover { color: var(--accent); text-decoration: underline; }
.game-home .resource-guide { background: var(--surface); border-color: var(--line); color: var(--ink); }
.game-home .resource-guide:hover { background: var(--surface-raised); border-color: #3b6881; }
.game-home .affiliate-slot { background: var(--surface); border-color: var(--line); color: var(--ink); }
.game-home .affiliate-slot > p, .game-home .advertising-notice { color: var(--muted); font-size: 13px; }
.game-home .advertising-notice > span { color: var(--gold); border-color: #765d31; background: #342c1d; font-size: 13px; }
.game-home #privacy-dialog a, .game-home .privacy-dialog-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1100px) {
  .wrap { padding-left: 26px; padding-right: 26px; }
  .site-header { gap: 35px; }
  .header-note { display: none; }
  .intro { gap: 38px; }
  .game-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-card { grid-template-columns: minmax(0, 1fr) 290px; }
  .experiment-main { padding: 0 20px; }
  .experiment-controls { padding: 24px 20px; }
  .board-area { padding: 18px; }
  .speed-control label { display: none; }
  .metrics > div + div { padding-left: 12px; }
  .stats-card, .chart-card { padding: 20px 18px; }
  .benchmark-card { grid-template-columns: minmax(0, 1fr) auto; gap: 18px; }
  .benchmark-card > .small-button { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 960px) {
  .intro { grid-template-columns: 1fr 1fr; gap: 30px; }
  .game-card b { font-size: 15px; }
  .game-card small { font-size: 11px; }
  .game-card > span:nth-child(2) { margin-left: 13px; }
  .game-card-arrow { margin-right: 13px; }
  .game-category { letter-spacing: .7px; }
  .lab-card { grid-template-columns: minmax(0, 1fr); }
  .experiment-main { padding: 0 24px; }
  .experiment-controls { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; padding: 25px; }
  .controls-heading, #maze-settings, .game-guide, .reward-setting, .insight { grid-column: 1 / -1; }
  .reward-setting { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 0 20px; }
  .reward-setting > .control-label { margin-bottom: 0; }
  .reward-chips { grid-column: 1 / -1; }
  .board-area { padding: 20px 26px; }
  .speed-control label { display: block; }
  .results-row { grid-template-columns: 1fr 1fr; }
  .learning-loop article { padding: 22px; }
  .lab-below { align-items: flex-start; flex-direction: column; gap: 10px; }
  .resources-section { gap: 24px; }
  .ad-placeholder { padding: 22px; gap: 20px; }
}
@media (max-width: 700px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .site-header { min-height: 76px; justify-content: space-between; gap: 20px; }
  .brand { font-size: 23px; }
  .brand-mark { width: 31px; height: 31px; }
  .site-header nav { gap: 20px; font-size: 11px; }
  .site-header nav a:last-child { display: none; }
  .intro { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; padding-bottom: 34px; }
  .game-home .intro h1 { font-size: clamp(40px, 8.5vw, 59px); letter-spacing: -1.3px; }
  .intro-description { font-size: 13px; line-height: 2; margin-top: 20px; }
  .intro-aside { max-width: none; }
  .game-home .hero-console { display: none; }
  .eyebrow { font-size: 11px; letter-spacing: 1px; }
  .section-heading { align-items: flex-start; gap: 12px; }
  .section-title { gap: 9px; }
  .section-title h2 { font-size: 19px; }
  .local-badge { max-width: 110px; line-height: 1.8; }
  .section-subtitle { max-width: 105px; line-height: 1.8; letter-spacing: .5px; }
  .game-picker { gap: 10px; margin: 18px 0 21px; }
  .game-card { gap: 13px 6px; padding-bottom: 14px; border-radius: 10px; grid-template-columns: minmax(0, 1fr); }
  .game-card b { font-size: 13px; }
  .game-card > span:nth-child(2) { gap: 5px; margin-left: 10px; margin-right: 10px; }
  .game-card-arrow { display: none; }
  .game-category { font-size: 11px; letter-spacing: 0; }
  .game-card small { display: none; }
  .experiment-main { padding: 0 18px; }
  .screen-topline { gap: 12px; padding: 18px 0; }
  #screen-title { font-size: 21px; }
  #screen-objective { font-size: 11px; }
  .screen-phase { font-size: 11px; letter-spacing: 0; }
  #screen-round { font-size: 27px; }
  .experiment-toolbar { gap: 12px; }
  .view-tabs { gap: 18px; }
  .view-tab { font-size: 11px; }
  .status { max-width: 130px; font-size: 11px; }
  .board-area { padding: 16px 15px; }
  .board-coordinates { font-size: 11px; margin-bottom: 16px; letter-spacing: .5px; }
  .grid { --grid-gap: 5px; width: min(100%, 390px); }
  .board-bottom { gap: 10px; }
  .legend { gap: 6px; font-size: 11px; }
  .legend i { margin-left: 3px; }
  .transition-note { font-size: 11px; margin-top: 13px; }
  .arcade-board { padding: 18px 14px; gap: 16px; }
  .comparison-heading h3 { font-size: 18px; }
  .comparison-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .comparison-card-heading { min-height: 62px; padding: 12px 14px; }
  .comparison-card-result { padding: 12px 14px 14px; }
  .lesson-band { flex-direction: column; gap: 6px; padding: 13px 14px; }
  .arcade-hud { font-size: 11px; letter-spacing: .3px; }
  .arcade-action-row { font-size: 11px; }
  .arcade-board > p { font-size: 11px; }
  .playback { grid-template-columns: minmax(0, 1fr) 46px; gap: 13px; }
  .practice-controls { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
  .primary-button { min-height: 54px; font-size: 14px; }
  .speed-control { grid-column: 1 / -1; }
  .compute-note { padding-top: 13px; }
  .experiment-controls { padding: 23px 20px; gap: 0 22px; }
  .parameter label { font-size: 12px; }
  .parameter output { font-size: 22px; }
  .range-labels { font-size: 11px; }
  .results-row { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .stats-card, .chart-card { padding: 22px; }
  .metrics strong { font-size: 32px; }
  .chart-body { height: 125px; }
  .benchmark-card { padding: 23px 21px 17px; grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .benchmark-card > .small-button { justify-self: stretch; }
  .benchmark-result { justify-content: flex-start; gap: 25px; }
  .benchmark-result strong { font-size: 36px; }
  .how-section { padding-top: 38px; }
  .learning-loop { grid-template-columns: minmax(0, 1fr); }
  .learning-loop article { padding: 26px 24px; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 0 20px; }
  .learning-loop article + article { border-left: 0; border-top: 1px solid var(--line); }
  .loop-number { position: absolute; top: 15px; left: 16px; }
  .loop-illustration { grid-row: 1 / 4; height: 100%; min-height: 100px; gap: 10px; }
  .action-art i { width: 27px; height: 27px; }
  .action-art > b { width: 28px; height: 31px; font-size: 17px; }
  .action-art > span { font-size: 23px; }
  .reward-art > span { font-size: 23px; padding: 3px 6px; }
  .reward-art > i { font-size: 21px; }
  .learn-art > span { font-size: 16px; letter-spacing: -2px; white-space: nowrap; }
  .learn-art > i { font-size: 27px; }
  .learning-loop h3 { font-size: 15px; margin-top: 0; }
  .learning-loop p { font-size: 12px; margin-top: 9px; }
  .loop-term { font-size: 11px; margin-top: 15px; letter-spacing: .5px; }
  .algorithm-details code { font-size: 12px; }
  .algorithm-details p { font-size: 12px; }
  .resources-section { grid-template-columns: minmax(0, 1fr); gap: 25px; padding-top: 39px; padding-bottom: 40px; }
  .resources-section h2 { font-size: 24px; }
  .ad-placeholder { padding: 24px; gap: 25px; }
  .site-footer { gap: 15px 20px; padding-top: 25px; }
  .footer-link { margin-left: 0; }
  .copyright { margin-left: auto; }
  dialog { padding: 24px; }
  .dialog-header h2 { font-size: 17px; }
}
@media (max-width: 420px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .site-header { gap: 8px; }
  .brand { font-size: 20px; gap: 8px; }
  .brand-mark { width: 28px; height: 30px; }
  .site-header nav { gap: 10px; }
  .game-home .intro h1 { font-size: clamp(31px, 8.6vw, 36px); }
  .intro-description { font-size: 12px; }
  .section-title h2 { font-size: 17px; }
  .section-heading { flex-wrap: wrap; }
  .local-badge { max-width: none; }
  .game-picker { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .game-card { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; padding: 11px; min-height: 94px; }
  .game-art { grid-column: auto; width: 96px; height: 70px; border: 1px solid var(--line); border-radius: 7px; }
  .game-card > span:nth-child(2) { margin: 0; }
  .game-card b { font-size: 14px; }
  .game-card small { display: block; font-size: 11px; }
  .game-category { font-size: 11px; }
  .experiment-main { padding: 0 13px; }
  .screen-topline { gap: 10px; }
  .screen-mode { font-size: 11px; }
  .screen-readout { min-width: 80px; }
  #screen-title { font-size: 18px; }
  #screen-round { font-size: 25px; }
  .experiment-toolbar { flex-wrap: wrap; gap: 3px 12px; padding: 5px 0; }
  .view-tabs { gap: 13px; }
  .status { max-width: none; margin-left: auto; margin-bottom: 8px; }
  .board-area { padding: 15px 11px; }
  .grid { --grid-gap: 4px; }
  .cell { border-radius: 4px; }
  .cell.is-goal .goal-flag { font-size: 25px; }
  .cell.is-start { font-size: 11px; }
  .start-label { font-size: 9px; }
  .agent { gap: 3px; }
  .agent:after, .agent:before { width: 2px; height: 4px; }
  .legend { gap: 5px; }
  .legend i { height: 6px; width: 6px; margin-left: 1px; }
  .arcade-board { padding: 16px 11px; }
  .arcade-hud { gap: 7px; }
  .primary-button { padding: 12px 10px; gap: 9px; font-size: 13px; }
  .experiment-controls { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; }
  .game-home #lab:not([data-game="maze"]) .experiment-controls { grid-template-columns: minmax(0, 1fr); }
  .reward-setting { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .parameter { margin-top: 24px; }
  .stats-card, .chart-card { padding: 20px 17px; }
  .metrics > div + div { padding-left: 10px; }
  .metrics strong { font-size: 27px; }
  .metrics p { gap: 4px; }
  .learning-loop article { padding: 25px 18px; grid-template-columns: 67px minmax(0, 1fr); gap: 0 16px; }
  .loop-illustration { gap: 6px; }
  .ad-placeholder { padding: 22px 18px; gap: 20px; }
  .ad-books > span { width: 42px; }
  .ad-books > span:last-child { width: 34px; }
  .ad-placeholder h3 { font-size: 14px; }
  .game-home .public-links { gap: 9px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { animation: none !important; transition: none !important; }
}

.club-header,
.club-intro,
.cartridge-heading,
.cartridge-shelf {
  color: #26251f;
  --focus: #a63720;
}
.club-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  position: relative;
}
.club-header::after {
  content: "";
  position: absolute;
  inset: auto 40px 0;
  border-bottom: 2px solid #292822;
}
.club-brand,
.club-header nav,
.club-header nav a {
  display: flex;
  align-items: center;
}
.club-brand {
  gap: 9px;
  color: #26251f;
  font: 900 25px/1.15 "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.club-header nav { gap: clamp(13px, 3vw, 34px); }
.club-header nav a {
  min-height: 44px;
  color: #424138;
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 5px;
}
.club-header nav a:hover { color: #a63720; text-decoration: underline; }
.club-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: clamp(22px, 3vw, 43px);
  padding-bottom: clamp(23px, 3vw, 44px);
}
.club-intro-copy { min-width: 0; }
.club-intro h1 {
  color: #26251f;
  margin: 0 0 .2em;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: clamp(38px, 5.7vw, 83px);
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: 1.18;
  width: auto;
}
.club-intro h1 span { color: #ac3822; }
.club-intro-copy p {
  margin: 0;
  color: #4e4b40;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 550;
  line-height: 1.8;
}
.club-handheld { width: clamp(170px, 22vw, 312px); flex: 0 0 auto; }
.cartridge-heading {
  display: flex;
  align-items: center;
  gap: 15px;
}
.cartridge-heading::after {
  content: "";
  flex: 1;
  height: 5px;
  border-block: 1px solid #aaa18b;
}
.cartridge-heading h2 {
  color: #26251f;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.5;
  letter-spacing: .04em;
}
.cartridge-shelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(9px, 1.4vw, 20px);
  margin: 12px 0 22px;
}
.cartridge-shelf .cartridge {
  --shell: #dfe3c8;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  padding: 13px 9px 8px;
  border: 1.5px solid #38382f;
  border-radius: 8px 8px 3px 3px;
  color: #292822;
  background: var(--shell);
  box-shadow: 0 3px 0 #888471;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cartridge-shelf #game-battle { --shell: #f0d6c5; }
.cartridge-shelf #game-invaders { --shell: #dedbea; }
.cartridge-shelf #game-platformer { --shell: #d4e4dc; }
.cartridge-shelf .cartridge::before,
.cartridge-shelf .cartridge::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 3px;
  height: 3px;
  border-radius: 100%;
  background: #6f6d5b;
}
.cartridge-shelf .cartridge::before { left: 6px; }
.cartridge-shelf .cartridge::after { right: 6px; }
.cartridge-shelf .cartridge:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #888471; }
.cartridge-shelf .cartridge[aria-selected="true"] {
  outline: 2px solid #a63b23;
  outline-offset: -2px;
  box-shadow: 0 3px 0 #a63b23;
}
.cartridge-shelf .cartridge:focus-visible {
  outline: 3px solid #303d65;
  outline-offset: 4px;
}
.cartridge-shelf .game-art {
  width: 100%;
  height: auto;
  aspect-ratio: 240 / 102;
  border: 1px solid #545345;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
}
.cartridge-shelf .maze-mini { background: #d8dfaa; }
.cartridge-shelf .battle-mini { background: #f1c3a5; }
.cartridge-shelf .invader-mini { background: #32334e; }
.cartridge-shelf .platformer-mini { background: #bad6d3; }
.cartridge-shelf .cartridge > .cartridge-label {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 7px 9px 8px;
  background: #fff9e9;
  border: 1px solid #545345;
  border-radius: 0 0 2px 2px;
}
.cartridge-shelf .cartridge-label b {
  color: #24251d;
  font-size: clamp(14px, 1.35vw, 20px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.55;
}
.cartridge-shelf .cartridge-label small {
  display: block;
  color: #554f40;
  font-size: clamp(11px, 1vw, 13px);
  line-height: 1.5;
}
.cartridge-selected {
  display: none;
  position: absolute;
  top: 10px;
  left: 7px;
  padding: 1px 6px 2px;
  background: #9e3421;
  color: #fff9e9;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
}
[aria-selected="true"] > .cartridge-selected { display: block; }
@media (max-width: 1000px) {
  .club-header::after { inset-inline: 26px; }
}
@media (max-width: 760px) {
  .cartridge-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cartridge-shelf .game-art { aspect-ratio: 240 / 85; }
  .club-handheld { width: 145px; }
}
@media (max-width: 700px) {
  .club-header { min-height: 52px; }
  .club-header::after { inset-inline: 20px; }
  .club-brand { gap: 6px; font-size: 22px; }
  .club-brand svg { width: 24px; }
  .club-header nav { gap: 12px; }
  .club-header nav a { font-size: 12px; }
  .club-intro h1 { font-size: clamp(34px, 6vw, 44px); }
  .club-intro-copy p { font-size: 13px; }
}
@media (max-width: 530px) {
  .club-intro { display: grid; grid-template-columns: 1fr clamp(64px, 21vw, 110px); gap: 6px 8px; }
  .club-intro-copy { display: contents; }
  .club-intro h1 { grid-area: 1 / 1; margin: 0; }
  .club-handheld { grid-area: 1 / 2; width: 100%; }
  .club-intro-copy p { grid-column: 1 / -1; }
  .cartridge-shelf { gap: 9px; margin-bottom: 18px; }
  .cartridge-shelf .cartridge { padding: 10px 5px 5px; }
  .cartridge-shelf .cartridge > .cartridge-label { padding: 5px 6px; }
  .cartridge-shelf .cartridge-label b { font-size: clamp(12px, 3.25vw, 15px); }
  .cartridge-shelf .cartridge-label small { display: none; }
  .cartridge-selected { top: 6px; left: 4px; padding-inline: 4px; font-size: 10px; }
}
@media (max-width: 420px) {
  .club-header { gap: 7px; }
  .club-brand { font-size: 18px; }
  .club-header::after { inset-inline: 16px; }
  .club-header nav { gap: 9px; }
  .club-header nav a { font-size: 11px; }
  .club-intro { padding-top: 19px; padding-bottom: 20px; }
  .club-intro h1 { font-size: 32px; }
  .club-intro-copy p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cartridge-shelf .cartridge { transition: none; }
}

/* The cabinet and its record sheet sit on the same paper as the game shelf. */
.game-home .lab-card,
.game-home .results-row,
.game-home .lab-below,
.game-home .benchmark-card {
  --ink: #29291f; --muted: #554e43; --subtle: #665e50;
  --accent: #a93420; --accent-soft: #f5e3d4; --accent-ink: #fff8e9;
  --surface: #fffaf0; --surface-soft: #f2eddf; --surface-raised: #fffdf6;
  --line: #b8ad97; --gold: #705016; --danger: #a33428;
  color: var(--ink); color-scheme: light;
}
.game-home .lab-card { background: var(--surface); border: 2px solid #343127; border-radius: 7px; box-shadow: 3px 4px 0 #5c5143; }
.game-home .screen-topline { align-items: center; border-color: var(--ink); padding-block: 18px 15px; }
.game-home #screen-title { margin: 0; line-height: 1.35; font-size: clamp(20px, 2.1vw, 30px); letter-spacing: .01em; }
.game-home .screen-readout { gap: 4px; }
.game-home .screen-phase { padding: 0; background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: 0; }
.game-home .screen-phase::before { content: ""; width: 7px; height: 7px; background: currentColor; border-radius: 50%; margin-right: 6px; }
.game-home .screen-phase[data-phase="training"] { color: #366448; }
.game-home .screen-phase[data-phase="offline"] { color: var(--danger); }
.game-home .screen-counter-label { margin: 0; }
.game-home #screen-round { font-size: 17px; letter-spacing: 0; color: var(--ink); }
.game-home .experiment-toolbar { min-height: 46px; }
.game-home #lab:not([data-game="maze"]) .experiment-toolbar { display: none; }
.game-home .board-area,
.game-home .arcade-board {
  --screen: #202d2a; --surface: #263733; --ink: #faf4dd; --muted: #d1d5c7; --subtle: #afbbaa;
  --line: #64746a; --accent: #ffe184; --accent-soft: #39483c; --accent-ink: #29291f;
  --gold: #ffe184; --danger: #ffa89c;
  color: var(--ink); background: var(--screen); border: 4px solid #302e28; border-radius: 5px;
}
.game-home .board-area { box-shadow: inset 0 0 0 1px #637268; }
.game-home .cell { background: #303f39; border-color: #59675a; border-radius: 3px; }
.game-home .cell.is-wall { background: #667062; border-color: #85937c; box-shadow: inset 0 -4px #434c43; }
.game-home .cell.is-wall::after { background: #9ba68e; }
.game-home .cell.is-goal { background: #4d4629; color: #ffe184; }
.game-home .cell.is-start { border-color: #b7beab; }
.game-home .agent, .game-home .legend-agent { background: #a4dfc2; }
.game-home .agent::before, .game-home .agent::after { background: #192e28; }
.game-home .arcade-board { margin-top: 15px; gap: 12px; border-color: #302e28; }
.game-home .comparison-heading h3 { margin: 0; font-size: 17px; }
.game-home .comparison-heading p { margin-top: 2px; }
.game-home .lesson-band { border: 0; border-left: 3px solid #deb96e; background: none; padding: 1px 10px; border-radius: 0; }
.game-home .lesson-band b { color: #fff1c1; }
.game-home .lesson-band p { margin: 1px 0 0; }
.game-home .practice-controls { padding: 2px 0; border: 0; background: none; }
.game-home .comparison-card { border-radius: 3px; }
.game-home .comparison-card-heading { padding: 8px 12px; min-height: 39px; }
.game-home .comparison-card-result { padding: 6px 12px 9px; }
.game-home .comparison-progress { margin-top: 4px; height: 3px; }
.game-home .comparison-card-heading h4 { font-size: 14px; }
.game-home .arcade-board .comparison-change { padding: 5px 0; background: none; border: 0; font-weight: 650; }
.game-home .comparison-change[data-state="improved"] { color: #b1edc5; }
.game-home .comparison-change[data-state="regressed"] { color: #ffc9b3; }
.game-home .comparison-change:empty, .game-home #arcade-event:empty { display: none; }
.game-home .primary-button { background: #b73c23; border: 1px solid #792819; border-radius: 4px; color: #fffbec; box-shadow: 0 3px 0 #792819; }
.game-home .primary-button:active { box-shadow: 0 1px 0 #792819; }
.game-home .arcade-board .practice-button { background: #ffe184; border-color: #987a36; color: #302b21; box-shadow: 0 3px 0 #937741; }
.game-home .experiment-controls { background: #f2eddf; }
.game-home .controls-heading { color: var(--ink); font-size: 17px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.game-home .game-guide h3, .game-home .benchmark-card h3 { margin-top: 0; }
.game-home .insight { border: 0; border-left: 2px solid #aa9679; background: transparent; border-radius: 0; padding: 0 12px; }
.game-home .stats-card, .game-home .chart-card, .game-home .benchmark-card { border-radius: 3px; border-color: #a79c85; }
.game-home .stats-heading h3 { margin: 0; font-size: 16px; }
.game-home .lab-below { padding-inline: 0; }
@media (max-width: 700px) {
  .game-home .screen-topline { gap: 8px; }
  .game-home .arcade-board { padding: 13px 8px; }
  .game-home .comparison-card-heading { min-height: 36px; }
  .game-home .practice-controls { gap: 6px; }
}
