:root {
  --bg: #05070c;
  --fg: #e8ecf4;
  --dim: #8a93a6;
  --red: #d8322b;
  --green: #4cd964;
  --amber: #ffb02e;
  --panel: rgba(12, 16, 26, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  background: var(--bg); color: var(--fg);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
input { -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.hidden { display: none !important; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- screens ---------- */
#screens { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.screen { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: auto; padding: 12px; }
.screen.active { display: flex; }
#scrMenu.active, #scrLobby.active, #scrWin.active {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(5,7,12,0.2), rgba(5,7,12,0.7) 85%);
}
.screen.overlay.active { background: rgba(0, 0, 0, 0.0); }
.screen.clickthrough { pointer-events: auto; background: rgba(0,0,0,0.35); }

.panel {
  width: min(440px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 22px 18px; box-shadow: 0 10px 60px rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.panel.wide { width: min(560px, 100%); }
.logo { margin: 0 0 4px; font-size: clamp(30px, 8vw, 44px); letter-spacing: 3px; text-align: center; font-weight: 900; text-shadow: 0 0 22px rgba(216,50,43,0.55); }
.logo span { color: var(--red); }
h2 { margin: 0 0 14px; font-size: 24px; text-align: center; letter-spacing: 1px; }
.tag { text-align: center; color: var(--dim); margin: 0 0 18px; font-size: 14px; }
.lbl { font-size: 11px; letter-spacing: 2px; color: var(--dim); }
.fld { display: block; font-size: 12px; color: var(--dim); letter-spacing: 1px; margin-bottom: 12px; text-transform: uppercase; }
input[type=text] {
  width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 16px; color: var(--fg);
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 8px; outline: none;
}
input[type=text]:focus { border-color: var(--red); }
.row { display: flex; gap: 8px; }
.row input { width: 90px; margin: 0; text-align: center; text-transform: uppercase; letter-spacing: 4px; font-weight: 700; }
.row .btn { flex: 1; }
.btn {
  display: block; width: 100%; padding: 13px 16px; font-size: 16px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--fg); background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: rgba(255,255,255,0.15); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--red); border-color: transparent; }
.btn.primary:hover { background: #ee4037; }
.btn.ghost { background: transparent; margin-top: 8px; color: var(--dim); font-weight: 500; }
.or { text-align: center; color: var(--dim); margin: 12px 0; font-size: 12px; position: relative; }
.or::before, .or::after { content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line); }
.or::before { left: 0; } .or::after { right: 0; }
.err { color: #ff6b63; min-height: 18px; text-align: center; font-size: 14px; margin-top: 10px; }
.help { margin-top: 10px; font-size: 12px; color: var(--dim); text-align: center; line-height: 1.7; }
.help b { color: var(--fg); background: rgba(255,255,255,0.08); padding: 1px 6px; border-radius: 4px; }
.wait { text-align: center; color: var(--dim); margin: 12px 0 4px; font-size: 14px; }

.codeBox { text-align: center; margin-bottom: 12px; }
#lobbyCode { font-size: 52px; font-weight: 900; letter-spacing: 12px; padding-left: 12px; color: var(--amber); text-shadow: 0 0 18px rgba(255,176,46,0.35); }
.share { display: flex; gap: 8px; margin-bottom: 14px; }
.share input { margin: 0; font-size: 13px; }
.share .btn { width: auto; white-space: nowrap; }
.plist { list-style: none; padding: 0; margin: 0 0 14px; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px; background: rgba(255,255,255,0.05); border-radius: 8px; font-size: 16px; }
.plist .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.plist .tagHost { margin-left: auto; font-size: 11px; color: var(--amber); letter-spacing: 1px; }
.plist .tagMe { color: var(--dim); font-size: 12px; }

.winTitle { color: var(--green); font-size: 30px; text-shadow: 0 0 20px rgba(76,217,100,0.4); }
.timeBox { text-align: center; margin-bottom: 14px; } .timeBox b { font-size: 28px; margin-left: 8px; }
#winTable { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
#winTable th { text-align: left; font-size: 11px; letter-spacing: 1.5px; color: var(--dim); padding: 6px 8px; border-bottom: 1px solid var(--line); }
#winTable td { padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 16px; }
#winTable td:last-child { font-weight: 800; font-size: 18px; }

.wipeBox { text-align: center; padding: 28px 32px; background: rgba(60,0,0,0.78); border: 1px solid rgba(255,60,50,0.4); border-radius: 12px; }
.wipeTitle { font-size: clamp(24px, 6vw, 40px); font-weight: 900; color: #ff4a40; text-shadow: 0 0 24px rgba(255,40,30,0.6); }
.wipeSub { margin-top: 10px; color: #ddd; font-size: 15px; }
#scrWipe.active { background: radial-gradient(ellipse at center, rgba(90,0,0,0.35), rgba(0,0,0,0.85)); }
.lockBox { font-size: 22px; font-weight: 700; padding: 18px 28px; background: rgba(0,0,0,0.6); border: 1px solid var(--line); border-radius: 10px; }
.rotBox { text-align: center; font-size: 20px; padding: 24px; background: rgba(0,0,0,0.85); border-radius: 12px; }
#scrRotate.active { background: rgba(0,0,0,0.92); }
.phone { width: 54px; height: 90px; border: 4px solid var(--fg); border-radius: 10px; margin: 0 auto 16px; animation: rot 2s ease-in-out infinite; }
@keyframes rot { 0%, 20% { transform: rotate(0deg); } 60%, 100% { transform: rotate(90deg); } }
#scrConn.active { background: rgba(0,0,0,0.6); }

/* ---------- HUD v2 ---------- */
:root { --op: 1; --joy: 119px; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-weight: 600; }
#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.45)); }
#hurtDir { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease-out; }
#hurtDir.on { opacity: 1; transition: none; }
#hurtDir .wedge { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#hurtDir .wedge::before {
  content: ""; position: absolute; left: -90px; top: -48vh; width: 180px; height: 120px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,20,10,0.85), rgba(255,20,10,0) 70%);
}
#lowHp { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 120px 30px rgba(200,0,0,0.75); transition: opacity .3s; }
#healFlash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(60,255,120,0.35)); transition: opacity .6s; }
#healFlash.on { opacity: 1; transition: none; }

/* crosshair v2: 4 thin lines + dot, ring for shotgun, dark outline for any background */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 5px; --ring: 22px; }
#crosshair i { position: absolute; background: rgba(255,255,255,0.95); box-shadow: 0 0 0 1px rgba(0,0,0,0.55); border-radius: 1px; }
#crosshair .cl, #crosshair .cr { width: 8px; height: 2px; top: -1px; }
#crosshair .cl { right: var(--gap); } #crosshair .cr { left: var(--gap); }
#crosshair .ct, #crosshair .cb { width: 2px; height: 8px; left: -1px; }
#crosshair .ct { bottom: var(--gap); } #crosshair .cb { top: var(--gap); }
#crosshair .cd { width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; }
#crosshair .ring { display: none; position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,0.9);
  width: calc(var(--ring) * 2); height: calc(var(--ring) * 2); left: calc(var(--ring) * -1); top: calc(var(--ring) * -1);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(0,0,0,0.4); }
#crosshair.ringed .ring { display: block; }
#crosshair.ringed .cl, #crosshair.ringed .cr, #crosshair.ringed .ct, #crosshair.ringed .cb { display: none; }
#crosshair.enemy i { background: #ff3b30; }
#crosshair.enemy .ring { border-color: #ff3b30; }

/* hit marker: X flash (white = hit, red + bigger = headshot, gold + ring = kill) */
#hitmark { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; --c: #fff; --len: 7px; --r: 8px; }
#hitmark i { position: absolute; left: calc(var(--len) / -2); top: -1px; width: var(--len); height: 2px; background: var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,0.55); }
#hitmark i:nth-child(1) { transform: rotate(45deg) translateX(var(--r)); }
#hitmark i:nth-child(2) { transform: rotate(135deg) translateX(var(--r)); }
#hitmark i:nth-child(3) { transform: rotate(225deg) translateX(var(--r)); }
#hitmark i:nth-child(4) { transform: rotate(315deg) translateX(var(--r)); }
#hitmark b { display: none; position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,0.45); }
#hitmark.on { animation: hm .22s ease-out forwards; }
#hitmark.head { --c: #ff3b30; --len: 10px; --r: 11px; animation-duration: .32s; }
#hitmark.kill { --c: #ffc23a; --len: 12px; --r: 13px; animation-duration: .55s; }
#hitmark.kill b { display: block; }
@keyframes hm { 0% { opacity: 1; transform: scale(1.45); } 28% { transform: scale(1); } 100% { opacity: 0; transform: scale(.96); } }

/* top area */
#objective { position: absolute; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); max-width: min(46vw, 440px); text-align: center; opacity: var(--op); }
#objText { font-size: 14px; padding: 5px 14px; background: rgba(0,0,0,0.45); border-radius: 16px; border: 1px solid var(--line); text-shadow: 0 1px 2px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: font-size .25s, padding .25s, opacity .25s; }
#objText.small { font-size: 11px; padding: 2px 10px; opacity: .6; }
#waypoint { position: absolute; left: 0; top: 0; width: 0; height: 0; display: none; }
#wpArrow { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; }
#wpArrow::before { content: ""; position: absolute; left: 4px; top: 4px; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 20px solid var(--amber); filter: drop-shadow(0 0 4px #000); }
#wpArrow.pin::before { border: 0; width: 14px; height: 14px; left: 7px; top: 7px; background: var(--amber); transform: rotate(45deg); border-radius: 50% 50% 0 50%; }
#wpDist { position: absolute; left: -30px; top: 16px; width: 60px; text-align: center; font-size: 13px; color: var(--amber); text-shadow: 0 1px 3px #000, 0 0 3px #000; }

#topLeft { position: absolute; top: calc(8px + var(--safe-t)); left: calc(10px + var(--safe-l)); opacity: var(--op); }
#team .tm { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; text-shadow: 0 1px 2px #000; }
#team .av { width: 17px; height: 17px; border-radius: 50%; font-size: 9px; font-weight: 800; line-height: 17px; text-align: center; color: #05070c; box-shadow: 0 0 0 1.5px rgba(0,0,0,0.55); flex: none; }
#team .bar { width: 40px; height: 4px; background: rgba(0,0,0,0.6); border-radius: 2px; overflow: hidden; }
#team .bar i { display: block; height: 100%; background: var(--green); }
#team .tm.downed .bar i { background: var(--red); }
#team .tm .st { font-size: 9px; color: #ff8a80; }
#team .tm.dead { opacity: 0.4; }

#topRight { position: absolute; top: calc(8px + var(--safe-t)); right: calc(52px + var(--safe-r)); width: min(30vw, 250px); text-align: right; opacity: var(--op); }
#killCount { text-shadow: 0 1px 3px #000; line-height: 1; }
#killCount .lbl { font-size: 9px; margin-right: 3px; }
#killCount b { font-size: 16px; color: #ff9a8f; }
#feed { margin-top: 5px; }
#feed .item { display: table; margin: 0 0 2px auto; font-size: 11px; padding: 2px 7px; background: rgba(0,0,0,0.45); border-right: 3px solid var(--fc, #fff); border-radius: 3px; text-shadow: 0 1px 2px #000; animation: feedIn .2s ease-out; transition: opacity .6s; text-align: right; }
#feed .item.out { opacity: 0; }
@keyframes feedIn { from { transform: translateX(12px); opacity: 0; } }

#gearBtn { position: fixed; top: calc(6px + var(--safe-t)); right: calc(8px + var(--safe-r)); width: 36px; height: 36px; padding: 6px; z-index: 25;
  border-radius: 50%; background: rgba(0,0,0,0.4); border: 1px solid var(--line); color: #fff; opacity: .75; touch-action: manipulation; }
#gearBtn svg, .tbtn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
#gearBtn svg { width: 100%; height: 100%; }
svg .f { fill: currentColor; stroke: none; }
svg.fillic, .tbtn svg.fillic { fill: currentColor; stroke: currentColor; stroke-width: 1.1; stroke-linejoin: round; }
svg.fillic .wd { fill-opacity: .55; }
svg.fillic .cut { fill: none; stroke: rgba(10,12,18,.85); stroke-width: 1.3; }

#prompt { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); padding: 8px 18px; font-size: 18px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.3); border-radius: 8px; text-shadow: 0 1px 3px #000; white-space: nowrap; }
body.touch #prompt { display: none !important; }
#reviveBar { position: absolute; left: 50%; top: 74%; transform: translateX(-50%); width: 200px; height: 18px; background: rgba(0,0,0,0.6); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
#reviveFill { height: 100%; width: 0%; background: var(--green); }
#reviveLbl { position: absolute; inset: 0; text-align: center; line-height: 18px; font-size: 12px; text-shadow: 0 1px 2px #000; }

#downed { position: absolute; left: 0; right: 0; top: 24%; text-align: center; text-shadow: 0 2px 8px #000; }
#downed::before { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at center, rgba(120,0,0,0.15), rgba(120,0,0,0.65)); z-index: -1; }
.dTitle { font-size: 34px; font-weight: 900; color: #ff4a40; letter-spacing: 3px; }
.dTimer { font-size: 64px; font-weight: 900; }
.dSub { font-size: 15px; color: #ddd; }
#spectate { position: absolute; left: 50%; bottom: calc(40px + var(--safe-b)); transform: translateX(-50%); text-align: center; padding: 8px 18px; background: rgba(0,0,0,0.6); border-radius: 8px; font-size: 16px; }
#spectate small { display: block; color: var(--dim); font-size: 11px; margin-top: 2px; }
#spectate span { color: var(--dim); font-size: 12px; letter-spacing: 1px; }

/* compact HP (bottom-left) and ammo (placed next to FIRE by settings.js) */
#bottomLeft { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(10px + var(--safe-b)); opacity: var(--op); }
body.lefty #bottomLeft { left: auto; right: calc(12px + var(--safe-r)); }
#hpWrap { position: relative; width: 112px; height: 14px; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.35); border-radius: 7px; overflow: hidden; }
#hpFill { height: 100%; width: 100%; background: linear-gradient(#59e06f, #2fa84a); transition: width .15s; }
#hpWrap.low #hpFill { background: linear-gradient(#ff6b5f, #c4281d); }
#hpWrap.mid #hpFill { background: linear-gradient(#ffcf4d, #d49a10); }
#hpText { position: absolute; inset: 0; text-align: center; line-height: 12px; font-size: 10px; text-shadow: 0 1px 2px #000; }
#ammoBox { position: absolute; right: 140px; bottom: 30px; text-align: right; text-shadow: 0 2px 6px #000; opacity: var(--op); white-space: nowrap; }
body.lefty #ammoBox { text-align: left; }
#wpnName { font-size: 10px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; line-height: 1.1; }
#ammo b { font-size: 30px; font-weight: 900; line-height: 1; }
#ammo b.empty { color: #ff4a40; }
#ammoRes { font-size: 14px; color: var(--dim); margin-left: 4px; }
#reloadBar { width: 80px; height: 4px; margin: 3px 0 0 auto; background: rgba(0,0,0,0.5); border-radius: 2px; overflow: hidden; opacity: 0; }
body.lefty #reloadBar { margin-left: 0; }
#reloadBar.on { opacity: 1; }
#reloadFill { height: 100%; width: 0; background: var(--amber); }

/* ---------- touch ---------- */
#touch { position: fixed; inset: 0; z-index: 20; touch-action: none; }
#joyBase { position: absolute; left: 0; top: 0; width: var(--joy); height: var(--joy); margin: calc(var(--joy) / -2) 0 0 calc(var(--joy) / -2); border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.3); pointer-events: none; opacity: var(--op);
  transition: opacity .2s, border-color .12s, box-shadow .12s; }
#joyBase.idle { opacity: calc(var(--op) * 0.28); }
#joyBase.sprint { border-color: var(--amber); box-shadow: 0 0 12px rgba(255,176,46,0.55), inset 0 0 0 3px rgba(255,176,46,0.22); }
#joyKnob { position: absolute; left: 50%; top: 50%; width: calc(var(--joy) * 0.44); height: calc(var(--joy) * 0.44); margin: calc(var(--joy) * -0.22) 0 0 calc(var(--joy) * -0.22);
  border-radius: 50%; background: rgba(255,255,255,0.3); border: 2px solid rgba(255,255,255,0.55); }

.tbtn {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  width: 80px; height: 80px; font-size: 11px; border-radius: 50%;
  background: rgba(18,22,32,0.42); border: 2px solid rgba(255,255,255,0.42); color: #fff; font-weight: 700; touch-action: none;
  text-shadow: 0 1px 3px #000; -webkit-user-select: none; user-select: none;
  opacity: 0; transform: scale(.7); visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, background .1s, visibility 0s .15s;
}
.tbtn.show { opacity: var(--op); transform: scale(1); visibility: visible; pointer-events: auto; transition: opacity .15s ease, transform .15s ease, background .1s, visibility 0s; }
.tbtn.show.down { transform: scale(.93); background: rgba(255,255,255,0.35); }
.tbtn .ic { display: block; pointer-events: none; }
.tbtn svg { width: 3.3em; height: 3.3em; pointer-events: none; }
.tbtn.cap svg { width: 2.9em; height: 2.9em; }
.tbtn .lb { display: block; font-size: .85em; line-height: 1; margin-top: .1em; max-width: 92%; pointer-events: none; opacity: .9; letter-spacing: .3px; }
#bFire svg { width: 3.8em; height: 3.8em; }
#bFire { background: rgba(216,50,43,0.36); border-color: rgba(255,120,110,0.85); }
#bFire.down { background: rgba(216,50,43,0.75); }
#bUse { background: rgba(40,160,80,0.34); border-color: rgba(120,255,150,0.8); }
#bUse.show { box-shadow: 0 0 14px rgba(76,255,120,0.4); }
#bUse svg.ring { position: absolute; left: -7px; top: -7px; width: calc(100% + 14px); height: calc(100% + 14px); transform: rotate(-90deg); pointer-events: none;
  stroke: #7dff9a; stroke-width: 6; stroke-dasharray: 289; stroke-dashoffset: 289; opacity: 0; }
#bUse svg.ring.on { opacity: 1; }
#bReload { border-color: rgba(255,200,90,0.75); }
#bReload.pulse { animation: pulse .7s ease-in-out infinite; background: rgba(255,176,46,0.32); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,176,46,0.6); } 50% { box-shadow: 0 0 0 9px rgba(255,176,46,0); transform: scale(1.06); } }

/* ---------- settings + layout editor ---------- */
#settings { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); padding: 10px; touch-action: auto; }
.spanel { width: min(560px, 100%); max-height: 100%; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
.spanel h2 { margin: 0 0 10px; font-size: 20px; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.srow { display: block; font-size: 12px; color: var(--dim); letter-spacing: .5px; text-transform: uppercase; }
.srow b { float: right; color: var(--fg); }
.srow.chk { display: flex; align-items: center; justify-content: space-between; }
.srow input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--red); }
.sbtns { display: flex; gap: 8px; margin-top: 14px; }
.sbtns .btn { flex: 1; padding: 10px 8px; font-size: 14px; }
#editBar { position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 6px 10px;
  background: rgba(10,12,18,0.92); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--dim); touch-action: manipulation; }
