:root {
  --ink: #fff8ef; --dim: #c6bfd6; --panel: rgba(20, 18, 38, 0.84); --line: rgba(255, 255, 255, 0.13);
  --hot: #ff8a2a; --hot2: #ffd23f;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --pad: min(30dvh, 252px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #141a30; color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, "Segoe UI", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; touch-action: none; }
canvas#c { position: fixed; inset: 0; display: block; touch-action: none; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; z-index: 10; }

/* ---------- menu ---------- */
#menu { pointer-events: none; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(18px + var(--sat)) calc(16px + var(--sar)) calc(18px + var(--sab)) calc(16px + var(--sal)); }
h1 { margin: 0; text-align: center; font-size: clamp(44px, 14vw, 72px); font-weight: 900; letter-spacing: .02em; line-height: .9;
  text-shadow: 0 4px 0 #1b1533, 0 10px 30px rgba(0,0,0,.35); }
h1 span { color: var(--hot); margin-left: .18em; }
.menu-col { pointer-events: auto; display: flex; flex-direction: column; gap: 10px; width: min(420px, 100%); margin: 0 auto; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.big, .mid { border-radius: 16px; padding: 15px 18px; font-weight: 800; font-size: 19px; box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s; }
.big { background: linear-gradient(180deg, var(--hot2), var(--hot)); color: #2a1406; font-size: 21px; }
.mid { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 15px; padding: 13px 8px; }
.big:active, .mid:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.tip { color: var(--dim); font-size: 12px; text-align: center; opacity: .85; }
.ver { opacity: .5; }

/* ---------- customiser ---------- */
#custom { pointer-events: none; }
.topbar { pointer-events: auto; position: absolute; top: calc(8px + var(--sat)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); display: flex; gap: 8px; align-items: center; }
.topbar h2 { margin: 0 auto 0 4px; font-size: 20px; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.pill { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.panel { pointer-events: auto; position: absolute; left: 0; right: 0; bottom: 0; height: 52dvh; background: var(--panel); border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 10px calc(12px + var(--sar)) calc(16px + var(--sab)) calc(12px + var(--sal));
  overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
.drag-hint { position: absolute; bottom: calc(52dvh + 8px); left: 16px; color: var(--dim); font-size: 12px; opacity: .7; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.presets:empty { display: none; }
.presets button { background: rgba(255,255,255,.08); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.presets button:active { background: var(--hot); color: #2a1406; }
.tabs { display: flex; gap: 4px; position: sticky; top: -10px; z-index: 2; padding: 4px 0 8px; background: linear-gradient(rgba(20,18,38,.98) 80%, transparent); overflow-x: auto; }
.tab { flex: 1; min-width: 58px; padding: 9px 6px; border-radius: 10px; background: rgba(255,255,255,.06); font-weight: 800; font-size: 13px; color: var(--dim); }
.tab.on { background: var(--hot); color: #2a1406; }
.row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lab { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin-bottom: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 8px 11px; border-radius: 9px; background: rgba(255,255,255,.07); border: 1px solid transparent; font-size: 13px; font-weight: 700; }
.chip.on { border-color: var(--hot); background: rgba(255,138,42,.22); color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); padding: 0; position: relative; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--hot); }
.sw.custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; display: inline-block; }
.sw.custom input { position: absolute; inset: -8px; width: 46px; height: 46px; opacity: 0; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--hot); height: 28px; touch-action: pan-x; }
input[type=text] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--ink); font: inherit; font-size: 16px; -webkit-user-select: text; user-select: text; }
.stats:empty { display: none; }
.stats { margin-top: 12px; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.28); }
.stat { display: grid; grid-template-columns: 78px 1fr 64px; gap: 8px; align-items: center; font-size: 12px; padding: 3px 0; }
.stat span { color: var(--dim); font-weight: 700; } .stat b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 7px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--hot), var(--hot2)); border-radius: 4px; transition: width .2s; }
.statx { margin-top: 6px; font-size: 12px; color: var(--dim); } .statx b { color: var(--hot2); }

/* ---------- HUD ---------- */
#hud { position: fixed; z-index: 5; inset: 0; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.hud-l { position: absolute; top: calc(10px + var(--sat)); left: calc(12px + var(--sal)); display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.clock { background: rgba(10,10,24,.45); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 6px 12px; font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.zone { font-weight: 800; font-size: 13px; color: var(--hot2); padding: 2px 9px; margin-top: 5px; background: rgba(10,10,24,.45); border-radius: 999px; align-self: flex-start; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.ammo { font-weight: 800; font-size: 12px; color: var(--dim); padding-left: 4px; }
#minimap { position: absolute; top: calc(6px + var(--sat)); right: calc(6px + var(--sar)); width: 132px; height: 132px; border-radius: 50%; pointer-events: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.speedo { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--pad) + 6px); background: rgba(10,10,24,.45); border-radius: 14px; padding: 4px 14px; text-align: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.speedo b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; } .speedo span { font-size: 11px; color: var(--dim); margin-left: 4px; font-weight: 800; }
.toast { position: absolute; left: calc(14px + var(--sal)); right: calc(72px + var(--sar)); width: fit-content; margin: 0 auto; top: calc(var(--sat) + 158px); /* stays clear of the phone/radio buttons on the right */ font-size: 13px; background: rgba(10,10,24,.6); padding: 8px 16px; border-radius: 999px; font-weight: 800; opacity: 0; transition: opacity .3s; text-align: center; }
.toast.on { opacity: 1; }

/* ---------- controller ---------- */
#pad { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; height: calc(var(--pad) + var(--sab));
  background: linear-gradient(to top, rgba(8, 8, 22, .38), rgba(8, 8, 22, .1) 55%, transparent);
  padding-bottom: var(--sab); }
#stickZone { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; touch-action: none; }
/* the stick: a frosted glass ring, faint until your thumb lands (it appears right there), with a rim light that points where
   you're pushing and turns orange once you're pushing hard enough to run */
#stickBase { position: absolute; left: calc(76px + var(--sal)); top: 62%; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(255,255,255,.13), rgba(255,255,255,.04) 58%, rgba(10,10,30,.10));
  border: 1.5px solid rgba(255,255,255,.3); box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 6px 20px rgba(0,0,0,.18);
  backdrop-filter: blur(7px) saturate(1.3); -webkit-backdrop-filter: blur(7px) saturate(1.3);
  opacity: .34; transform: scale(.92); transition: opacity .35s ease, transform .25s ease, border-color .15s, box-shadow .15s; }
#stickBase.live { opacity: 1; transform: scale(1); transition: opacity .08s, transform .12s, border-color .15s, box-shadow .15s; }
#stickBase::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from calc(var(--a, 0deg) - 45deg), var(--rim, rgba(255,255,255,.85)) 0deg 90deg, transparent 90deg 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  opacity: var(--p, 0); filter: blur(.4px); }
#stickBase.run { --rim: #ff8a2a; border-color: rgba(255,138,42,.75); box-shadow: inset 0 0 18px rgba(255,138,42,.18), 0 0 24px rgba(255,138,42,.45); }
#stickKnob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%; transform: translate(-50%,-50%);
  background: radial-gradient(circle at 36% 30%, rgba(255,255,255,.96), rgba(255,255,255,.62) 46%, rgba(235,238,255,.42));
  border: 1px solid rgba(255,255,255,.7); box-shadow: 0 5px 14px rgba(0,0,0,.28), inset 0 -3px 7px rgba(0,0,0,.12); transition: box-shadow .15s; }
#stickBase.run #stickKnob { box-shadow: 0 0 16px rgba(255,138,42,.85), 0 5px 14px rgba(0,0,0,.25), inset 0 -3px 7px rgba(255,138,42,.25); }
.mid-btns { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; gap: 8px; }
.sbtn { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 900; letter-spacing: .05em; }
/* action buttons sit on an arc round where the right thumb rests: the main attack biggest and lowest, the rest fanned above it */
.face { position: absolute; right: var(--sar); bottom: 0; width: 240px; height: 232px; }
.fbtn { position: absolute; right: var(--r); bottom: var(--b); width: var(--s); height: var(--s); border-radius: 50%; border: 1.5px solid rgba(255,255,255,.32); background: rgba(255,255,255,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; touch-action: none;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); box-shadow: none; transition: transform .08s, background .12s; }
.fbtn svg { width: calc(var(--s) * .36); height: calc(var(--s) * .36); fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.fbtn span { font-size: 8.5px; font-weight: 800; margin-top: 2px; opacity: .85; text-transform: uppercase; letter-spacing: .04em; }
.fbtn.x { --r: 92px; --b: calc(22px + var(--sab)); --s: 74px; } .fbtn.b { --r: 16px; --b: calc(62px + var(--sab)); --s: 62px; } .fbtn.y { --r: 30px; --b: calc(140px + var(--sab)); --s: 54px; } .fbtn.a { --r: 168px; --b: calc(92px + var(--sab)); --s: 60px; }
.fbtn.idle { opacity: .35; }
#pad .fbtn.x { border-color: rgba(255,110,90,.8); }
#pad.driving .fbtn.a { border-color: rgba(76,217,100,.8); background: rgba(76,217,100,.16); --s: 66px; }
#pad.driving .fbtn.x { border-color: rgba(255,80,90,.8); background: rgba(255,80,90,.14); --s: 76px; }
.fbtn.ready { background: rgba(76,217,100,.35); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { box-shadow: 0 0 0 6px rgba(76,217,100,.25); } }
.fbtn.down { transform: scale(.92); background: rgba(255,255,255,.26); }

/* ---------- overlays ---------- */
#mapView { background: rgba(10, 12, 26, .92); display: grid; place-items: center; }
#bigmap { width: min(94vw, 60dvh); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.map-hint { position: absolute; bottom: calc(18px + var(--sab)); left: 0; right: 0; text-align: center; color: var(--dim); font-size: 13px; }
#pause { display: grid; place-items: center; background: rgba(10, 8, 24, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.card { width: min(320px, 86vw); display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.card h2 { margin: 0 0 4px; font-size: 28px; font-weight: 900; }
#rotate { position: fixed; inset: 0; z-index: 50; background: #141a30; display: none; place-items: center; text-align: center; font-size: 22px; font-weight: 800; line-height: 1.5; }
#rotate small { font-size: 14px; color: var(--dim); font-weight: 600; }


/* ---------- map actions, hurt, death ---------- */
#mapView { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: calc(14px + var(--sat)) 14px calc(14px + var(--sab)); }
#mapView .big { width: min(420px, 100%); text-align: center; }
.map-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(420px, 100%); }
.mbtn { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; font-size: 12px; font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mbtn i { font-style: normal; font-size: 22px; }
.mbtn:active { background: rgba(255,138,42,.3); }
.map-hint { position: static; }
#hurt { position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(180,0,20,0) 42%, rgba(190,0,25,.55) 75%, rgba(150,0,15,.9) 100%); }
#deathScreen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .8s;
  background: radial-gradient(ellipse at center, rgba(40,0,6,.55), rgba(10,0,2,.92)); text-align: center; }
