:root {
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
  color: #d7d8db;
  background: #0b0c0e;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 50% 35%, #1a1c20 0, #0b0c0e 65%); }
main { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.console { width: min(512px, calc((100svh - 160px) * 2 / 3), 100%); min-width: 240px; }
.console-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 16px; }
h1 { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .13em; margin: 0; }
.format { font: 10px ui-monospace, monospace; color: #90939a; white-space: nowrap; }
.screens { position: relative; width: 100%; aspect-ratio: 2 / 3; background: #000; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px #ffffff12, 0 0 0 7px #090a0c, 0 24px 90px #0008; }
canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; outline-offset: -3px; }
#cover { position: absolute; inset: 0; }
#cover[hidden], [hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
#play { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; }
#play img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
#play::after { content: ''; position: absolute; inset: 0; background: #0002; transition: background .2s; }
#play:hover::after { background: #0004; }
.play-prompt { position: absolute; z-index: 1; top: 75%; left: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 12px; }
.play-disc { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; border: 1px solid #ffffff65; color: #fff; background: #101114c9; backdrop-filter: blur(12px); box-shadow: 0 6px 30px #0008; transition: background .2s, transform .2s, border-color .2s; }
.play-disc svg { width: 28px; height: 28px; }
.play-label { font: 600 10px ui-monospace, monospace; letter-spacing: .2em; text-transform: uppercase; text-shadow: 0 1px 8px #000; color: #fff; }
#play:hover .play-disc, #play:focus-visible .play-disc { background: #efb46e; color: #17120d; border-color: #efb46e; transform: scale(1.06); }
#play:disabled { cursor: wait; }
#play[aria-busy="true"] .play-disc { border-color: #ffffff25; border-top-color: #efb46e; animation: spin 1s linear infinite; }
#play[aria-busy="true"] .play-disc svg { visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }
#status { position: absolute; z-index: 2; bottom: 16px; left: 16px; right: 16px; margin: 0; padding: 10px 12px; border-radius: 4px; background: #0b0c0ee8; color: #ddd; font-size: 12px; line-height: 1.5; text-align: center; pointer-events: none; }
#status:empty { display: none; }
nav { position: relative; display: flex; align-items: center; gap: 2px; margin: 14px -8px 0; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 11px; background: transparent; color: #989ba3; border: 0; border-radius: 5px; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover, .help[open] summary { color: #f5f5f6; background: #ffffff09; }
/* Paused: the Resume button is amber and pulses, so a paused game is easy to see. */
#pause.resume { color: #17120d; background: #efb46e; animation: pulse 1.6s ease-out infinite; }
#pause.resume:hover { background: #f5c78d; }
nav:has(#pause.resume) output { color: #efb46e; }
@keyframes pulse { from { box-shadow: 0 0 0 0 #efb46ea0; } to { box-shadow: 0 0 0 12px #efb46e00; } }
.icon-button:disabled { opacity: .25; cursor: default; background: transparent; }
.control-divider { width: 1px; height: 14px; background: #ffffff12; margin: 0 8px; }
button:focus-visible, summary:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid #efb46e; outline-offset: 3px; }
#play:focus-visible { outline-offset: -4px; }
output { margin-left: auto; padding-right: 8px; font: 10px ui-monospace, monospace; color: #777b85; font-variant-numeric: tabular-nums; }
footer { padding-top: 8px; text-align: center; }
footer a { font-size: 10px; color: #767a83; text-decoration: none; }
a { color: inherit; text-underline-offset: 3px; }
footer a:hover { color: #d7d8db; }
.help summary { list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help-panel { position: absolute; z-index: 3; left: 8px; bottom: 54px; width: min(280px, calc(100% - 16px)); padding: 18px; border: 1px solid #ffffff1a; border-radius: 6px; background: #17191ef5; box-shadow: 0 10px 40px #0009; backdrop-filter: blur(16px); }
.help-panel p { margin: 0 0 18px; font-size: 12px; color: #b9bbc2; }
dl { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; margin: 0; font-size: 12px; }
dd { margin: 0; color: #a0a3ac; }
kbd { font: 10px ui-monospace, monospace; border: 1px solid #ffffff25; border-radius: 3px; padding: 3px 5px; }
#notice { font-size: 12px; line-height: 1.5; color: #efb46e; }
#notice:empty { display: none; }
.console.filled { position: fixed; inset: 0; z-index: 10; width: auto; }
.console:is(:fullscreen, .filled) { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; background: #0b0c0e; overflow: auto; }
.console:is(:fullscreen, .filled) .screens { flex: none; width: min(100%, calc((100dvh - 145px) * 2 / 3)); }
.console:is(:fullscreen, .filled) .console-heading, .console:is(:fullscreen, .filled) nav { width: min(100%, calc((100dvh - 145px) * 2 / 3)); }
.console:is(:fullscreen, .filled) footer { display: none; }
.credits { display: block; width: min(100%, 640px); margin: auto; padding: 64px 24px; line-height: 1.8; }
.credits h1 { font-size: 20px; margin: 32px 0; }
.credits p { font-size: 14px; color: #a0a3ac; }
@media (max-width: 540px) {
  /* The screens go from edge to edge; only the heading and the controls keep an inset. */
  main { padding: 16px 0; }
  .console { width: min(100%, calc((100svh - 150px) * 2 / 3)); }
  .console-heading { padding: 0 14px 12px; }
  .screens { border-radius: 0; box-shadow: none; }
  nav { margin: 8px 0 0; padding: 0 6px; }
  h1 { font-size: 11px; }
  .format { font-size: 9px; }
}
@media (max-height: 500px) and (min-width: 541px) {
  .console { min-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
