body.ninja-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;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.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; }
.bar-doll { width: 1.6em; height: 1.6em; vertical-align: -0.45em; image-rendering: pixelated; }

.ninja-stage {
  position: relative; z-index: 1; width: min(100vw - 16px, 960px); height: min(100dvh - 120px, 680px); min-height: 340px;
  border: 4px solid #000; box-shadow: 0 0 0 4px #3a3a46, 8px 8px 0 4px #000; background: #120a2e;
  touch-action: none; overflow: hidden; cursor: crosshair; container-type: size;
}
#c { width: 100%; height: 100%; display: block; }

.ninja-hud {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
  font-family: 'Press Start 2P', monospace; pointer-events: none; color: #cfd0e6; font-size: clamp(10px, 2.2vw, 15px);
}
.ninja-hud[hidden] { display: none; }
.ninja-hud .score b { color: var(--yellow); font-weight: normal; font-size: clamp(18px, 4.4vw, 32px); text-shadow: 3px 3px 0 #000; }
.ninja-hud .best b { color: var(--green); font-weight: normal; }
.lives { display: flex; gap: 4px; }
.lives img { width: clamp(18px, 3.6vw, 30px); height: clamp(18px, 3.6vw, 30px); image-rendering: pixelated; }
.lives img.lost { filter: grayscale(1) brightness(.35); }
.lives.hit { animation: shake .3s steps(3); }
@keyframes shake { 33% { transform: translateX(-4px); } 66% { transform: translateX(4px); } }

.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqh;
  background: rgba(11, 6, 32, .78); text-align: center; padding: 3cqh 4cqw; 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: clamp(16px, 6.5cqw, 52px); line-height: 1.2; }
.screen h2 { font-size: clamp(16px, 6cqw, 44px); color: var(--pink); }
.howto { font-family: 'Press Start 2P', monospace; font-size: clamp(9px, 2.4cqw, 16px); color: var(--cyan); margin: 0; line-height: 1.6; }
.howto.small { font-family: 'VT323', monospace; font-size: clamp(15px, 3cqw, 24px); color: #cfd0e6; line-height: 1.2; }
.gold { color: var(--yellow); }
.score-line { margin: 0; font-size: clamp(15px, 3.4cqw, 28px); line-height: 1.1; }
.score-line.small { font-size: clamp(13px, 2.8cqw, 22px); color: #cfd0e6; }
.score-line b { font-family: 'Press Start 2P', monospace; color: var(--green); font-weight: normal; font-size: .8em; }
.newbest { font-family: 'Press Start 2P', monospace; color: var(--yellow); font-size: clamp(9px, 2.4cqw, 16px); margin: 0; animation: blink .6s steps(1) infinite; }
.start {
  font-family: 'Press Start 2P', monospace; font-size: clamp(10px, 2.6cqw, 18px); color: #000; background: var(--green);
  border: 3px solid #000; padding: 1.8cqh 2.6cqw; box-shadow: 3px 3px 0 #000; cursor: pointer;
}
.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: clamp(14px, 3cqw, 22px); padding: 4px 8px; }
@container (max-height: 300px) { .howto.small { display: none; } .score-line.small { display: none; } }

.under { position: relative; z-index: 1; color: var(--dim); font-size: 19px; text-align: center; margin: 14px 16px 24px; }
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: inline; }
  .desk-only { display: none; }
}
@media (max-width: 520px) {
  .game-bar .game-name { display: none; }
  .game-bar { font-size: 10px; padding: 10px 12px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .game-bar { padding: 4px 12px; font-size: 9px; }
  .ninja-stage { height: calc(100dvh - 48px); min-height: 0; }
  .under { display: none; }
  .crt { animation: none; }
}

#arcadeBtns { margin-top: 1cqh; }
@container (max-height: 320px) { #over .small-link { display: none; } #over .newbest { display: none; } }
