:root {
  --bg: #12161c;
  --red: #ff8a1f;
  --blue: #3d8bff;
  /* team colours (Settings can switch to a colour-blind friendly palette) */
  --ta: #3d8bff; --tb: #ff8a1f; --ta-text: #7fb2ff; --tb-text: #ffb066;
  --ink: #e8eaed;
  --dim: rgba(232,234,237, 0.6);
  --panel: rgba(18,22,28, 0.88);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: 'Chakra Petch', system-ui, sans-serif; user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 0.35em; border: 1px solid rgba(255,255,255,0.35); border-radius: 3px; font: 600 0.8em 'Chakra Petch', sans-serif; text-align: center; background: rgba(255,255,255,0.06); }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
/* match panel: top-left, angled slab with an orange edge */
#matchPanel { position: absolute; top: 12px; left: 12px; padding: 8px 12px 9px; background: linear-gradient(100deg, rgba(14,17,22,0.82), rgba(14,17,22,0.55));
  border-left: 3px solid var(--red); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); min-width: 250px; }
.mp-row { display: flex; align-items: center; gap: 10px; }
.score { font-size: 30px; font-weight: 700; width: 40px; text-align: center; line-height: 1; }
.score.blue { color: var(--ta-text); } .score.red { color: var(--tb-text); }
.clock { flex: 1; text-align: center; }
#timer { font-size: 24px; font-weight: 700; line-height: 1.05; letter-spacing: 1px; }
#timer.low { color: var(--red); }
#timer.charge { color: var(--red); }
#roundLabel { font-size: 10px; letter-spacing: 1px; color: var(--dim); white-space: nowrap; }
.mp-pips { display: flex; justify-content: space-between; margin-top: 6px; gap: 16px; }
.pips { display: flex; gap: 3px; }
.pip { width: 18px; height: 18px; display: grid; place-items: center; font-weight: 700; font-size: 10px; background: rgba(255,255,255,0.08); border-bottom: 2px solid; transform: skewX(-12deg); }
.pip.dead { opacity: 0.25; }
.pip.me { outline: 1px solid #fff; }
#uplinkBar { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.ub { flex: 1; height: 6px; background: rgba(255,255,255,0.12); position: relative; transform: skewX(-20deg); overflow: hidden; }
.ub i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ta-text); }
.ub.r i { left: auto; right: 0; background: var(--tb-text); }
#uplinkTxt { font-size: 10px; letter-spacing: 1.5px; font-weight: 700; min-width: 86px; text-align: center; }

/* right column: minimap with the kill feed under it */
#rightCol { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#minimap { background: rgba(10, 14, 20, 0.7); border: 1px solid rgba(255,255,255,0.12); border-right: 3px solid var(--red); }
#killfeed { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kf { background: rgba(10,14,20,0.6); padding: 3px 10px; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; animation: kfIn 0.15s ease-out; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); }
.kf.mine { box-shadow: inset 0 0 0 1px rgba(255,138,31,0.8); }
.kf .w { color: var(--dim); font-size: 12px; }
.kf .t0 { color: var(--ta-text); } .kf .t1 { color: var(--tb-text); }
@keyframes kfIn { from { transform: translateX(20px); opacity: 0; } }

#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; opacity: 0; transition: opacity 0.15s; background:
  linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
