/* Base styles */
body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: #111;
  color: white;
  margin: 0;
  padding: 20px;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 {
  font-family: 'Racing Sans One', cursive;
  color: #ffcc00;
  margin-bottom: 20px;
  font-size: 3em;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.container {
  max-width: 800px;
  margin: 0 auto;
  flex: 1;
}

/* Track styles */
#track {
  height: 300px;
  background-color: #222;
  position: relative;
  margin: 20px 0;
  border: 1px solid #444;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Car styles */
.car {
  position: absolute;
  width: 80px;
  height: 30px;
  border-radius: 5px;
  transition: left 0.1s linear;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#player-car {
  bottom: 50px;
  left: 10px;
  background-color: red;
}

#cpu-car {
  top: 50px;
  left: 10px;
  background-color: blue;
}

.car-label {
  position: absolute;
  color: white;
  font-weight: bold;
  font-size: 12px;
  background-color: rgba(0,0,0,0.7);
  padding: 2px 5px;
  border-radius: 3px;
}

#player-label {
  bottom: -20px;
  left: 20px;
}

#cpu-label {
  top: -20px;
  left: 20px;
}

/* Crowd and environment */
.crowd {
  position: absolute;
  width: 100%;
  height: 20px;
  background: repeating-linear-gradient(
    45deg,
    #444,
    #444 10px,
    #555 10px,
    #555 20px
  );
}

.top-crowd {
  top: 0;
}

.bottom-crowd {
  bottom: 0;
}

/* RPM meter */
#rpm-meter {
  width: 30px;
  height: 200px;
  background-color: #222;
  margin: 15px auto;
  position: relative;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

#rpm-indicator {
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: white;
  bottom: 0%;
  left: 0;
  box-shadow: 0 0 5px white;
  transition: bottom 0.1s linear;
}

#rpm-background {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to top, #4CAF50, #FFC107 70%, #F44336 85%);
  border-radius: 3px;
  opacity: 0.8;
}

#shift-target {
  position: absolute;
  left: 0;
  width: 100%;
  height: 15%;
  background-color: rgba(255,255,255,0.3);
  border: 2px dashed white;
  box-sizing: border-box;
  z-index: 1;
  animation: pulse 2s infinite;
}

/* Car selection */
.car-selection {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

.car-option {
  width: 150px;
  padding: 15px;
  border: 2px solid #444;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #222;
}

.car-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.car-option.selected {
  border-color: #4CAF50;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.car-preview {
  height: 60px;
  margin: 15px 0;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
}

.muscle-preview { color: #F44336; }
.sport-preview { color: #2196F3; }
.exotic-preview { color: #FFC107; }

/* Buttons */
button {
  padding: 15px 30px;
  font-size: 18px;
  margin: 10px;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: #4CAF50;
  color: white;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-weight: bold;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#shift-button {
  background-color: #f44336;
  font-size: 24px;
  padding: 15px 40px;
}

/* Stats display */
.stats {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.stat-box {
  padding: 10px 20px;
  background-color: #222;
  border-radius: 5px;
  font-size: 16px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Message display */
#message {
  height: 30px;
  font-size: 24px;
  font-weight: bold;
  color: #ffcc00;
  margin: 10px 0;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

/* Screen management */
.screen {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.screen.active {
  display: block;
  opacity: 1;
}

/* Finish line */
.finish-line {
  position: absolute;
  right: 10px;
  top: 0;
  width: 10px;
  height: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    black,
    black 20px,
    white 20px,
    white 40px
  );
}

/* Game controls layout */
.game-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
}

.meter-container {
  margin: 0 20px;
}

/* Animations */
@keyframes pulse {
  0% { opacity: 0.3; }
  50% { opacity: 0.6; }
  100% { opacity: 0.3; }
}

/* Instructions */
.instructions {
  margin: 20px 0;
  padding: 20px;
  background-color: #222;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.controls-hint {
  color: #4CAF50;
  font-style: italic;
}

/* End screen */
#result-message {
  font-size: 36px;
  margin: 20px 0;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#final-score {
  font-size: 24px;
  margin-bottom: 30px;
  color: #FFC107;
} 