/**
 * 3C ULTRA YARIŞ - Ultra Modern Motorsport Glassmorphic UI (Akıllı Tahta & Mobil Ergonomik Tasarım)
 */
:root {
  --bg-dark: #050811;
  --panel-bg: rgba(10, 15, 28, 0.78);
  --panel-border: rgba(0, 245, 212, 0.24);
  --cyan: #00f5d4;
  --blue: #00b4d8;
  --red: #ff0055;
  --orange: #ff6b00;
  --gold: #ffbe0b;
  --green: #38b000;
  --text-main: #f8f9fa;
  --text-muted: #94a3b8;
  --font-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  touch-action: none;
}

/* 3D SAHNE TUVALİ */
#canvas-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#game-canvas, #fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#fx-canvas {
  pointer-events: none;
  z-index: 2;
}

/* CAM EFEKTLİ BAR VE PANELLER */
.glass-bar {
  background: linear-gradient(90deg, rgba(7, 11, 22, 0.88) 0%, rgba(13, 21, 40, 0.82) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 245, 212, 0.25);
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.glass-hud {
  background: rgba(8, 12, 24, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* ÜST ÇUBUK */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: linear-gradient(135deg, var(--red), #ff5400);
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(255, 0, 85, 0.5);
}

.brand-titles h1 {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hdr-tag {
  font-size: 11px;
  background: rgba(0, 245, 212, 0.18);
  color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
}

.brand-titles p {
  font-size: 11px;
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.credits-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 190, 11, 0.14);
  border: 1px solid rgba(255, 190, 11, 0.45);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--gold);
  font-size: 13px;
}

.credits-label {
  font-size: 10px;
  opacity: 0.85;
}

.action-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.action-btn:hover, .action-btn:active {
  background: rgba(0, 245, 212, 0.18);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.action-btn.accent-cyan {
  background: rgba(0, 245, 212, 0.16);
  border-color: var(--cyan);
  color: var(--cyan);
}

.action-btn.accent-orange {
  background: linear-gradient(135deg, rgba(255, 84, 0, 0.28), rgba(255, 0, 85, 0.28));
  border-color: #ff5400;
  color: #ffbe0b;
}

.action-btn.danger {
  background: rgba(255, 0, 85, 0.2);
  border-color: var(--red);
}

.action-btn.large {
  padding: 13px 22px;
  font-size: 14px;
}

/* EKRAN KATMANLARI */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  pointer-events: none;
}

.screen.active {
  display: flex;
}

/* ANA MENÜ & GARAJ DÜZENİ */
#menu-screen {
  padding: 72px 18px 16px 18px;
  justify-content: space-between;
  align-items: stretch;
  gap: 14px;
}

.menu-panel {
  width: 360px;
  max-width: 32vw;
  padding: 15px;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow-y: auto;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.panel-header h2 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--cyan);
}

.panel-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.mt-12 {
  margin-top: 12px;
}

.badge-pill {
  background: rgba(0, 180, 216, 0.2);
  border: 1px solid var(--blue);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

/* OYUN MODU KARTLARI */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  padding: 9px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.mode-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mode-card.active {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.22), rgba(0, 180, 216, 0.12));
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

.mode-card.highlight-2p.active {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.28), rgba(255, 190, 11, 0.18));
  border-color: var(--gold);
}

.mode-icon {
  font-size: 20px;
}

.mode-info strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.mode-info span {
  font-size: 10px;
  color: var(--text-muted);
}

/* PİST SEÇİM LİSTESİ */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.track-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.16s ease;
  color: var(--text-main);
  text-align: left;
}

.track-card:hover {
  background: rgba(255, 255, 255, 0.09);
}

.track-card.active {
  background: linear-gradient(90deg, rgba(0, 180, 216, 0.26), rgba(0, 245, 212, 0.08));
  border-color: var(--cyan);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.track-card-left strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.track-card-left small {
  font-size: 10px;
  color: var(--text-muted);
}

.track-weather-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  white-space: nowrap;
}

/* ORTA VİTRİN VE BAŞLAT BUTONU */
.center-showcase {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.showcase-rotate-hint {
  background: rgba(6, 10, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-muted);
}

.bottom-launch-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  pointer-events: auto;
}