#hitmarker.show { opacity: 1; transition: none; }
#hitmarker.kill { background: linear-gradient(45deg, transparent 43%, var(--red) 43%, var(--red) 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, var(--red) 43%, var(--red) 57%, transparent 57%); }
#dmgNums { position: absolute; left: 50%; top: 50%; }
.dn { position: absolute; left: 18px; top: -30px; font-weight: 700; font-size: 18px; color: #fff; text-shadow: 0 1px 2px #000; animation: dn 0.7s ease-out forwards; }
.dn.head { color: #ffd23f; font-size: 22px; }
@keyframes dn { to { transform: translateY(-30px); opacity: 0; } }

#centerMsg { position: absolute; top: 22%; left: 0; right: 0; text-align: center; text-shadow: 0 2px 8px rgba(0,0,0,0.6); transition: opacity 0.3s; }
#msgMain { font-size: 54px; font-weight: 700; letter-spacing: 4px; }
#msgMain.win { color: #6effc4; } #msgMain.lose { color: var(--red); }
#msgSub { font-size: 20px; color: var(--ink); letter-spacing: 1px; }
#specLabel { position: absolute; bottom: 130px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.55); padding: 6px 16px; border-radius: 3px; font-size: 16px; }
#buffs { position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.buff { background: rgba(0,0,0,0.55); padding: 3px 10px; border-radius: 3px; font-weight: 700; font-size: 14px; letter-spacing: 1px; }

/* vitals: bottom-centre bars */
#vitals { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; }
.vnum { text-align: center; min-width: 54px; }
.vnum span { font-size: 30px; font-weight: 700; line-height: 1; display: block; }
.vnum small { font-size: 10px; letter-spacing: 2px; color: var(--dim); }
.vnum.armor span { font-size: 22px; color: #9fd8ff; }
#hpVal.low { color: var(--red); }
.vbars { width: clamp(140px, 24vw, 300px); display: flex; flex-direction: column; gap: 4px; }
.vbar { height: 6px; background: rgba(255,255,255,0.12); transform: skewX(-20deg); overflow: hidden; }
.vbar.hp { height: 12px; }
.vbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e8eaed, #ffffff); transition: width 0.12s; }
.vbar.ar i { background: #9fd8ff; }

/* weapon card: gadgets stacked beside the ammo */
#bottomRight { position: absolute; bottom: 16px; right: 16px; display: flex; align-items: flex-end; gap: 10px; }
.wcard { text-align: right; padding: 8px 14px 8px 22px; background: linear-gradient(260deg, rgba(14,17,22,0.82), rgba(14,17,22,0.4)); border-right: 3px solid var(--red); clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%); }
#ammo span { font-size: 40px; font-weight: 700; line-height: 1; }
#ammo small { font-size: 18px; color: var(--dim); }
#ammo.reload span { color: #ffd23f; }
#weaponName { font-size: 12px; letter-spacing: 2px; color: var(--dim); }
#credits { font-size: 15px; font-weight: 700; color: #6effc4; }
#abilities { display: flex; flex-direction: column; gap: 6px; }
.abil { position: relative; width: 150px; padding: 5px 8px 5px 10px; background: rgba(14,17,22,0.72); border-left: 3px solid var(--acc, #666); display: flex; align-items: center; gap: 8px; }
.abil .nm { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.abil .ch { display: inline; font-weight: 700; font-size: 12px; color: var(--acc); padding: 0; }
.abil.empty { opacity: 0.4; }
@keyframes pulse { 50% { box-shadow: 0 0 4px var(--acc); } }

#flash, #blackout, #vignette, #scope { position: fixed; inset: 0; pointer-events: none; opacity: 0; }
#flash { background: #fff; }
#blackout { background: radial-gradient(circle, transparent 8%, rgba(20, 0, 40, 0.97) 32%); }
#vignette { background: radial-gradient(circle, transparent 55%, rgba(255, 30, 50, 0.55) 100%); }
#scope { background: radial-gradient(circle, transparent 0, transparent 38vh, #000 38.2vh); }
#scope .ring { position: absolute; inset: 0; background: linear-gradient(#000, #000) center/100% 1px no-repeat, linear-gradient(#000, #000) center/1px 100% no-repeat; }

/* ---------------- Panels ---------------- */
.panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--panel); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 18px 22px; backdrop-filter: blur(6px); }
#buyMenu { width: min(1180px, 96vw); }
.buyHead { display: flex; align-items: baseline; gap: 18px; }
.buyHead h2 { margin: 0; letter-spacing: 4px; }
#buyCredits { font-size: 24px; font-weight: 700; color: #6effc4; }
#buyTimer { margin-left: auto; color: var(--dim); }
.buyCols { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 10px; }
@media (max-width: 900px) { .buyCols { grid-template-columns: repeat(3, 1fr); } }
.buyCols h3 { margin: 4px 0 8px; font-size: 13px; letter-spacing: 3px; color: var(--dim); }
.items { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; color: var(--ink); font-size: 16px; font-weight: 600; text-align: left; }
.item:hover { background: rgba(255,255,255,0.12); }
.item .k { color: var(--dim); font-size: 12px; margin-right: 6px; }
.item .c { color: #6effc4; }
.item.owned { border-color: #6effc4; }
.item.poor { opacity: 0.4; }
.item small { display: block; color: var(--dim); font-size: 12px; font-weight: 500; }
.hint { color: var(--dim); font-size: 13px; margin: 14px 0 0; }

#scoreboard { width: min(820px, 94vw); padding: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th { text-align: left; font-size: 12px; letter-spacing: 2px; color: var(--dim); padding: 4px 8px; }
td { padding: 5px 8px; border-top: 1px solid rgba(255,255,255,0.06); }
tr.t0 td:first-child { border-left: 3px solid var(--ta); }
tr.t1 td:first-child { border-left: 3px solid var(--tb); }
tr.me td { background: rgba(255,255,255,0.08); }
tr.dead td { opacity: 0.45; }
td.num, th.num { text-align: right; }
.agentTag { font-weight: 700; font-size: 13px; }

/* ---------------- Menus ---------------- */
.screen { position: fixed; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 24px 16px;
  background: radial-gradient(ellipse at 30% 20%, #1f3346 0%, transparent 60%), radial-gradient(ellipse at 80% 90%, #3a1a24 0%, transparent 55%), var(--bg); }
.screen.dim { background: rgba(10, 16, 24, 0.82); backdrop-filter: blur(4px); }
.menuInner { width: min(1000px, 100%); text-align: center; }
.menuInner.small { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
h1 { font-size: clamp(54px, 10vw, 110px); margin: 0; letter-spacing: 8px; line-height: 0.9; }
h1 span { color: var(--red); }
.tag { color: var(--dim); font-size: 18px; margin: 8px 0 22px; }
.menuInner h3 { letter-spacing: 4px; font-size: 14px; color: var(--dim); }
#agentCards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { text-align: left; background: rgba(255,255,255,0.04); border: 2px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 14px; color: var(--ink); transition: transform 0.12s, border-color 0.12s; }
.card:hover { transform: translateY(-3px); }
.card.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, transparent); }
.card .face { height: 70px; border-radius: 4px; display: grid; place-items: center; font-size: 34px; font-weight: 700; letter-spacing: 3px; color: #12161c; background: var(--acc); }
.card .role { font-size: 12px; letter-spacing: 3px; color: var(--acc); margin-top: 8px; font-weight: 700; }
.card .blurb { font-size: 14px; color: var(--dim); margin: 4px 0 8px; min-height: 36px; }
.card ul { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.card li { margin: 5px 0; line-height: 1.25; }
.card li b { color: var(--acc); }
.opts { display: flex; justify-content: center; flex-wrap: wrap; gap: 28px; margin: 22px 0 18px; }
.opt h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: 3px; color: var(--dim); }
.seg { display: inline-flex; border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--ink); padding: 7px 16px; font-size: 16px; font-weight: 600; }
.seg button.on { background: var(--ink); color: var(--bg); }
input[type=range] { width: 180px; accent-color: var(--red); }
button.big { background: var(--red); color: #fff; border: 0; padding: 14px 54px; font-size: 22px; font-weight: 700; letter-spacing: 4px; border-radius: 3px; }
button.big:hover { filter: brightness(1.1); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid rgba(255,255,255,0.3); padding: 10px 24px; font-size: 16px; border-radius: 3px; }
.row { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
#touchWarn { color: #ffd23f; }
.controls { margin: 22px auto 0; max-width: 640px; text-align: left; color: var(--dim); }
.controls summary { cursor: pointer; text-align: center; letter-spacing: 2px; }
.controls .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 10px; }
#over h2, #pause h2 { font-size: 56px; margin: 0; letter-spacing: 6px; }
#overTitle.win { color: #6effc4; } #overTitle.lose { color: var(--red); }
#overBoard { margin-top: 10px; }

@media (max-width: 760px) {
  #agentCards { grid-template-columns: 1fr 1fr; }
  .controls .grid { grid-template-columns: 1fr; }
}
#overBoard td:not(.num), #overBoard th:not(.num) { text-align: left; }

#hitDir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.hd { position: absolute; left: -110px; top: -110px; width: 220px; height: 220px; border-radius: 50%;
  border-top: 6px solid rgba(255, 50, 70, 0.85); filter: drop-shadow(0 0 6px rgba(255, 40, 60, 0.8));
  -webkit-mask: linear-gradient(90deg, transparent 32%, #000 42%, #000 58%, transparent 68%); mask: linear-gradient(90deg, transparent 32%, #000 42%, #000 58%, transparent 68%);
  animation: hdFade 1.4s ease-in forwards; }
@keyframes hdFade { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }

#prompt { position: absolute; top: 62%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.55); padding: 6px 16px; border-radius: 3px; font-size: 17px; font-weight: 600; letter-spacing: 1px; }
#prompt kbd { font-size: 15px; }
#actionBar { position: absolute; top: 67%; left: 50%; transform: translateX(-50%); width: 260px; height: 10px; background: rgba(0,0,0,0.55); border-radius: 5px; overflow: hidden; }
#actionBar div { height: 100%; width: 0; background: #ffd23f; }
#actionBar.defuse div { background: #3ee6d6; }
#actionBar span { position: absolute; left: 50%; top: 0; width: 2px; height: 100%; background: rgba(255,255,255,0.6); }
#actionBar:not(.defuse) span { display: none; }
#comms { position: absolute; top: 150px; left: 12px; display: flex; flex-direction: column; gap: 4px; max-width: 300px; }
.cm { background: rgba(0,0,0,0.5); padding: 3px 9px; border-radius: 3px; font-size: 14px; font-weight: 600; animation: kfIn 0.15s ease-out; }
.cm b { color: var(--ta-text); margin-right: 6px; }
.cm.sys { color: #ffd23f; }
#timer.charge { color: #ff8a1f; }
.pip.carrier::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #ff8a1f; margin: -20px 0 0 20px; box-shadow: 0 0 4px #ff8a1f; }
.pip { position: relative; }

/* ---------- menu top bar, profile, daily challenges ---------- */
.menuTop { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.navBtns { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; padding: 6px 12px; text-align: left; }
.badge .lv { font-size: 26px; font-weight: 700; color: #ffd23f; }
.badge .bar { width: 160px; height: 6px; background: rgba(255,255,255,0.15); border-radius: 3px; overflow: hidden; }
.badge .bar i { display: block; height: 100%; background: #ffd23f; }
.badge small { color: var(--dim); font-size: 12px; }
#newHere { margin: -8px 0 14px; color: #ffd23f; }
#newHere button { background: #ffd23f; color: #12161c; border: 0; border-radius: 3px; padding: 4px 10px; font-weight: 700; }
#modeHint { margin: -6px 0 14px; }
.daily { margin: 22px auto 0; max-width: 620px; text-align: left; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 10px 14px; }
.daily h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: 3px; color: var(--dim); }
.ch { display: grid; grid-template-columns: 1fr 120px 60px; gap: 10px; align-items: center; font-size: 14px; padding: 4px 0; }
.ch .bar { height: 6px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.ch .bar i { display: block; height: 100%; background: #6effc4; }
.ch.done { color: #6effc4; }
.ch em { font-style: normal; color: #ffd23f; text-align: right; }

/* ---------- settings ---------- */
.menuInner.settings, .menuInner.loadout { width: min(1150px, 100%); text-align: left; }
.set-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.set-head h2 { margin: 0 auto 0 0; letter-spacing: 5px; }
.set-head .big { padding: 10px 34px; font-size: 18px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.set-grid section { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.set-grid h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: 3px; color: var(--dim); }
.set-row { display: grid; grid-template-columns: 1fr 130px 44px; align-items: center; gap: 8px; padding: 5px 0; font-size: 15px; }
.set-row input[type=range] { width: 100%; }
.set-row em { font-style: normal; color: var(--dim); text-align: right; font-size: 13px; }
.set-row input[type=checkbox] { justify-self: start; width: 18px; height: 18px; accent-color: var(--red); }
.xh-preview { height: 110px; border-radius: 4px; margin-bottom: 8px; background: linear-gradient(135deg, #5b6a7a, #2b3440 60%, #a89a7c); position: relative; }
.xh { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.xh i, .xh b, #crosshair i, #crosshair b { position: absolute; display: block; }
.swatches { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.sw.on { border-color: #fff; }
#xhCustom { width: 30px; height: 26px; border: 0; background: none; padding: 0; }
.binds { display: grid; gap: 4px; }
.bind-row { display: grid; grid-template-columns: 1fr 96px; align-items: center; font-size: 14px; }
.bind-row button { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); color: var(--ink); border-radius: 3px; padding: 4px 0; font-weight: 700; }
.bind-row button.wait { background: #ffd23f; color: #12161c; }
@media (max-width: 960px) { .set-grid { grid-template-columns: 1fr; } }

/* ---------- loadout ---------- */
.lo-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
.lo-list { display: flex; flex-direction: column; gap: 4px; }
.lo-list button { text-align: left; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--ink); padding: 7px 10px; border-radius: 3px; font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; }
.lo-list button.on { border-color: #ffd23f; background: rgba(255,210,63,0.1); }
.lo-list button small { color: var(--dim); font-weight: 500; }
#loPreview { width: 100%; height: auto; aspect-ratio: 640 / 300; border-radius: 6px; background: radial-gradient(circle at 50% 40%, #2a3a4c, #12161c); display: block; }
.lo-name { font-size: 22px; font-weight: 700; letter-spacing: 2px; margin: 8px 0; }
.lo-skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.skin { background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.1); border-radius: 4px; padding: 8px; color: var(--ink); text-align: left; }
.skin .sw2 { height: 26px; border-radius: 3px; margin-bottom: 6px; }
.skin.on { border-color: #ffd23f; }
.skin.locked { opacity: 0.45; }
.skin small { display: block; color: var(--dim); font-size: 12px; }

/* ---------- results XP ---------- */
#xpPanel { max-width: 560px; margin: 0 auto 14px; text-align: left; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 12px 16px; }
#xpPanel:empty { display: none; }
.xp-line { display: flex; justify-content: space-between; font-size: 15px; padding: 2px 0; }
.xp-line em { font-style: normal; color: #ffd23f; }
.xp-total { font-weight: 700; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 6px; padding-top: 6px; }
.xp-bar { height: 10px; background: rgba(255,255,255,0.12); border-radius: 5px; overflow: hidden; margin: 10px 0 4px; }
.xp-bar i { display: block; height: 100%; background: #ffd23f; transition: width 1.2s ease-out; }
.unlock { margin-top: 8px; color: #6effc4; font-weight: 700; }

/* ---------- range / tutorial / fps ---------- */
#rangeStats { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; background: rgba(0,0,0,0.55); padding: 6px 16px; border-radius: 4px; font-size: 15px; font-weight: 600; pointer-events: none; }
#rangeStats b { color: #6effc4; }
#tutorial { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); width: min(520px, 92vw); background: rgba(18,22,28,0.88); border: 1px solid rgba(255,210,63,0.5); border-radius: 6px; padding: 12px 16px; pointer-events: none; text-align: center; }
#tutorial .step { color: var(--dim); font-size: 12px; letter-spacing: 3px; }
#tutorial .txt { font-size: 20px; font-weight: 700; margin: 4px 0; }
#tutorial .sub { color: var(--dim); font-size: 14px; }
#tutorial .bar { height: 4px; background: rgba(255,255,255,0.12); border-radius: 2px; margin-top: 8px; overflow: hidden; }
#tutorial .bar i { display: block; height: 100%; background: #ffd23f; }
#tutorial.done { pointer-events: auto; border-color: #6effc4; }
#tutorial.done button { margin: 8px 4px 0; }
#fps { position: fixed; right: 8px; bottom: 4px; font-size: 12px; color: #6effc4; font-family: monospace; pointer-events: none; }

/* ---------- online ---------- */
.account { display: flex; align-items: center; gap: 8px; margin-right: auto; margin-left: 10px; }
.account .who { font-weight: 700; }
.account small { color: var(--dim); font-weight: 500; }
button.sm { padding: 4px 10px; font-size: 13px; }
button.big.online { background: #2a6fdb; margin-left: 8px; }
.auth input, .online-wrap input, .lobby input { width: 100%; padding: 10px 12px; font: 600 16px 'Chakra Petch', sans-serif; background: rgba(255,255,255,0.06); color: var(--ink); border: 1px solid rgba(255,255,255,0.18); border-radius: 3px; }
.auth .google { background: #fff; color: #1f1f1f; border: 0; border-radius: 3px; padding: 11px; font-size: 16px; font-weight: 700; }
.auth .google b { color: #4285f4; margin-right: 6px; }
.auth .or { color: var(--dim); font-size: 13px; }
.err { color: #ff7a85; font-size: 14px; min-height: 18px; }
.notice { background: rgba(255,210,63,0.1); border: 1px solid rgba(255,210,63,0.4); color: #ffd23f; border-radius: 4px; padding: 8px 12px; text-align: left; font-size: 14px; }
.notice code { color: #fff; }
.online-wrap { width: min(1000px, 100%); text-align: left; }
.ol-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }
.ol-grid section, .lb-grid section { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ol-grid h3, .lb-grid h3 { margin: 0; font-size: 12px; letter-spacing: 3px; color: var(--dim); }
.fr { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 15px; }
.fr small { color: var(--dim); margin-right: auto; }
.fr .dot { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.fr .dot.on { background: #6effc4; box-shadow: 0 0 6px #6effc4; }
.fr.req { color: #ffd23f; }
.fr-add { display: flex; gap: 6px; }
button.x { padding: 4px 8px; }
.lobby { width: min(1150px, 100%); text-align: left; }
.lobby .code { color: #ffd23f; letter-spacing: 6px; }
.lb-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.team { background: rgba(255,255,255,0.03); border-radius: 6px; padding: 10px; border-top: 3px solid var(--ta); display: flex; flex-direction: column; gap: 6px; }
.team.t1 { border-top-color: var(--tb); }
.team h3 { margin: 0 0 4px; font-size: 12px; letter-spacing: 3px; color: var(--dim); }
.slot { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.05); padding: 6px 8px; border-radius: 4px; font-size: 15px; }
.slot.me { outline: 1px solid #ffd23f; }
.slot.bot { opacity: 0.45; }
.slot small { margin-left: auto; color: #ffd23f; font-size: 11px; letter-spacing: 2px; }
.slot small.ok { color: #6effc4; }
.slot .ag { width: 24px; height: 24px; border-radius: 3px; display: grid; place-items: center; font-weight: 700; color: #12161c; background: rgba(255,255,255,0.2); }
.agents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.agents button { background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.12); color: var(--acc); font-weight: 700; padding: 8px 0; border-radius: 4px; letter-spacing: 1px; }
.agents button.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 15%, transparent); }
.lb-grid .seg { flex-wrap: wrap; }
.lb-grid .seg button:disabled { cursor: default; opacity: 0.7; }
.lb-grid .seg button.on:disabled { opacity: 1; }
.chat .log { height: 130px; overflow-y: auto; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.chat .sys { color: var(--dim); font-style: italic; }
#toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--panel); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; font-size: 15px; box-shadow: 0 6px 24px rgba(0,0,0,0.4); animation: kfIn 0.2s ease-out; }
.toast span { margin-right: 6px; }
@media (max-width: 900px) { .ol-grid, .lb-grid, .teams { grid-template-columns: 1fr; } }

/* map loading card */
#loading { z-index: 60; background: radial-gradient(circle at 50% 40%, rgba(18,22,28,0.92), rgba(5,8,12,0.98)); display: flex; align-items: center; justify-content: center; }
#loading[hidden] { display: none; }
.loadCard { text-align: center; color: #e8eaed; }
.loadCard small { letter-spacing: 0.3em; color: #ff8a1f; font-weight: 700; }
.loadCard h2 { font-size: 64px; margin: 8px 0 4px; letter-spacing: 0.08em; }
.loadCard p { opacity: 0.7; margin: 0 0 18px; }
.loadCard i { display: block; width: 180px; height: 3px; margin: 0 auto; background: linear-gradient(90deg, transparent, #ff8a1f, transparent); animation: loadbar 0.9s linear infinite; }
@keyframes loadbar { from { transform: translateX(-60px); } to { transform: translateX(60px); } }

.card .perk { font-size: 13px; margin: 8px 0 4px; line-height: 1.35; }
.card .perk b { display: block; color: var(--acc); letter-spacing: 1px; text-transform: uppercase; font-size: 12px; }
.card .picks { font-size: 12px; color: var(--dim); }

/* ---------------- Main menu: two columns ---------------- */
.menuGrid { width: min(1120px, 100%); text-align: left; display: grid; grid-template-columns: 1fr 1.05fr; gap: 10px 36px; align-items: start; }
.menuGrid .menuTop { grid-column: 1 / -1; }
.mLeft h1 { text-align: left; font-size: clamp(54px, 8vw, 96px); letter-spacing: 4px; font-style: italic; }
.mLeft .tag { text-align: left; margin: 6px 0 16px; }
.mLeft .opts { flex-direction: column; gap: 14px; margin: 14px 0 6px; align-items: flex-start; }
.mLeft .seg { flex-wrap: wrap; }
.mLeft #modeHint { text-align: left; max-width: 480px; }
.deployRow { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.deployRow .big { clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); padding: 14px 44px; }
.mRight h3 { margin: 6px 0 10px; }
.mRight #agentCards { grid-template-columns: 1fr; gap: 8px; }
.mRight .card { display: grid; grid-template-columns: 74px 1fr; gap: 2px 14px; padding: 10px 12px; border-width: 0 0 0 4px; border-color: rgba(255,255,255,0.15); border-radius: 0; }
.mRight .card.on { border-color: var(--acc); }
.mRight .card:hover { transform: translateX(4px); }
.mRight .card .face { grid-row: span 4; height: auto; min-height: 74px; font-size: 18px; letter-spacing: 2px; clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%); }
.mRight .card .role { margin-top: 0; }
.mRight .card .blurb { min-height: 0; margin: 2px 0 2px; }
.mRight .card .perk { margin: 2px 0; }
.mRight .daily { margin: 14px 0 0; max-width: none; }
@media (max-width: 860px) { .menuGrid { grid-template-columns: 1fr; } }

@media (max-width: 1100px) { #vitals { left: 16px; transform: none; } }

/* ---------------- First-minute & feedback ---------------- */
.deployRow .big.quick { background: #e8eaed; color: #12161c; }
.welcomeCard { text-align: center; }
.welcomeCard small { letter-spacing: 0.3em; color: var(--dim); }
.welcomeCard h2 { font-size: 64px; margin: 0; font-style: italic; letter-spacing: 3px; }
.welcomeCard h2 span { color: var(--red); }
.welcomeCard p { color: var(--dim); line-height: 1.45; margin: 6px 0 10px; }

#medals { position: absolute; left: 50%; top: calc(50% + 46px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.medal { display: flex; align-items: baseline; gap: 10px; padding: 4px 16px; background: rgba(14,17,22,0.7); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  font-weight: 700; letter-spacing: 1.5px; font-size: 15px; animation: medalIn 0.28s cubic-bezier(.2,1.6,.4,1); }
.medal b { color: var(--mc, #ffd23f); }
.medal em { font-style: normal; color: #6effc4; font-size: 13px; }
.medal.out { transition: opacity 0.4s, transform 0.4s; opacity: 0; transform: translateY(-8px); }
@keyframes medalIn { from { transform: scale(1.6); opacity: 0; } }
#hitmarker.kill { animation: killPop 0.35s ease-out; }
@keyframes killPop { 0% { transform: scale(1.9) rotate(45deg); } 100% { transform: scale(1) rotate(0); } }

#hintBar { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); padding: 8px 18px; background: rgba(14,17,22,0.78); border-left: 3px solid #ffd23f;
  font-size: 15px; font-weight: 600; letter-spacing: 0.5px; animation: medalIn 0.3s ease-out; white-space: nowrap; }
#hintBar small { color: #ffd23f; margin-right: 8px; letter-spacing: 2px; font-size: 11px; }

#deathCard { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); min-width: 300px; padding: 12px 20px; text-align: center;
  background: linear-gradient(180deg, rgba(14,17,22,0.85), rgba(14,17,22,0.65)); border-top: 3px solid var(--red); animation: medalIn 0.3s ease-out; }
#deathCard small { letter-spacing: 3px; color: var(--dim); font-size: 11px; }
#deathCard h3 { margin: 2px 0; font-size: 28px; letter-spacing: 2px; }
#deathCard .dcs { display: flex; justify-content: center; gap: 16px; font-size: 13px; color: var(--dim); }
#deathCard .dcs b { color: var(--ink); }
#deathCard .respawn { margin-top: 6px; font-size: 13px; color: #6effc4; letter-spacing: 1px; }

#streakBox { position: absolute; right: 16px; bottom: 132px; padding: 4px 12px; background: rgba(14,17,22,0.7); border-right: 3px solid #6effc4;
  font-size: 12px; font-weight: 600; letter-spacing: 1px; text-align: right; }
#streakBox b { color: #6effc4; font-size: 15px; }
#streakBox small { display: block; color: var(--dim); font-size: 11px; }

/* ---------------- Phone / tablet controls ---------------- */
body.touch { touch-action: none; -webkit-user-select: none; }
#touchUI { position: absolute; inset: 0; pointer-events: auto; touch-action: none; z-index: 5; }
body.touch #hud > *:not(#touchUI) { z-index: 6; }
body.touch #abQ, body.touch #abE, body.touch .wcard { pointer-events: auto; }
body.touch .abil { width: 130px; padding: 9px 10px; }
#tStick { position: absolute; width: 116px; height: 116px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.06);
  left: 60px; bottom: 120px; opacity: 0.45; pointer-events: none; }
#tStick.on { opacity: 1; bottom: auto; }
#tKnob { position: absolute; left: 33px; top: 33px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.55); }
.tbtn { position: absolute; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: rgba(14,17,22,0.55);
  border: 2px solid rgba(255,255,255,0.35); color: #e8eaed; font-weight: 700; font-size: 12px; letter-spacing: 1px; pointer-events: auto; touch-action: none; }
.tbtn.down { background: rgba(255,138,31,0.6); border-color: #ff8a1f; }
.tbtn.big { width: 92px; height: 92px; font-size: 15px; border-color: rgba(255,138,31,0.8); }
.tbtn.small { width: 52px; height: 52px; font-size: 18px; border-color: rgba(255,138,31,0.6); }
.tbtn.top { width: auto; height: 34px; border-radius: 4px; padding: 0 12px; }
/* thumb layout: fire cluster bottom-right above the weapon card, gadgets in a column on the right edge */
#tFire { right: 140px; bottom: 84px; }
#tFire2 { left: 18px; top: 34%; }
#tAim { right: 238px; bottom: 150px; width: 56px; height: 56px; }
#tJump { right: 240px; bottom: 74px; width: 58px; height: 58px; }
#tCrouch { right: 316px; bottom: 104px; width: 56px; height: 56px; font-size: 9px; }
#tReload { right: 158px; bottom: 186px; width: 46px; height: 46px; }
#tLoadout { left: 50%; top: 8px; transform: translateX(-120%); }
#tPause { left: 50%; top: 8px; transform: translateX(60%); }
body.touch #minimap { width: 108px; height: auto; opacity: 0.85; }
body.touch #rightCol { gap: 4px; }
body.touch .kf { font-size: 11px; padding: 2px 8px; }
body.touch #abilities { position: fixed; right: 10px; top: 112px; }
body.touch #streakBox { right: 10px; bottom: auto; top: 196px; font-size: 10px; padding: 2px 8px; }
body.touch #streakBox b { font-size: 12px; }
body.touch #medals { top: calc(50% + 30px); }
body.touch .medal { font-size: 12px; padding: 2px 10px; }
body.touch #msgMain { font-size: 30px; letter-spacing: 2px; }
body.touch #msgSub { font-size: 13px; }
body.touch #centerMsg { top: 16%; }
body.touch #comms { top: 92px; }
body.touch #comms > * { font-size: 11px; }
body.touch #matchPanel { transform: scale(0.68); transform-origin: top left; opacity: 0.92; }
body.touch #vitals { left: 16px; transform: none; bottom: 10px; }
body.touch #bottomRight { bottom: 10px; right: 10px; }
body.touch #hintBar { bottom: auto; top: 98px; white-space: normal; max-width: 70vw; text-align: center; }
/* please turn the phone sideways */
#rotateMsg { display: none; }
@media (orientation: portrait) {
  body.touch #rotateMsg { display: grid; position: fixed; inset: 0; z-index: 100; place-items: center; background: #12161c; color: #e8eaed;
    font-size: 20px; font-weight: 700; letter-spacing: 1px; text-align: center; padding: 24px; }
}
/* small screens: tighter menu */
@media (max-height: 520px) {
  .mLeft h1 { font-size: 46px; }
  .mLeft .tag { margin: 2px 0 8px; }
  .mLeft .opts { gap: 8px; }
  .seg button { padding: 5px 10px; font-size: 14px; }
  .mRight .card { padding: 6px 10px; }
  .mRight .card .blurb { display: none; }
}
body.touch .deployRow { position: fixed; right: 12px; bottom: 12px; z-index: 30; margin: 0; }
body.touch .deployRow .big { padding: 10px 22px; font-size: 16px; }
body.touch .mLeft { padding-bottom: 70px; }

/* outfits */
.loTabs { margin: 0 0 12px; }
.of-row { margin: 8px 0 4px; }
.of-row h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: 2px; color: var(--dim); }
.of-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.of-opts button { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.1); color: var(--ink);
  padding: 4px 9px; border-radius: 3px; font-size: 13px; font-weight: 600; }
.of-opts button.on { border-color: #ffd23f; }
.of-opts button.locked { opacity: 0.4; }
.of-opts i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); }
.of-opts small { color: var(--dim); font-weight: 500; font-size: 11px; }

#tSwap { right: 14px; top: 236px; }
body.touch #killfeed .kf:nth-child(n+4) { display: none; }
body.touch .wcard { padding: 4px 10px 4px 16px; }
body.touch #ammo span { font-size: 30px; }
body.touch #vitals .vbars { width: 150px; }
body.touch .vnum span { font-size: 22px; }
/* touch-control editor */
#touchEdit { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.25); touch-action: none; }
body.touch-editing #hud { display: block !important; }
body.touch-editing .tbtn, body.touch-editing #abilities { outline: 2px dashed rgba(255,255,255,0.5); outline-offset: 2px; }
.te-sel { outline: 3px solid #ffd23f !important; }
.te-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(260px, 36vw); padding: 8px 10px; background: rgba(14,17,22,0.92);
  border-top: 3px solid var(--red); display: flex; flex-direction: column; gap: 4px; font-size: 12px; transition: opacity 0.15s; }
.te-panel.left { left: 3%; transform: translateY(-50%); }
.te-panel.right { left: auto; right: 3%; transform: translateY(-50%); }
#touchEdit.dragging .te-panel { opacity: 0.15; pointer-events: none; }
.te-panel b { font-size: 13px; }
.te-panel small { color: var(--dim); }
.te-panel label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.te-panel input[type=range] { width: 60%; }
.te-row { display: flex; gap: 8px; justify-content: flex-end; }
.te-row .big { padding: 6px 16px; font-size: 13px; }
.te-row .ghost { padding: 5px 12px; font-size: 13px; }

.set-btnrow { align-items: center; }
.set-btnrow small { display: block; color: var(--dim); font-size: 11px; font-weight: 500; }
.set-btnrow button { padding: 6px 12px; font-size: 13px; }
/* editing the touch layout from the menu: show only the touch buttons and gadget cards over the scene */
body.touch-editing #hud > *:not(#touchUI):not(#bottomRight) { visibility: hidden; }
body.touch-editing #bottomRight .wcard { visibility: hidden; }
body.touch-editing #menu, body.touch-editing #pause { visibility: hidden; }

/* phones: the loadout fills the screen, scrolls, keeps its header (and Close) pinned on top */
body.touch #buyMenu { top: 6px; bottom: 6px; left: 8px; right: 8px; width: auto; transform: none; padding: 0 10px 10px; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-y; z-index: 40; }
body.touch .buyHead { position: sticky; top: 0; z-index: 1; padding: 8px 0 6px; background: rgba(14,17,22,0.96); align-items: center; }
body.touch .buyHead h2 { font-size: 18px; letter-spacing: 3px; }
body.touch #buyClose { padding: 8px 20px; font-size: 15px; border-color: var(--acc, #ff8a1f); }
body.touch .buyCols { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 2px; }
body.touch .buyCols h3 { margin: 2px 0 4px; font-size: 11px; }
body.touch .items { gap: 5px; }
body.touch .item { padding: 7px 8px; font-size: 14px; }
body.touch .item small { font-size: 10px; }
body.touch .item .k { display: none; }
body.touch #buyMenu .hint { display: none; }
#tBoard { left: 50%; top: 8px; transform: translateX(72px); font-size: 11px; }
#tBoard.on { border-color: #ffd23f; color: #ffd23f; }
body.touch #scoreboard { top: 50px; transform: translateX(-50%); max-height: calc(100vh - 60px); overflow-y: auto; padding: 8px; }
body.touch #scoreboard table { font-size: 13px; }
body.touch #scoreboard td { padding: 3px 6px; }
/* challenges: daily + weekly, with a once-a-day swap */
.daily h4 small { letter-spacing: 0; font-size: 11px; font-weight: 500; }
.daily h4.wk { margin-top: 10px; }
.ch { grid-template-columns: 1fr 90px 52px 26px; }
.ch > span small { display: block; color: var(--dim); font-size: 11px; }
.ch .reroll { width: 24px; height: 24px; padding: 0; border-radius: 3px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); color: var(--ink); font-size: 14px; line-height: 1; }
.ch .reroll:hover { background: rgba(255,255,255,0.15); }
body.touch .ch { font-size: 12px; padding: 2px 0; grid-template-columns: 1fr 60px 44px 26px; gap: 6px; }
/* landscape phones: two-column menu, tighter spacing */
@media (min-width: 600px) and (max-height: 520px) {
  body.touch #menu { padding: 10px 14px; place-items: start center; }
  body.touch .menuGrid { grid-template-columns: 1.15fr 1fr; gap: 14px; }
  body.touch .menuTop { margin-bottom: 4px; }
  body.touch .badge { padding: 3px 10px; }
  body.touch .badge .lv { font-size: 20px; }
  body.touch .badge .bar { width: 110px; }
  body.touch .navBtns button { padding: 5px 10px; font-size: 13px; }
  body.touch .mLeft h1 { font-size: 34px; margin: 2px 0 0; }
  body.touch .mLeft .tag { font-size: 13px; }
  body.touch .opt h4 { margin: 4px 0 3px; }
  body.touch .seg { flex-wrap: wrap; }
  body.touch .seg button { padding: 4px 8px; font-size: 12px; }
  body.touch #modeHint, body.touch .mLeft > .hint { font-size: 11px; margin: 4px 0; }
  body.touch .mRight h3 { margin: 2px 0 6px; }
  body.touch .mRight #agentCards { grid-template-columns: 1fr 1fr; gap: 6px; }
  body.touch .mRight .card { grid-template-columns: 1fr; padding: 5px 8px; }
  body.touch .mRight .card .face { display: none; }
  body.touch .mRight .card .perk { display: none; }
  body.touch .mRight .daily { margin-top: 8px; padding: 6px 10px; }
}
@media (min-width: 600px) and (max-height: 520px) {
  body.touch .deployRow .big { padding: 8px 18px; font-size: 14px; letter-spacing: 2px; }
  body.touch .mRight { padding-bottom: 56px; }
  body.touch .mLeft { padding-bottom: 56px; }
}
/* landscape phones: loadout & skins, online lobby, settings, pause */
@media (min-width: 600px) and (max-height: 520px) {
  body.touch .screen { padding: 10px 14px; }
  body.touch .set-head { margin-bottom: 6px; gap: 10px; }
  body.touch .set-head h2 { font-size: 18px; letter-spacing: 3px; }
  body.touch .set-head .big { padding: 6px 18px; font-size: 14px; }
  body.touch .loTabs { margin: 0 0 6px; }
  body.touch .lo-grid { grid-template-columns: 190px 1fr; gap: 10px; }
  body.touch .lo-list button { padding: 4px 8px; font-size: 13px; }
  body.touch #loPreview { max-height: 130px; width: auto; max-width: 100%; margin: 0 auto; }
  body.touch .lo-name { font-size: 15px; margin: 4px 0; }
  body.touch .lo-skins { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 5px; }
  body.touch #loHint { display: none; }
  body.touch .of-row { margin: 4px 0 2px; }
  body.touch .of-opts button { padding: 3px 7px; font-size: 12px; }
  body.touch .ol-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  body.touch .lb-grid { grid-template-columns: 1.2fr 1fr; gap: 8px; }
  body.touch .ol-grid section, body.touch .lb-grid section { padding: 8px 10px; gap: 5px; }
  body.touch .menuInner.small { gap: 6px; }
  body.touch .menuInner.small h2 { margin: 0; }
  body.touch .menuInner.small .big { padding: 8px 18px; font-size: 15px; }
}
/* landscape phones: results side by side (XP left, scoreboard right), buttons always in reach */
@media (min-width: 600px) and (max-height: 520px) {
  body.touch #over h2, body.touch #pause h2 { font-size: 30px; letter-spacing: 4px; }
  body.touch #over .menuInner { display: grid; grid-template-columns: 1fr 1.5fr; gap: 4px 12px; align-items: start; width: 100%; }
  body.touch #over #overTitle, body.touch #over #overScore, body.touch #over .row { grid-column: 1 / -1; }
  body.touch #over #overScore { margin: 0; }
  body.touch #xpPanel { margin: 0; padding: 6px 10px; }
  body.touch .xp-line { font-size: 12px; padding: 1px 0; }
  body.touch #overBoard { margin: 0; }
  body.touch #overBoard table { font-size: 12px; }
  body.touch #overBoard td, body.touch #overBoard th { padding: 2px 5px; }
  body.touch #over .row { position: sticky; bottom: 0; padding: 6px 0; background: linear-gradient(transparent, rgba(10,12,16,0.95) 40%); justify-content: center; }
  body.touch #over .row .big { padding: 8px 22px; font-size: 15px; }
}
/* phones: no live blur of the 3D view behind panels (re-blurring every frame heats the GPU) */
body.touch .panel, body.touch .screen.dim { backdrop-filter: none; -webkit-backdrop-filter: none; }
body.touch .screen.dim { background: rgba(10, 16, 24, 0.9); }
body.touch .panel { background: rgba(14, 17, 22, 0.94); }
/* weapon levels + attachments (Loadout & Skins) */
.lo-name .wl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; margin: 6px 0 4px; font-size: 13px; letter-spacing: 1px; }
.lo-name .wl b { color: #ffd23f; }
.lo-name .wl .bar { height: 6px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.lo-name .wl .bar i { display: block; height: 100%; background: #ffd23f; }
.lo-name .wl small { grid-column: 1 / -1; color: var(--dim); font-weight: 500; letter-spacing: 0; font-size: 12px; }
.lo-name .att { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 8px; }
.lo-name .att button { text-align: left; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: var(--ink); padding: 5px 8px; border-radius: 3px;
  font-size: 13px; font-weight: 700; letter-spacing: 0; }
.lo-name .att button small { display: block; color: var(--dim); font-size: 11px; font-weight: 500; }
.lo-name .att button.on { border-color: #6effc4; background: rgba(110,255,196,0.08); }
.lo-name .att button.locked { opacity: 0.4; }
.skin.mastery { border-style: dashed; }
body.touch .lo-name .att { grid-template-columns: repeat(2, 1fr); }
/* profile badge is a button that opens the profile */
button.badge { color: var(--ink); font: inherit; cursor: pointer; }
button.badge:hover { border-color: #ffd23f; }
.badge em { font-style: normal; color: var(--dim); font-size: 11px; letter-spacing: 1px; }
/* profile screen */
.pf-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pf-tile { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; padding: 10px 12px; }
.pf-tile b { display: block; font-size: 22px; }
.pf-tile b small { font-size: 12px; color: var(--dim); font-weight: 500; }
.pf-tile span { color: var(--dim); font-size: 12px; letter-spacing: 1px; }
.pf-h { margin: 16px 0 6px; }
.pf-table td, .pf-table th { padding: 4px 8px; }
.pf-table .num { text-align: right; }
.pf-lv { display: flex; align-items: center; gap: 8px; }
.pf-lv b { width: 30px; color: #ffd23f; }
.pf-lv .bar { width: 90px; height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.pf-lv .bar i { display: block; height: 100%; background: #ffd23f; }
@media (max-width: 900px) { .pf-stats { grid-template-columns: repeat(3, 1fr); } }
body.touch .pf-stats { grid-template-columns: repeat(4, 1fr); gap: 5px; }
body.touch .pf-tile { padding: 5px 8px; }
body.touch .pf-tile b { font-size: 16px; }
body.touch .pf-table { font-size: 12px; }
body.touch .pf-table td, body.touch .pf-table th { padding: 2px 5px; }
/* results: match highlights */
#xpPanel .hl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
#xpPanel .hl div { background: rgba(255,255,255,0.05); border-radius: 4px; padding: 5px 8px; }
#xpPanel .hl b { display: block; font-size: 15px; }
#xpPanel .hl b small { color: var(--dim); font-size: 11px; font-weight: 500; }
#xpPanel .hl span { color: var(--dim); font-size: 11px; }
body.touch #xpPanel .hl { grid-template-columns: repeat(3, 1fr); gap: 4px; }
body.touch #xpPanel .hl b { font-size: 12px; }
/* team score: room for 3 digits, your team underlined, your own K/D/A below */
.score { width: auto; min-width: 40px; padding: 0 2px; }
.score.mine { box-shadow: inset 0 -3px 0 currentColor; padding-bottom: 3px; }
.mp-me { margin-top: 5px; font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #e8eaed; white-space: pre; text-align: center; }
.mp-me:empty { display: none; }
body.touch .mp-me { font-size: 14px; }
/* new-version banner */
#updateBar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 12px;
  background: rgba(14,17,22,0.96); border: 1px solid #ffd23f; border-radius: 6px; padding: 8px 10px 8px 16px; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
#updateBar span { color: #ffd23f; }
#updateBar .big { padding: 6px 18px; font-size: 14px; }
#updateBar .ghost { padding: 5px 10px; font-size: 13px; }
#noticeBar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 200; max-width: min(560px, 92vw); background: rgba(14,17,22,0.96);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; padding: 10px 16px; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
#noticeBar b { color: #ffd23f; }
.navBtns .install { border-color: #6effc4; color: #6effc4; }
/* leaderboard */
.lb-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lb-table td, .lb-table th { padding: 5px 10px; }
.lb-table .num { text-align: right; }
.lb-table tr.me td { background: rgba(255,210,63,0.12); }
.lb-table tr.top1 td:first-child { color: #ffd23f; font-weight: 700; }
.lb-table tr.top2 td:first-child { color: #d0d6dc; font-weight: 700; }
.lb-table tr.top3 td:first-child { color: #d08a4a; font-weight: 700; }
.lb-me { margin-top: 10px; font-size: 15px; }
.lb-me b { color: #ffd23f; }
body.touch .lb-table { font-size: 12px; }
body.touch .lb-table td, body.touch .lb-table th { padding: 3px 6px; }
/* killcam */
#killcamTag { position: absolute; top: 14%; left: 50%; transform: translateX(-50%); padding: 6px 16px; background: rgba(160,20,30,0.85); border-radius: 3px;
  font-size: 16px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; animation: kcPulse 1s ease-in-out infinite alternate; }
#killcamTag b { margin-right: 8px; }
@keyframes kcPulse { from { opacity: 1; } to { opacity: 0.75; } }
#deathCard.kc { top: auto; bottom: 4%; transform: translateX(-50%) scale(0.8); transform-origin: bottom center; }
#hud:has(#killcamTag:not([hidden])) { box-shadow: inset 0 0 120px rgba(200,20,40,0.35); }
body.killcam #tStick, body.killcam #tFire, body.killcam #tFire2, body.killcam #tAim, body.killcam #tJump, body.killcam #tCrouch,
body.killcam #tReload, body.killcam #tSwap, body.killcam #abilities, body.killcam #streakBox, body.killcam #vitals, body.killcam #bottomRight { visibility: hidden; }
/* pings */
#pings { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ping { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: -14px 0 0 -40px; width: 80px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #ffd23f; text-shadow: 0 1px 3px #000; }
.ping i { width: 16px; height: 16px; background: #ffd23f; transform: rotate(45deg); box-shadow: 0 0 10px rgba(255,210,63,0.8); border: 2px solid #12161c; }
.ping.enemy { color: #ff4d5e; }
.ping.enemy i { background: #ff4d5e; box-shadow: 0 0 10px rgba(255,77,94,0.8); }
.ping.node i { border-radius: 50%; transform: none; }
.ping.edge { opacity: 0.8; }
@keyframes pingIn { from { opacity: 0; scale: 2; } }
.ping i { animation: pingIn 0.25s ease-out; }
#tPing { left: 50%; top: 8px; transform: translateX(160px); font-size: 11px; border-color: rgba(255,210,63,0.7); color: #ffd23f; }
/* accessibility: palette picker, captions */
.set-col { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.set-col small { color: var(--dim); font-size: 11px; }
.seg.pal { flex-wrap: wrap; }
.seg.pal button { display: inline-flex; align-items: center; gap: 4px; }
.seg.pal i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
#caption { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); max-width: 70vw; padding: 5px 14px; background: rgba(0,0,0,0.75); border-radius: 3px;
  font-size: 18px; font-weight: 600; text-align: center; color: #fff; }
#caption::first-letter { text-transform: uppercase; }
/* What's new */
.newsCard { width: min(560px, 100%); text-align: left; }
.newsCard h2 { margin: 0 0 6px; letter-spacing: 4px; }
.newsCard small { color: #ffd23f; letter-spacing: 3px; }
#newsList { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow-y: auto; margin-bottom: 4px; }
.news-item { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 7px 10px; background: rgba(255,255,255,0.05); border-left: 3px solid #ffd23f; border-radius: 3px; font-size: 14px; }
.news-item b { color: #ffd23f; }
.news-item span { color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 0; color: #ffd23f; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
body.touch .news-item { grid-template-columns: 1fr; gap: 2px; font-size: 12px; padding: 5px 8px; }
body.touch #newsList { max-height: 60vh; }
