/* Uzun Yol: oyun alanı orta paneli doldurur; göstergeler yarı saydam, temanın vurgu rengiyle */

.road { flex: 1; min-height: 0; display: flex; padding: 0 16px; }
.road-stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden; outline: none;
  background: #0b0d10; border: 1px solid var(--line); border-radius: 10px;
}
.road-stage:fullscreen { border: 0; border-radius: 0; }
.road-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.road-stage canvas:active { cursor: grabbing; }
.road-stage.photo .rd-hud { display: none; }
.rd-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: var(--muted); text-align: center; }

.rd-hud {
  position: absolute; inset: 0; pointer-events: none; color: #fff; font-size: 12px;
  background: radial-gradient(ellipse 75% 70% at 50% 46%, transparent 55%, rgb(0 0 0 / 0.22) 100%); /* hafif kenar gölgesi */
}
.rd-glass {
  background: rgb(10 12 16 / 0.52); border: 1px solid rgb(255 255 255 / 0.1); border-radius: 10px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* Sol üst: bölge ve sıradaki kasaba */
.rd-place { position: absolute; left: 12px; top: 12px; display: grid; gap: 2px; padding: 8px 12px; }
.rd-place b { font-size: 13px; font-weight: 600; }
.rd-place small { color: rgb(255 255 255 / 0.72); font-size: 11px; }
.rd-place small::before { content: "→ "; }

/* Ortada: bölgeye girince / kasabaya varınca büyük yazı */
.rd-banner {
  position: absolute; left: 50%; top: 20%; transform: translateX(-50%); width: max-content; max-width: 90%;
  text-align: center; opacity: 0; text-shadow: 0 2px 18px rgb(0 0 0 / 0.55);
}
.rd-banner b { display: block; font-size: clamp(22px, 4.2vw, 44px); font-weight: 300; letter-spacing: 0.14em; }
.rd-banner small { display: block; margin-top: 4px; font-size: 12px; letter-spacing: 0.3em; opacity: 0.85; }
.rd-banner.on { animation: rd-banner 4.8s ease forwards; }
@keyframes rd-banner {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  14%, 76% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}

/* Sol alt: hız ve yolculuk */
.rd-gauge {
  position: absolute; left: 12px; bottom: 12px; display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 0 8px;
  min-width: 176px; padding: 10px 14px;
}
.rd-speed { font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.rd-unit { padding-bottom: 4px; font-size: 11px; opacity: 0.7; }
.rd-trip { grid-column: 1 / -1; margin-top: 5px; font-size: 11px; opacity: 0.75; }
.rd-badge {
  grid-column: 1 / -1; justify-self: start; margin-top: 7px; padding: 1px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg); font-size: 10px; font-weight: 700;
}

/* Sağ üst: yoldaki arkadaşlar */
.rd-convoy { position: absolute; right: 12px; top: 12px; display: grid; gap: 4px; min-width: 190px; padding: 8px 10px; pointer-events: auto; }
.rd-convoy-title { color: rgb(255 255 255 / 0.6); font-size: 10px; letter-spacing: 0.12em; }
.rd-convoy-row { display: flex; align-items: center; gap: 8px; }
.rd-convoy-row b { font-weight: 600; }
.rd-convoy-row small { flex: 1; color: rgb(255 255 255 / 0.7); font-size: 11px; }
.rd-go {
  height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: var(--accent); color: var(--accent-fg);
}

/* Sağ alt: düğmeler */
.rd-bar { position: absolute; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 62%; pointer-events: auto; }
.rd-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; color: #fff; font-size: 12px;
  background: rgb(10 12 16 / 0.52); border: 1px solid rgb(255 255 255 / 0.12); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.rd-btn:hover { border-color: rgb(255 255 255 / 0.4); }
.rd-btn.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.rd-icon { width: 14px; text-align: center; }

/* Ayarlar */
.rd-panel {
  position: absolute; right: 12px; bottom: 54px; display: grid; gap: 12px; width: min(340px, calc(100% - 24px));
  max-height: calc(100% - 80px); overflow-y: auto; padding: 14px; pointer-events: auto;
  color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgb(0 0 0 / 0.4);
}
.rd-panel-title { font-size: 13px; }
.rd-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rd-row-title { width: 100%; color: var(--faint); font-size: 11px; letter-spacing: 0.06em; }
.rd-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-choice button {
  height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px;
  color: var(--muted); background: var(--raise); border: 1px solid var(--line);
}
.rd-choice button.on { color: var(--fg); border-color: var(--accent); }
.rd-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-swatches button { width: 24px; height: 24px; border-radius: 50%; background: var(--c); border: 2px solid var(--line); }
.rd-swatches button.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd-time { flex: 1; min-width: 140px; accent-color: var(--accent); }
.rd-time-label { font-variant-numeric: tabular-nums; }
.rd-check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.rd-league { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.rd-league-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 6px; border-radius: 6px; }
.rd-league-row.me { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rd-league small { color: var(--faint); }

/* İlk açılışta tuşlar, kısa bilgiler */
.rd-help {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
  padding: 9px 14px; border-radius: 10px; background: rgb(10 12 16 / 0.62); text-align: center; line-height: 1.6;
  opacity: 0; transition: opacity 0.6s;
}
.rd-help.on { opacity: 1; }
.rd-help kbd { padding: 0 5px; border-radius: 4px; background: rgb(255 255 255 / 0.14); font: inherit; }
.rd-toast {
  position: absolute; left: 50%; top: 14px; transform: translate(-50%, -6px); padding: 6px 12px; border-radius: 999px;
  background: rgb(10 12 16 / 0.62); opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
.rd-toast.on { opacity: 1; transform: translate(-50%, 0); }
.rd-loading {
  position: absolute; inset: 0; display: grid; place-items: center; background: #0b0d10;
  color: #9aa0a8; letter-spacing: 0.2em; font-size: 12px;
}

/* Dokunmatik: sol altta direksiyon, sağda gaz / fren */
.rd-touch { display: none; }
.rd-touch-btn {
  position: absolute; width: 64px; height: 64px; border-radius: 50%; pointer-events: auto; touch-action: none;
  color: #fff; font-size: 22px; background: rgb(10 12 16 / 0.42); border: 1px solid rgb(255 255 255 / 0.25);
}
.rd-touch-btn.on { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.rd-touch-btn.left { left: 14px; bottom: 112px; }
.rd-touch-btn.right { left: 88px; bottom: 112px; }
.rd-touch-btn.gas { right: 14px; bottom: 150px; }
.rd-touch-btn.brake { right: 14px; bottom: 80px; }
@media (pointer: coarse) {
  .rd-touch { display: block; }
}

/* Dar alanda düğmelerde sadece simge */
@container (max-width: 760px) {
  .rd-label { display: none; }
  .rd-bar { max-width: 70%; }
  .rd-place { max-width: 46%; }
}
@media (max-width: 760px) {
  .rd-help { top: 42%; }
  .road { padding: 0; }
  .road-stage { border-radius: 0; border-width: 0; }
  .rd-gauge { min-width: 0; padding: 8px 10px; }
  .rd-speed { font-size: 26px; }
  .rd-trip { display: none; }
}