.car-quick-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.car-pill {
  background: rgba(9, 14, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.car-pill.locked-pill {
  opacity: 0.75;
  border-color: rgba(255, 190, 11, 0.35);
  color: #c9d4e5;
}

.car-pill.active {
  background: var(--cyan);
  color: #040810;
  border-color: #fff;
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.6);
}

.car-pill.active.locked-pill {
  background: linear-gradient(135deg, #ffbe0b, #ff8800);
  color: #050811;
  border-color: #fff;
  box-shadow: 0 0 14px rgba(255, 190, 11, 0.65);
}

.car-series-badge.locked-badge {
  background: rgba(255, 190, 11, 0.18);
  border: 1px solid #ffbe0b;
  color: #ffbe0b;
}

.launch-btn {
  background: linear-gradient(135deg, #00f5d4 0%, #00b4d8 55%, #0077b6 100%);
  color: #040811;
  border: 2px solid #ffffff;
  border-radius: 16px;
  padding: 13px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 245, 212, 0.42);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.launch-btn.unlock-ready-btn {
  background: linear-gradient(135deg, #ffbe0b 0%, #ff7700 65%, #ff0055 100%);
  color: #ffffff;
  border-color: #ffbe0b;
  box-shadow: 0 10px 30px rgba(255, 190, 11, 0.6);
  animation: pulseGold 1.2s infinite alternate ease-in-out;
}
@keyframes pulseGold {
  from { box-shadow: 0 6px 18px rgba(255, 190, 11, 0.45); }
  to { box-shadow: 0 12px 32px rgba(255, 190, 11, 0.85); transform: scale(1.02); }
}

.launch-btn.locked-disabled-btn {
  background: rgba(22, 27, 40, 0.94);
  color: #8b9bb4;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.85;
}
.launch-btn.locked-disabled-btn:hover {
  transform: none;
  box-shadow: none;
}

.launch-btn:hover, .launch-btn:active {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 245, 212, 0.65);
}

.launch-btn.compact {
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 900;
}

.launch-icon {
  font-size: 26px;
}

.launch-text {
  text-align: left;
}

.launch-text strong {
  display: block;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.launch-text small {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}

/* SAĞ PANEL: GARAJ SEKMELERİ VE ARAÇ ÖZELLİKLERİ */
.garage-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.garage-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 7px 6px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.garage-tab.active {
  background: rgba(0, 245, 212, 0.2);
  border-color: var(--cyan);
  color: var(--text-main);
}

.car-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 9px;
  margin-bottom: 10px;
}

.nav-arrow {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(0, 245, 212, 0.14);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.car-title-box {
  text-align: center;
  flex: 1;
  padding: 0 6px;
}

.car-series-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  color: var(--gold);
  background: rgba(255, 190, 11, 0.16);
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 2px;
}

.car-title-box h2 {
  font-size: 15px;
  font-weight: 900;
}

.car-title-box p {
  font-size: 11px;
  color: var(--text-muted);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.tab-content.active {
  display: flex;
}

.stat-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
}

.stat-label span {
  color: var(--text-muted);
  font-weight: 700;
}

.stat-bar {
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 99px;
  transition: width 0.3s ease;
}

.acoustic-info-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 9px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.acoustic-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.acoustic-row span {
  color: var(--text-muted);
}

.p2-selector-box {
  background: rgba(255, 0, 85, 0.15);
  border: 1px solid var(--red);
  border-radius: 10px;
  padding: 8px;
  margin-top: 4px;
}

.p2-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 5px;
  text-align: center;
}

.p2-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-arrow {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}

/* ÖZELLEŞTİRME RENK PALETLERİ VE PLAKA */
.custom-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.custom-group label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.color-swatch {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.color-swatch.active {
  transform: scale(1.18);
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.plate-input-row {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 3px solid #111;
  border-radius: 8px;
  overflow: hidden;
  height: 38px;
}

.tr-flag-badge {
  background: #0038a8;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  height: 100%;
  padding: 0 10px;
  display: flex;
  align-items: center;
}

#plate-input {
  border: none;
  background: transparent;
  color: #0b0d10;
  font-weight: 900;
  font-size: 17px;
  text-align: center;
  width: 100%;
  outline: none;
  text-transform: uppercase;
  user-select: text;
  -webkit-user-select: text;
}

/* PERFORMANS YÜKSELTME LİSTESİ */
.upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.upgrade-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upgrade-info strong {
  display: block;
  font-size: 12px;
}

.upgrade-info small {
  color: var(--cyan);
  font-size: 10px;
}

.upgrade-btn {
  background: linear-gradient(135deg, var(--gold), #ff8800);
  color: #050811;
  border: none;
  padding: 7px 11px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 11px;
  cursor: pointer;
}

.upgrade-btn:disabled {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  cursor: default;
}

/* ============================================================================
   YARIŞ İÇİ SADE VE FERAH HUD EKRANI (Kalabalık Giderildi, Hız Kadranı Küçültüldü)
   ============================================================================ */
#hud-screen {
  flex-direction: column;
  justify-content: space-between;
}

/* Sol Üst: Sadece Kompakt Mini Harita */
.hud-top-left {
  position: fixed;
  top: 12px;
  left: 14px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  z-index: 16;
}

.minimap-box {
  width: 154px;
  height: 154px;
  padding: 4px;
}

/* Orta Üst: Kompakt Telemetri Hapı */
.hud-top-center {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 16;
}

.race-telemetry {
  display: flex;
  gap: 16px;
  padding: 6px 18px;
}

.telemetry-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.t-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.t-value {
  font-size: 19px;
  font-weight: 900;
}

.t-value small {
  font-size: 11px;
  opacity: 0.7;
}

.t-value.accent-gold {
  color: var(--gold);
}

.t-value.accent-cyan {
  color: var(--cyan);
}

.mono {
  font-variant-numeric: tabular-nums;
}

/* Kısa Süreli Bonus / Drift / Joker Bildirim Hapı */
.drift-popup {
  background: linear-gradient(90deg, rgba(157, 78, 221, 0.92), rgba(0, 245, 212, 0.92));
  border: 1.5px solid #fff;
  padding: 4px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 245, 212, 0.45);
  animation: pulseDrift 0.3s infinite alternate;
}

.drift-popup.drift-style {
  background: linear-gradient(90deg, rgba(255, 0, 85, 0.88), rgba(255, 136, 0, 0.88));
}

@keyframes pulseDrift {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.drift-title {
  font-size: 11px;
  font-weight: 900;
}

#drift-current-pts {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}

.mult-badge {
  background: #050811;
  color: var(--gold);
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 11px;
}

/* Sağ Üst: Hızlı Aksiyon Butonları */
.hud-top-right {
  position: fixed;
  top: 12px;
  right: 14px;
  display: flex;
  gap: 6px;
  pointer-events: auto;
  z-index: 25;
}

.hud-btn {
  background: rgba(8, 13, 26, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 7px 11px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}

.hud-btn.accent {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 245, 212, 0.16);
}

.hud-btn.danger {
  border-color: var(--red);
  background: rgba(255, 0, 85, 0.25);
}

/* GERİ SAYIM VE F1 IŞIKLARI */
.countdown-overlay {
  position: fixed;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 25;
}

.f1-lights-row {
  display: flex;
  gap: 10px;
  background: rgba(8, 10, 16, 0.9);
  padding: 8px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.f1-bulb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #222;
  border: 2px solid #444;
}

.f1-bulb.red {
  background: #ff002b;
  box-shadow: 0 0 18px #ff002b;
}

.f1-bulb.green {
  background: #38b000;
  box-shadow: 0 0 20px #38b000;
}

.countdown-number {
  font-size: 72px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 28px var(--cyan), 0 6px 18px rgba(0, 0, 0, 0.8);
}

/* KÜÇÜLTÜLMÜŞ KOMPAKT HIZ KADRANI (Sağ Üstte, Kontrolleri ve Yolu Kapatmaz) */
.tachometer-cluster {
  position: fixed;
  top: 52px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 16;
}

.nitro-bar-wrap {
  width: 152px;
  margin-top: -6px;
  background: rgba(7, 11, 22, 0.82);
  border: 1px solid rgba(0, 245, 212, 0.35);
  padding: 4px 8px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nitro-label {
  font-size: 9px;
  font-weight: 900;
  color: var(--cyan);
  white-space: nowrap;
}

.nitro-track {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  overflow: hidden;
}

.nitro-fill {
  height: 100%;
  background: linear-gradient(90deg, #00b4d8, #00f5d4, #ffffff);
  box-shadow: 0 0 10px var(--cyan);
  transition: width 0.08s linear;
}

/* ============================================================================
   1. EKRAN GENELİ SOL VE SAĞ YÖNLENDİRME DOKUNMA ALANLARI
   ============================================================================ */
.screen-steer-layer {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  pointer-events: auto;
}

.steer-zone {
  flex: 1;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  display: flex;
  align-items: center;
  transition: background 0.12s ease;
}

.steer-zone.steer-left {
  justify-content: flex-start;
  padding-left: 28px;
}

.steer-zone.steer-right {
  justify-content: flex-end;
  padding-right: 28px;
}

.steer-visual-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.22;
  transition: opacity 0.15s ease, transform 0.15s ease, filter 0.15s ease;
  pointer-events: none;
}

.steer-hint-arrow {
  font-size: 46px;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 16px var(--cyan);
  line-height: 1;
}

.steer-hint-text {
  font-size: 11px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 1.2px;
}

/* Ekrana dokunulduğunda anında canlı parlama efekti */
.steer-zone.active {
  background: radial-gradient(circle at center, rgba(0, 245, 212, 0.09) 0%, transparent 68%);
}

.steer-zone.active .steer-visual-hint {
  opacity: 0.90;
  transform: scale(1.18);
  filter: drop-shadow(0 0 18px var(--cyan));
}

/* ============================================================================
   2. ALT ORTA SADELEŞTİRİLMİŞ FREN VE NİTRO DOCK PANELİ
   ============================================================================ */
.bottom-dock-1p {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  gap: 16px;
  align-items: center;
  pointer-events: auto;
}

.dock-btn {
  border-radius: 18px;
  height: 74px;
  min-width: 140px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.08s ease, filter 0.15s ease, border-color 0.15s ease, background 0.2s ease;
}

.dock-btn:active, .dock-btn.pressed {
  transform: scale(0.93);
}

.dock-brake {
  background: linear-gradient(180deg, rgba(255, 0, 85, 0.38), rgba(120, 0, 40, 0.78));
  border-color: var(--red);
  color: #ffffff;
}

.dock-brake.pressed, .dock-brake:active {
  background: linear-gradient(180deg, rgba(255, 0, 85, 0.75), rgba(190, 0, 60, 0.95));
  box-shadow: 0 0 24px rgba(255, 0, 85, 0.75);
}

.dock-nitro {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  border-color: var(--cyan);
  background: rgba(14, 22, 38, 0.88);
}

.dock-nitro-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(0deg, rgba(0, 180, 216, 0.5) 0%, rgba(0, 245, 212, 0.72) 100%);
  border-top: 2.5px solid #ffffff;
  box-shadow: 0 0 16px var(--cyan);
  pointer-events: none;
  z-index: 1;
  transition: height 0.08s linear;
}

.dock-nitro .dock-btn-icon,
.dock-nitro .dock-nitro-content {
  position: relative;
  z-index: 2;
}

.dock-nitro-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.dock-btn-icon {
  font-size: 28px;
  line-height: 1;
}

.dock-btn-label {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.dock-nitro-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 99px;
  margin-top: 2px;
}

/* Nitro Doluyken (Hazır) */
.dock-nitro.nitro-ready {
  background: linear-gradient(180deg, rgba(0, 180, 216, 0.35), rgba(0, 245, 212, 0.22));
  border-color: #00f5d4;
  box-shadow: 0 0 22px rgba(0, 245, 212, 0.55);
}
.dock-nitro.nitro-ready .dock-nitro-badge {
  background: rgba(0, 245, 212, 0.3);
  color: #00f5d4;
  border: 1px solid #00f5d4;
}

/* Nitro Harcanırken (Burning) */
.dock-nitro.nitro-burning {
  border-color: #ffbe0b;
  box-shadow: 0 0 30px rgba(255, 190, 11, 0.85);
  animation: pulseBurning 0.25s infinite alternate;
}
@keyframes pulseBurning {
  from { filter: brightness(1); }
  to { filter: brightness(1.35); }
}

/* Nitro Boş / Dolarken: Kullanıcı isteği: hem gri renk olsun tuş üzerinde dolma efekti olsun */
.dock-nitro.nitro-recharging {
  background: rgba(22, 26, 38, 0.94);
  border-color: rgba(255, 255, 255, 0.16);
  color: #8fa0be;
  box-shadow: none;
}
.dock-nitro.nitro-recharging .dock-btn-icon {
  filter: grayscale(0.85);
  opacity: 0.65;
}
.dock-nitro.nitro-recharging .dock-nitro-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.dock-nitro.nitro-shake {
  animation: dockShake 0.35s ease-in-out;
}
@keyframes dockShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* 2 KİŞİLİK BÖLÜNMÜŞ EKRAN (SPLIT-SCREEN) KONTROLLERİ */
#split-divider {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--red));
  transform: translateX(-50%);
  z-index: 18;
  pointer-events: none;
}

.split-tag {
  position: absolute;
  top: 64px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.p1-tag {
  right: 10px;
  background: var(--cyan);
  color: #050811;
}

.p2-tag {
  left: 10px;
  background: var(--red);
  color: #fff;
}

.p2-cluster {
  top: 52px;
  right: 14px;
}

.p2-mini-hud {
  padding: 6px 12px;
  min-width: 150px;
  text-align: center;
}

.p2-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.p2-speed-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin: 2px 0;
}

.p2-speed-row strong {
  font-size: 22px;
  font-weight: 900;
}

.p2-gear {
  background: var(--red);
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 900;
  font-size: 12px;
}

.touch-layer-2p {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 22;
}

.p1-touch-cluster {
  position: absolute;
  bottom: 14px;
  left: 25%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: rgba(7, 12, 24, 0.78);
  padding: 7px 10px;
  border-radius: 16px;
  border: 1px solid rgba(0, 245, 212, 0.35);
  pointer-events: auto;
}

.p2-touch-cluster {
  position: absolute;
  bottom: 14px;
  left: 75%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: rgba(7, 12, 24, 0.78);
  padding: 7px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 0, 85, 0.35);
  pointer-events: auto;
}

.duel-btn {
  min-width: 66px;
  height: 64px;
  padding: 0 10px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(10, 16, 32, 0.85);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
}

.duel-btn.gas {
  background: rgba(56, 176, 0, 0.38);
  border-color: var(--green);
}

.duel-btn.nitro {
  background: rgba(0, 245, 212, 0.28);
  border-color: var(--cyan);
}

.duel-btn.brake {
  background: rgba(255, 0, 85, 0.28);
  border-color: var(--red);
}

/* ============================================================================
   İLK GİRİŞ: CİHAZ & KONTROL MODU SEÇİM MODALI VE AYARLAR
   ============================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(10px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: 660px;
  max-width: 95vw;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.device-modal-card {
  width: 760px;
  text-align: center;
  align-items: center;
}

.auto-detect-pill {
  background: rgba(0, 245, 212, 0.16);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  padding: 5px 14px;
  border-radius: 99px;
}

.device-modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.45;
}

.device-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.device-choice-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 14px 12px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all 0.16s ease;
}

.device-choice-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.device-choice-card.active {
  background: linear-gradient(180deg, rgba(0, 245, 212, 0.24), rgba(0, 180, 216, 0.1));
  border-color: var(--cyan);
  box-shadow: 0 0 22px rgba(0, 245, 212, 0.35);
}

.dc-icon {
  font-size: 34px;
}

.dc-title {
  font-size: 14px;
  font-weight: 900;
  color: #fff;
}

.dc-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.38;
  flex: 1;
}

.dc-tag {
  font-size: 10px;
  font-weight: 900;
  background: rgba(255, 190, 11, 0.18);
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 99px;
}

.results-card {
  text-align: center;
  align-items: center;
  transition: all 0.25s ease;
}

.finish-status-pill {
  background: rgba(0, 245, 212, 0.16);
  border: 1.5px solid var(--cyan);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 5px 16px;
  border-radius: 99px;
}

/* Şık Kaybetme / Elenme Ekranı Teması */
.results-card.eliminated-card {
  border: 2px solid #ff0055;
  background: linear-gradient(180deg, rgba(36, 6, 18, 0.94) 0%, rgba(12, 8, 22, 0.95) 100%);
  box-shadow: 0 0 48px rgba(255, 0, 85, 0.45), inset 0 0 24px rgba(255, 0, 85, 0.18);
}

.results-card.eliminated-card .finish-status-pill {
  background: rgba(255, 0, 85, 0.24);
  border-color: #ff0055;
  color: #ff6b9b;
  animation: pulseElimPill 0.6s infinite alternate;
}

.results-card.eliminated-card #finish-title {
  color: #ff2a6d;
  text-shadow: 0 0 18px rgba(255, 0, 85, 0.55);
}

