/* ============ NITRO RUSH — Stil ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #0b0e1a; --panel: rgba(14, 18, 32, 0.92); --panel2: rgba(24, 30, 52, 0.9);
  --line: #232a44; --txt: #e8ecff; --muted: #8b93b8;
  --acc: #3fd2ff; --acc2: #a45cff; --gold: #ffd24a; --danger: #ff5c5c; --green: #4dffa6;
}
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg); color: var(--txt);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none; position: fixed; inset: 0;
}
#game { position: fixed; inset: 0; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }

/* ---------- çipler / üst bar ---------- */
#topBar {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 0; right: 0;
  display: flex; gap: 8px; justify-content: flex-end; padding: 0 12px; z-index: 40; pointer-events: none;
}
.chip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 12px; font-size: 14px; font-weight: 700; pointer-events: auto;
}
.chip.gem { color: #c9a6ff; }
.chip.gold { color: var(--gold); }
#profileChip { margin-right: auto; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ekranlar ---------- */
.screen {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 54px) 18px calc(env(safe-area-inset-bottom, 0px) + 16px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.screen.dim { background: rgba(7, 9, 18, 0.86); justify-content: center; }

/* ---------- menü ---------- */
#screen-menu { justify-content: space-between; }
.menuTop { align-self: flex-end; }
.menuIcon { font-size: 26px; padding: 8px; }
.logo { text-align: center; margin-top: 6vh; text-shadow: 0 0 34px rgba(63, 210, 255, 0.45); }
.logo h1 { font-size: 52px; letter-spacing: 4px; font-style: italic; }
.logo h1 span { color: var(--acc); }
.logo p { color: var(--muted); letter-spacing: 5px; text-transform: uppercase; font-size: 12px; margin-top: 4px; }
.levelWrap { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 340px; margin: 18px auto; font-size: 13px; font-weight: 700; }
.xpBarBg { flex: 1; height: 8px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.xpBarBg i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width 0.4s; }
.menuBtns { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.row2 { display: flex; gap: 10px; }
.row2 .big { flex: 1; }
.big {
  position: relative; border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 900; letter-spacing: 1px;
  background: var(--panel2); border: 1px solid var(--line); transition: transform 0.06s;
}
.big:active { transform: scale(0.97); }
.big.play { background: linear-gradient(135deg, #2bb1ff, #7a3cff); border: none; box-shadow: 0 8px 28px rgba(63, 160, 255, 0.35); font-size: 20px; }
.big.gift { background: linear-gradient(135deg, #ff9a3d, #ff5c8a); border: none; }
.big.sub { font-size: 15px; }
.badge {
  position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff;
  border-radius: 10px; min-width: 20px; height: 20px; font-size: 12px; line-height: 20px; padding: 0 5px;
}
.eventChip { margin-top: 14px; font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 8px 14px; border-radius: 14px; }
.eventChip em { color: var(--gold); font-style: normal; font-weight: 800; }

/* ---------- ekran başlıkları ---------- */
.screenHead { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 480px; margin-bottom: 12px; }
.screenHead h2 { flex: 1; font-size: 20px; letter-spacing: 1px; }
.back { font-size: 30px; width: 44px; height: 44px; color: var(--txt); background: var(--panel2); border-radius: 12px; border: 1px solid var(--line); }
.muted { color: var(--muted); font-size: 13px; }
.muted.small { font-size: 12px; }
.center { text-align: center; }

/* ---------- pist seçimi ---------- */
.modeTabs { display: flex; gap: 8px; width: 100%; max-width: 480px; }
.modeTabs.small .modeTab { padding: 8px 10px; font-size: 12px; }
.modeTab { flex: 1; padding: 10px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); font-weight: 800; font-size: 14px; color: var(--muted); }
.modeTab.on { background: linear-gradient(135deg, #2bb1ff, #7a3cff); color: #fff; border: none; }
#modeDesc { color: var(--muted); font-size: 12px; margin: 8px 0; }
#trackList { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 480px; }
.trackCard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; position: relative; }
.trackCard.locked { opacity: 0.55; }
.tcTop { display: flex; justify-content: space-between; align-items: center; }
.tcTop b { font-size: 16px; }
.evTag { font-size: 10px; color: #0b0e1a; background: var(--gold); padding: 3px 8px; border-radius: 8px; font-weight: 900; }
.tcTheme { font-size: 30px; padding: 8px 0; }
.tcInfo { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.tcLock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(7, 9, 18, 0.5); border-radius: 16px; font-weight: 800; }

/* ---------- garaj ---------- */
.carStage { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 480px; }
.carSilhouette { font-size: 84px; filter: drop-shadow(0 10px 24px rgba(63, 210, 255, 0.3)); }
.navBtn { font-size: 34px; width: 54px; height: 84px; color: var(--muted); }
#garageName { font-size: 22px; margin: 6px 0 10px; letter-spacing: 1px; }
#btnCarAction { width: 100%; max-width: 480px; margin-bottom: 8px; }
#screen-garage h4 { color: var(--muted); font-size: 12px; letter-spacing: 2px; margin: 14px 0 8px; align-self: flex-start; max-width: 480px; width: 100%; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; width: 100%; max-width: 480px; font-size: 12px; color: var(--muted); }
.stats label { line-height: 12px; }
.bar { height: 10px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); border-radius: 6px; transition: width 0.3s; }
.paintRow { display: flex; gap: 10px; }
.paint { width: 44px; height: 44px; border-radius: 12px; background: var(--panel2); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; }
.paint i { width: 26px; height: 26px; border-radius: 8px; display: block; box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.4); }
.paint.owned { border-color: var(--acc); }
.paint.sel { border-color: var(--gold); box-shadow: 0 0 12px rgba(255, 210, 74, 0.4); }
.upgradeRow { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 480px; }
.upg { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.upg span { flex: 1; font-size: 13px; font-weight: 700; }
.upg b { color: var(--acc); letter-spacing: -2px; }
button.mini { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12px; font-weight: 800; }
button.mini:disabled { opacity: 0.45; }
button.mini.ghosted { align-self: center; margin-top: 8px; }

/* ---------- liderlik ---------- */
.lbHead { display: flex; gap: 8px; width: 100%; max-width: 480px; margin-bottom: 6px; }
.lbHead select { flex: 1; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 12px; padding: 10px; font-size: 14px; }
.lbHead .modeTabs { width: 40%; }
#lbList { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.lbRow { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.lbRow.me { border-color: var(--acc); background: rgba(63, 210, 255, 0.08); }
.lbr { width: 34px; font-weight: 900; color: var(--muted); }
.lbn { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbv { font-weight: 900; color: var(--acc); }
.lbEmpty { color: var(--muted); text-align: center; padding: 30px 0; }
#lbMe { position: sticky; bottom: 8px; margin-top: 8px; width: 100%; max-width: 480px; }
#btnLbClaim { width: 100%; max-width: 480px; margin-top: 10px; font-size: 14px; }

/* ---------- mağaza ---------- */
#shopList { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 8px; }
#shopList h3 { color: var(--muted); font-size: 12px; letter-spacing: 2px; margin: 12px 0 2px; }
.shopRow { display: flex; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 700; }
.shopRow button { background: linear-gradient(135deg, #2bb1ff, #7a3cff); border-radius: 10px; padding: 10px 14px; font-weight: 900; }
.exchange { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 13px; }

/* ---------- görevler ---------- */
#missionList { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 10px; }
.missionRow { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.mTop { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.mTop b { color: var(--gold); }
.mBar { height: 8px; background: var(--panel2); border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.mBar i { display: block; height: 100%; background: var(--green); }

/* ---------- ayarlar ---------- */
#screen-settings .setRow { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 480px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.toggle { width: 52px; height: 30px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); position: relative; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: 0.15s; }
.toggle.on::after { left: 25px; background: var(--green); }
#gyroSens { width: 130px; }
#langSel, select { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.accForm { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 480px; margin: 8px 0 14px; }
.accForm input { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 12px; padding: 12px; font-size: 15px; }

/* ---------- HUD kontrolleri ---------- */
#hudControls { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
.hudBtn {
  position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 108px);
  width: 88px; height: 88px; border-radius: 50%; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; letter-spacing: 1px; color: #fff;
  background: rgba(20, 26, 46, 0.55); border: 2px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}
.hudBtn.on { transform: scale(0.94); background: rgba(63, 210, 255, 0.35); }
.hudBtn.drift { left: 20px; }
.hudBtn.nitro { right: 20px; background: rgba(122, 60, 255, 0.4); }
.hudPause { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 130px); left: 50%; transform: translateX(-50%); pointer-events: auto; width: 44px; height: 36px; border-radius: 10px; background: rgba(20, 26, 46, 0.55); border: 1px solid rgba(255, 255, 255, 0.2); font-weight: 900; }

/* ---------- sonuçlar ---------- */
.resultCard { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; width: 100%; max-width: 400px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.resultCard h1 { font-size: 56px; }
.stars { font-size: 30px; color: var(--gold); letter-spacing: 6px; }
.record { color: var(--green); font-weight: 900; letter-spacing: 2px; animation: pulse 0.8s infinite alternate; }
@keyframes pulse { from { opacity: 0.6; } to { opacity: 1; } }
.rewardRow { display: flex; justify-content: center; gap: 18px; font-weight: 900; font-size: 17px; }

/* ---------- tutorial ---------- */
.tutList { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; font-size: 16px; max-width: 400px; }
.tutList p { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }

/* ---------- modallar ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 7, 14, 0.7); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.dark { z-index: 80; }
.modalCard { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: 100%; max-width: 400px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.modalClose { position: absolute; top: 10px; right: 12px; font-size: 16px; color: var(--muted); }
.giftRow { display: flex; gap: 6px; }
.giftDay { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; font-size: 9px; color: var(--muted); }
.giftDay b { display: block; font-size: 11px; color: var(--txt); margin-top: 4px; }
.giftDay.done { opacity: 0.45; border-color: var(--green); }
.giftDay.next { border-color: var(--gold); box-shadow: 0 0 12px rgba(255, 210, 74, 0.35); }
.crateBox { min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--panel2); border-radius: 16px; font-size: 18px; font-weight: 900; }
.crateBox.common { border: 2px solid #8b93b8; }
.crateBox.rare { border: 2px solid var(--acc); box-shadow: 0 0 22px rgba(63, 210, 255, 0.4); }
.crateBox.epic { border: 2px solid var(--acc2); box-shadow: 0 0 30px rgba(164, 92, 255, 0.55); }
.crateIcon { font-size: 60px; animation: bounce 1s infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.adCount { font-size: 46px; font-weight: 900; color: var(--acc); min-height: 60px; }
.price { font-size: 30px; font-weight: 900; color: var(--gold); }

/* ---------- toast & banner ---------- */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 170px);
  background: var(--panel); border: 1px solid var(--acc); color: var(--txt);
  padding: 10px 18px; border-radius: 14px; font-size: 14px; font-weight: 700; z-index: 90;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
#bannerAd {
  position: fixed; left: 0; right: 0; bottom: 0; height: 52px; z-index: 30;
  background: rgba(14, 18, 32, 0.95); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; letter-spacing: 2px;
}
@media (min-width: 700px) { .logo h1 { font-size: 72px; } }
