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

body {
  background: #0C0D14;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  color: #e0e0e0;
}

#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#main-area {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

#game-canvas {
  border: 2px solid #2a2d3a;
  border-radius: 4px;
  display: block;
}

#side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 120px;
}

.panel-section {
  background: #161822;
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
}

.panel-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #888;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

#next-canvas {
  display: block;
  margin: 0 auto;
}

#game-over-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(12, 13, 20, 0.88);
  z-index: 10;
  transition: opacity 0.3s ease;
}

#game-over-overlay.hidden {
  display: none;
}

#game-over-box {
  text-align: center;
  padding: 40px 60px;
  background: #161822;
  border: 2px solid #2a2d3a;
  border-radius: 12px;
}

#game-over-box h1 {
  font-size: 42px;
  color: #ff5555;
  margin-bottom: 16px;
  font-weight: 700;
}

#game-over-box p {
  font-size: 22px;
  margin-bottom: 10px;
  color: #cccccc;
}

#final-score,
#final-level {
  color: #ffffff;
  font-weight: 700;
}

.restart-hint {
  font-size: 16px !important;
  color: #777 !important;
  margin-top: 12px !important;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (max-width: 600px) {
  #main-area {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  #side-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    min-width: auto;
    gap: 6px;
  }

  .panel-section {
    padding: 6px 12px;
  }

  .panel-section h3 {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-value {
    font-size: 22px;
  }

  #game-over-box {
    padding: 24px 32px;
  }

  #game-over-box h1 {
    font-size: 30px;
  }

  #game-over-box p {
    font-size: 18px;
  }
}