@keyframes pulseElimPill {
  from { transform: scale(1); box-shadow: 0 0 8px rgba(255, 0, 85, 0.4); }
  to { transform: scale(1.05); box-shadow: 0 0 18px rgba(255, 0, 85, 0.85); }
}

/* Son Rakiple Ara Açıldığında Çıkan Geri Sayım İbresi Kutusu */
.elim-warning-box {
  margin-top: 6px;
  background: linear-gradient(135deg, rgba(35, 6, 16, 0.92), rgba(16, 10, 26, 0.92));
  border: 2px solid #ff0055;
  border-radius: 18px;
  padding: 8px 16px 8px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 28px rgba(255, 0, 85, 0.48), inset 0 0 14px rgba(255, 0, 85, 0.22);
  animation: elimBoxPulse 0.45s infinite alternate;
}

@keyframes elimBoxPulse {
  from { transform: scale(1); border-color: #ff0055; }
  to { transform: scale(1.03); border-color: #ffbe0b; }
}

.elim-gauge-wrap {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#elimination-gauge-canvas {
  width: 84px;
  height: 84px;
}

.elim-info-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.elim-badge {
  background: rgba(255, 0, 85, 0.28);
  border: 1px solid #ff4d79;
  color: #ffb3c6;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

.elim-title {
  font-size: 16px;
  font-weight: 900;
  color: #ffbe0b;
  letter-spacing: 0.4px;
  text-shadow: 0 0 12px rgba(255, 190, 11, 0.5);
}

.elim-sub {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
}

/* Belirgin Tam Ekran Butonu Stili */
.hud-btn.fullscreen-highlight, #btn-fullscreen {
  background: linear-gradient(135deg, rgba(255, 190, 11, 0.24), rgba(0, 245, 212, 0.20));
  border: 1.5px solid var(--gold);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(255, 190, 11, 0.3);
}

.hud-btn.fullscreen-highlight:hover, #btn-fullscreen:hover {
  background: linear-gradient(135deg, rgba(255, 190, 11, 0.4), rgba(0, 245, 212, 0.32));
  transform: translateY(-1px);
}

.trophy-banner {
  font-size: 58px;
}

.results-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.res-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 11px;
  border-radius: 12px;
}