#editBar .btn { width: auto; padding: 6px 12px; font-size: 13px; }
#editBar .es { display: flex; align-items: center; gap: 6px; }
#editBar input[type=range] { width: 110px; margin: 0; }
body.editing #screens { display: none; }
body.editing .tbtn { opacity: var(--op); transform: none; visibility: visible; pointer-events: auto; cursor: grab; outline: 2px dashed rgba(255,255,255,0.55); outline-offset: 4px; }
body.editing .tbtn.sel { outline: 2px solid var(--amber); }
body.editing #gearBtn { display: none; }
body.editing #joyBase.idle { opacity: .5; }

.sens { margin: 14px 0 0; }
.sens b { color: var(--fg); float: right; }
input[type=range] { width: 100%; margin-top: 8px; accent-color: var(--red); touch-action: manipulation; }
.urlBox { text-align: center; font-size: 22px; font-weight: 800; color: var(--amber); padding: 14px; background: rgba(255,255,255,0.06); border-radius: 8px; word-break: break-all; user-select: text; -webkit-user-select: text; }
.qrBox { display: flex; justify-content: center; margin: 14px 0 0; }
.qrBox canvas { width: 180px; height: 180px; }
.qr { background: #fff; border-radius: 6px; image-rendering: pixelated; flex: none; }
.lrow { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 4px; }
.lrow .codeBox { margin: 0; }
#lobbyQr { width: 120px; height: 120px; }
@media (max-height: 460px) {
  .lrow { gap: 10px; justify-content: flex-start; }
  #lobbyQr { width: 104px; height: 104px; }
  #lobbyCode { font-size: 30px !important; letter-spacing: 6px !important; padding-left: 6px !important; }
  .share { margin-bottom: 4px; }
}
.tag.small { font-size: 12px; margin-top: 12px; }
.rotBox small { display: block; color: var(--dim); margin-top: 6px; font-size: 13px; }

@media (max-height: 460px) and (min-width: 600px) {
  .panel.split { width: min(760px, 100%); display: flex; gap: 22px; align-items: center; }
  .panel.split .pcol { flex: 1; min-width: 0; }
  .plist li { padding: 6px 10px; margin-bottom: 4px; font-size: 14px; }
  .btn { padding: 10px 14px; font-size: 15px; }
  input[type=text] { padding: 9px 12px; }
  .fld { margin-bottom: 8px; }
  .or { margin: 8px 0; }
  .btn.ghost { margin-top: 4px; }
  .codeBox { margin-bottom: 8px; }
  #winTable td { padding: 5px 8px; font-size: 14px; }
  .timeBox { margin-bottom: 6px; } .timeBox b { font-size: 22px; }
  .winTitle { font-size: 24px; }
  .help { text-align: left; margin-top: 12px; }
}
@media (max-height: 460px) {
  .panel { padding: 14px 16px; }
  .logo { font-size: 24px; }
  .tag { margin-bottom: 8px; }
  h2 { margin-bottom: 8px; font-size: 20px; }
  #lobbyCode { font-size: 36px; }
  .help { font-size: 11px; margin-top: 6px; }
}
