* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #070b18; color: #e8f2ff;
  font-family: "Segoe UI", Roboto, Arial, sans-serif; user-select: none; -webkit-user-select: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* Katmanlar */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(8,12,30,.55), rgba(3,5,14,.92)); z-index: 20; }
.card { background: rgba(10,14,32,.88); border: 1px solid rgba(46,242,255,.35);
  box-shadow: 0 0 40px rgba(46,242,255,.15), inset 0 0 30px rgba(255,45,149,.06);
  border-radius: 14px; padding: 28px 34px; min-width: 300px; max-width: 92vw; text-align: center; }
.card.wide { max-width: 640px; }
.card h2 { font-size: 24px; letter-spacing: 1px; margin-bottom: 16px; color: #2ef2ff; }
.logo { font-size: clamp(38px, 8vw, 72px); font-weight: 900; letter-spacing: 4px; color: #fff;
  text-shadow: 0 0 18px #2ef2ff, 0 0 40px #2ef2ff; }
.logo span { color: #ff2d95; text-shadow: 0 0 18px #ff2d95, 0 0 40px #ff2d95; }
.sub { letter-spacing: 6px; font-size: 13px; color: #9fb2d8; margin: 6px 0 24px; }
.btn { display: block; width: 100%; margin: 8px 0; padding: 12px 22px; border: 0; border-radius: 8px;
  font-size: 16px; font-weight: 700; letter-spacing: 1px; cursor: pointer; color: #04101a;
  background: linear-gradient(90deg, #2ef2ff, #67ffd0); box-shadow: 0 0 18px rgba(46,242,255,.45); }
.btn:hover { filter: brightness(1.12); }
.btn.big { font-size: 22px; padding: 16px; margin-bottom: 20px; }
.btn.ghost { background: transparent; color: #cfe3ff; border: 1px solid rgba(207,227,255,.35); box-shadow: none; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; text-align: left; font-size: 14px; color: #b6c6e6; }
.controls b { color: #ffc83a; margin-right: 4px; }
.note { margin-top: 18px; font-size: 13px; color: #8da0c8; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#topLeft { position: absolute; top: 16px; left: 18px; }
#money { font-size: 30px; font-weight: 800; color: #6dff9c; text-shadow: 0 0 12px rgba(109,255,156,.6); }
#district { font-size: 14px; letter-spacing: 3px; text-transform: uppercase; color: #9fd0ff; margin-top: 2px; }
#raceBox { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); text-align: center;
  background: rgba(8,12,28,.7); border: 1px solid rgba(255,200,58,.5); border-radius: 10px; padding: 8px 22px; }
#raceName { font-size: 12px; letter-spacing: 3px; color: #ffc83a; text-transform: uppercase; }
.raceRow { display: flex; gap: 26px; font-size: 24px; font-weight: 800; justify-content: center; }
#racePos { color: #ff2d95; }
#minimap { position: absolute; left: 18px; bottom: 18px; width: 180px; height: 180px; border-radius: 50%;
  border: 2px solid rgba(46,242,255,.6); box-shadow: 0 0 18px rgba(46,242,255,.3); background: #070b18; }
#speedBox { position: absolute; right: 24px; bottom: 20px; text-align: right; }
#speed { font-size: 64px; font-weight: 900; font-style: italic; text-shadow: 0 0 16px rgba(46,242,255,.7); }
#speedUnit { font-size: 16px; margin-left: 6px; color: #9fb2d8; }
#nitroBar { width: 220px; height: 10px; margin: 6px 0 2px auto; background: rgba(255,255,255,.12); border-radius: 6px; overflow: hidden; }
#nitroFill { height: 100%; width: 100%; background: linear-gradient(90deg, #2ef2ff, #ff2d95); box-shadow: 0 0 10px #2ef2ff; }
#nitroLabel { font-size: 11px; letter-spacing: 3px; color: #8ee9ff; }
#prompt { position: absolute; bottom: 24%; left: 50%; transform: translateX(-50%); padding: 12px 22px; font-size: 18px; font-weight: 700;
  background: rgba(8,12,28,.82); border: 1px solid #ffc83a; border-radius: 10px; color: #ffe39a; pointer-events: auto; cursor: pointer; text-align: center; }
#count { position: absolute; top: 28%; left: 50%; transform: translateX(-50%); font-size: 110px; font-weight: 900; font-style: italic;
  color: #fff; text-shadow: 0 0 24px #ff2d95, 0 0 60px #ff2d95; }
#toast { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 8px;
  background: rgba(8,12,28,.85); border: 1px solid rgba(46,242,255,.5); font-size: 16px; }
#hint { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); font-size: 12px; color: rgba(190,205,235,.55); white-space: nowrap; }

/* Sonuç tablosu */
#resRank { font-size: 54px; font-weight: 900; color: #ff2d95; text-shadow: 0 0 18px #ff2d95; margin-bottom: 10px; }
#resTable { width: 100%; margin: 8px 0 14px; border-collapse: collapse; font-size: 16px; }
#resTable td { padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; }
#resTable td:last-child { text-align: right; font-weight: 700; color: #cfe9ff; }
.good { color: #6dff9c !important; }

@media (max-width: 760px) {
  #minimap { width: 120px; height: 120px; }
  #speed { font-size: 42px; }
  #hint { display: none; }
}

#gps { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px;
  background: rgba(8,12,28,.72); border: 1px solid #20f0ff; color: #bffaff; font-weight: 700; font-size: 14px;
  letter-spacing: .04em; box-shadow: 0 0 12px rgba(32,240,255,.35); white-space: nowrap; pointer-events: none; }
#gps.hidden { display: none; }

.mapcard { padding: 10px; max-width: 96vw; max-height: 96vh; }
#bigmapCv { display: block; width: min(86vh, 92vw); height: auto; max-height: 82vh; border-radius: 10px; border: 1px solid #20f0ff; background: #0a1020; }
.maplegend { margin-top: 8px; font-size: 13px; color: #9fb4d8; text-align: center; }
.maplegend .lg { margin: 0 8px; font-weight: 700; }
.lg.me { color: #fff; } .lg.tg { color: #ff3df0; } .lg.st { color: #ffc83a; } .lg.rt { color: #20f0ff; }

#wanted { margin-top: 4px; font-size: 22px; letter-spacing: 3px; color: #ffd23a; text-shadow: 0 0 10px rgba(255,210,58,.7); min-height: 26px; }
#wanted .off { color: rgba(255,255,255,.15); text-shadow: none; }
#wanted.flash { animation: wflash .5s steps(2) infinite; }
@keyframes wflash { 50% { color: #ff3355; text-shadow: 0 0 12px #2070ff; } }
#status { position: absolute; left: 50%; top: 54px; transform: translateX(-50%); text-align: center; min-width: 240px;
  background: rgba(8,12,28,.72); border: 1px solid rgba(255,51,85,.6); border-radius: 10px; padding: 6px 14px; }
#statusText { font-size: 13px; font-weight: 800; letter-spacing: 2px; color: #ffd0d8; }
#statusBar { height: 6px; margin-top: 5px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
#statusFill { height: 100%; width: 0; background: linear-gradient(90deg, #ff3355, #ffc83a); }
#status.good { border-color: rgba(48,255,128,.6); }
#status.good #statusFill { background: linear-gradient(90deg, #30ff80, #2ef2ff); }

#radioSub { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); max-width: 70vw; text-align: center;
  background: rgba(8,12,28,.78); border: 1px solid rgba(255,200,58,.5); border-radius: 10px; padding: 8px 14px; color: #ffe9b0; font-size: 15px; line-height: 1.35; pointer-events: none; }
#radioSub.hidden { display: none; }
#radioName { position: absolute; right: 24px; bottom: 112px; color: #ffc83a; font-weight: 700; font-size: 13px; letter-spacing: .05em; text-shadow: 0 0 8px rgba(255,200,58,.6); pointer-events: none; }
/* v11: menü arka planı (Higgsfield posteri) */
#menu.poster { background: linear-gradient(90deg, rgba(5,6,14,0.15) 0%, rgba(5,6,14,0.55) 45%, rgba(5,6,14,0.15) 100%), var(--poster) center / cover no-repeat; }

/* ---- v22: Mobil dokunmatik ---- */
.touchNote { display: none; }
body.touch .touchNote { display: block; color: #7fe7ff; }
body.touch .controls { display: none; }
body.touch #hint { display: none !important; }
body.touch, body.touch * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.touch { touch-action: none; overscroll-behavior: none; }
#touchUI { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
#touchUI.hidden { display: none; }
.tc-zone { position: absolute; left: 0; top: 22%; width: 48%; bottom: 0; pointer-events: auto; }
.tc-base { position: absolute; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; border: 2px solid rgba(46,242,255,.55); background: rgba(10,20,40,.25); box-shadow: 0 0 18px rgba(46,242,255,.25); pointer-events: none; }
.tc-base.hidden { display: none; }
.tc-knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: rgba(46,242,255,.45); border: 2px solid rgba(220,255,255,.8); }
.tc-btn { pointer-events: auto; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; border-radius: 50%; font: 800 14px/1.05 system-ui, sans-serif; color: #fff; background: rgba(12,14,28,.45); border: 2px solid rgba(255,255,255,.35); backdrop-filter: blur(2px); }
.tc-btn small { font-size: 10px; font-weight: 600; opacity: .85; }
.tc-btn.on { transform: scale(.93); filter: brightness(1.6); }
.tc-pad { position: absolute; right: 14px; bottom: 14px; width: 250px; height: 220px; }
.tc-pad.hidden { display: none; }
.tc-pad .big { position: absolute; right: 0; bottom: 0; width: 104px; height: 104px; font-size: 20px; }
.tc-pad .mid { position: absolute; width: 74px; height: 74px; }
.tc-car .gas { border-color: #4dff9a; background: rgba(30,120,70,.4); }
.tc-car .brake { right: 116px; bottom: 0; border-color: #ff4a5a; background: rgba(120,20,30,.4); }
.tc-car .nitro { right: 14px; bottom: 116px; border-color: #2ef2ff; background: rgba(20,90,120,.4); }
.tc-car .hb { right: 116px; bottom: 90px; border-color: #ffd23a; background: rgba(120,90,10,.35); font-size: 12px; }
.tc-foot .punch { font-size: 40px; border-color: #ff3fb4; background: rgba(120,20,80,.4); }
.tc-foot .jump { right: 116px; bottom: 0; border-color: #ffd23a; }
.tc-foot .run { right: 14px; bottom: 116px; border-color: #2ef2ff; }
.tc-top { position: absolute; top: 8px; right: 10px; display: flex; gap: 8px; }
.tc-top .sm { width: 42px; height: 42px; font-size: 19px; }
.tc-act { position: absolute; right: 14px; bottom: 206px; display: flex; flex-direction: row; gap: 10px; }
.tc-act .act { width: 64px; height: 64px; font-size: 20px; border-color: rgba(255,255,255,.5); }
.tc-act .act small { font-size: 9px; }
/* Mobil HUD düzeni: mini harita sol üste, hız göstergesi ortaya */
body.touch #minimap { left: 10px; top: 74px; bottom: auto; width: 112px; height: 112px; }
body.touch #topLeft { top: 8px; left: 12px; transform: scale(.8); transform-origin: top left; }
body.touch #speedBox { right: 50%; transform: translateX(50%) scale(.7); transform-origin: bottom center; bottom: 4px; text-align: center; }
body.touch #gps { top: 56px; font-size: 12px; }
body.touch #radioName { bottom: auto; top: 58px; right: 12px; font-size: 11px; }
body.touch #toast { top: 18%; font-size: 14px; }
body.touch #prompt { bottom: 30%; font-size: 14px; }
body.touch .card { max-height: 92vh; overflow-y: auto; padding: 16px 20px; }
body.touch .logo { font-size: 38px; }
#rotateMsg { display: none; }
@media (orientation: portrait) {
  body.touch:not(.portraitOk) #rotateMsg { display: flex; position: fixed; inset: 0; z-index: 50; background: #05040b; color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-family: system-ui, sans-serif; text-align: center; }
  body.touch #rotateMsg div { font-size: 56px; }
  body.touch #rotateMsg b { font-size: 22px; color: #2ef2ff; }
  body.touch #rotateMsg span { font-size: 14px; opacity: .7; }
}
body.touch #radioSub { font-size: 11px; max-width: 46%; bottom: 22%; padding: 5px 10px; }
@media (max-height: 340px) { .tc-act { bottom: 196px; } .tc-act .act { width: 54px; height: 54px; } .tc-pad { transform: scale(.88); transform-origin: bottom right; } }
.mapcard { position: relative; }
.btn.mapclose { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; padding: 0; font-size: 18px; border-radius: 50%; }
#bigmapCv { cursor: crosshair; }
body.touch .mapcard { padding: 8px; }
body.touch #bigmapCv { width: auto; height: 78vh; max-width: 92vw; }
body.touch .maplegend { font-size: 10px; }
.inappNote { display: block; margin: 6px 0 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,170,40,.12); border: 1px solid rgba(255,170,40,.5); color: #ffd28a; font-size: 13px; }
body.touch #rotateMsg em { font-style: normal; font-size: 13px; color: #ffd28a; max-width: 80%; margin-top: 10px; }
body.touch #rotateMsg em i { font-style: normal; font-weight: 800; color: #fff; }
#rotateMsg .btn { margin-top: 18px; font-size: 13px; padding: 8px 16px; }
/* dikey oynanış: düğmeleri biraz küçült */
@media (orientation: portrait) { body.touch.portraitOk .tc-pad { transform: scale(.8); transform-origin: bottom right; } body.touch.portraitOk .tc-act { bottom: 180px; } body.touch.portraitOk .tc-top .sm { width: 36px; height: 36px; font-size: 16px; } }
