/* Bowling for America - NES / 8-bit Style */
:root {
  --nes-red: #e60012;
  --nes-cream: #f8e8c8;
  --nes-chrome: #c0c0c0;
  --nes-teal: #00a8a8;
  --nes-wood: #8b4513;
  --nes-wood-light: #d2691e;
  --nes-black: #000000;
  --nes-white: #ffffff;
  --nes-yellow: #f8d800;
  --nes-green: #00a800;
  --nes-blue: #0000bc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  height: 100%;
  background: #1a0f0a;
  color: var(--nes-cream);
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
  touch-action: manipulation;
}

#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #120a08;
}

#game-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-width: 100%;
  max-height: 100%;
  background: #1a0f0a;
  border: 4px solid #3a2a1a;
  box-shadow: 0 0 0 2px #000, inset 0 0 20px rgba(0,0,0,0.5);
}

#scoreboard {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: min(96%, 520px);
  background: #000;
  border: 3px solid var(--nes-teal);
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--nes-cream);
  z-index: 10;
  box-shadow: 0 0 0 1px #000;
}

#scoreboard .player-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  padding: 2px 0;
  border-bottom: 1px dashed #333;
}

#scoreboard .player-row.active {
  background: rgba(0, 168, 168, 0.25);
  color: var(--nes-yellow);
}

#scoreboard .frames {
  font-family: monospace;
  letter-spacing: 1px;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.overlay.hidden {
  display: none;
}

.title-box {
  text-align: center;
  padding: 24px;
  background: #1a0f0a;
  border: 4px solid var(--nes-red);
  box-shadow: 0 0 0 4px #000, 0 0 0 8px var(--nes-teal);
  max-width: 420px;
  width: 90%;
}

.title-box h1 {
  font-size: 42px;
  line-height: 0.9;
  color: var(--nes-red);
  text-shadow: 3px 3px 0 #000, -1px -1px 0 var(--nes-teal);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.title-box h2 {
  font-size: 32px;
  color: var(--nes-yellow);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 16px;
}

.subtitle {
  color: var(--nes-teal);
  font-size: 12px;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.nes-btn {
  background: var(--nes-red);
  color: #fff;
  border: 3px solid #fff;
  border-bottom-width: 5px;
  border-right-width: 5px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-height: 48px;
  min-width: 140px;
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.05s;
}

.nes-btn:active {
  transform: translate(2px, 2px);
  border-bottom-width: 3px;
  border-right-width: 3px;
}

.mode-select {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}

/* Mobile controls removed — pure drag/swipe on canvas */

#final-scores {
  font-size: 18px;
  margin: 16px 0;
  line-height: 1.6;
}

#final-scores .winner {
  color: var(--nes-yellow);
  font-weight: bold;
}

/* Scanline overlay (subtle) */
#game-container::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.08) 0px,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 5;
  mix-blend-mode: multiply;
}
