@font-face { font-family: 'ONOFF'; src: url('./assets/onoff.otf') format('opentype'); font-display: swap; }
:root { --ink: #333; --paper: #fff; --quiet: #767676; --line: #d5d5d5; --stage-height: calc(100dvh - 180px); }
body { min-height: 100dvh; height: auto; display: flex; flex-direction: column; justify-content: center; padding: 20px 32px 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif; font-size: 13px; color: var(--ink); background: #e5e5e5; }
button, a { -webkit-tap-highlight-color: transparent; }
button { appearance: none; border: 1px solid transparent; background: transparent; color: inherit; font: inherit; font-weight: 500; cursor: pointer; min-height: 40px; padding: 8px 12px; border-radius: 0; transition: background 120ms, color 120ms; }
button:hover { background: #d7d7d7; }
button:focus-visible, a:focus-visible, [role='button']:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
a { color: inherit; text-decoration: none; }
span { margin-left: 0; }
.topbar, .bottom-bar, .credits { width: min(100%, 1200px); display: flex; align-items: center; }
.topbar { min-height: 56px; gap: 24px; margin: 0 auto 14px; }
.wordmark { display: inline-flex; align-items: center; font-family: 'ONOFF', monospace; font-size: 22px; letter-spacing: 1px; white-space: nowrap; }
.wordmark span { opacity: .3; }
.wordmark i { width: 7px; height: 7px; background: var(--ink); margin-left: 12px; }
#status { margin: 0; color: #666; font-size: 12px; letter-spacing: .5px; }
.topbar nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
#continue { background: #333; color: #fff; margin-right: 8px; }
#continue:hover { background: #555; }
#stage { position: relative; display: grid; align-items: center; width: min(100%, 1200px, calc(var(--stage-height) * 1.6)); aspect-ratio: 8 / 5; overflow: hidden; flex-shrink: 0; background: #fff; isolation: isolate; }
#stage:focus { outline: none; }
#stage > svg { width: 100%; height: 100%; max-height: none; grid-area: 1 / 1; overflow: hidden; }
#stage .menu .item { cursor: pointer; }
#stage .menu .item .text { opacity: .45; }
#stage .menu .selected .text { opacity: 1; }
#hud { opacity: .4; }
#esc { display: none; }
.bottom-bar { justify-content: space-between; min-height: 50px; gap: 16px; margin: 8px auto 0; }
#help-line { display: flex; flex-wrap: wrap; gap: 22px; color: #666; font-size: 11px; }
kbd { display: inline-block; min-width: 19px; text-align: center; padding: 3px 4px; font-family: inherit; font-size: 10px; font-weight: 500; line-height: 1; border: 1px solid #bcbcbc; margin-right: 3px; color: #444; }
#phase { font-family: 'ONOFF', monospace; font-size: 19px; letter-spacing: 2px; }
.credits { justify-content: space-between; color: #777; font-size: 10px; letter-spacing: .4px; margin: 0 auto; }
.credits a:hover { color: #333; text-decoration: underline; }
#notice { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 12px 20px; max-width: min(520px, 90vw); z-index: 30; font-size: 13px; box-shadow: 0 4px 20px #0002; }
#notice:empty { display: none; }
.pause-panel { position: absolute; inset: 0; display: grid; place-items: center; background: #fffffff0; z-index: 10; }
.pause-card { width: min(340px, 86%); text-align: center; }
.eyebrow { letter-spacing: 3px; font-size: 10px; color: #777; }
.pause-card h1 { font-size: clamp(24px, 4vw, 40px); letter-spacing: -2px; margin: 16px 0 14px; font-weight: 500; }
.pause-card p { color: #777; font-size: 12px; margin: 0 0 30px; }
button.primary { width: 100%; background: #333; color: #fff; text-align: left; padding: 14px 20px; font-size: 14px; }
button.primary span { float: right; }
button.primary:hover { background: #555; }
.pause-secondary { display: flex; gap: 12px; margin-top: 10px; }
.pause-secondary button { flex: 1; color: #666; }
.is-paused #stage > svg * { animation-play-state: paused !important; transition: none !important; }
#touch-controls { display: none; }
#editor-actions { display: flex; gap: 5px; }
#editor-actions button { border: 1px solid #bbb; white-space: nowrap; }
#editor-hint { font-size: 11px; color: #666; }
#dialog { z-index: 20; width: min(410px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; right: 16px; top: 16px; font: inherit; border: 1px solid #ddd; }
#dialog h3 { font-size: 18px; font-weight: 500; }
#dialog li { font-size: 12px; }
#dialog li span { margin-left: 8px; }
#dialog kbd { padding: 5px; }
#dialog button { width: 100%; background: #333; color: #fff; }
.editor-note { color: #777; font-size: 12px; line-height: 1.7; }
.off .wordmark i { background: #fff; outline: 1px solid #bbb; }
@media (max-width: 850px) {
  body { padding: 12px 16px; }
  .topbar { gap: 12px; }
  #status { display: none; }
  #help-line { gap: 12px; }
  #editor-hint { display: none !important; }
  button { padding: 8px; }
}
@media (pointer: coarse), (max-width: 600px) {
  :root { --stage-height: calc(100dvh - 270px); }
  body { padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); justify-content: center; }
  .topbar { margin-bottom: 12px; min-height: 48px; flex-wrap: wrap; gap: 4px; }
  .wordmark { font-size: 18px; }
  .wordmark i { display: none; }
  .topbar nav { gap: 0; }
  .topbar button { min-height: 44px; font-size: 11px; padding: 6px 8px; }
  #fullscreen { display: none; }
  #continue { margin-right: 2px; }
  #touch-controls { width: min(100%, 900px); display: flex; justify-content: space-between; margin-top: 18px; }
  .touch-move, .touch-action { display: flex; gap: 12px; }
  #touch-controls button { width: clamp(52px, 13vw, 72px); height: 56px; background: #d8d8d8; border: 1px solid #bbb; font-size: 24px; touch-action: none; user-select: none; }
  #touch-controls button.pressed { background: #333; color: #fff; }
  #touch-controls .touch-action button:last-child { background: #333; color: #fff; }
  .bottom-bar { min-height: 42px; }
  #help-line { font-size: 10px; gap: 8px; }
  #help-line span:first-child { display: none; }
  .credits { font-size: 9px; }
  .pause-card h1 { margin: 8px 0; }
  .pause-card p, .eyebrow { display: none; }
  .pause-secondary { margin-top: 4px; }
  .pause-card { max-width: 270px; }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  :root { --stage-height: calc(100dvh - 72px); }
  .topbar { margin-bottom: 0; min-height: 36px; }
  .topbar button { min-height: 32px; }
  .bottom-bar, .credits { display: none; }
  #touch-controls { position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); left: 16px; width: calc(100% - 32px); max-width: none; pointer-events: none; z-index: 4; }
  #touch-controls button { pointer-events: auto; width: 50px; opacity: .8; }
  .touch-move, .touch-action { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .walk #left_foot, .walk #right_foot, .walk #head, #inner-goal { animation: none; }
  #inner-goal-finish { transition: none; }
  button { transition: none; }
}
