/* NES Pinball page: the WebAssembly remake; nes.js sizes the screen and the camera follows the ball */
.t-nes { --bg: #000; --bg2: #101848; --accent: #6cc6ff; --accent2: #ff5ec8; }

.nes-play { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 12px 6px; }
/* width and height are set by nes.js; these are the no-JS fallback */
.nes-screen {
  position: relative; flex: none;
  width: min(calc(100vw - 24px), 472px); aspect-ratio: 236 / 477;
  background: #000 url(/img/nes-board.png) left bottom / 100% auto no-repeat;
  image-rendering: pixelated;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .1), 0 30px 80px rgba(0, 0, 0, .7);
}
.nes-screen canvas {
  position: absolute; inset: 0; display: block;
  width: 100% !important; height: 100% !important;
  touch-action: none; outline: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}

.nes-cover, .nes-over {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; text-align: center;
}
.nes-cover { background: rgba(0, 0, 10, .45); }
.nes-cover[hidden], .nes-over[hidden], .nes-status[hidden] { display: none; }
.nes-start { font-size: 20px; padding: 14px 34px; }
.nes-start:disabled { opacity: .7; cursor: progress; }
.nes-status { margin: 0; max-width: 260px; color: #fff; font-weight: 600; text-shadow: 0 1px 3px #000; }
.nes-over { background: rgba(0, 0, 12, .72); pointer-events: none; }
.nes-over b { font-size: 26px; font-weight: 900; color: #ff8a3a; letter-spacing: 1px; text-transform: uppercase; }
.nes-over span { font-size: 17px; color: #fff; }
.nes-over i { font-style: normal; font-weight: 800; color: var(--gold); }
.nes-over .btn { pointer-events: auto; margin-top: 6px; }

.nes-hud {
  display: flex; justify-content: space-between; gap: 10px; box-sizing: border-box;
  font: 800 13px/20px var(--font); letter-spacing: .5px; color: #9fb6ff;
}
.nes-hud[hidden] { display: none; }
.nes-hud b { color: #fff; font-variant-numeric: tabular-nums; margin-left: 4px; }

.nes-keys { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.nes-keys kbd {
  display: inline-block; min-width: 22px; padding: 0 5px; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06);
  font: 600 12px/20px var(--font); color: #fff;
}
.nes-restart {
  margin-left: 6px; padding: 3px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .25); background: none; color: #fff; font-size: 13px; font-weight: 600;
}
.nes-restart:hover { border-color: rgba(255, 255, 255, .5); }

.nes-pad { display: none; }
@media (hover: none) and (pointer: coarse) {
  .nes-play { padding-top: 8px; gap: 8px; }
  .nes-keys span { display: none; }
  .nes-pad {
    display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px;
    width: min(100%, 420px);
  }
  .nes-pad button {
    height: 58px; border-radius: 16px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff;
    font: 800 18px var(--font); touch-action: none;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  }
  .nes-pad .nes-launch { background: linear-gradient(#ffd24a, #ff9a2a); color: #241200; border: 0; }
  .nes-pad button.on { filter: brightness(1.35); transform: scale(.97); }
}

.nes-credits { font-size: 14px; color: var(--muted); }
