:root {
  --d: #ff7a1a; --s: #8b55e0; --ink: #fff; --panel: rgba(18, 22, 30, 0.72);
  font-family: Rubik, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #9cc4e0; color: var(--ink); user-select: none; }
#game, #game canvas { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }
.d { color: var(--d); } .s { color: var(--s); }
kbd { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25); border-bottom-width: 3px; border-radius: 6px; padding: 1px 7px; font-family: inherit; font-size: 0.85em; }

/* ---------- lobby ---------- */
#lobby { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(180deg, rgba(10,20,35,0.15), rgba(10,15,25,0.55)); overflow-y: auto; }
.card { width: min(860px, 100%); background: var(--panel); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.12); border-radius: 22px; padding: 26px 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.35); margin: auto; }
.title { font-size: clamp(42px, 8vw, 72px); font-weight: 900; line-height: 1; text-align: center; letter-spacing: -1px;
  background: linear-gradient(90deg, var(--d), #ffd36b 50%, var(--s)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(0,0,0,0.35)); }
.subtitle { text-align: center; font-weight: 700; opacity: 0.85; margin-top: 6px; font-size: 18px; }
.tagline { text-align: center; margin: 10px 0 18px; font-size: 17px; }
.tagline .d, .tagline .s { font-weight: 800; }
#joinPanel { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
input, select { font-family: inherit; font-size: 17px; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: #fff; outline: none; }
input:focus, select:focus { border-color: #ffd36b; }
select option { color: #111; }
#nameInput { flex: 2 1 200px; } #roomInput { flex: 1 1 120px; direction: ltr; text-align: center; }
button { font-family: inherit; cursor: pointer; border: 0; border-radius: 12px; font-weight: 800; font-size: 16px; padding: 10px 16px; color: #fff; background: rgba(255,255,255,0.14); transition: transform .08s, filter .15s; }
button:hover { filter: brightness(1.15); } button:active { transform: scale(0.97); }
button.big { font-size: 20px; padding: 13px 26px; background: linear-gradient(90deg, var(--d), var(--s)); box-shadow: 0 6px 0 rgba(0,0,0,0.25); }
#startBtn { display: block; margin: 14px auto 6px; min-width: 260px; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.team { border-radius: 16px; padding: 14px; background: rgba(0,0,0,0.25); border: 2px solid; display: flex; flex-direction: column; }
.team.d { border-color: var(--d); } .team.s { border-color: var(--s); }
.team h3 { margin: 0 0 4px; font-size: 22px; font-weight: 900; }
.team.d h3 { color: var(--d); } .team.s h3 { color: #b48cff; }
.abil { font-size: 13.5px; opacity: 0.85; margin-bottom: 8px; min-height: 36px; }
.team ul { list-style: none; margin: 0 0 10px; padding: 0; min-height: 70px; flex: 1; }
.team li { padding: 5px 10px; border-radius: 8px; background: rgba(255,255,255,0.07); margin-bottom: 4px; font-weight: 600; }
.team li.me { background: rgba(255,225,74,0.18); }
.team li.empty { opacity: 0.5; background: none; font-weight: 400; }
.team.d .joinTeam { background: var(--d); } .team.s .joinTeam { background: var(--s); }
.modes { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin: 14px 0; }
.mode { border-radius: 14px; padding: 10px 12px; background: rgba(255,255,255,0.07); font-size: 13.5px; }
.mode b { display: block; font-size: 16px; margin-bottom: 3px; }
.mode.active { border: 2px solid #ffd36b; } .mode.soon { opacity: 0.45; }
#settings { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: center; font-weight: 600; }
#settings label { display: flex; align-items: center; gap: 8px; }
#settings select { padding: 6px 10px; font-size: 15px; }
#settings .chk input { width: 18px; height: 18px; }
#matchInfo { text-align: center; margin-top: 10px; opacity: 0.85; font-weight: 600; }
#waitHost { text-align: center; margin: 14px 0; font-weight: 700; opacity: 0.85; }
#shareBox { text-align: center; font-size: 13px; opacity: 0.8; margin-top: 8px; user-select: text; }
#shareBox code { direction: ltr; display: inline-block; background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 6px; margin-top: 3px; user-select: all; }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 16px; font-size: 13.5px; opacity: 0.8; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#scorebar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; direction: ltr; }
.pill, .pill.d, .pill.s { color: #fff; }
.pill { min-width: 104px; text-align: center; font-size: 44px; font-weight: 900; padding: 2px 22px; border-radius: 999px; border: 4px solid #fff; box-shadow: 0 5px 0 rgba(0,0,0,0.25), 0 8px 20px rgba(0,0,0,0.2); text-shadow: 0 3px 0 rgba(0,0,0,0.25); }
.pill.d { background: linear-gradient(180deg, #ff9a3d, #e86a0c); }
.pill.s { background: linear-gradient(180deg, #a476f0, #6f3dc8); }
#timer { background: rgba(30,34,44,0.85); border: 3px solid #fff; border-radius: 12px; padding: 4px 14px; font-size: 22px; font-weight: 800; min-width: 86px; text-align: center; }
#timer.urgent { background: #d33; animation: pulse 0.5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
#teamnames { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); width: 340px; display: flex; justify-content: space-between; direction: ltr; font-weight: 800; text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
#chairStatus { position: absolute; top: 104px; left: 50%; transform: translateX(-50%); background: rgba(20,24,32,0.6); padding: 5px 14px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
#chairStatus:empty { display: none; }
#feed { position: absolute; top: 16px; right: 16px; width: 330px; display: flex; flex-direction: column; gap: 6px; }
.feedItem { background: rgba(20,24,32,0.72); border-right: 4px solid #fff; padding: 6px 10px; border-radius: 8px; font-size: 14.5px; animation: slidein .25s ease-out; transition: opacity .6s; }
.feedItem.fade { opacity: 0; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
#banner { position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%) scale(0.6); text-align: center; opacity: 0; transition: opacity .2s, transform .25s cubic-bezier(.2,1.6,.4,1); }
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#bannerMain { font-size: clamp(36px, 6vw, 68px); font-weight: 900; text-shadow: 0 4px 0 rgba(0,0,0,0.45), 0 0 30px rgba(0,0,0,0.4); white-space: nowrap; }
#bannerSub { font-size: 20px; font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,0.7); }
#countdown { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%); font-size: 130px; font-weight: 900; opacity: 0; text-shadow: 0 6px 0 rgba(0,0,0,0.4); }
#countdown.show { opacity: 1; animation: pop .9s ease-out; }
#countdown.go { color: #ffe14a; font-size: 100px; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(1.6); } to { transform: translate(-50%, -50%) scale(1); } }
#minimap { position: absolute; top: 16px; left: 16px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.6); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
#abilityBar { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: flex-end; }
.slot { position: relative; min-width: 96px; background: rgba(20,24,32,0.75); border: 2px solid rgba(255,255,255,0.25); border-radius: 14px; padding: 8px 12px; text-align: center; opacity: 0.6; transition: opacity .2s, border-color .2s; }
.slot.big { min-width: 130px; padding: 12px 14px; }
.slot.ready { opacity: 1; border-color: #ffe14a; }
.slot.active { border-color: #fff; box-shadow: 0 0 20px #ffe14a; }
.slot .key { font-size: 12px; font-weight: 800; opacity: 0.8; }
.slot .name { font-weight: 800; font-size: 16px; }
.slot .cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 900; background: rgba(0,0,0,0.45); border-radius: 12px; }
.slot .cd:empty { display: none; }
#youAre { position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%); font-weight: 600; text-shadow: 0 2px 4px rgba(0,0,0,0.7); white-space: nowrap; }
#lockHint { position: absolute; top: 58%; left: 50%; transform: translateX(-50%); background: rgba(20,24,32,0.7); padding: 8px 16px; border-radius: 10px; font-weight: 600; }

/* ---------- end ---------- */
#endScreen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,14,22,0.45); }
.endCard { text-align: center; background: var(--panel); padding: 30px 50px; border-radius: 24px; backdrop-filter: blur(8px); }
#endTitle { font-size: clamp(40px, 7vw, 70px); font-weight: 900; }
#endScore { font-size: 56px; font-weight: 900; direction: ltr; unicode-bidi: isolate; display: flex; justify-content: center; gap: 18px; }
#endScore .sep { color: #fff; }
#endSub { font-size: 20px; margin-top: 6px; }
#endBack { opacity: 0.7; margin-top: 14px; }

@media (max-width: 700px) {
  .teams, .modes { grid-template-columns: 1fr; }
  #feed { width: 220px; font-size: 12px; } #minimap { width: 160px; height: 107px; }
  .pill { font-size: 30px; min-width: 70px; }
}

/* ---------- FPS HUD ---------- */
#crosshair { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.5); }
#crosshair i:nth-child(1) { width: 2px; height: 8px; left: -1px; top: -14px; }
#crosshair i:nth-child(2) { width: 2px; height: 8px; left: -1px; top: 6px; }
#crosshair i:nth-child(3) { width: 8px; height: 2px; left: -14px; top: -1px; }
#crosshair i:nth-child(4) { width: 8px; height: 2px; left: 6px; top: -1px; }
#crosshair.carry i { background: #ffe14a; }
#hitmarker { position: absolute; top: 50%; left: 50%; width: 0; height: 0; opacity: 0; }
#hitmarker.show { opacity: 1; }
#hitmarker i { position: absolute; width: 2px; height: 9px; background: #fff; left: -1px; top: -4.5px; box-shadow: 0 0 0 1px rgba(0,0,0,0.5); }
#hitmarker i:nth-child(1) { transform: rotate(45deg) translateY(-11px); } #hitmarker i:nth-child(2) { transform: rotate(135deg) translateY(-11px); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateY(-11px); } #hitmarker i:nth-child(4) { transform: rotate(315deg) translateY(-11px); }
#hitmarker.ko i { background: #ff3b3b; height: 13px; }
#paint { position: absolute; inset: 0; overflow: hidden; }
.psplat { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; animation: drip 1.8s ease-in forwards; }
@keyframes drip { 0% { opacity: 0.95; } 60% { opacity: 0.85; } 100% { opacity: 0; transform: translate(-50%, -40%); } }
#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(200,0,0,0.75) 100%); transition: opacity .3s; }
#prompt { position: absolute; top: 58%; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 18px; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
#hpBox { position: absolute; bottom: 22px; left: 22px; display: flex; align-items: center; gap: 10px; background: rgba(20,24,32,0.75); padding: 10px 14px; border-radius: 14px; direction: ltr; }
.hpIcon { color: #ff5a5a; font-size: 22px; }
.hpTrack { width: 200px; height: 14px; border-radius: 7px; background: rgba(255,255,255,0.15); overflow: hidden; }
#hpFill { height: 100%; width: 100%; background: #4caf50; transition: width .15s; }
#hpNum { font-size: 26px; font-weight: 900; min-width: 44px; text-align: right; }
#weaponBox { position: absolute; bottom: 22px; right: 22px; text-align: left; background: rgba(20,24,32,0.75); padding: 10px 16px; border-radius: 14px; min-width: 190px; }
#wName { font-weight: 900; font-size: 20px; }
#wAmmo { font-size: 15px; opacity: 0.9; direction: rtl; }
#wAmmo b { font-size: 30px; }
#weaponBox.low #wAmmo b { color: #ff6b6b; }
#mission { position: absolute; top: 210px; left: 16px; width: 240px; background: rgba(20,24,32,0.78); border: 2px solid #ffe14a; border-radius: 12px; padding: 8px 10px; }
.mHead { display: flex; justify-content: space-between; font-weight: 900; color: #ffe14a; }
#mDesc { font-size: 13px; opacity: 0.9; margin: 3px 0 6px; }
.mRow { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-top: 3px; direction: ltr; }
.mTrack { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.15); overflow: hidden; }
.mRow.d .mTrack div { background: var(--d); height: 100%; width: 0; } .mRow.s .mTrack div { background: var(--s); height: 100%; width: 0; }
#downScreen { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 22px; font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,0.8); }
.dTitle { font-size: 46px; font-weight: 900; color: #ff8a8a; }
#youAre { transition: opacity 1s; } #youAre.fade { opacity: 0; }
#youAre { bottom: 104px; }
@media (max-width: 700px) { .hpTrack { width: 110px; } #weaponBox { min-width: 140px; } #mission { top: 130px; width: 180px; } }

.marker { position: absolute; left: 0; top: 0; padding: 4px 10px; border-radius: 999px; background: rgba(15,18,26,0.78); border: 2px solid var(--mc, #fff); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; box-shadow: 0 0 14px var(--mc, #fff); }
.marker b { font-size: 16px; }
.marker.edge { opacity: 0.9; }

/* ---------- free roam ---------- */
body.roam #scorebar, body.roam #teamnames, body.roam #weaponBox, body.roam #mission, body.roam #youAre, body.roam #slotAbility .cd:empty { display: none; }
#roamHint { display: none; position: absolute; bottom: 104px; left: 50%; transform: translateX(-50%); background: rgba(20,24,32,0.7); padding: 6px 14px; border-radius: 999px; font-weight: 700; }
body.roam #roamHint { display: block; }
.menuHint { text-align: center; margin-bottom: 12px; font-weight: 700; color: #ffe14a; }
#lobby { background: linear-gradient(180deg, rgba(10,20,35,0.25), rgba(10,15,25,0.6)); }

/* ---------- join screen: compact bar at the bottom so the city flight stays visible ---------- */
body.joining .title { font-size: clamp(30px, 5vw, 46px); }
body.joining .subtitle { font-size: 15px; margin-top: 2px; }
body.joining .tagline { margin: 6px 0 12px; font-size: 14.5px; }
body.joining .controls { margin-top: 10px; font-size: 12.5px; }

.osmCredit { text-align: center; font-size: 11px; opacity: 0.6; margin-top: 8px; direction: rtl; }

/* driving */
#speedo { position: absolute; bottom: 14px; right: 18px; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4)); direction: ltr; }
#carHint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); background: rgba(20,24,32,0.72); padding: 7px 16px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
body.driving #weaponBox, body.driving #abilityBar, body.driving #crosshair, body.driving #roamHint, body.driving #hpBox { display: none; }
#minimap.round { border-radius: 50%; border: 3px solid rgba(255,255,255,0.75); width: 210px; height: 210px; }
@media (max-width: 700px) { #minimap.round { width: 140px; height: 140px; } #speedo svg { width: 140px; height: 140px; } }

/* ---------- login: city title, one nickname, one click ---------- */
.activityHead .d { color: var(--d); font-weight: 800; } .activityHead .s { color: #b48cff; font-weight: 800; }
.activityHead { text-align: center; font-size: 22px; font-weight: 900; margin: 4px 0 12px; color: #ffd36b; }
.activityHead small { display: block; font-size: 14px; font-weight: 500; color: #fff; opacity: 0.85; margin-top: 2px; }
body.joining .controls, body.joining .menuHint { display: none; }
body:not(.joining) .card .title { font-size: 30px; } body:not(.joining) .card .subtitle { font-size: 14px; margin-bottom: 10px; }
body.joining #lobby { align-items: center; background: radial-gradient(ellipse at center, rgba(6,10,18,0.35), rgba(6,10,18,0) 60%); padding: 16px; }
body.joining .card { width: min(560px, 100%); padding: 22px 24px; background: rgba(14,18,26,0.58); border-radius: 24px; margin: auto; }
body.joining .osmCredit { display: none; } /* the map credit lives in Esc → credits */
body.joining .title { font-size: clamp(40px, 7vw, 64px); letter-spacing: -1.5px; background: linear-gradient(90deg, #7ee06a, #ffd36b 50%, #ff8a3d); -webkit-background-clip: text; background-clip: text; }
body.joining .subtitle { font-size: 16px; margin: 4px 0 16px; letter-spacing: 0.3px; }
#joinPanel { display: flex; gap: 10px; flex-wrap: nowrap; justify-content: center; }
#joinPanel #nameInput { flex: 1 1 auto; min-width: 0; text-align: center; font-size: 18px; }
#joinPanel .big { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 480px) { #joinPanel { flex-wrap: wrap; } #joinPanel .big { width: 100%; } }
#keysToast { position: absolute; top: 140px; left: 50%; transform: translateX(-50%); background: rgba(14,18,26,0.78); border: 1px solid rgba(255,255,255,0.18); border-radius: 16px; padding: 12px 18px; text-align: center; font-size: 14.5px; line-height: 1.9; transition: opacity 0.8s; max-width: calc(100vw - 32px); }
#keysToast b { font-size: 17px; color: #ffd36b; } #keysToast .kt2 { opacity: 0.8; font-size: 13.5px; }
#keysToast.fade { opacity: 0; }

/* ---------- M: map of Netanya ---------- */
#mapView { position: fixed; inset: 0; z-index: 30; background: #9d978a; }
#bigMap { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.mapHead { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(14,18,26,0.8); padding: 8px 18px; border-radius: 999px; display: flex; gap: 14px; align-items: center; white-space: nowrap; font-size: 14px; }
.mapHead b { font-size: 18px; color: #ffd36b; }
.mapSide { position: absolute; top: 70px; right: 16px; width: 270px; max-height: calc(100vh - 90px); overflow-y: auto; background: rgba(14,18,26,0.82); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mapSec h4 { margin: 0 0 6px; font-size: 15px; color: #ffd36b; }
.mapSec { font-size: 14px; }
.act { background: rgba(255,255,255,0.07); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.act b { display: block; } .act small { opacity: 0.75; }
.act .row, .friend { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.act button, .friend button, .mapSide > button, #wpClear { font-size: 13px; padding: 6px 10px; }
.friend { justify-content: space-between; margin: 0 0 4px; }
@media (max-width: 700px) { .mapSide { top: auto; bottom: 10px; right: 10px; left: 10px; width: auto; max-height: 38vh; } .mapHead span { display: none; } }
#wpMarker { --mc: #c86bff; }

/* ---------- Esc: game menu ---------- */
#pauseMenu { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; background: rgba(6,10,18,0.55); backdrop-filter: blur(4px); padding: 16px; }
.pauseCard { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: rgba(16,20,28,0.92); border: 1px solid rgba(255,255,255,0.12); border-radius: 22px; padding: 20px 22px; }
.pauseCard .title { font-size: 34px; margin-bottom: 14px; }
.pauseBtns { display: flex; flex-direction: column; gap: 8px; }
.pauseBtns button { width: 100%; text-align: center; }
.pauseBtns button.on { outline: 2px solid #ffd36b; }
.pane { margin-top: 14px; background: rgba(255,255,255,0.05); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.pane p { margin: 0 0 8px; } .pane ul { margin: 0; padding-inline-start: 18px; line-height: 1.7; }
.pane label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-weight: 600; }
.pane input[type=range] { flex: 1; max-width: 240px; padding: 0; accent-color: #ffd36b; }
.pane select { flex: 1; max-width: 240px; font: inherit; padding: 4px 8px; border-radius: 8px; }
.gfxNote { margin: -6px 0 10px; font-size: 0.85em; opacity: 0.75; min-height: 1em; }
.pane h4 { margin: 10px 0 6px; color: #ffd36b; }
.keyGrid { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.inviteRow { display: flex; gap: 8px; } .inviteRow input { flex: 1; min-width: 0; direction: ltr; font-size: 14px; }
#inviteNote { font-size: 12.5px; opacity: 0.75; margin-top: 6px; }

/* ---------- online ---------- */
#pingTag { position: absolute; top: 232px; left: 16px; width: 210px; text-align: center; font-size: 12px; font-weight: 700; opacity: 0.85; text-shadow: 0 1px 3px rgba(0,0,0,0.8); direction: ltr; } /* ltr: "ping 12ms" then "FPS 60", the gap between them */
#pingTag .good { color: #7ee06a; } #pingTag .ok { color: #ffd36b; } #pingTag .bad { color: #ff6b6b; }
#pingTag #fpsVal:not(:empty) { margin-inline-start: 10px; } /* FPS beside the ping */
body:not(.roam) #pingTag { top: 210px; width: 260px; }
#netStatus { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); background: rgba(14,18,26,0.88); border: 2px solid #ffd36b; padding: 14px 24px; border-radius: 16px; font-size: 18px; font-weight: 800; z-index: 40; }
@media (max-width: 700px) { #pingTag { top: 152px; width: 140px; } }

/* round minimap: bottom-left, right above the health bar (navigation + health in one place, the top of the screen stays clear) */
#minimap.round { top: auto; bottom: 84px; left: 22px; }
body.driving #minimap.round { bottom: 22px; } /* no health bar while driving */
body.roam #pingTag { top: auto; bottom: 300px; left: 22px; width: 210px; }
body.roam.driving #pingTag { bottom: 238px; }
@media (max-width: 700px) {
  #minimap.round { bottom: 76px; left: 14px; } body.driving #minimap.round { bottom: 14px; }
  body.roam #pingTag { bottom: 220px; left: 14px; width: 140px; } body.roam.driving #pingTag { bottom: 158px; }
}

/* ---------- world editor (F2, developer only) ---------- */
#editorPanel { position: fixed; top: 12px; right: 12px; width: 330px; max-height: calc(100vh - 24px); overflow-y: auto; z-index: 45; background: rgba(14,18,26,0.9); border: 2px solid #ffd36b; border-radius: 16px; padding: 12px; font-size: 13.5px; }
#editorPanel .edHead { display: flex; flex-direction: column; margin-bottom: 8px; } #editorPanel .edHead b { font-size: 18px; color: #ffd36b; } #editorPanel .edHead small { opacity: 0.75; }
#editorPanel .edTools { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
#editorPanel button { font-size: 13px; padding: 6px 9px; border-radius: 9px; }
#editorPanel button.on { outline: 2px solid #ffd36b; background: rgba(255,211,107,0.22); }
#editorPanel .edSel { background: rgba(255,255,255,0.06); border-radius: 10px; padding: 8px; margin-bottom: 8px; min-height: 40px; }
#editorPanel .edRow { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; } #editorPanel .edRow .big { flex: 1; font-size: 15px; padding: 8px; }
#editorPanel .edStatus { margin: 6px 0; font-weight: 700; color: #cfe; }
#editorPanel .edKeys { font-size: 12px; opacity: 0.8; line-height: 1.8; }
body.editing #hud > *:not(#feed) { display: none !important; }
body.editing #game canvas { cursor: crosshair; }

#placeSearch { width: 100%; box-sizing: border-box; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.35); color: #fff; font: inherit; font-size: 13px; margin-bottom: 6px; }
#placeList { max-height: 210px; overflow-y: auto; }
.place { display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; padding: 5px 6px; border-radius: 8px; cursor: pointer; }
.place:hover { background: rgba(255,255,255,0.1); }
.place span { grid-row: span 2; font-size: 16px; align-self: center; }
.place small { opacity: 0.7; font-size: 12px; }

/* ---------------- login / account / character creator (auth.js) ---------------- */
#auth { position: fixed; inset: 0; z-index: 30; display: none; pointer-events: none; }
body.joining #auth { display: block; }
body.joining #lobby .card { display: none; }
body.joining #lobby { background: linear-gradient(90deg, rgba(8,8,14,0) 35%, rgba(8,8,14,0.45) 100%); }
#auth .authSide { position: absolute; top: 0; bottom: 0; right: max(16px, 5vw); width: min(560px, calc(100vw - 32px)); display: flex; flex-direction: column; justify-content: center; gap: 22px; pointer-events: auto; overflow-y: auto; padding: 24px 0; }
#auth .brand { text-align: center; color: #fff; user-select: none; }
#auth .brandSky svg { width: 190px; height: 32px; fill: #e9a82a; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
#auth .brandTitle { font: 900 clamp(40px, 6.4vw, 74px)/1 Rubik, Arial, sans-serif; letter-spacing: -1px; background: linear-gradient(180deg, #fffaf0 30%, #e3c99c 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 10px rgba(0,0,0,.55)); }
#auth .brandSub { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; font: 800 clamp(22px, 2.8vw, 32px)/1 Rubik, Arial, sans-serif; color: #f2b332; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
#auth .brandSub span { width: clamp(50px, 9vw, 120px); height: 3px; border-radius: 2px; background: linear-gradient(90deg, rgba(242,179,50,0), #f2b332); }
#auth .brandSub span:last-child { transform: scaleX(-1); }
#auth .authCard { background: linear-gradient(180deg, rgba(34,34,40,0.86), rgba(22,22,28,0.9)); border: 1px solid rgba(233,168,42,0.35); border-radius: 22px; padding: 26px 34px 24px; box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(6px); color: #f3efe8; display: flex; flex-direction: column; gap: 14px; }
#auth .authCard.hidden, #auth .hidden { display: none !important; }
#auth .authCard h2 { margin: 0; text-align: center; font: 800 clamp(28px, 3.2vw, 40px)/1.15 Rubik, Arial, sans-serif; color: #fff; }
#auth .goldBar { width: 110px; height: 4px; border-radius: 3px; background: #f2b332; margin: -4px auto 6px; }
#auth .field { display: flex; align-items: center; gap: 12px; background: rgba(10,10,14,0.55); border: 1px solid rgba(255,255,255,0.14); border-radius: 14px; padding: 0 16px; height: 62px; transition: border-color .15s; }
#auth .field:focus-within { border-color: #f2b332; box-shadow: 0 0 0 3px rgba(242,179,50,.15); }
#auth .field svg { width: 26px; height: 26px; fill: #cfc8bd; flex: none; }
#auth .field input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; color: #fff; font: 500 20px Rubik, Arial, sans-serif; }
#auth .field input::placeholder { color: #b9b2a6; }
#auth .goldBtn { height: 62px; border: 0; border-radius: 14px; cursor: pointer; background: linear-gradient(180deg, #ffc94d 0%, #eea51f 55%, #d98c12 100%); color: #1b1408; font: 800 clamp(20px, 2.2vw, 26px) Rubik, Arial, sans-serif; box-shadow: 0 8px 22px rgba(233,150,20,.35), inset 0 1px 0 rgba(255,255,255,.45); display: flex; align-items: center; justify-content: center; gap: 10px; }
#auth .goldBtn:hover { filter: brightness(1.06); } #auth .goldBtn:disabled { filter: grayscale(.4) brightness(.8); cursor: wait; }
#auth .goldBtn .chev { font-size: 1.4em; line-height: 0; margin-top: -2px; }
#auth .authLink { align-self: center; color: #f3efe8; font: 500 19px Rubik, Arial, sans-serif; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: rgba(242,179,50,.8); cursor: pointer; }
#auth .authLink.small { font-size: 15px; color: #cfc8bd; }
#auth .authRow { display: flex; justify-content: center; gap: 28px; }
#auth .authErr { min-height: 20px; margin: -4px 0; text-align: center; color: #ff9b8a; font: 500 15px Rubik, Arial, sans-serif; }
/* creator */
#auth .authCard.wide { padding: 22px 22px 20px; }
#auth .genderRow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#auth .genderRow button { height: 56px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(10,10,14,.5); color: #e8e2d8; font: 700 21px Rubik, Arial, sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; }
#auth .genderRow button .gIcon { font-size: 26px; }
#auth .genderRow button.on { border-color: #f2b332; background: linear-gradient(180deg, rgba(242,179,50,.22), rgba(242,179,50,.08)); color: #ffd47a; box-shadow: 0 0 0 1px rgba(242,179,50,.4), 0 0 18px rgba(242,179,50,.2); }
#auth .partTabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#auth .partTabs button { height: 50px; border-radius: 12px 12px 4px 4px; border: 1px solid rgba(255,255,255,.12); border-bottom: 3px solid transparent; background: rgba(10,10,14,.45); color: #d8d2c8; font: 600 17px Rubik, Arial, sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; }
#auth .partTabs button svg { width: 22px; height: 22px; fill: currentColor; }
#auth .partTabs button.on { color: #ffcf6b; border-bottom-color: #f2b332; background: rgba(242,179,50,.12); }
#auth .swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06); }
#auth .sw { position: relative; aspect-ratio: 1.05; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: radial-gradient(circle at 50% 35%, #3a3a42, #23232a); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 8px; }
#auth .sw svg { width: 82%; height: 82%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
#auth .sw:hover { border-color: rgba(242,179,50,.55); }
#auth .sw.on { border: 2px solid #f2b332; box-shadow: 0 0 16px rgba(242,179,50,.35); }
#auth .sw.on::after { content: '✓'; position: absolute; top: 5px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: #f2b332; color: #1b1408; font: 800 14px/22px Rubik, Arial; text-align: center; }
#auth .swatchName { text-align: center; min-height: 18px; margin-top: -6px; color: #cfc8bd; font: 500 15px Rubik, Arial, sans-serif; }
#lookPreview { position: fixed; top: 0; bottom: 0; left: 0; width: 52vw; height: 100vh; pointer-events: auto; cursor: grab; }
#lookPreview:active { cursor: grabbing; }
@media (max-width: 900px) {
  #lookPreview { width: 100vw; height: 46vh; }
  #auth .authSide { right: 16px; top: auto; justify-content: flex-end; }
  #auth.creating .authSide { top: 40vh; justify-content: flex-start; }
  #auth.creating .brand { display: none; }
  #auth .field, #auth .goldBtn { height: 54px; }
}
#auth.creating .brandSky { display: none; }
#auth.creating .brandTitle { font-size: clamp(32px, 4.2vw, 50px); }
#auth.creating .brandSub { font-size: clamp(18px, 2vw, 24px); }
#auth.creating .authSide { gap: 14px; }
#auth.creating .authCard.wide { gap: 11px; }
