body.game-page {
  display: flex; flex-direction: column; align-items: center; min-height: 100vh; min-height: 100dvh; background: #0b0620;
  touch-action: manipulation; overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
}
.game-bar {
  position: relative; z-index: 2; width: 100%; max-width: 980px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 16px; font-family: 'Press Start 2P', monospace; font-size: 11px;
}
.game-bar .back { color: var(--yellow); text-decoration: none; white-space: nowrap; }
.game-bar .game-name { color: var(--pink); white-space: nowrap; }
.mute { font: inherit; background: #000; color: var(--green); border: 3px solid #444; padding: 6px 8px; cursor: pointer; white-space: nowrap; }

.stage {
  position: relative; z-index: 1; width: min(100vw - 16px, 960px, (100dvh - 110px) * 1.818);
  aspect-ratio: 320 / 176; border: 4px solid #000; box-shadow: 0 0 0 4px #3a3a46, 8px 8px 0 4px #000;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  container-type: size;
}
#game { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; cursor: pointer; }

/* Everything inside the stage scales with the stage itself (cqw = 1% of stage width). */
.hud {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 2% 3%; font-family: 'Press Start 2P', monospace; font-size: 12px; font-size: clamp(8px, 2.6cqw, 16px); color: #000; pointer-events: none;
}
.hud[hidden] { display: none; }
.hud .mid { display: flex; align-items: center; gap: 1.5cqw; }
.gas { display: flex; gap: 0.8cqw; }
.gas i { width: 10px; height: 10px; width: clamp(7px, 2cqw, 14px); height: clamp(7px, 2cqw, 14px); background: #c1c5c6; border: 2px solid #000; display: inline-block; }
.gas i.empty { background: transparent; }
.gas.flash i { border-color: #e01e1e; background: #ff8a8a; }
.shield-ico { width: 20px; height: 20px; width: clamp(14px, 4cqw, 28px); height: clamp(14px, 4cqw, 28px); image-rendering: pixelated; animation: blink .5s steps(1) infinite; margin-top: -0.4em; }
.speed { color: #000; opacity: .7; }

.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqh;
  background: rgba(11, 6, 32, .72); text-align: center; padding: 3cqh 3cqw; color: #fff; overflow: hidden;
}
.screen[hidden] { display: none; }
.screen h1, .screen h2 { font-family: 'Press Start 2P', monospace; margin: 0; color: var(--yellow); text-shadow: 3px 3px 0 #000; }
.screen h1 { font-size: 28px; font-size: clamp(16px, 8cqw, 60px); line-height: 1.15; }
.screen h2 { font-size: 22px; font-size: clamp(14px, 6.5cqw, 44px); color: var(--pink); }
.howto { font-family: 'Press Start 2P', monospace; font-size: 11px; font-size: clamp(8px, 2.6cqw, 16px); color: var(--cyan); margin: 0; line-height: 1.6; }
.cause { font-size: 18px; font-size: clamp(13px, 3.6cqw, 26px); color: var(--orange); margin: 0; }
.score-line { margin: 0; font-size: 18px; font-size: clamp(13px, 3.6cqw, 28px); line-height: 1.1; }
.score-line b { font-family: 'Press Start 2P', monospace; color: var(--green); font-size: .8em; }
.newbest { font-family: 'Press Start 2P', monospace; color: var(--yellow); font-size: 11px; font-size: clamp(8px, 2.4cqw, 16px); margin: 0; animation: blink .6s steps(1) infinite; }
.start {
  font-family: 'Press Start 2P', monospace; font-size: 12px; font-size: clamp(9px, 2.6cqw, 18px); color: #000; background: var(--green);
  border: 3px solid #000; padding: 1.8cqh 2.4cqw; box-shadow: 3px 3px 0 #000; cursor: pointer; touch-action: manipulation;
}
.start:active { transform: translate(3px, 3px); box-shadow: 0 0 0 #000; }
.blink-btn { animation: blink 1.2s steps(1) infinite; }
.small-link { color: var(--cyan); font-size: 18px; font-size: clamp(13px, 3.4cqw, 24px); padding: 4px 8px; }
@container (max-height: 240px) {
  .cause { display: none; }
  .screen { gap: 1.2cqh; }
}

.inline-poop { width: 22px; height: 22px; vertical-align: -5px; image-rendering: pixelated; }

.howto-panel {
  position: relative; z-index: 1; width: min(100vw - 32px, 720px); margin: 22px 16px 28px; padding: 14px 18px;
  background: var(--panel); border: 4px solid #000; box-shadow: 6px 6px 0 #000, inset 0 0 0 3px #3b2c86;
}
.howto-panel h2 { font-family: 'Press Start 2P', monospace; font-size: 12px; color: var(--green); margin: 0 0 10px; }
.howto-panel ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.howto-panel b { color: var(--yellow); font-weight: normal; }
.under { position: relative; z-index: 1; color: var(--dim); font-size: 18px; text-align: center; margin: 12px 0 0; }

/* touch vs mouse wording */
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: inline; }
  p.touch-only { display: block; }
  .desk-only { display: none; }
}

.rotate-hint { display: none; position: relative; z-index: 1; margin: 16px 16px 0; color: var(--yellow); font-family: 'Press Start 2P', monospace; font-size: 10px; text-align: center; line-height: 1.6; }
@media (orientation: portrait) and (hover: none) and (pointer: coarse) {
  .rotate-hint { display: block; animation: blink 2s steps(1) infinite; }
  .stage { margin-top: 6px; }
}

/* narrow phones: no room for the game name in the bar */
@media (max-width: 520px) {
  .game-bar .game-name { display: none; }
  .game-bar { font-size: 10px; padding: 10px 12px; }
}
/* landscape phones: squeeze the chrome so the game gets the height */
@media (max-height: 500px) and (orientation: landscape) {
  .game-bar { padding: 4px 12px; font-size: 9px; }
  .mute { padding: 3px 6px; border-width: 2px; }
  .stage { width: min(100vw - 24px, 960px, (100dvh - 48px) * 1.818); }
  .crt { animation: none; }
}
