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

body {
  background: #1a1a2e;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #eee;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #00d4aa;
}

#scores { display: flex; gap: 8px; }

.score-box {
  background: #16213e;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-align: center;
  min-width: 70px;
}

.score-box .label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.score-box span:last-child {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
}

#game-canvas {
  flex: 1;
  max-height: 500px;
  aspect-ratio: 1;
  width: 100%;
  margin: 0 auto;
  border-radius: 10px;
  background: #0f0f23;
  border: 2px solid #16213e;
}

#ad-banner {
  height: 60px;
  margin-top: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 35, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay.hidden { display: none; }

.overlay-content {
  text-align: center;
  background: #16213e;
  padding: 32px 48px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.overlay-content h2 { font-size: 2.5rem; margin-bottom: 12px; color: #ff6b6b; }
.overlay-content p { font-size: 1.2rem; margin-bottom: 20px; }

.overlay-content button {
  display: block;
  width: 100%;
  padding: 14px 24px;
  margin: 8px 0;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

#watch-ad-btn {
  background: #00d4aa;
  color: #0f0f23;
}

#watch-ad-btn:hover { background: #00b894; }

#restart-btn {
  background: #e17055;
  color: white;
}

#restart-btn:hover { background: #d63031; }

#controls {
  display: grid;
  grid-template-columns: 60px 60px 60px;
  grid-template-rows: 60px 60px;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.ctrl-btn {
  background: #16213e;
  border: 2px solid #00d4aa;
  border-radius: 12px;
  color: #00d4aa;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.ctrl-btn:active {
  background: #00d4aa;
  color: #0f0f23;
}

.ctrl-up { grid-column: 2; grid-row: 1; }
.ctrl-left { grid-column: 1; grid-row: 2; }
.ctrl-down { grid-column: 2; grid-row: 2; }
.ctrl-right { grid-column: 3; grid-row: 2; }
