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

body {
  background: #0a0a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: 'Courier New', monospace;
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
}

.hidden { display: none !important; }

/* ── Shared buttons ── */
.btn {
  display: block;
  width: 220px;
  padding: 12px 0;
  margin: 8px auto;
  background: transparent;
  border: 2px solid #16a34a;
  border-radius: 8px;
  color: #86efac;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: #16a34a; color: #fff; box-shadow: 0 0 14px #22c55e; }
.btn-primary { border-color: #22c55e; color: #bbf7d0; }
.btn-primary:hover { background: #22c55e; }

/* ── Menu ── */
#screen-menu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(160deg, #0a0a1a 0%, #052e16 100%);
  z-index: 50;
}
.game-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: #4ade80;
  letter-spacing: 12px;
  text-shadow: 0 0 20px #16a34a, 0 0 40px #166534;
  margin-bottom: 10px;
  animation: titleGlow 2s ease-in-out infinite;
}
@keyframes titleGlow {
  0%,100% { text-shadow: 0 0 20px #16a34a, 0 0 40px #166534; }
  50%     { text-shadow: 0 0 40px #4ade80, 0 0 80px #16a34a; }
}
.coin-badge { color: #fbbf24; font-size: 1.1rem; margin: 4px 0 12px; }
.hint { color: #4b5563; font-size: 0.75rem; letter-spacing: 1px; margin-top: 6px; }

/* ── Shop ── */
#screen-shop {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(160deg, #0a0a1a 0%, #052e16 100%);
  z-index: 50;
}
.screen-title { color: #4ade80; font-size: 1.6rem; letter-spacing: 4px; }
#skin-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 540px;
  padding: 4px;
}
.skin-card {
  width: 86px;
  border: 2px solid #14532d;
  border-radius: 10px;
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(20,83,45,0.2);
  color: #86efac;
  font-size: 0.74rem;
  text-align: center;
}
.skin-card:hover { border-color: #22c55e; background: rgba(34,197,94,0.15); }
.skin-card.selected { border-color: #fbbf24; }
.skin-preview { border-radius: 10px; display: block; }
.skin-status { color: #fbbf24; font-size: 0.68rem; }
.skin-price  { color: #9ca3af; }

/* ── Game screen ── */
#screen-game {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0a0a1a;
}

/* HUD */
#hud {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
  pointer-events: none;
}
#hud-left { display: flex; gap: 16px; }
#hud-powerup {
  color: #fbbf24;
  font-size: 0.78rem;
  min-width: 90px;
  text-align: center;
}
#btn-pause {
  pointer-events: auto;
  background: transparent;
  border: 1px solid rgba(74,222,128,0.4);
  border-radius: 6px;
  color: #4ade80;
  font-size: 0.9rem;
  width: 30px; height: 26px;
  cursor: pointer;
  padding: 0;
  font-family: 'Courier New', monospace;
  transition: all 0.15s;
}
#btn-pause:hover { background: rgba(74,222,128,0.2); color: #fff; }

/* Canvas */
#gameCanvas {
  display: block;
  border: 3px solid #16a34a;
  border-radius: 8px;
  box-shadow: 0 0 28px rgba(22,163,74,0.35);
  flex-shrink: 0;
}

/* D-pad */
#controls {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}
.dpad { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dpad-row { display: flex; gap: 4px; align-items: center; }
.dpad-center { width: 40px; height: 40px; }
.dpad-btn {
  width: 44px; height: 44px;
  background: rgba(22,163,74,0.15);
  border: 1px solid #16a34a;
  border-radius: 8px;
  color: #4ade80;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.1s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.dpad-btn:hover { background: rgba(22,163,74,0.35); }
.dpad-btn:active { background: #16a34a; color: #fff; transform: scale(0.9); }

/* ── Overlays ── */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
.overlay-box {
  background: rgba(10,10,26,0.97);
  border: 2px solid #16a34a;
  border-radius: 14px;
  padding: 34px 40px;
  text-align: center;
  min-width: 260px;
  box-shadow: 0 0 40px rgba(22,163,74,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  animation: popIn 0.2s ease-out;
}
@keyframes popIn {
  from { opacity:0; transform: scale(0.85); }
  to   { opacity:1; transform: scale(1); }
}
.overlay-box h2 { font-size: 1.8rem; color: #4ade80; }
.stat-line { color: #86efac; font-size: 1rem; }

/* ── Fullscreen ── */
:fullscreen       #app { width: 100vw; height: 100vh; }
:-webkit-full-screen #app { width: 100vw; height: 100vh; }
