:root {
  color-scheme: light;
  --ink: #263d32;
  --muted: #526457;
  --green: #2f6349;
  --paper: #fffcf2;
  --line: #dedac7;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: #f8f4e8 radial-gradient(ellipse at 48% 0, #fffdf5, transparent 70%);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.sprite-definitions { position: absolute; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid #185ca0; outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1, h2, .mouse-name { font-family: Georgia, serif; }
.wrap { width: min(1120px, calc(100% - 48px)); margin: auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 21px 0 16px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { display: block; width: clamp(125px, 17vw, 172px); height: auto; mix-blend-mode: multiply; }
.brand-sub { color: var(--muted); font-size: .73rem; }
.pill, .action {
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  padding: 8px 14px; font-size: .85rem; font-weight: 750;
}
.pill:hover, .action:hover { background: #edf2e4; }
.intro { text-align: center; padding: 12px 0 23px; }
.eyebrow { color: var(--green); font-size: .68rem; font-weight: 850; letter-spacing: .19em; text-transform: uppercase; }
h1 { font-size: clamp(2.15rem, 5.3vw, 4.1rem); line-height: 1.04; letter-spacing: -.055em; margin: 6px 0 8px; }
.intro p:last-child { color: var(--muted); font-size: .94rem; }
.stage {
  position: relative; display: grid; place-items: center; isolation: isolate;
  min-height: 480px; border-radius: 26px; overflow: hidden; border: 1px solid #b7c8aa;
  background: #e0eee2; box-shadow: 0 12px 25px #34433113;
}
#scene { position: absolute; width: 100%; height: 100%; inset: 0; z-index: -1; pointer-events: none; }
.paper-grain { mix-blend-mode: multiply; pointer-events: none; }
.ribbon { position: absolute; top: 14px; left: 14px; pointer-events: none; }
.stage.play { min-height: clamp(285px, calc(100svh - 245px), 480px); touch-action: none; cursor: pointer; }
.stage.play.paused { touch-action: auto; cursor: default; }
.stage-controls, .hud { display: flex; gap: 7px; align-items: center; }
.stage-controls { position: absolute; top: 14px; right: 14px; z-index: 1; }
.hud output { font-variant-numeric: tabular-nums; white-space: nowrap; }
#fullscreen { display: flex; align-items: center; gap: 5px; min-width: 44px; min-height: 44px; justify-content: center; }
#fullscreen svg { width: 17px; height: 17px; }
html.game-expanded { overflow: hidden; overscroll-behavior: none; }
.stage.expanded {
  position: fixed; inset: 0; z-index: 10;
  width: 100%; height: 100%; height: 100dvh; min-height: 0;
  border: 0; border-radius: 0; box-shadow: none; background: #b8dadd;
  overflow: auto; overscroll-behavior: contain;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.stage.expanded .stage-controls {
  top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right));
}
.stage.expanded .ribbon {
  top: max(10px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left));
}
.stage.expanded #jump {
  min-height: 44px; bottom: max(5px, env(safe-area-inset-bottom));
}
.panel {
  width: min(480px, calc(100% - 28px)); margin: 55px 0 37px; text-align: center;
  border: 1px solid #fff; background: #fffcf3f5; border-radius: 25px; padding: 21px 24px 23px;
  box-shadow: 0 14px 36px #354a3930;
}
h2 { font-size: clamp(1.75rem, 4.2vw, 2.45rem); letter-spacing: -.035em; line-height: 1.12; margin: 4px 0 5px; }
.panel p:not(.eyebrow) { color: var(--muted); font-size: .88rem; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.choice {
  border: 1px solid #c9d5c9; border-radius: 17px; padding: 7px 5px 8px; background: #e9f1ea;
  transition: transform .18s, box-shadow .18s;
}
.choice + .choice { background: #f8edd3; border-color: #e4d6ae; }
.choice:hover { transform: translateY(-4px); box-shadow: 0 5px 0 #344b3425; }
.choice svg { display: block; width: 100%; height: 113px; overflow: visible; }
.choice .mouse-name { font-size: 1.35rem; font-weight: bold; display: block; line-height: 1.15; }
.choice small { display: block; margin-top: 3px; font-size: .72rem; color: #47574c; }
.hint { margin-top: 14px; }
.hint kbd { font: inherit; padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: #fffdf7; }
.primary { background: var(--green); color: #fff; border-color: var(--green); }
.primary:hover { background: #214a36; }
#jump { position: absolute; bottom: 13px; left: 50%; transform: translateX(-50%); }
#final-score { color: var(--green); font: bold 2.8rem/1.15 Georgia, serif; display: block; margin: 5px 0; }
#score-form { margin: 12px auto 8px; }
#score-form label { display: block; font-size: .82rem; font-weight: 750; margin-bottom: 5px; }
.form-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
input { width: 11rem; max-width: 100%; min-width: 0; border-radius: 10px; border: 1px solid #aeb9a3; color: var(--ink); background: white; padding: 7px 10px; }
#save-status { margin: 8px 0 10px; }
.below { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 0; }
.info { background: #fffcf4; border: 1px solid var(--line); border-radius: 17px; padding: 12px 15px; display: flex; gap: 11px; align-items: start; }
.info-icon { background: #e6eddc; border-radius: 11px; color: var(--green); width: 36px; height: 36px; padding: 7px; flex: none; }
.info > div { flex: 1; min-width: 0; }
.info h2 { font: 800 .91rem/1.45 system-ui, sans-serif; margin: 0 0 2px; letter-spacing: 0; }
.info p, .info li { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.info ol { margin: 4px 0 0; padding-left: 1.3em; }
.info li { padding: 2px 0; }
footer { font-size: .72rem; color: var(--muted); text-align: center; padding: 17px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#runner.running { --stride-animation: stride; }
.foot-a { animation: var(--stride-animation, none) .26s ease-in-out infinite alternate; }
.foot-b { animation: var(--stride-animation, none) .26s ease-in-out infinite alternate-reverse; }
@keyframes stride { from { transform: translate(-5px, -2px); } to { transform: translate(7px, 1px); } }
@media (max-width: 580px) {
  .wrap { width: calc(100% - 24px); }
  header { padding: 12px 0 8px; }
  .brand-sub { display: none; }
  .intro { padding: 10px 0 16px; }
  .stage { min-height: 428px; border-radius: 19px; }
  .stage.play:not(.expanded) { min-height: 340px; }
  .panel { padding: 17px 12px; }
  .ribbon { top: 9px; left: 9px; }
  .stage-controls { top: 9px; right: 9px; }
  .ribbon, .hud .pill { font-size: .74rem; padding: 6px 9px; }
  #fullscreen { padding: 6px 9px; font-size: .74rem; }
  .stage.play #fullscreen span { display: none; }
  .below { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 380px) {
  .stage.play .ribbon { display: none; }
}
@media (max-height: 460px) {
  .stage.expanded .panel { margin: 56px 0 8px; padding: 10px 12px; }
  .stage.expanded .choices, .stage.expanded .hint { margin-top: 8px; }
  .stage.expanded .choice svg { height: 70px; }
  .stage.expanded #jump { left: auto; right: max(8px, env(safe-area-inset-right)); transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .choice { transition: none; }
  .choice:hover { transform: none; }
  #runner.running { --stride-animation: none; }
}
