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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Courier New', Courier, monospace;
  background: #1a1a2e;
  color: #e0e0e0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

h1 {
  font-size: 1.3rem;
  color: #4ecdc4;
}

/* Game Header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  background: #16213e;
  border-bottom: 2px solid #0f3460;
}

.back-link {
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 4px 10px;
  background: #0f3460;
  border-radius: 4px;
}

.back-link:hover {
  background: #1a4a8a;
}

.score-container {
  display: flex;
  gap: 6px;
  align-items: center;
}

.score-box {
  background: #0f3460;
  border-radius: 4px;
  padding: 2px 10px;
  text-align: center;
  min-width: 50px;
}

.score-label {
  display: block;
  font-size: 0.45rem;
  color: #8899aa;
  text-transform: uppercase;
  font-weight: bold;
}

#score, #best {
  display: block;
  font-size: 1rem;
  font-weight: bold;
  color: #4ecdc4;
}

.restart-btn {
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 14px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  transition: background 0.2s;
}

.restart-btn:hover {
  background: #c73650;
}

/* Game Area */
#game-area-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#game-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

/* Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 46, 0.88);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

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

.overlay-content h2 {
  font-size: 2rem;
  color: #e94560;
  margin-bottom: 12px;
  font-family: 'Courier New', monospace;
}

.overlay-content p {
  font-size: 1rem;
  color: #e0e0e0;
  margin-bottom: 18px;
  font-family: 'Courier New', monospace;
}

.hidden {
  display: none;
}

/* Medal on game over */
.medal {
  font-size: 3rem;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 480px) {
  .game-header {
    padding: 4px 6px;
  }

  h1 {
    font-size: 1rem;
  }

  .score-box {
    padding: 2px 6px;
    min-width: 40px;
  }

  #score, #best {
    font-size: 0.85rem;
  }

  .overlay-content h2 {
    font-size: 1.5rem;
  }

  .overlay-content p {
    font-size: 0.85rem;
  }
}
