body {
  margin: 0;
  font-family: "Arial", sans-serif;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  background-color: #87CEEB;
}

.background-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.sky {
  width: 100%;
  height: 200px;
  background: linear-gradient(to bottom, #b0e0f8, #d6f1fb);
}

.ground {
  width: 100%;
  height: calc(100% - 200px);
  background: linear-gradient(to top, #556B2F, #6B8E23);
  position: relative;
}

.ground::before {
  content: '';
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: url('https://cdn.pixabay.com/photo/2014/04/02/10/47/trees-306243_1280.png') no-repeat bottom center;
  background-size: contain;
  opacity: 0.5;
  pointer-events: none;
}

.game-container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: auto;
  padding: 10px;
  text-align: center;
}

.screen {
  position: relative;
  width: 100%;
  height: 300px;
  perspective: 400px;
  overflow: hidden;
  background: url('https://www.transparenttextures.com/patterns/grass.png');
  border-radius: 10px;
  margin-top: 30px;
}

#road {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 400px;
  background: linear-gradient(to bottom, #888, #444);
  transform: rotateX(15deg);
  transform-origin: bottom;
  border-left: 20px solid #eee;
  border-right: 20px solid #eee;
  box-sizing: border-box;
  overflow: hidden;
}

.line {
  position: absolute;
  width: 10px;
  height: 50px;
  background: #fff;
  left: 50%;
  transform: translateX(-50%);
  animation-name: move-lines;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  opacity: 1;
}

@keyframes move-lines {
  0% { top: -50px; }
  100% { top: 100%; }
}

.driving .line {
  opacity: 1;
}

#car {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 150px;
  z-index: 10;
  transform-origin: bottom center;
  transition: transform 0.2s ease-out;
}

.car-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: #f39c12;
  border-radius: 40% 40% 10% 10%;
  box-shadow: 0 5px 10px rgba(0,0,0,0.5);
}

.car-roof {
  position: absolute;
  top: 20%;
  left: 15%;
  width: 70%;
  height: 40%;
  background-color: #c0392b;
  border-radius: 50% 50% 0 0;
  border-top: 5px solid #bdc3c7;
}

.car-light {
  position: absolute;
  bottom: 10px;
  width: 15px;
  height: 5px;
  background-color: #f1c40f;
  border-radius: 3px;
}

.car-light.left {
  left: 5px;
}

.car-light.right {
  right: 5px;
}

.boost {
  transform: translateX(-50%) scale(1.1) !important;
  animation: boost-flash 0.1s linear 2;
}

@keyframes boost-flash {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

.ui-panel {
  padding: 15px 0;
}

#word {
  font-size: 2.5rem;
  font-weight: bold;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#input {
  font-size: 1.5rem;
  padding: 10px;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  border: 2px solid white;
  margin-top: 10px;
}

#stats {
  margin: 10px 0;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 10px;
}

#startBtn {
  font-size: 1.2rem;
  padding: 10px 20px;
  margin-top: 15px;
  background: orange;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px #c26a00;
}

#startBtn:active {
  transform: scale(0.95) translateY(2px);
  box-shadow: 0 2px #c26a00;
}

.ui-panel > div {
  display: flex;
  justify-content: center;
}
