@font-face { font-family: "Press Start 2P"; src: url("press-start-2p.woff2") format("woff2"); font-display: swap; }
:root {
  --bg: #141312; --shell: #262421; --shell-hi: #34312c; --ink: #f4efe2; --muted: #a39d90;
  --btn: #f4efe2; --btn-ink: #141312; --accent: #bdb5a2;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex; flex-direction: column; align-items: center;
  overscroll-behavior: none; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.top { width: 100%; max-width: 560px; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 13px; letter-spacing: .04em; }
.top span { font-family: "Press Start 2P", monospace; font-size: 11px; }
.top a { color: var(--muted); text-decoration: none; }
.top a:hover { color: var(--ink); }
.console {
  --scr: min(calc(100vw - 72px), calc((100dvh - 250px) * 160 / 144), 520px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 14px 14px 18px; border-radius: 14px 14px 36px 14px;
  background: linear-gradient(160deg, var(--shell-hi), var(--shell)); box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.bezel { background: #0b0b0a; padding: 10px; border-radius: 8px 8px 22px 8px; }
#screen { display: block; width: var(--scr); height: calc(var(--scr) * 144 / 160); image-rendering: pixelated; outline: none; border-radius: 2px; }
.controls { width: calc(var(--scr) + 20px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.dpad { position: relative; width: 116px; height: 116px; justify-self: start; touch-action: none; cursor: pointer; }
.dpad .arm, .dpad .hub { position: absolute; background: #0d0d0c; border-radius: 6px; }
.dpad .arm.h { left: 0; right: 0; top: 38px; height: 40px; }
.dpad .arm.v { top: 0; bottom: 0; left: 38px; width: 40px; }
.dpad .hub { left: 46px; top: 46px; width: 24px; height: 24px; border-radius: 50%; background: #1d1c1a; }
.dpad[data-dir=up] .arm.v { box-shadow: inset 0 40px 0 -2px #2c2a26; }
.dpad[data-dir=down] .arm.v { box-shadow: inset 0 -40px 0 -2px #2c2a26; }
.dpad[data-dir=left] .arm.h { box-shadow: inset 40px 0 0 -2px #2c2a26; }
.dpad[data-dir=right] .arm.h { box-shadow: inset -40px 0 0 -2px #2c2a26; }
.mid { display: flex; flex-direction: column; gap: 10px; align-items: center; align-self: end; padding-bottom: 6px; }
button { font: inherit; border: 0; cursor: pointer; touch-action: none; }
.pill { font-family: "Press Start 2P", monospace; font-size: 8px; letter-spacing: .06em; color: var(--muted); background: #0d0d0c; padding: 7px 12px; border-radius: 999px; }
.pill[aria-pressed=false] { opacity: .45; }
.ab { justify-self: end; display: flex; gap: 14px; transform: rotate(-22deg); padding-right: 4px; }
.round { width: 54px; height: 54px; border-radius: 50%; background: var(--btn); color: var(--btn-ink); font-family: "Press Start 2P", monospace; font-size: 13px; box-shadow: 0 4px 0 #8f897c; }
.round.a { margin-top: -22px; }
.round.on, .pill.on { transform: translateY(3px); box-shadow: 0 1px 0 #8f897c; }
.help { max-width: 560px; padding: 14px 16px 24px; color: var(--muted); font-size: 12px; text-align: center; }
.help p { margin: 4px 0; }
.help b { color: var(--ink); font-weight: 600; }
/* Embedded in a feed: no chrome, fill the frame */
.embed body, html.embed body { justify-content: center; }
html.embed .top, html.embed .help { display: none; }
html.embed .console { --scr: min(calc(100vw - 48px), calc((100vh - 196px) * 160 / 144)); border-radius: 0; box-shadow: none; background: var(--shell); width: 100vw; height: 100vh; justify-content: center; padding: 8px; gap: 8px; }
html.embed .dpad { width: 104px; height: 104px; }
html.embed .dpad .arm.h { top: 34px; height: 36px; } html.embed .dpad .arm.v { left: 34px; width: 36px; }
html.embed .dpad .hub { left: 41px; top: 41px; width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) { html:not(.embed) .console { --scr: min(calc(100vw - 72px), calc((100dvh - 290px) * 160 / 144), 520px); } }
