/* ============================================
   Run Run 8-bit  —  Web port styles
   ============================================ */

@font-face {
  font-family: 'PixelFont';
  src: url('assets/fonts/pixel.ttf') format('truetype');
  font-display: swap;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

canvas {
  display: block;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── Overlays ── */
.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55);
  z-index: 10;
  transition: opacity .3s;
}
.overlay.hidden { display: none; }

.char-panel {
  background: #1a1a2e;
  border: 2px solid #ffb347;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  color: #fff;
  font-family: 'PixelFont', monospace;
  max-width: 380px;
  width: 90%;
}
.char-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.char-options {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.char-btn {
  background: #111;
  border: 2px solid #444;
  border-radius: 12px;
  padding: 10px 8px 6px;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.char-btn img {
  display: block;
  width: 56px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
}
.char-btn span {
  font-family: 'PixelFont', monospace;
  font-size: .7rem;
  color: #aaa;
  text-transform: uppercase;
}
.char-btn.selected {
  border-color: #ffb347;
  background: #222;
  transform: scale(1.08);
}
.char-btn.selected span { color: #ffb347; }
.char-btn:active { transform: scale(.95); }

.play-btn {
  font-family: 'PixelFont', monospace;
  font-size: 1.1rem;
  padding: 10px 36px;
  border: none;
  border-radius: 8px;
  background: #ffb347;
  color: #111;
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background .2s;
}
.play-btn:hover { background: #ffc56d; }
.play-btn:active { background: #e09530; }

/* ── Landscape lock ── */
.rotate-msg {
  display: none;
  position: fixed; inset: 0;
  z-index: 9999;
  background: #111;
  color: #ffb347;
  font-family: 'PixelFont', monospace;
  font-size: 1.2rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}
.rotate-msg .icon { font-size: 3rem; }

@media (orientation: portrait) {
  .rotate-msg { display: flex; }
  canvas, .overlay { visibility: hidden; }
}
