/* ==========================================================================
   Game Page Styles — shared by Snake and Doodler
   ========================================================================== */

.game-shell {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-hud {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  color: #4a3e3d;
}

.game-hud .score-value {
  color: #a83232;
  font-size: 1.2rem;
}

.game-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #eae2e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
  touch-action: none;
}

.game-canvas-wrapper canvas {
  display: block;
  width: 100%;
  height: auto;
  background-color: #fbf7f6;
}

/* Start / Game Over overlay shown on top of the canvas */
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: rgba(43, 43, 43, 0.72);
  color: #ffffff;
  text-align: center;
  padding: 20px;
}

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

.game-overlay h2 {
  font-size: 1.4rem;
}

.game-overlay .final-score {
  font-size: 1.1rem;
  color: #ffb3b3;
  font-weight: 700;
}

.game-overlay p {
  font-size: 0.9rem;
  color: #eee;
  max-width: 360px;
}

.game-controls-note {
  margin-top: 14px;
  font-size: 0.9rem;
  color: #4a4a4a;
  text-align: center;
}

.game-mobile-controls {
  display: none;
  margin-top: 16px;
  gap: 10px;
}

.game-mobile-controls .pad-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.game-pad-btn {
  background-color: #4a3e3d;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  width: 56px;
  height: 48px;
  font-size: 1.2rem;
  cursor: pointer;
}

.game-pad-btn:active {
  background-color: #a83232;
}

@media (max-width: 600px) {
  .game-mobile-controls {
    display: flex;
    flex-direction: column;
  }
}

/* ==========================================================================
   Race Game — HUD, standings bars, results list
   ========================================================================== */

.race-hud {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: #4a3e3d;
}

.race-hud .timer-value {
  color: #a83232;
  font-size: 1.2rem;
}

.race-standings {
  width: 100%;
  max-width: 480px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.race-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #4a4a4a;
}

.race-progress-row .racer-label {
  width: 58px;
  flex-shrink: 0;
  font-weight: 600;
}

.race-bar {
  flex-grow: 1;
  height: 10px;
  background-color: #eae2e0;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.race-bar-fill {
  height: 100%;
  border-radius: 6px;
  background-color: #b7aca9;
  transition: width 0.2s linear;
}

.race-progress-row.you .race-bar-fill {
  background-color: #a83232;
}

.race-results-list {
  list-style: none;
  margin: 10px 0 4px 0;
  padding: 0;
  width: 100%;
  max-width: 320px;
  text-align: left;
}

.race-results-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
}

.race-results-list li.you {
  color: #ffb3b3;
  font-weight: 700;
}

