body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    flex-direction: column;
    /* Dokunmatik gecikmesini ve seçimi engelle */
    touch-action: manipulation;
    user-select: none;
}

.game-container {
    width: 450px;
    border: 3px solid #333;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.street {
    width: 450px;
    height: 200px;
    background-color: #555;
    border-top: 20px solid #f0e68c;
    border-bottom: 20px solid #f0e68c;
    position: relative;
    overflow: hidden;
}

.car {
    width: 40px;
    height: 60px;
    background-image: url('car.png');
    background-size: contain;
    background-repeat: no-repeat;
    color: white;
    text-align: center;
    line-height: 60px;
    font-weight: bold;
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: transparent;
    transition: background-color 0.3s;
    border-radius: 5px;
    /* Arabanın dönüş merkezi (ön tekerlekler gibi) */
    transform-origin: center 70%;
}

.parked-car {
    width: 50px;
    height: 80px;
    background-color: #007bff;
    color: white;
    text-align: center;
    line-height: 80px;
    font-weight: bold;
    position: absolute;
    top: 50px;
    transform: translateY(-50%);
    border-radius: 5px;
}

.parked-left { left: 50px; }
.parked-right { right: 50px; }

#message {
    width: 450px;
    margin-top: 15px;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    text-align: center;
    min-height: 1.5em; /* Mesajın kaymasını engelle */
}

/* YENİ: Mobil Kontrol Stilleri */
.controls {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    width: 150px;
    height: 100px;
}

.controls button {
    font-size: 1.5em;
    border: none;
    background-color: #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Butonların grid içindeki yerleşimi */
#btn-up { grid-column: 1 / 3; grid-row: 1; height: 50px;}
#btn-down { grid-column: 1 / 3; grid-row: 2; }
#btn-left { grid-column: 1; grid-row: 1 / 3; transform: translateY(50%); height: 50px; }
#btn-right { grid-column: 2; grid-row: 1 / 3; transform: translateY(50%); height: 50px; }

/* Dokunma/Tıklama efekti */
.controls button:active {
    background-color: #aaa;
    transform: scale(0.95) translateY(50%); /* Sol/Sağ için ayar */
}
#btn-up:active, #btn-down:active {
    transform: scale(0.95); /* Yukarı/Aşağı için */
}

/* Sadece dokunmatik olmayan cihazlarda (fare) hover efekti göster */
@media (hover: hover) and (pointer: fine) {
    .controls button:hover {
        background-color: #bbb;
    }
}


/* Her bir kontrol grubunun (sol ve sağ) stili */
.control-group {
  display: flex;
  gap: 15px; /* Butonlar arası boşluk */
}

/* Sol/Sağ butonları YATAY hizalar */
.steering-controls {
  flex-direction: row;
}

/* Gaz/Fren butonlarını DİKEY hizalar (Gaz üste gelir) */
.movement-controls {
  flex-direction: column-reverse;
}

/* Butonların kendisi */
.mobile-controls button {
  width: 65px;
  height: 65px;
  border: 2px solid white;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  font-size: 2rem;
  line-height: 1;
  border-radius: 50%; /* Yuvarlak butonlar */
  
  /* Dokunma hissiyatı için */
  user-select: none; /* Metin seçilmesini engeller */
  -webkit-tap-highlight-color: transparent; /* Dokunma vurgusunu kaldırır */
}

/* Butona basıldığında */
.mobile-controls button:active {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

/* MEDYA SORGUSU: 
  Bu stiller sadece ekran genişliği 768px veya daha az 
  olduğunda (yani tablet ve telefonlarda) uygulanır.
*/
@media (max-width: 768px) {
  .mobile-controls {
    display: flex; /* Gizli olan kontrolleri görünür yap */
  }
}

/* Direksiyonun kendisi */
#steering-wheel {
  width: 120px;  /* Butonlardan daha geniş */
  height: 120px; /* Butonlardan daha geniş */
  background-color: rgba(0, 0, 0, 0.5);
  border: 6px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%; /* Tamamen yuvarlak */
  position: relative; /* İç çubuklar için */
  
  /* Dokunma hissiyatı */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  
  /* Dokunma ile dönerken yumuşak geçiş */
  transition: transform 0.1s ease-out;
}

/* Direksiyonun içindeki çubuklar (Görsel amaçlı) */
#steering-wheel::before,
#steering-wheel::after {
  content: '';
  position: absolute;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
}

/* Dikey çubuk */
#steering-wheel::before {
  width: 10px;
  height: 40px;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}

/* Yatay çubuk */
#steering-wheel::after {
  width: 80px;
  height: 10px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Direksiyonun yerleştiği grubu ortalamak için */
.steering-controls {
  /* Zaten flex-direction: row; idi, ortalayalım */
  justify-content: center;
  flex-grow: 1; /* Sol tarafın boşluğunu doldurur */
}

.movement-controls {
  /* Sağ tarafı biraz iter */
  flex-shrink: 0;
}