body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: linear-gradient(180deg, #edf2ff 0%, #e2e8f0 100%);
  color: #111827;
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  margin: 0;
  font-size: 2.4rem;
}

.title-row .hint {
  color: #4b5563;
  font-size: 0.95rem;
}

.game-panel {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 20px;
  margin-bottom: 22px;
}

.board-card,
.control-card,
.status-card,
.log-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.small-label {
  margin: 0 0 6px;
  color: #6b7280;
  font-size: 0.95rem;
}

.route-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.status-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.route-track {
  position: relative;
  height: 140px;
  margin-bottom: 20px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 60%);
  border-radius: 20px;
  padding: 28px 20px 12px;
}

.track-line {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 70px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c7d2fe 0%, #a5b4fc 100%);
}

.stop-markers {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 55px;
  height: 40px;
}

.stop-marker {
  position: absolute;
  top: 0;
  width: 36px;
  height: 36px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #f8fafc;
  color: #1f2937;
  border: 2px solid #cbd5e1;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.92rem;
}

.stop-marker.current-stop {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.stop-marker.next-stop {
  background: #c7d2fe;
  border-color: #93c5fd;
}

.bus-icon {
  position: absolute;
  top: 42px;
  left: 0;
  width: 56px;
  height: 56px;
  transform: translateX(-50%);
  border-radius: 18px;
  background: #1e3a8a;
  color: #ffffff;
  font-size: 1.8rem;
  display: grid;
  place-items: center;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
  transition: left 0.1s ease-out;
}

.drive-panel,
.buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.control-card label,
.control-card select,
.control-card button {
  display: block;
}

.control-card label {
  margin-bottom: 10px;
  color: #374151;
  font-weight: 700;
}

.control-card select,
.control-card button {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 1rem;
}

button {
  cursor: pointer;
  font-weight: 700;
  color: #111827;
  transition: transform 0.15s ease, background 0.15s ease;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

#driveButton,
#startButton {
  background: #2563eb;
  color: #ffffff;
  border: none;
}

#accelerateButton,
#brakeButton {
  background: #e0f2fe;
  border: none;
}

#refuelButton,
#endButton {
  background: #e2e8f0;
}

.status-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 20px;
}

.status-card h2,
.log-card h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.15rem;
}

.status-card p,
.log-output div {
  margin: 10px 0;
}

.log-output {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
}

.log-output div {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fafc;
}

.compact {
  padding: 16px;
}

@media (max-width: 960px) {
  .game-panel {
    grid-template-columns: 1fr;
  }

  .drive-panel,
  .buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .drive-panel,
  .buttons {
    grid-template-columns: 1fr;
  }
}