#deathScreen.on { opacity: 1; pointer-events: auto; }
#deathScreen b { display: block; font-size: 30px; font-weight: 900; color: #ff4d5a; letter-spacing: .02em; }
#deathScreen span { display: block; margin-top: 8px; color: var(--dim); font-size: 14px; font-weight: 700; }

/* ---------- v4: money, modals, dealer, minigames ---------- */
.hud-row { display: flex; gap: 6px; align-items: center; }
.money { background: rgba(10,30,16,.55); border: 1px solid rgba(94,224,122,.5); color: #7dff9a; border-radius: 999px; padding: 6px 12px; font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.money-float { position: absolute; top: 40px; left: 110px; font-weight: 900; color: #7dff9a; font-size: 18px; opacity: 0; pointer-events: none; }
.money-float.go { animation: floatUp 1.4s ease-out; }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
.race-txt { position: absolute; left: 50%; transform: translateX(-50%); top: calc(178px + var(--sat)); white-space: nowrap; font-size: 14px; background: rgba(160,20,30,.7); padding: 8px 16px; border-radius: 999px; font-weight: 900; font-size: 16px; }
#speedo { pointer-events: none; z-index: 2; }
.map-info { color: var(--dim); font-size: 13px; font-weight: 700; text-align: center; }
.map-info b { color: #7dff9a; }
#modal { display: grid; place-items: center; background: rgba(8,8,20,.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-card { text-align: center; }
.modal-card h3 { margin: 4px 0; font-size: 22px; font-weight: 900; }
.modal-card p { color: var(--dim); font-size: 14px; line-height: 1.45; margin: 6px 0; }
.modal-card p b { color: #fff; }
.big-ico { font-size: 54px; line-height: 1; }
.price { font-size: 26px; font-weight: 900; color: #7dff9a; margin: 6px 0; }
.modal-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.modal-btns button:disabled { opacity: .45; }
#randBtn.buy { background: linear-gradient(180deg, #7dff9a, #2fbf55); color: #06290f; border: 0; font-weight: 900; }
#randBtn:disabled { opacity: .5; }
.presets button b { color: #7dff9a; margin-left: 4px; }
.presets button.on { background: var(--hot); color: #2a1406; }
.presets button.on b { color: #2a1406; }
#dealUI { display: flex; align-items: flex-end; background: rgba(8,8,20,.45); }
.deal-card { position: relative; width: 100%; max-height: 70dvh; overflow-y: auto; background: var(--panel); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 16px calc(14px + var(--sar)) calc(18px + var(--sab)) calc(14px + var(--sal)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); touch-action: pan-y; }
.deal-close { position: absolute; right: 14px; top: 12px; }
.deal-top b { font-size: 20px; font-weight: 900; display: block; } .deal-top span { color: var(--dim); font-size: 12px; font-weight: 700; }
.deal-stats { display: flex; gap: 14px; margin: 10px 0; font-weight: 900; font-size: 16px; }
.good { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.gi { font-size: 28px; text-align: center; }
.gn b { display: block; font-size: 15px; } .gn small { color: var(--dim); font-size: 12px; font-weight: 600; }
.hot { display: inline-block; font-style: normal; font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 6px; margin: 2px 0; }
.hot.cheap { background: #2fbf55; color: #06290f; } .hot.high { background: #ff8a2a; color: #2a1406; }
.gb { display: flex; gap: 6px; }
.gb button { padding: 9px 12px; border-radius: 10px; font-weight: 900; font-size: 13px; background: rgba(76,217,100,.25); border: 1px solid rgba(76,217,100,.6); }
.gb button[data-a=sell] { background: rgba(255,138,42,.22); border-color: rgba(255,138,42,.6); }
.gb button:disabled { opacity: .3; }
#mg { background: radial-gradient(ellipse at top, #2a2252, #120f24); display: flex; flex-direction: column; padding: calc(10px + var(--sat)) 12px calc(12px + var(--sab)); z-index: 30; }
.mg-head { display: flex; justify-content: space-between; align-items: center; font-size: 20px; font-weight: 900; }
.mg-timer { height: 8px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.mg-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--hot), var(--hot2)); }
#mgCanvas { flex: 1; width: 100%; touch-action: none; border-radius: 16px; }
.mg-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; }
.mg-card h3 { margin: 0; font-size: 26px; font-weight: 900; } .mg-card p { color: var(--dim); }
.mg-money { font-size: 34px; font-weight: 900; color: #7dff9a; }

/* ---------- v5: weapon button, side buttons, wheel ---------- */
.wp { font-weight: 800; font-size: 12px; color: #ffd23f; padding-left: 4px; }
.wp:empty { display: none; }
.wpn { pointer-events: auto; display: flex; align-items: center; gap: 6px; margin-top: 2px; background: rgba(10,10,24,.5); border: 1px solid rgba(255,255,255,.22); border-radius: 14px; padding: 5px 10px 5px 6px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); touch-action: none; }
.wpn .wicon { width: 34px; height: 34px; }
.wpn b { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.wpn span { font-size: 12px; color: var(--dim); font-weight: 800; }
.wpn b.rl { font-size: 11px; color: var(--hot2); animation: blink .5s infinite alternate; }
@keyframes blink { to { opacity: .35; } }
.wicon { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.wicon.sm { width: 22px; height: 22px; vertical-align: middle; }
.side-btns { position: absolute; top: calc(146px + var(--sat)); right: calc(14px + var(--sar)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sidebtn { pointer-events: auto; width: 46px; height: 46px; border-radius: 14px; font-size: 24px; background: rgba(10,10,24,.5); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); touch-action: none; }
.sidebtn:active { transform: scale(.92); }
#wheel { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(circle, rgba(10,8,24,.35), rgba(10,8,24,.7)); pointer-events: none; }
.wheel-ring { position: relative; width: 320px; height: 320px; }
#wheelSvg { position: absolute; inset: 0; width: 100%; height: 100%; }
#wheelSvg path { fill: rgba(20,18,38,.78); stroke: rgba(255,255,255,.18); stroke-width: 1.5; transition: fill .08s; }
#wheelSvg path.on { fill: rgba(255,138,42,.85); stroke: #fff; }
#wheelSvg path.off { fill: rgba(20,18,38,.5); }
#wheelSvg path.on.off { fill: rgba(120,120,130,.7); }
.wheel-item { position: absolute; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.wheel-item .wicon { width: 40px; height: 40px; }
.wheel-item.off { opacity: .35; }
.wheel-item small { font-size: 11px; font-weight: 900; margin-top: -2px; }
.wheel-item .ri { font-size: 30px; }
.wheel-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 116px; text-align: center; }
.wheel-center b { display: block; font-size: 14px; font-weight: 900; line-height: 1.15; }
.wheel-center span { display: block; font-size: 11px; color: var(--dim); font-weight: 700; margin-top: 3px; }

/* ---------- v5: phone ---------- */
#phone { position: fixed; inset: 0; z-index: 20; display: grid; place-items: end center; background: rgba(6,6,16,0); transition: background .25s; padding-bottom: calc(8px + var(--sab)); }
#phone.open { background: rgba(6,6,16,.45); }
.phone-stage { perspective: 1400px; }
.iphone { --pw: min(84vw, 360px); width: var(--pw); height: min(calc(var(--pw) * 2.05), 86dvh); position: relative; border-radius: 52px; padding: 11px;
  background: linear-gradient(145deg, #3a3c44, #15161a 40%, #2b2d33); box-shadow: inset 0 0 0 2px #55575f, inset 0 0 0 4px #121216, 0 30px 60px rgba(0,0,0,.6), 0 0 0 1px #000;
  transform: translateY(105%) rotateX(32deg) rotateZ(-4deg); transform-origin: 50% 100%; transition: transform .38s cubic-bezier(.2,.9,.25,1.1); }
#phone.open .iphone { transform: translateY(0) rotateX(6deg) rotateZ(-1.5deg); }
.btn-side { position: absolute; width: 4px; background: #2b2d33; border-radius: 2px; }
.btn-side.l1 { left: -4px; top: 110px; height: 34px; } .btn-side.l2 { left: -4px; top: 160px; height: 60px; } .btn-side.r1 { right: -4px; top: 140px; height: 80px; }
.ph-screen { position: relative; width: 100%; height: 100%; border-radius: 42px; overflow: hidden; background: linear-gradient(170deg, #ff9a62 0%, #e0567a 38%, #6a3fa0 70%, #23224f 100%); color: #fff; display: flex; flex-direction: column; }
.island { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 34%; height: 30px; background: #000; border-radius: 20px; z-index: 3; }
.ph-status { display: flex; justify-content: space-between; padding: 14px 26px 0; font-size: 13px; font-weight: 800; height: 44px; flex: none; }
#phApp { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 16px 40px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.homebar { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 38%; height: 5px; border-radius: 3px; background: rgba(255,255,255,.85); padding: 0; }
.homebar::after { content: ''; position: absolute; inset: -16px -10px; }
.ph-home { text-align: center; }
.ph-clock { font-size: 64px; font-weight: 300; letter-spacing: -1px; margin-top: 18px; text-shadow: 0 2px 12px rgba(0,0,0,.2); }
.ph-date { font-size: 15px; font-weight: 700; opacity: .9; margin-bottom: 30px; }
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; }
.ph-icon { display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; padding: 0; background: none; }
.ph-icon i { font-style: normal; width: 58px; height: 58px; border-radius: 15px; display: grid; place-items: center; font-size: 30px; box-shadow: 0 4px 10px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.3); }
.ph-icon span { font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.ph-icon em { position: absolute; top: -5px; right: 4px; background: #ff3b30; font-style: normal; font-size: 11px; font-weight: 900; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; }
#phApp h4 { margin: 4px 0 10px; font-size: 26px; font-weight: 900; }
.ph-back { background: none; color: #fff; font-weight: 800; font-size: 15px; padding: 2px 0; opacity: .9; }
#phMap { width: 100%; aspect-ratio: 3 / 4; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,.35); touch-action: none; display: block; }
.ph-mapwrap { position: relative; }
.ph-mapbtns { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ph-mapbtns button { width: 36px; height: 36px; border-radius: 10px; background: rgba(20,18,38,.82); color: #fff; font-size: 20px; font-weight: 900; display: grid; place-items: center; }
.ph-hint { font-size: 13px; opacity: .85; margin: 8px 2px; line-height: 1.4; }
.ph-btn { display: block; width: 100%; margin: 8px 0; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.18); font-weight: 800; font-size: 15px; text-align: left; backdrop-filter: blur(6px); }
.ph-btn:active, .ph-row:active { background: rgba(255,255,255,.3); }
.ph-list { display: flex; flex-direction: column; gap: 8px; }
.ph-msg { display: grid; grid-template-columns: 40px 1fr; gap: 10px; background: rgba(255,255,255,.14); border-radius: 16px; padding: 10px; }
.ph-msg .av { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.25); display: grid; place-items: center; font-size: 22px; }
.ph-msg b { font-size: 14px; } .ph-msg p { margin: 3px 0 6px; font-size: 13px; line-height: 1.35; opacity: .95; }
.ph-mini { background: rgba(0,0,0,.25); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.ph-sec { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; opacity: .8; margin: 14px 2px 4px; }
.ph-row { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 11px 12px; margin: 4px 0; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 14px; font-weight: 700; text-align: left; gap: 8px; }
.ph-row small { opacity: .75; font-weight: 700; white-space: nowrap; }
.ph-row.on { background: rgba(255,255,255,.3); }
.ph-row.danger { background: rgba(255,59,48,.3); }
.ph-cash { font-size: 40px; font-weight: 900; color: #7dff9a; text-shadow: 0 2px 10px rgba(0,0,0,.3); }

/* ---------- v5: Pokémon-style conversation ---------- */
#talkUI { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
#talkFlash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#talkFlash.go { animation: tflash .45s ease-out; }
@keyframes tflash { 0% { opacity: 1; } 100% { opacity: 0; } }
.talk-tag { position: absolute; top: calc(18px + var(--sat)); left: calc(14px + var(--sal)); background: #fff8e8; color: #1c1a2e; border: 3px solid #1c1a2e; border-radius: 14px 4px 14px 4px; padding: 8px 16px 8px 12px; box-shadow: 4px 4px 0 rgba(28,26,46,.35); animation: tagIn .5s ease-out; min-width: 52%; }
.talk-tag b { display: block; font-size: 20px; font-weight: 900; }
.talk-tag span { display: block; font-size: 12px; font-weight: 800; color: #6b5a7a; }
@keyframes tagIn { from { transform: translateX(-120%); } to { transform: none; } }
.talk-box { pointer-events: auto; position: absolute; left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); bottom: calc(12px + var(--sab)); min-height: 25dvh; background: #fff8e8; color: #1c1a2e; border: 4px solid #1c1a2e; border-radius: 18px; padding: 14px 16px 16px; box-shadow: inset 0 0 0 3px #e9b44c, 0 8px 0 rgba(28,26,46,.35); animation: boxIn .35s ease-out; }
@keyframes boxIn { from { transform: translateY(110%); } to { transform: none; } }
.talk-who { display: inline-block; background: #1c1a2e; color: #ffd23f; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 8px; margin-bottom: 8px; }
.talk-box.you .talk-who { background: #2f80ed; color: #fff; }
.talk-text { font-size: 18px; font-weight: 800; line-height: 1.4; min-height: 3.2em; }
.talk-more { position: absolute; right: 18px; bottom: 12px; font-size: 16px; color: #e23b3b; animation: bob .6s infinite alternate; }
@keyframes bob { to { transform: translateY(4px); } }
.talk-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.talk-opts.one { grid-template-columns: 1fr; }
.talk-opts button { background: #fff; color: #1c1a2e; border: 3px solid #1c1a2e; border-radius: 12px; padding: 12px 10px; font-weight: 900; font-size: 14px; text-align: left; box-shadow: 0 3px 0 #1c1a2e; display: flex; align-items: center; gap: 4px; }
.talk-opts button:active { transform: translateY(2px); box-shadow: 0 1px 0 #1c1a2e; background: #ffd23f; }
.talk-opts button:disabled { opacity: .4; }
.talk-opts .wicon { stroke: #1c1a2e; filter: none; }

/* ---------- v5: trade & gun store sheets ---------- */
#dealUI { z-index: 15; }
.deal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.deal-head b { font-size: 22px; font-weight: 900; }
.deal-stats .dn { margin-left: auto; color: var(--dim); font-size: 12px; font-weight: 700; align-self: center; }
.deal-stats b { color: #7dff9a; }
.trows { display: flex; flex-direction: column; gap: 6px; }
.trow { display: grid; grid-template-columns: 34px 1fr 62px 62px 34px; align-items: center; gap: 6px; padding: 9px 8px; border-radius: 12px; background: rgba(255,255,255,.06); border: 2px solid transparent; text-align: left; }
.trow.on { border-color: var(--hot); background: rgba(255,138,42,.15); }
.trow .gi { font-size: 24px; text-align: center; }
.trow .gn b { font-size: 14px; display: block; }
.trow .gp { font-size: 13px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
.trow .gp i { display: block; font-style: normal; font-size: 9px; color: var(--dim); font-weight: 800; text-transform: uppercase; }
.trow .gh { font-size: 13px; font-weight: 900; color: var(--hot2); text-align: right; }
.tbar { position: sticky; bottom: -18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; padding: 10px 0 4px; background: linear-gradient(transparent, rgba(20,18,38,.98) 30%); }
.qty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.qty button { width: 46px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.12); font-size: 20px; font-weight: 900; }
.qty button[data-q=max] { width: auto; padding: 0 12px; font-size: 13px; }
.qty b { font-size: 24px; font-weight: 900; min-width: 44px; text-align: center; }
.tbuy, .tsell { padding: 14px 8px; border-radius: 14px; font-weight: 900; font-size: 15px; background: linear-gradient(180deg, #7dff9a, #2fbf55); color: #06290f; }
.tsell { background: linear-gradient(180deg, var(--hot2), var(--hot)); color: #2a1406; }
.tbuy:disabled, .tsell:disabled { opacity: .35; }
.grows { display: flex; flex-direction: column; gap: 6px; }
.grow { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06); }
.grow .wicon { width: 40px; height: 40px; }
.grow .gn b { display: block; font-size: 15px; } .grow .gn small { color: var(--dim); font-weight: 700; font-size: 12px; }
.grow .tbuy { padding: 10px 12px; font-size: 13px; }
.grow .owned { color: var(--dim); font-weight: 800; font-size: 13px; }

/* ---------------- v6 */
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: none; }
.ic.sm { width: 16px; height: 16px; margin-top: -2px; }
.ic.big { width: 56px; height: 56px; stroke-width: 1.6; }
.ic.app { width: 30px; height: 30px; color: #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.ic.btn { width: 28px; height: 28px; color: #fff; }
.ic.wheel { width: 34px; height: 34px; color: #fff; }
.sidebtn { display: grid; place-items: center; color: #fff; position: relative; }
.sidebtn .ic { width: 24px; height: 24px; }
#phoneBtn.badge::after { content: ''; position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b30; border: 2px solid #fff; animation: bob .6s infinite alternate; }
.clock { display: flex; align-items: center; gap: 5px; }
#clockIco { display: grid; color: #ffd23f; }
.needs { display: flex; gap: 6px; margin-top: 6px; }
.need { --v: 50%; position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) var(--v), rgba(255,255,255,.16) 0); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.need::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: rgba(14,14,30,.88); }
.need i { display: none; }
#nHunger, .tn-h { --c: #ff8a2a; } #nEnergy, .tn-e { --c: #ffd23f; } #nMood, .tn-m { --c: #ff6fb5; } #nHygiene, .tn-y { --c: #38c8ff; } #nBladder, .tn-b { --c: #e8d34a; }
.need .ic { position: relative; z-index: 1; width: 14px; height: 14px; margin: 0; color: var(--c); }
.need.low { animation: lowPulse .8s infinite alternate; }
.talk-needs { display: flex; gap: 6px; margin-top: 6px; }
.talk-needs .need { width: 30px; height: 30px; }
@keyframes lowPulse { to { box-shadow: 0 0 0 3px rgba(255,59,48,.7), 0 2px 6px rgba(0,0,0,.35); } }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 60; transition: opacity .2s; }
#fade.on { opacity: 1; }
#editBar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 120px); display: flex; gap: 8px; pointer-events: auto; z-index: 5; }
#editBar .pill { background: rgba(10,10,24,.75); }
#editBar .pill.go { background: #4cd964; color: #08200f; }
.money-float.neg { color: #ff6b6b; }
.mg-money.neg { color: #ff6b6b; }
.talk-rel { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: #e23b3b; }
.talk-rel small { font-size: 11px; font-weight: 900; color: #6b5a7a; }
.relbar { display: inline-block; width: 70px; height: 7px; background: #e6dccb; border-radius: 4px; overflow: hidden; border: 1px solid #1c1a2e; }
.relbar i { display: block; height: 100%; background: #e23b3b; }
.talk-more::after { content: ''; display: block; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 10px solid #e23b3b; }
.talk-opts button .ic { margin-right: 4px; }
.pbar { display: block; width: 100%; height: 7px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; margin-top: 6px; }
.pbar i { display: block; height: 100%; border-radius: 4px; }
.ph-row.col { flex-direction: column; align-items: stretch; gap: 2px; }
.ph-row.col > span { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.rowbtns { display: flex; gap: 6px; margin-top: 8px; }
.rowbtns button { flex: 1; padding: 7px; border-radius: 9px; background: rgba(255,255,255,.2); font-weight: 800; font-size: 12px; }
.ph-hint { font-size: 12px; opacity: .75; margin: 2px 2px 8px; line-height: 1.35; }
.sheet-hint { font-size: 13px; opacity: .75; margin: 6px 2px 10px; line-height: 1.4; }
.mtable { display: grid; gap: 4px; font-size: 12px; }
.mrow { display: grid; grid-template-columns: 1.4fr repeat(6, 1fr); gap: 4px; align-items: center; background: rgba(255,255,255,.07); border-radius: 8px; padding: 6px; text-align: center; }
.mrow > span:first-child { text-align: left; font-weight: 800; }
.mrow.head { background: none; }
.mrow i { font-style: normal; opacity: .65; }
.mrow .cheap { color: #7dff9a; } .mrow .high { color: #ffd23f; }
.cols { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); }
.dot.on { border-color: #fff; box-shadow: 0 0 0 2px #ff8a2a; }
.grow .ic, .trow .gi .ic { width: 26px; height: 26px; }
.ph-status .ph-sig { display: flex; align-items: center; gap: 5px; }
.ph-status .bars { width: 16px; height: 10px; background: linear-gradient(90deg, #fff 0 3px, transparent 3px 4px, #fff 4px 7px, transparent 7px 8px, #fff 8px 11px, transparent 11px 12px, #fff 12px 15px); clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.ph-status .batt { width: 22px; height: 11px; border: 1.5px solid #fff; border-radius: 3px; position: relative; background: linear-gradient(90deg, #fff 75%, transparent 75%); background-clip: content-box; padding: 1px; }

#wheel.live { pointer-events: auto; }
.wheel-center { pointer-events: none; }
.wheel-center::before { content: attr(data-label); position: absolute; left: 50%; top: -34px; transform: translateX(-50%); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.14); white-space: nowrap; }

#loveBtn { color: #ff6fb5; border-color: rgba(255,111,181,.6); animation: lowPulse 1.2s infinite alternate; }
.ph-thread { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding: 6px 2px; }
.bub { align-self: flex-start; max-width: 78%; background: rgba(255,255,255,.22); padding: 8px 12px; border-radius: 16px 16px 16px 4px; font-size: 13px; font-weight: 600; line-height: 1.3; }
.bub.me { align-self: flex-end; background: #2f80ed; border-radius: 16px 16px 4px 16px; }
.ph-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ph-replies .ph-mini { flex: 1 1 45%; }
#fxVig { --vc: rgba(255,30,60,.5); position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, var(--vc) 100%); transition: opacity .15s; }

.wanted { display: flex; align-items: center; gap: 4px; min-height: 0; width: max-content; padding: 5px 8px; border-radius: 12px; background: rgba(10,14,30,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.wanted u { display: none; }
.wanted:empty { display: none; }
/* police shields: gold rim, navy field, white crest. Lit ones glow; when you're slipping away they flash red/blue like a light bar */
.wanted i { position: relative; width: 15px; height: 18px; display: block; background: linear-gradient(#fff0b0, #d39e1c 60%, #9a6c0c); clip-path: polygon(50% 0, 70% 6%, 100% 8%, 98% 52%, 86% 78%, 50% 100%, 14% 78%, 2% 52%, 0 8%, 30% 6%); }
.wanted i::after { content: ''; position: absolute; inset: 2.5px 2.5px 3.5px; background: radial-gradient(circle at 50% 44%, #fff 0 17%, #3d7be8 19% 46%, #1b2f66 48%); clip-path: polygon(50% 0, 70% 6%, 100% 8%, 98% 52%, 86% 78%, 50% 100%, 14% 78%, 2% 52%, 0 8%, 30% 6%); }
.wanted i.off { background: rgba(255,255,255,.22); }
.wanted i.off::after { background: rgba(10,14,30,.75); }
.wanted.flash i:not(.off) { animation: sirenFlash .45s infinite alternate; }
@keyframes sirenFlash { from { filter: drop-shadow(0 0 3px #ff2a3a) brightness(1.15); } to { filter: drop-shadow(0 0 3px #2a7bff) brightness(.85); } }
@keyframes starFlash { to { opacity: .3; } }
/* prison fast-forward cutscene */
#jailCut { position: fixed; inset: 0; z-index: 21; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .5s; background: repeating-linear-gradient(90deg, #07080c 0 34px, #1b1e26 34px 44px), #07080c; text-align: center; }
#jailCut > div { background: rgba(7,8,12,.86); padding: 22px 26px; border-radius: 18px; max-width: 300px; }
#jailCut.on { opacity: 1; pointer-events: auto; }
#jailCut b { display: block; font-size: 28px; font-weight: 900; color: #ff8a2a; }
#jailCut i { display: block; font-style: normal; margin-top: 10px; font-size: 22px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
#jailCut span { display: block; margin-top: 10px; color: var(--dim); font-size: 14px; font-weight: 700; line-height: 1.35; }

/* dance floor overlay */
#danceUI { position: fixed; inset: 0; z-index: 7; }
#danceCv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#danceQuit { position: absolute; right: calc(14px + var(--sar)); top: calc(var(--sat) + 160px); }

/* new-life story picker */
.story-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 58dvh; overflow-y: auto; }
.story { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.story span { display: flex; flex-direction: column; gap: 3px; }
.story b { font-size: 15px; } .story small { opacity: .75; font-size: 12px; line-height: 1.35; }
.story:active { background: rgba(255,210,63,.2); }

/* life event cards */
.ev-card { text-align: center; }
.ev-ico { width: 64px; height: 64px; margin: 2px auto 8px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, #ffd23f, #ff6fb5); color: #1c1a2e; }
.ev-ico svg { width: 34px; height: 34px; }
.ev-card p { line-height: 1.45; }

.talk-opts button .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.talk-opts button .t small { font-size: 11.5px; font-weight: 700; opacity: .65; line-height: 1.2; }

.talk-box.think { background: #eef3ff; box-shadow: inset 0 0 0 3px #9fb8ff, 0 8px 0 rgba(28,26,46,.35); }
.talk-box.think .talk-text { font-style: italic; }

.deal-head { position: sticky; top: -16px; z-index: 2; background: var(--panel); padding: 10px 0 8px; margin-top: -10px; }
.qty .done { width: auto; font-size: 14px; margin-left: 6px; background: #ffd23f !important; color: #1c1a2e !important; font-weight: 900; padding: 0 16px; }
/* stacked rows (career / education): title on top, details wrap underneath */
.ph-row.col > span.stack { flex-direction: column; align-items: flex-start; gap: 3px; }
.ph-row.col > span.stack small { white-space: normal; line-height: 1.35; }
/* when a job/race timer pill is showing, drop pop-up messages below it so they never overlap */
#hud:has(#raceTxt:not(.hidden)) .toast { top: calc(var(--sat) + 226px); }
.race-txt { font-size: 14px !important; padding: 7px 14px; }

/* stick on the right: mirror the whole control layout */
#pad.righty #stickZone { left: auto; right: 0; }
#pad.righty #stickBase { left: auto; right: calc(18px + var(--sar)); }
#pad.righty .face { right: auto; left: var(--sal); }
#pad.righty .fbtn { right: auto; left: var(--r); }

/* side buttons stretch into a pill (phone: message summary, radio: song) */
.sidebtn { transition: width .35s cubic-bezier(.2,.9,.3,1.2), background .3s; }
.sidebtn .peek { position: absolute; left: 14px; right: 50px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-start; text-align: left; opacity: 0; transition: opacity .2s; white-space: nowrap; pointer-events: none; overflow: hidden; }
.sidebtn .peek b { font-size: 13px; font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sidebtn .peek small { font-size: 11px; font-weight: 700; opacity: .75; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sidebtn .ic { position: absolute; right: 11px; top: 11px; }
.sidebtn.open { width: min(210px, calc(100vw - 160px)); background: rgba(10,10,24,.82); }
.sidebtn.open .peek { opacity: 1; transition-delay: .12s; }
#hud:has(.sidebtn.open) .toast { top: calc(var(--sat) + 262px); }

#carLabel { position: absolute; left: calc(80px + var(--sal)); bottom: auto; top: calc(58% - 96px); transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.85); text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none; opacity: 0; transition: opacity .3s; }
#carLabel.on { opacity: 1; }
#pad.righty #carLabel { left: auto; right: calc(80px + var(--sar)); transform: translateX(50%); }

/* speedometer sits above the stick you drive with, with the local speed limit sign */
.speedo { left: calc(80px + var(--sal)); transform: translateX(-50%); bottom: auto; top: calc(58% - 102px); display: flex; align-items: center; gap: 2px; padding: 2px 8px; background: rgba(10,10,24,.35); border-radius: 10px; }
.speedo b { font-size: 17px !important; } .speedo span { font-size: 9px !important; }
.speedo.righty { left: auto; right: calc(80px + var(--sar)); transform: translateX(50%); }
.speedo .lim { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 22px; height: 26px; margin-left: 6px; border-radius: 3px; background: #fff; border: 2px solid #141428; box-shadow: inset 0 0 0 1.5px #fff, inset 0 0 0 2.5px #141428; font-style: normal; } /* US-style SPEED LIMIT sign */
.speedo .lim::before { content: 'LIMIT'; font-size: 5px; font-weight: 900; color: #141428; letter-spacing: .02em; }
.speedo .lim em { font-style: normal; font-size: 11px; font-weight: 900; color: #141428; line-height: 1; }
.speedo .lim.hidden { display: none; }
.speedo.over b, .speedo.over span { color: #ff5a5a; animation: spdFlash .45s steps(1) infinite; }
@keyframes spdFlash { 50% { opacity: .25; } }

/* swipe-to-delete rows in Messages */
.swr { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 8px; }
.swr-del { position: absolute; inset: 0; background: #e23b3b; color: #fff; font-weight: 900; font-size: 13px; display: flex; align-items: center; justify-content: flex-end; padding-right: 18px; border-radius: 16px; }
.swr > :last-child { position: relative; touch-action: pan-y; margin: 0 !important; }
.swr .ph-msg { background: #3a3f52; }
.swr .ph-row { background: #3a3f52; border-radius: 12px; }
.ph-list .swr { margin-bottom: 0; }
/* tattoo parlour */
.ink-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ink { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid transparent; font-size: 10px; font-weight: 800; color: #fff; }
.ink img { width: 40px; height: 40px; background: #f2d8c4; border-radius: 8px; }
.ink.on { border-color: var(--hot); background: rgba(255,138,42,.22); }
.big-btn { display: block; width: 100%; margin-top: 10px; padding: 13px; border-radius: 12px; background: var(--hot, #ff8a2a); color: #141428; font-weight: 900; font-size: 15px; border: 0; }
.big-btn.alt { background: rgba(255,255,255,.12); color: #fff; }
.big-btn:disabled { opacity: .4; }

/* subtitles: someone talking to you while you roam. Face, name, the line. No reply needed. */
#subs { position: absolute; left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); max-width: 460px; margin: 0 auto; bottom: calc(var(--pad) + var(--sab) - 50px); display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 18px; background: rgba(10,10,24,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12); transition: opacity .25s, transform .25s; text-shadow: none; }
#subs.hidden { display: flex !important; opacity: 0; transform: translateY(10px); }
#subs.radio { border-color: rgba(70,130,255,.6); }
#subs.me { border-color: rgba(255,210,63,.45); }
.subFaceWrap { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 35%, #5a6280, #23263a); }
#subs.radio .subFaceWrap { background: radial-gradient(circle at 50% 35%, #3a5aa8, #141c3a); }
#subFace { width: 64px; height: 64px; display: block; }
.subBody { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#subName { font-size: 11px; font-weight: 900; color: #ffd23f; letter-spacing: .03em; text-transform: uppercase; }
#subs.radio #subName { color: #8ab4ff; }
#subTxt { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.3; }

/* main story texts: pinned, can't be swiped away until they're done */
.ph-msg.main { border: 1px solid rgba(255,210,63,.55); background: rgba(255,210,63,.12); border-radius: 14px; }
.mainpill { display: table; font-size: 10px; font-weight: 900; letter-spacing: .05em; color: #16161b; background: #ffd23f; border-radius: 999px; padding: 2px 8px; margin-bottom: 4px; }
.ph-msg .goal { font-weight: 800; color: #ffd23f; display: flex; gap: 6px; align-items: center; }

/* ---- HUD v2: the top-left slot. Needs rings step aside when someone talks, a notification lands or a song changes. ---- */
.hud-l { width: calc(100vw - 172px - var(--sal) - var(--sar)); max-width: 330px; }
.hud-l .needs, .hud-l .wanted { transition: opacity .18s; }
#hud.slot .hud-l .needs { display: none; }
#subs { position: static; margin: 0; width: 100%; max-width: none; bottom: auto; left: auto; right: auto; padding: 6px 10px 6px 6px; gap: 8px; border-radius: 16px; }
#subs.hidden { display: none !important; }
.subFaceWrap { flex: 0 0 54px; width: 54px; height: 54px; }
#subFace { width: 54px; height: 54px; }
#subTxt { font-size: 13px; }
.toast { position: static; margin: 0; width: auto; max-width: 100%; top: auto; left: auto; right: auto; text-align: left; border-radius: 14px; padding: 7px 12px; display: none; }
.toast.on { display: block; }
.note { pointer-events: none; display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 12px 6px 6px; border-radius: 16px; background: rgba(10,10,24,.72); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.note.hidden { display: none; }
.note .nico { flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #2f80ed; }
.note.radio .nico { background: #9b51e0; }
.note .nbody { display: flex; flex-direction: column; min-width: 0; }
.note b { font-size: 13px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note small { font-size: 12px; font-weight: 700; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* where you are: bottom-left corner, under the stick */
#zoneTxt { position: fixed; left: calc(14px + var(--sal)); bottom: calc(8px + var(--sab)); margin: 0; z-index: 7; pointer-events: none; }
/* weapon: just above the action buttons, in reach of your thumb (on foot and in the car) */
#wpnBtn { position: fixed; right: calc(14px + var(--sar)); bottom: calc(var(--pad) + var(--sab) + 2px); margin: 0; z-index: 7; }
#pad.righty ~ #hud #wpnBtn, body.righty #wpnBtn { right: auto; left: calc(14px + var(--sal)); }
body.righty #zoneTxt { left: auto; right: calc(14px + var(--sar)); }

/* the minimap is your phone: a little screen in the corner. Tap it to open the phone. */
#mmWrap { position: absolute; top: calc(6px + var(--sat)); right: calc(8px + var(--sar)); width: 104px; height: 139px; border-radius: 22px; border: 4px solid #16161b; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35), 0 6px 16px rgba(0,0,0,.4); overflow: hidden; pointer-events: auto; background: #3d8fd0; }
#mmWrap::before { content: ''; position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 34px; height: 9px; border-radius: 9px; background: #16161b; z-index: 2; pointer-events: none; }
#mmWrap #minimap { position: static; width: 100%; height: 100%; border-radius: 0; filter: none; display: block; }
#mmWrap.badge::after { content: ''; position: absolute; top: 6px; right: 8px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b30; border: 2px solid #fff; z-index: 3; animation: bob .6s infinite alternate; }
.side-btns { top: calc(154px + var(--sat)); }
.hud-l { width: calc(100vw - 140px - var(--sal) - var(--sar)); }
.bub.typing { opacity: .6; letter-spacing: 2px; }

/* the phone grows out of the phone-map in the corner, and shrinks back into it */
.iphone { transform: translate(var(--fx, 0px), var(--fy, 105%)) scale(var(--fs, 1)); transform-origin: 50% 50%; transition: transform .36s cubic-bezier(.2,.9,.25,1.05), opacity .2s; }
#phone:not(.open) .iphone { opacity: .0; transition: transform .36s cubic-bezier(.4,0,.6,1), opacity .3s .1s; }
#phone.open .iphone { transform: translate(0, 0) scale(1) rotateX(6deg) rotateZ(-1.5deg); opacity: 1; transition: transform .36s cubic-bezier(.2,.9,.25,1.05), opacity .08s; }
body.phone-out #mmWrap { opacity: 0; transition: opacity .1s; }
#mmWrap { transition: opacity .2s .25s; }
#nHealth { --c: #ff3b4a; }

/* speed on the phone-map, like a sat-nav: turns red when you're over the limit */
#mmSpeed { position: absolute; left: 6px; bottom: 6px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.95); border: 3px solid #16161b; display: grid; place-items: center; align-content: center; line-height: 1; z-index: 3; color: #16161b; text-shadow: none; }
#mmSpeed b { font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
#mmSpeed small { font-size: 7px; font-weight: 900; letter-spacing: .04em; }
#mmSpeed.over { background: #ff3b30; border-color: #fff; color: #fff; }
#mmSpeed.hidden { display: none; }
#mmWrap.badge::after { display: none; }
/* closing: shrink back into the map, only fading right at the end */
#phone:not(.open) .iphone { opacity: 0; transition: transform .32s cubic-bezier(.45,0,.7,.4), opacity .08s linear .26s; }
#mmWrap { transition: opacity .12s; }

/* the radio: a small button under the needs rings that stretches out to show what's playing */
#radioBtn.inpill { width: 38px; height: 38px; border-radius: 13px; margin-top: 2px; }
#radioBtn.inpill .ic { left: 8px; right: auto; top: 7px; width: 22px; height: 22px; }
#radioBtn.inpill .peek { left: 40px; right: 10px; }
#radioBtn.inpill.open { width: min(100%, calc(100vw - 150px)); }
#radioBtn.inpill.hidden { display: none; }
.ph-mini.on { background: #fff; color: #16161b; }

/* ---- the slot, v3: one card at a time that bubbles in and out; everything under it glides out of the way ---- */
.hud-l { position: relative; }
#subs { position: absolute; left: 0; top: 46px; width: 100%; z-index: 3; opacity: 0; transform: translateY(-4px) scale(.86); transform-origin: 24px 24px; transition: opacity .2s ease, transform .3s cubic-bezier(.2,1.35,.4,1); pointer-events: none; }
#subs.show { opacity: 1; transform: none; }
#subs:not(.show) { transition: opacity .2s ease, transform .24s cubic-bezier(.5,0,.8,.4); }
#subs.hidden { display: flex !important; visibility: hidden; }
.subIco { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #2f80ed; }
#subs.radio-note .subIco, #subs.plain.radio .subIco { background: #9b51e0; }
#subs.plain { padding: 8px 12px 8px 8px; }
#subs.plain:not(:has(.subIco[style*="grid"])) { padding-left: 14px; }
.hud-l .needs { transition: opacity .2s ease; }
#hud.slot .hud-l .needs { display: flex; opacity: 0; }
.hud-l #radioBtn, .hud-l .wanted { transition: transform .32s cubic-bezier(.2,.9,.3,1.05), width .35s cubic-bezier(.2,.9,.3,1.2), background .3s; }
#hud.slot .hud-l #radioBtn, #hud.slot .hud-l .wanted { transform: translateY(calc(var(--slotH, 64px) - 32px)); }
.toast { position: fixed; top: calc(var(--sat) + 10px); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 40px); z-index: 30; display: block; text-align: center; border-radius: 999px; }
.toast:not(.on) { display: none; }
.note { display: none !important; }

/* incoming call: the phone-map buzzes */
#mmWrap.ring { animation: phoneRing .12s linear 12; }
@keyframes phoneRing { 0% { transform: rotate(0) translateX(0); } 25% { transform: rotate(-4deg) translateX(-2px); } 75% { transform: rotate(4deg) translateX(2px); } 100% { transform: rotate(0) translateX(0); } }

/* sat-nav strip on the phone-map: distance big, where you're going under it */
#mmNav { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px 5px 6px; background: linear-gradient(transparent, rgba(10,10,24,.85) 30%); display: flex; flex-direction: column; align-items: flex-end; text-align: right; z-index: 2; pointer-events: none; text-shadow: 0 1px 2px #000; }
#mmNav.hidden { display: none; }
#mmNav b { font-size: 13px; font-weight: 900; color: #ffd23f; line-height: 1.1; }
#mmNav small { font-size: 8.5px; font-weight: 800; color: #fff; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
#mmWrap.navving #mmNav { padding-left: 48px; }
#mmWrap:not(:has(#mmSpeed.hidden)) #mmNav { padding-left: 48px; }
#mmWrap:has(#mmSpeed.hidden) #mmNav { align-items: center; text-align: center; padding-left: 6px; }
/* sat-nav: just the distance, one line, fixed in place */
#mmNav small { display: none; }
#mmNav { flex-direction: row; justify-content: flex-end; align-items: center; height: 30px; padding: 0 8px 6px 48px; }
#mmWrap:has(#mmSpeed.hidden) #mmNav { justify-content: center; padding-left: 8px; align-items: center; }
#mmNav b { white-space: nowrap; font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1; }

#pad #wpnBtn { position: absolute; right: calc(12px + var(--sar)); left: auto; top: 22px; bottom: auto; z-index: 3; }
#pad.righty #wpnBtn { right: auto; left: calc(12px + var(--sal)); }

/* speed sits above the distance strip so they never overlap */
/* speed dial sits in the bottom-left corner; distance is a small one-line readout beside it */
#mmSpeed { bottom: 5px; left: 5px; width: 34px; height: 34px; border-width: 2.5px; }
#mmSpeed b { font-size: 13px; } #mmSpeed small { font-size: 6.5px; }
#mmNav, #mmWrap:has(#mmSpeed.hidden) #mmNav, #mmWrap:not(:has(#mmSpeed.hidden)) #mmNav, #mmWrap.navving #mmNav { justify-content: center; padding: 0 6px 7px 6px; height: 24px; }
#mmWrap:not(:has(#mmSpeed.hidden)) #mmNav { padding-left: 42px; }
#mmNav b { font-size: 12px; white-space: nowrap; }

/* level up: gold, bouncy, a bit of shine */
#subs.plain.levelup { background: linear-gradient(135deg, rgba(255,210,63,.95), rgba(255,138,42,.95)); border-color: #fff3a0; box-shadow: 0 0 24px rgba(255,210,63,.6); }
#subs.plain.levelup #subName { color: #16161b; font-size: 13px; letter-spacing: .12em; }
#subs.plain.levelup #subTxt { color: #16161b; font-weight: 900; }
#subs.plain.levelup .subIco { color: #16161b; box-shadow: 0 0 0 2px #fff; }
#subs.levelup.show { animation: lvlPop .7s cubic-bezier(.2,1.6,.4,1); }
@keyframes lvlPop { 0% { transform: scale(.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* the deal ring */
#ringUI { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8,6,16,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: rIn .22s ease; padding: 16px; }
#ringUI.out { opacity: 0; transition: opacity .2s; }
@keyframes rIn { from { opacity: 0; } }
#ringUI .rcard { width: min(360px, 100%); background: linear-gradient(180deg, #221c38, #15111f); border: 1px solid rgba(255,255,255,.1); border-radius: 26px; padding: 16px 16px 18px; color: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.5); display: grid; gap: 10px; animation: rPop .32s cubic-bezier(.2,1.4,.4,1); }
@keyframes rPop { from { transform: scale(.85); } }
#ringUI .rtop { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
#ringUI .rtop b { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #ffd23f; }
#ringUI .rtop span { font-weight: 800; font-size: 15px; text-align: right; }
#ringUI .rwrap { position: relative; width: 100%; aspect-ratio: 1; max-width: 260px; margin: 0 auto; }
#ringUI canvas { width: 100%; height: 100%; display: block; }
#ringUI .rmid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
#ringUI .rnum { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
#ringUI .rsub { font-size: 12px; font-weight: 800; color: rgba(255,255,255,.7); letter-spacing: .04em; }
#ringUI.win .rnum { color: #6dff8a; animation: rWin .5s cubic-bezier(.2,1.6,.4,1); }
#ringUI.lose .rnum { color: #ff5c6a; animation: rLose .4s; }
@keyframes rWin { 40% { transform: scale(1.25); } }
@keyframes rLose { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
#ringUI .rtip { margin: 0; font-size: 12.5px; color: rgba(255,255,255,.72); text-align: center; }
#ringUI .rtip .g { color: #6dff8a; font-weight: 800; }
#ringUI .rbtns { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
#ringUI .rbtns button { border: 0; border-radius: 16px; padding: 12px 10px; font: inherit; font-weight: 900; color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; flex-direction: column; touch-action: none; user-select: none; -webkit-user-select: none; }
#ringUI .rsafe { background: rgba(255,255,255,.1); }
#ringUI .rsafe small { font-weight: 700; opacity: .7; }
#ringUI .rhold { background: linear-gradient(180deg, #4cd964, #26a644); font-size: 18px; flex-direction: row !important; box-shadow: 0 6px 0 #17702c; transition: transform .08s, box-shadow .08s; }
#ringUI .rhold.on { transform: translateY(5px); box-shadow: 0 1px 0 #17702c; }

/* passive captions: what you overhear */
#amb { position: fixed; left: 50%; bottom: calc(var(--pad) + var(--sab) + 14px); transform: translate(-50%, 8px); max-width: min(78vw, 360px); z-index: 5; pointer-events: none; display: flex; gap: 6px; align-items: baseline; justify-content: center; text-align: center; font-size: 12.5px; line-height: 1.3; color: rgba(255,255,255,.92); background: rgba(10,8,20,.42); padding: 5px 11px; border-radius: 12px; opacity: 0; transition: opacity .35s ease, transform .35s ease; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
#amb.show { opacity: 1; transform: translate(-50%, 0); }
#amb b { font-weight: 900; color: #ffd23f; white-space: nowrap; font-size: 11.5px; letter-spacing: .02em; }
#amb span { font-style: italic; font-weight: 600; }

/* gunsmith attachment chips: name, green/red effects, price or lock */
.chip.rich { display: grid; gap: 3px; text-align: left; padding: 8px 10px; min-width: 120px; align-content: start; }
.chip.rich .cn { font-weight: 800; font-size: 13px; }
.chip.rich .cfx { display: flex; flex-wrap: wrap; gap: 3px 6px; }
.chip.rich .cfx i { font-style: normal; font-size: 10.5px; font-weight: 800; color: rgba(255,255,255,.6); }
.chip.rich .cfx i.up { color: #5cf08a; } .chip.rich .cfx i.dn { color: #ff6b78; }
.chip.rich .cpr { font-size: 10.5px; font-weight: 800; color: #ffd23f; }
.chip.rich .clk { font-size: 10.5px; font-weight: 900; color: rgba(255,255,255,.55); }
.chip.locked { opacity: .5; filter: grayscale(.6); }
.chip.locked .cn::before { content: ''; display: inline-block; width: 8px; height: 9px; margin-right: 5px; border: 2px solid currentColor; border-radius: 2px; vertical-align: -1px; }
.stat .bar { position: relative; }
.stat .bar em { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.stat .bar em.up { background: #3fd477; } .stat .bar em.dn { background: #ff4d5e; opacity: .85; }
.stat.better b { color: #5cf08a; } .stat.worse b { color: #ff6b78; }
/* gunsmith / garage: stats pinned at the top of the panel so the green/red changes are visible while picking parts */
.panel.scroll { display: flex; flex-direction: column; }
.panel.scroll > .stats { order: -1; position: sticky; top: -10px; z-index: 2; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; padding: 8px 10px; background: rgba(22,18,40,.97); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel.scroll > .stats:empty { display: none; }
.panel.scroll > .stats .stat { grid-template-columns: 58px 1fr 42px; gap: 5px; font-size: 10.5px; padding: 1.5px 0; }
.panel.scroll > .stats .statx { grid-column: 1 / -1; font-size: 11px; margin-top: 4px; }
.panel.scroll > * { flex-shrink: 0; }
.statx .cls { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 5px; font-weight: 900; color: #16161b; background: #9aa0aa; }
.statx .clsS { background: linear-gradient(135deg, #ffe066, #ff8a2a); } .statx .clsA { background: #ff6fb5; } .statx .clsB { background: #38e8ff; } .statx .clsC { background: #4cd964; }
.wbtns { display: flex; gap: 6px; flex-shrink: 0; } .wbtns button { min-width: 0; padding-inline: 12px; }
/* the armory: shelf of weapons, part categories, swipeable options, colours at the bottom */
.arm-hint { font-size: 12px; color: var(--dim); margin: 2px 0 8px; }
.acar, .acats, .aopts { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding-bottom: 6px; scrollbar-width: none; }
.acar::-webkit-scrollbar, .acats::-webkit-scrollbar, .aopts::-webkit-scrollbar { display: none; }
.acard { flex: 0 0 132px; scroll-snap-align: start; display: grid; justify-items: start; gap: 4px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.07); border: 2px solid transparent; text-align: left; color: #fff; }
.acard .aic svg { width: 56px; height: 28px; }
.acard b { font-size: 14px; font-weight: 900; line-height: 1.15; }
.acard small { font-size: 12px; font-weight: 800; color: #ffd23f; }
.acard.own small { color: #5cf08a; }
.acard.on { border-color: var(--hot); }
.arm-wallet { margin-top: 10px; font-weight: 900; color: #5cf08a; display: flex; gap: 6px; align-items: center; }
.arm-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.arm-new { font-size: 12px; color: #ffd23f; font-weight: 800; }
.arm-back, .arm-ammo { border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 900; background: rgba(255,255,255,.1); color: #fff; display: inline-flex; gap: 5px; align-items: center; }
.arm-ammo { background: linear-gradient(180deg, #4cd964, #26a644); }
.arm-ammo:disabled { opacity: .5; }
.acat { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.07); font-weight: 900; font-size: 13px; color: rgba(255,255,255,.75); position: relative; }
.acat.on { background: var(--hot); color: #2a1406; }
.acat.chg::after { content: ''; position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: #5cf08a; }
.aopts { margin-top: 6px; }
.aopt { flex: 0 0 150px; scroll-snap-align: center; display: grid; gap: 4px; align-content: start; text-align: left; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.07); border: 2px solid transparent; color: #fff; min-height: 92px; }
.aopt b { font-size: 13.5px; font-weight: 900; }
.aopt .cfx { display: flex; flex-wrap: wrap; gap: 2px 6px; } .aopt .cfx i { font-style: normal; font-size: 10.5px; font-weight: 800; color: rgba(255,255,255,.6); } .aopt .cfx i.up { color: #5cf08a; } .aopt .cfx i.dn { color: #ff6b78; }
.aopt small { font-size: 11px; font-weight: 900; color: #ffd23f; margin-top: auto; }
.aopt.on { border-color: var(--hot); background: rgba(255,138,42,.18); }
.aopt.locked { opacity: .5; } .aopt.locked small { color: rgba(255,255,255,.6); }
.acols { margin-top: 10px; display: grid; gap: 8px; }
.acolk { display: flex; gap: 6px; } .acolk button { flex: 1; padding: 6px 0; border-radius: 10px; background: rgba(255,255,255,.07); font-size: 12px; font-weight: 900; color: rgba(255,255,255,.7); }
.acolk button.on { background: rgba(255,255,255,.22); color: #fff; }
.acolsw { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; } .acolsw .sw { flex: 0 0 30px; height: 30px; }
.arm-simple { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 10px 0; } .arm-simple .aic svg { width: 90px; height: 45px; } .arm-simple p { margin: 0; color: rgba(255,255,255,.8); font-size: 14px; }
.arm-buy { padding: 12px 22px; border-radius: 14px; font-weight: 900; background: linear-gradient(180deg, #4cd964, #26a644); color: #fff; font-size: 16px; } .arm-buy:disabled { opacity: .5; }
.arm-owned { color: #5cf08a; }
body.armory .panel { height: 60dvh; padding-top: 10px; }
body.armory .panel.scroll > .stats { margin-bottom: 6px; padding: 6px 8px; }
body.armory .panel.scroll > .stats .stat { font-size: 10px; padding: 1px 0; }
body.armory .presets { margin-bottom: 4px; } body.armory .presets button { padding: 5px 9px; font-size: 12px; }
body.armory .drag-hint { bottom: calc(60dvh + 6px); }
.tabs:empty { display: none; }
/* minigames play as full-screen cutscenes: no frame, the title and quit float, hint and result fade over the action */
#mg { padding: 0; display: block; }
#mg.see { background: transparent; }
#mgCanvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
#mg .mg-timer { position: absolute; left: 0; right: 0; top: 0; height: 4px; margin: 0; border-radius: 0; background: rgba(0,0,0,.25); z-index: 2; }
#mg .mg-timer i { border-radius: 0; }
#mg .mg-head { position: absolute; left: 0; right: 0; top: calc(10px + var(--sat)); padding: 0 12px; z-index: 2; pointer-events: none; }
#mg .mg-head b { font-size: 15px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); background: rgba(10,8,20,.35); padding: 6px 12px; border-radius: 999px; }
#mg .mg-head .pill { pointer-events: auto; padding: 7px 14px; font-size: 13px; background: rgba(10,8,20,.45); }
#mgHint { position: absolute; left: 50%; bottom: calc(18% + var(--sab)); transform: translate(-50%, 10px); z-index: 2; pointer-events: none; font-size: 20px; font-weight: 900; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.8); opacity: 0; transition: opacity .35s, transform .35s; text-align: center; width: 86%; }
#mgHint.show { opacity: 1; transform: translate(-50%, 0); }
#mgBanner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.8); z-index: 3; pointer-events: none; opacity: 0; transition: opacity .25s, transform .35s cubic-bezier(.2,1.5,.4,1); text-align: center; display: grid; gap: 4px; }
#mgBanner b { font-size: 34px; font-weight: 900; color: #fff; text-shadow: 0 3px 16px rgba(0,0,0,.8); letter-spacing: .02em; }
#mgBanner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#mgBanner.win b { color: #6dff8a; } #mgBanner.lose b { color: #ff6b78; }
/* jail pay phone dial screen */
#payphone { position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center; padding: 16px 16px calc(24px + var(--sab)); background: rgba(10,8,20,.55); }
#payphone .pp { width: min(420px, 100%); background: #2b2d34; border: 3px solid #16161b; border-radius: 22px; padding: 14px; display: grid; gap: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
#payphone .pphead b { display: block; color: #fff; font-size: 18px; font-weight: 900; } #payphone .pphead small { color: rgba(255,255,255,.6); font-weight: 700; }
#payphone .ppbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#payphone .ppbtns button { background: #3d4049; color: #fff; border-radius: 14px; padding: 12px; font-weight: 900; text-align: left; display: flex; gap: 8px; align-items: center; border-bottom: 4px solid #1b1c22; }
#payphone .ppbtns button small { display: block; color: #ffd23f; }
.fbtn span { max-width: 90%; text-align: center; line-height: 1.05; white-space: normal; overflow-wrap: normal; word-break: keep-all; } /* two-word labels wrap at the space, single words never split */
.fbtn span.xs { overflow-wrap: anywhere; }
.fbtn span.sm { font-size: 8.5px; letter-spacing: .01em; }
.fbtn span.xs { font-size: 7.6px; letter-spacing: 0; }
/* on foot outside, the weapon button sits in the thumb arc (where Kick used to be): tap to holster/draw, hold for the weapon wheel, ammo shown under the icon */
#pad.wpnslot #wpnBtn { right: calc(30px + var(--sar)); left: auto; top: auto !important; bottom: calc(140px + var(--sab)); width: 58px; height: 58px; padding: 0; border-radius: 50%; gap: 0 2px;
  flex-wrap: wrap; justify-content: center; align-content: center; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.32); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#pad.wpnslot.righty #wpnBtn { right: auto; left: calc(30px + var(--sal)); }
#pad.wpnslot #wpnBtn .wicon, #pad.wpnslot #wpnBtn > svg { width: 26px; height: 22px; flex-basis: 100%; }
#pad.wpnslot #wpnBtn b { font-size: 10px; line-height: 1; } #pad.wpnslot #wpnBtn span { font-size: 9px; line-height: 1; }
#pad.wpnslot #wpnBtn b.rl { font-size: 7.5px; }
#a2hs { position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 10px); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: rgba(18,16,28,.92); color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.4); transform: translateY(-140%); transition: transform .4s cubic-bezier(.2,.9,.3,1.1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#a2hs.on { transform: none; }
#a2hs img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
#a2hs div { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.3; }
#a2hs div b { font-size: 14px; }
#a2hs .ish { width: 15px; height: 15px; vertical-align: -3px; fill: none; stroke: #4aa3ff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#a2hs .pill { flex: none; }
#a2hs .pill.hot { background: #ff8a2a; border-color: #ff8a2a; color: #1a1208; }
/* area name sits just under the phone-map, top right (clear of the thumbstick) */
#zoneTxt { left: auto !important; bottom: auto !important; right: calc(8px + var(--sar)); top: calc(6px + var(--sat) + 139px + 6px); max-width: 140px; text-align: center; align-self: auto; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.righty #zoneTxt { right: calc(8px + var(--sar)); }
/* ---- phone home: swipeable pages, dots, dock, wiggle mode */
#phApp.home { overflow: hidden; padding: 0; touch-action: none; }
.ph-home2 { position: relative; height: 100%; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }
.ph-pages { flex: 1; overflow: hidden; position: relative; }
.ph-track { display: flex; height: 100%; transition: transform .25s cubic-bezier(.2,.8,.3,1); }
.ph-page { flex: 0 0 100%; padding: 6px 16px 0; box-sizing: border-box; text-align: center; }
.ph-page .ph-grid { gap: 14px 6px; }
.ph-dots { height: 22px; display: flex; justify-content: center; align-items: center; gap: 7px; }
.ph-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); }
.ph-dots i.on { background: #fff; }
.ph-dock { margin: 0 10px 22px; padding: 10px 6px; border-radius: 28px; background: rgba(255,255,255,.22); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ph-dock .ph-icon span { display: none; }
.ph-done { position: absolute; top: 2px; right: 14px; z-index: 5; padding: 5px 14px; border-radius: 999px; background: rgba(255,255,255,.9); color: #111; font-weight: 800; font-size: 13px; }
.jiggle .ph-icon i { animation: wiggle .3s infinite alternate ease-in-out; }
.jiggle .ph-icon:nth-child(2n) i { animation-delay: -.15s; animation-direction: alternate-reverse; }
@keyframes wiggle { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
.ph-del { position: absolute; top: -6px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: rgba(60,60,70,.92); color: #fff; font-size: 17px; line-height: 20px; font-weight: 900; z-index: 2; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.ph-ghost { position: fixed !important; z-index: 9999; pointer-events: none; transform: scale(1.15); opacity: .95; display: flex; }
.ph-ghost i { animation: none !important; box-shadow: 0 10px 24px rgba(0,0,0,.45) !important; }
.ph-hole { opacity: .2; }
/* App Store, Weather, News */
.store-row { align-items: center; }
.st-app { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-app i { flex: none; width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-style: normal; }
.st-app span { display: flex; flex-direction: column; min-width: 0; } .st-app small { opacity: .7; font-size: 11px; }
.ph-mini.get { background: rgba(56,176,255,.25); color: #8fd0ff; min-width: 60px; }
.ph-mini.loading { width: 26px; min-width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 3px solid rgba(143,208,255,.3); border-top-color: #8fd0ff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wx-now { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; } .wx-now .ic.big { width: 56px; height: 56px; }
.wx-t { font-size: 46px; font-weight: 900; } .wx-now small { display: block; opacity: .75; font-size: 12px; }
.wx-hours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; background: rgba(255,255,255,.08); border-radius: 14px; padding: 10px 4px; text-align: center; }
.wx-h { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.ph-row.news span { white-space: normal; }
.ph-row.news { align-items: flex-start; text-align: left; } .ph-row.news span, .ph-row.news small { text-align: left; }

/* compact weapon wheel: takes over the bottom-right buttons instead of filling the screen */
#wheel.compact { display: block; background: radial-gradient(circle at var(--cx) var(--cy), rgba(10,8,24,.55) 0, rgba(10,8,24,.25) 150px, rgba(10,8,24,0) 240px); }
#wheel.compact .wheel-ring { position: absolute; left: calc(var(--cx) - 160px); top: calc(var(--cy) - 160px); transform-origin: 50% 50%; }
#wheel.compact .wheel-item small { font-size: 13px; }
#wheel.compact .wheel-center b { font-size: 16px; }
#wheel.compact .wheel-center span { font-size: 13px; }
body.wheel-compact #pad .face, body.wheel-compact #wpnBtn { opacity: 0; transition: opacity .12s; }

/* police badges ride alongside the radio; while you're wanted the song name stays tucked away */
.radio-row { display: flex; align-items: center; gap: 6px; max-width: 100%; transition: transform .32s cubic-bezier(.2,.9,.3,1.05); }
.radio-row .wanted { margin: 2px 0 0; }
#hud.slot .hud-l .radio-row { transform: translateY(calc(var(--slotH, 64px) - 32px)); }
#hud.slot .hud-l .radio-row #radioBtn, #hud.slot .hud-l .radio-row .wanted { transform: none; }

/* Maps: category toggles above the list of places */
.ph-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.ph-cat { display: flex; align-items: center; gap: 5px; padding: 6px 10px 6px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; color: rgba(255,255,255,.55); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.ph-cat .ic { width: 16px; height: 16px; opacity: .55; }
.ph-cat.on { color: #fff; background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.4); }
.ph-cat.on .ic { opacity: 1; }
.ph-row > span { min-width: 0; }

/* Online sign-in: buttons into the player's mail app */
.ph-mailapps { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ph-mailapps .ph-btn { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: #fff; }
.ph-mailapps .ph-btn.alt { background: rgba(255,255,255,.1); }
/* action buttons in the same frosted glass as the stick: soft inner light, a coloured rim per role, and they glow when pressed */
.fbtn, #pad.wpnslot #wpnBtn { --tint: 255,255,255;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.16), rgba(255,255,255,.05) 60%, rgba(10,10,30,.12));
  border: 1.5px solid rgba(var(--tint), .38); box-shadow: inset 0 0 16px rgba(var(--tint), .08), 0 6px 18px rgba(0,0,0,.2);
  backdrop-filter: blur(7px) saturate(1.3); -webkit-backdrop-filter: blur(7px) saturate(1.3);
  transition: transform .1s, box-shadow .15s, border-color .15s, background .15s; }
#pad .fbtn.x { --tint: 255,110,90; } #pad.driving .fbtn.x { --tint: 255,80,90; } #pad.driving .fbtn.a { --tint: 76,217,100; }
#pad .fbtn.x, #pad.driving .fbtn.x, #pad.driving .fbtn.a { border-color: rgba(var(--tint), .8); background: radial-gradient(circle at 50% 30%, rgba(var(--tint), .26), rgba(var(--tint), .08) 62%, rgba(10,10,30,.12)); }
.fbtn.ready { --tint: 76,217,100; border-color: rgba(76,217,100,.85); background: radial-gradient(circle at 50% 30%, rgba(76,217,100,.42), rgba(76,217,100,.16) 62%, rgba(10,10,30,.12)); }
.fbtn.down, #pad.wpnslot #wpnBtn:active { transform: scale(.92); border-color: rgba(var(--tint), 1); box-shadow: inset 0 0 18px rgba(var(--tint), .3), 0 0 22px rgba(var(--tint), .55); background: radial-gradient(circle at 50% 30%, rgba(var(--tint), .4), rgba(var(--tint), .14) 62%, rgba(10,10,30,.1)); }
#pad.wpnslot #wpnBtn { --tint: 255,210,63; }
/* ---------- title: sign in, pick a save, play ---------- */
#title { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: radial-gradient(120% 80% at 50% 0%, rgba(255,138,92,.55), rgba(196,70,122,.55) 45%, rgba(40,20,80,.85) 85%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow-y: auto; }
.tt-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 10px; text-align: center; color: #fff; }
.tt-logo { font-size: clamp(54px, 15vw, 84px); font-weight: 900; line-height: .86; letter-spacing: -.02em; margin-bottom: 14px; text-shadow: 0 6px 30px rgba(0,0,0,.35); }
.tt-logo span { display: block; color: #ffd23f; }
.tt-sub { margin: 0; font-size: 14px; opacity: .92; line-height: 1.4; }
#title input { width: 100%; padding: 14px 16px; border-radius: 16px; border: 1.5px solid rgba(255,255,255,.35); background: rgba(10,8,30,.35); color: #fff; font-size: 17px; font-weight: 700; text-align: center; outline: none; }
#title input:focus { border-color: #ffd23f; }
#title input.tt-code { font-size: 28px; letter-spacing: 10px; font-weight: 900; }
.tt-btn { padding: 15px; border-radius: 999px; background: #fff; color: #c4467a; font-size: 17px; font-weight: 900; border: 0; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; }
.tt-btn.big { font-size: 22px; padding: 18px; }
.tt-btn small { font-size: 12px; opacity: .7; font-weight: 800; margin-top: 2px; }
.tt-btn:disabled { opacity: .7; }
.tt-link { background: none; border: 0; color: #fff; opacity: .85; font-size: 13px; font-weight: 800; padding: 8px; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.tt-apps { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tt-app { display: inline-flex; gap: 6px; align-items: center; padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; }
.tt-save { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-radius: 18px; background: #fff; color: #2a1640; border: 0; font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.tt-save b { display: inline-flex; gap: 8px; align-items: center; } .tt-save span { font-weight: 800; color: #c4467a; }
.tt-save.alt { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35); } .tt-save.alt span { color: #ffd23f; }
.tt-keys { font-size: 12px; opacity: .75; margin: 8px 0 0; }
.inst { text-align: left; padding-left: 20px; line-height: 1.6; }

/* ---------- on a computer: keyboard + mouse, the touch controls step aside and a key legend shows instead ---------- */
body.desktop #stickZone, body.desktop #pad .face { display: none !important; }
body.desktop #pad.wpnslot #wpnBtn { bottom: calc(18px + var(--sab)); right: 18px; }
#keyHints { position: fixed; left: 16px; bottom: 16px; z-index: 8; display: flex; flex-direction: column; gap: 5px; pointer-events: none; padding: 10px 12px; border-radius: 14px; background: rgba(10,10,30,.42); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); }
#keyHints div { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: #fff; }
#keyHints kbd { min-width: 26px; padding: 3px 6px; border-radius: 7px; background: rgba(255,255,255,.92); color: #1a1530; font: 900 11px/1 system-ui, sans-serif; text-align: center; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
body:not(.desktop) #keyHints { display: none; }
/* ---------- landscape phones: smaller controls tucked into the corners, the HUD squeezes up ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  #pad .face { transform: scale(.78); transform-origin: bottom right; }
  #pad.righty .face { transform-origin: bottom left; }
  #stickBase { transform: scale(.82); top: auto; bottom: 18px; margin-top: 0; }
  #stickBase.live { transform: scale(.88); }
  #pad.wpnslot #wpnBtn { transform: scale(.8); transform-origin: bottom right; bottom: calc(108px + var(--sab)); right: 20px; }
  .hud-l { max-width: 300px; gap: 3px; }
  #mmWrap { transform: scale(.78); transform-origin: top right; }
  /* landscape: the phone sits on the right, tilted like it's in your hand, laid out as a real portrait phone and scaled to fit */
  #phone { place-items: center end; padding: 0 max(4vw, var(--sar, 0px)) 0 0; }
  #phone .iphone { --pw: 310px; width: 310px; height: 560px; max-height: none; position: absolute; top: 50%; right: calc(max(3vw, var(--sar, 0px)) - 155px * (1 - var(--phs, .7))); margin-top: -280px; transform-origin: center center; }
  #phone.open .iphone { transform: rotate(-8deg) scale(var(--phs, .7)); }
  #phone:not(.open) .iphone { transform: translate(40%, 90%) rotate(-14deg) scale(var(--phs, .7)); }
}
.ph-home2.short .ph-clock, .ph-home2.short .ph-date { display: none; }
/* title: a big sign over the city fly-over */
body:has(#title) #keyHints { display: none; }
#title { background: linear-gradient(180deg, rgba(20,8,40,.55) 0%, rgba(20,8,40,0) 38%, rgba(20,8,40,0) 52%, rgba(20,8,40,.75) 100%); backdrop-filter: none; -webkit-backdrop-filter: none; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: max(28px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom)); overflow-y: auto; }
#ttFade { position: absolute; inset: 0; background: #12081f; pointer-events: none; opacity: 1; z-index: -1; }
.tt-top { text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; }
.tt-kicker { font-size: 12px; font-weight: 900; letter-spacing: .32em; text-transform: uppercase; opacity: .85; margin-bottom: 8px; }
#title .tt-logo { font-size: clamp(70px, 22vw, 136px); margin: 0; color: #fff; text-shadow: 0 0 18px rgba(255,138,92,.9), 0 0 60px rgba(196,70,122,.8), 0 10px 40px rgba(0,0,0,.5); }
#title .tt-logo span { color: #ffd23f; text-shadow: 0 0 18px rgba(255,210,63,.9), 0 0 70px rgba(255,138,92,.8), 0 10px 40px rgba(0,0,0,.5); }
.tt-tag { margin-top: 12px; font-size: clamp(17px, 4.6vw, 24px); font-weight: 900; letter-spacing: .02em; text-shadow: 0 2px 14px rgba(0,0,0,.6); }
.tt-pitch { margin-top: 10px; font-size: 14px; font-weight: 800; color: #ffd23f; text-shadow: 0 2px 10px rgba(0,0,0,.7); min-height: 1.3em; }
.tt-pitch.in { animation: ttPitch .6s ease-out; }
@keyframes ttPitch { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#title.intro .tt-kicker { animation: ttRise 1s .2s ease-out both; }
#title.intro .tt-logo { animation: ttSlam 1.1s .4s cubic-bezier(.2,1.4,.4,1) both; }
#title.intro .tt-tag { animation: ttRise .9s 1.2s ease-out both; }
#title.intro .tt-pitch { animation: ttRise .9s 1.6s ease-out both; }
#title.intro .tt-card { animation: ttRise .9s 1.8s ease-out both; }
@keyframes ttSlam { from { opacity: 0; transform: scale(1.6); filter: blur(8px); letter-spacing: .2em; } to { opacity: 1; transform: none; filter: none; } }
@keyframes ttRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
#title .tt-card { background: rgba(20,10,40,.42); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.18); border-radius: 26px; padding: 16px; }
.tt-load { display: flex; gap: 10px; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; padding: 10px; }
.tt-load i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #ffd23f; animation: ttSpin .8s linear infinite; }
@keyframes ttSpin { to { transform: rotate(360deg); } }
.tt-slots { display: flex; flex-direction: column; gap: 8px; max-height: 42vh; overflow-y: auto; }
.tt-slot { display: flex; gap: 8px; align-items: stretch; }
.tt-slot .tt-save { flex: 1; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px; text-align: left; }
.tt-del { border: 0; border-radius: 16px; padding: 0 14px; background: rgba(255,255,255,.14); color: #fff; font-weight: 900; font-size: 13px; }
.tt-del.armed { background: #e0384f; }
@media (orientation: landscape) and (max-height: 520px) { #title { flex-direction: row; gap: 24px; justify-content: center; } #title .tt-logo { font-size: clamp(56px, 12vh, 96px); } .tt-slots { max-height: 46vh; } }
.tt-h { margin: 0; font-size: 19px; display: flex; gap: 8px; align-items: center; justify-content: center; }
#title .inst { text-align: left; margin: 0; padding-left: 22px; font-size: 15px; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; }