.res-box span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.res-box strong {
  font-size: 20px;
  font-weight: 900;
  color: var(--cyan);
}

.res-box.highlight strong {
  color: var(--gold);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 10px;
}

.setting-row strong {
  display: block;
  font-size: 13px;
}

.setting-row small {
  font-size: 11px;
  color: var(--text-muted);
}

.seg-buttons {
  display: flex;
  gap: 6px;
}

.seg-buttons button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.seg-buttons button.active {
  background: var(--cyan);
  color: #040811;
  border-color: #fff;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hidden {
  display: none !important;
}

/* MOBİL VE KÜÇÜK EKRAN ADAPTASYONU */
@media (max-width: 1100px) {
  #top-bar {
    height: 50px;
    padding: 0 10px;
  }
  .brand-titles p, .brand-badge {
    display: none;
  }
  .brand-titles h1 {
    font-size: 14px;
  }
  #menu-screen {
    padding: 56px 10px 10px 10px;
    gap: 8px;
  }
  .menu-panel {
    width: 270px;
    max-width: 35vw;
    padding: 10px;
  }
  .minimap-box {
    width: 120px;
    height: 120px;
  }
  .sb-btn {
    min-width: 72px;
    height: 70px;
  }
  .sb-btn.steer {
    min-width: 84px;
    height: 72px;
  }
}

@media (max-width: 760px) {
  #menu-screen {
    flex-direction: column;
    overflow-y: auto;
    pointer-events: auto;
  }
  .menu-panel {
    width: 100%;
    max-width: 100%;
  }
  .device-choice-grid {
    grid-template-columns: 1fr;
  }
}
