/* Neon Block Blaster — neon dark theme */

.game-page {
  background: #0f0f1a;
  color: #e6e6f0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.site-header h1 {
  color: #e94560;
  text-shadow: 0 0 18px rgba(233, 69, 96, 0.6), 0 0 4px rgba(233, 69, 96, 0.9);
  margin: 0;
  font-size: 1.8rem;
}

.subtitle {
  color: #a0a0c0;
  font-size: 0.95rem;
}

.back-link {
  display: inline-block;
  padding: 8px 16px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #e94560;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.back-link:hover {
  background: #232344;
  transform: translateX(-2px);
}

/* HUD */
.hud {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0 10px;
}

.hud-cell {
  background: linear-gradient(145deg, #1a1a2e, #232344);
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.hud-label {
  color: #a0a0c0;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.hud-value {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(233, 69, 96, 0.4);
}

.hud-bricks .hud-value {
  text-shadow: 0 0 12px rgba(0, 255, 200, 0.5);
}

.hud-cell.pulse .hud-value {
  animation: pulse-glow 0.5s ease-out;
}

@keyframes pulse-glow {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); color: #ffe066; }
  100% { transform: scale(1); }
}

/* Power-up indicators */
.powerup-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
  min-height: 30px;
}

.powerup-slot {
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid #e94560;
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #e94560;
  animation: fade-in 0.3s, powerup-glow 1.2s infinite alternate;
  text-shadow: 0 0 6px #e94560;
}

@keyframes powerup-glow {
  from { box-shadow: 0 0 4px #e94560; }
  to { box-shadow: 0 0 16px #e94560, 0 0 4px #e94560; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Canvas */
.canvas-wrap {
  position: relative;
  background: #0a0a14;
  border: 2px solid #2a2a4a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.4);
  margin: 0 auto;
  max-width: 800px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: radial-gradient(ellipse at center, #15152a 0%, #0a0a14 100%);
}

/* Overlay (start / game over) */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay-content {
  text-align: center;
  padding: 30px;
  max-width: 540px;
}

.overlay-content h2 {
  color: #e94560;
  font-size: 2.6rem;
  text-shadow: 0 0 24px rgba(233, 69, 96, 0.7), 0 0 6px rgba(233, 69, 96, 1);
  margin: 0 0 16px;
  letter-spacing: 2px;
}

.overlay-content p {
  color: #d0d0e0;
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 20px;
}

.overlay-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn {
  background: #1a1a2e;
  border: 2px solid #2a2a4a;
  color: #e6e6f0;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn:hover {
  background: #232344;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #e94560, #c0354f);
  border-color: #e94560;
  box-shadow: 0 0 16px rgba(233, 69, 96, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f05770, #d04060);
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.6);
}

.btn-danger {
  background: #2a1a1a;
  border-color: #aa3344;
  color: #ff8090;
}

.btn-danger:hover {
  background: #3a2020;
}

.highscore-banner {
  margin-top: 18px;
  padding: 10px 18px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid #ffd700;
  border-radius: 8px;
  color: #ffd700;
  font-weight: 700;
  font-size: 0.95rem;
  animation: gold-pulse 1.4s infinite alternate;
  text-shadow: 0 0 8px #ffd700;
}

@keyframes gold-pulse {
  from { box-shadow: 0 0 4px rgba(255, 215, 0, 0.3); }
  to { box-shadow: 0 0 16px rgba(255, 215, 0, 0.6); }
}

/* Pause overlay */
.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

.pause-content {
  text-align: center;
  padding: 30px;
}

.pause-content h2 {
  color: #00ffe0;
  text-shadow: 0 0 16px rgba(0, 255, 224, 0.6);
  font-size: 2.4rem;
  margin: 0 0 16px;
  letter-spacing: 4px;
}

.pause-content p {
  color: #d0d0e0;
  margin: 0 0 18px;
}

/* Controls */
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

.control-btn {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  color: #e6e6f0;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
}

.control-btn:hover {
  background: #232344;
  border-color: #e94560;
}

/* Mobile dpad */
.dpad {
  display: none;
  justify-content: center;
  gap: 14px;
  margin: 16px 0 30px;
}

.dpad-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #1a1a2e;
  border: 2px solid #e94560;
  color: #e94560;
  font-size: 1.8rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.dpad-btn:active {
  background: #e94560;
  color: #fff;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(145deg, #1a1a2e, #15152a);
  border: 1px solid #2a2a4a;
  border-radius: 14px;
  padding: 30px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 60px rgba(233, 69, 96, 0.2);
}

.modal-content h2 {
  color: #e94560;
  margin: 0 0 18px;
  text-shadow: 0 0 12px rgba(233, 69, 96, 0.4);
}

.modal-content h3 {
  color: #00ffe0;
  margin: 18px 0 10px;
  font-size: 1.1rem;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px 10px;
}

.modal-close:hover {
  color: #e94560;
}

.how-list {
  padding-left: 22px;
  color: #d0d0e0;
  line-height: 1.7;
}

.how-list li {
  margin: 6px 0;
}

.powerup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.powerup-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: #d0d0e0;
}

.powerup-card.bad {
  border-color: #aa3344;
  background: rgba(170, 51, 68, 0.1);
}

.pu {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: #e94560;
  color: #fff;
  font-weight: 900;
  border-radius: 6px;
  text-align: center;
  line-height: 32px;
  box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
  flex-shrink: 0;
}

.pu.bad {
  background: #aa3344;
  box-shadow: 0 0 10px rgba(170, 51, 68, 0.5);
}

/* Leaderboard rows */
.lb-row {
  display: grid;
  grid-template-columns: 60px 1fr 100px 100px;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a2a4a;
  align-items: center;
  font-size: 0.95rem;
}

.lb-row.header {
  font-weight: 700;
  color: #a0a0c0;
  font-size: 0.8rem;
  letter-spacing: 1px;
  border-bottom: 2px solid #e94560;
}

.lb-row .rank { font-weight: 900; font-size: 1.1rem; }
.lb-row.gold .rank { color: #ffd700; text-shadow: 0 0 8px #ffd700; }
.lb-row.silver .rank { color: #c0c0c0; text-shadow: 0 0 6px #c0c0c0; }
.lb-row.bronze .rank { color: #cd7f32; text-shadow: 0 0 6px #cd7f32; }

.lb-empty {
  color: #888;
  text-align: center;
  padding: 30px;
  font-style: italic;
}

/* Stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a4a;
}

.stat-row:last-of-type {
  border-bottom: none;
}

.stat-label {
  color: #a0a0c0;
}

.stat-value {
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  .hud {
    grid-template-columns: repeat(3, 1fr);
  }
  .hud-bricks {
    grid-column: 1 / -1;
  }
  .dpad {
    display: flex;
  }
  .overlay-content h2 {
    font-size: 1.8rem;
  }
}
