/* Spinfall UI: modern esports (owner decision 2026-09-30, notes/art/ui-brief.md).
   Flat solid panels with hard angled cuts and thin keylines, Barlow Condensed
   for every heading, label, button and number, Barlow for body text. Colour
   is information only: cyan for the Stormcallers, the enemy tribe colour
   injected at runtime, gold for rewards, red for danger. */
@font-face { font-family: "Lexend"; src: url("fonts/lexend-500.woff2") format("woff2"); font-weight: 400 600; font-display: block; }
@font-face { font-family: "Lexend"; src: url("fonts/lexend-800.woff2") format("woff2"); font-weight: 700 900; font-display: block; }
/* Barlow and Barlow Condensed (OFL, fonts/OFL-barlow.txt): the esports UI face */
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-800.woff2") format("woff2"); font-weight: 800 900; font-display: block; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-500.woff2") format("woff2"); font-weight: 400 500; font-display: block; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-600.woff2") format("woff2"); font-weight: 600 700; font-display: block; }

:root {
  --bg: #05080d;
  --surface: rgba(11, 17, 25, 0.9);
  --surface-2: rgba(18, 28, 40, 0.94);
  --edge: rgba(170, 215, 245, 0.2);
  --ink: #eef6ff;
  --muted: #8ea6ba;
  --accent: #3fd4ff;
  --reward: #ffc24a;
  --danger: #ff4a3a;
  --enemy: #ff4a3a;
  --good: #5dff9a;
  --font-ui: "Barlow", "Lexend", system-ui, sans-serif;
  --font-display: "Barlow Condensed", "Lexend", system-ui, sans-serif;
  --text-s: 14px;
  --text-m: 16px;
  --text-l: 24px;
  --text-xl: 56px;
  --space: 8px;
  --radius: 4px;
  --cut: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font-ui); user-select: none; -webkit-user-select: none; }
canvas#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2; }
#flashScrim { position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0; background: #fff; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
b { font-weight: 800; }
/* the display face: headings, labels, buttons, tags and every number */
h1, h2, h3, .eyebrow, .lbl, .btn, .tag, .rar, .lvtag, .st, .wslot, .scorebar, .chip-row, .armorName, .records, .stat, .spd, .kf, #banner, .pop,
.rs-title, .rs-count, .lvl, .gold, .route .node, .resolve, .statrow, .seg button, .num, .kbd, .logo, .result-title, .bcell .big, .gun b, .gun .gtags,
.sb-head, .sb-team .tn, .sb-team th, .perkchip, #perkStrip span, .bar-label, #tip, .card .cost, .t-btn { font-family: var(--font-display); }

.kbd { display: inline-block; min-width: 1.7em; padding: 1px 6px; margin: 0 2px; border: 1px solid var(--edge); border-bottom-width: 2px; border-radius: 3px; background: rgba(255,255,255,0.06); font-size: 0.85em; text-align: center; color: var(--ink); }

/* ------------------------------------------------ screens */
.screen { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: calc(var(--space) * 3); }
.screen.show { display: flex; animation: fadeIn 0.28s ease-out; }
.screen.sheet { z-index: 30; background: rgba(2, 6, 10, 0.55); backdrop-filter: blur(4px); }
#pause { z-index: 25; background: rgba(2, 6, 10, 0.5); backdrop-filter: blur(6px) saturate(0.7); }
#loading { background: radial-gradient(ellipse at 50% 60%, #10202e 0%, #04070b 70%); flex-direction: column; gap: calc(var(--space) * 2); }
#results, #draft, #runover, #briefing, #loadout, #aspects, #shop { background: linear-gradient(180deg, rgba(3, 7, 12, 0.35), rgba(3, 7, 12, 0.8)); backdrop-filter: blur(3px); }
#clickToPlay { z-index: 26; background: rgba(2,6,10,0.35); cursor: pointer; }
#unsupported { z-index: 40; background: var(--bg); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
html.rm .screen.show { animation: none; }

.panel {
  position: relative; background: var(--surface); border: 1px solid var(--edge);
  padding: calc(var(--space) * 4); min-width: 380px; max-width: 520px; width: 100%;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  max-height: calc(100vh - 48px); overflow-y: auto;
}
.panel::before { content: ""; position: absolute; left: var(--cut); top: 0; width: 72px; height: 3px; background: var(--accent); }
.panel.wide { max-width: 1080px; }
.panel.small { max-width: 420px; text-align: center; }
h1, h2, h3 { margin: 0 0 calc(var(--space) * 1.5); letter-spacing: 0.03em; text-transform: uppercase; font-weight: 800; line-height: 1.05; }
h2 { font-size: 34px; }
h3 { font-size: 19px; color: var(--accent); }
p { line-height: 1.5; margin: 0 0 var(--space); }
.eyebrow { font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.lbl { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: calc(var(--space) * 2) 0 var(--space); }
.hint { font-size: var(--text-s); color: var(--muted); margin-top: calc(var(--space) * 2); }
.row-end { display: flex; justify-content: flex-end; gap: var(--space); margin-top: calc(var(--space) * 3); }

.logo { font-weight: 800; font-size: 64px; letter-spacing: 0.06em; line-height: 1; color: var(--ink); text-shadow: 0 0 30px rgba(63, 212, 255, 0.35); }
.logo span { color: var(--accent); }
.logo.big { font-size: clamp(76px, 13vw, 180px); letter-spacing: 0.04em; font-style: italic; margin: 0 0 14px; background: linear-gradient(180deg, #ffffff 0%, #bfe9ff 55%, #5fb8e0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 30px rgba(63,212,255,0.35)); }
.logo.big span { background: linear-gradient(180deg, #8ff0ff, #1faee6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loadbar { width: 320px; height: 3px; background: rgba(255,255,255,0.08); }
.loadbar i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); transition: width 0.2s; }

/* title */
#title { justify-content: flex-start; background: linear-gradient(90deg, rgba(2,5,9,0.82) 0%, rgba(2,5,9,0.45) 45%, rgba(2,5,9,0) 75%); }
.title-wrap { max-width: 640px; margin-left: 5vw; }
.lede { font-size: 18px; color: #c9dbe8; max-width: 520px; }
.menu { display: flex; flex-direction: column; gap: var(--space); margin: calc(var(--space) * 3) 0; max-width: 320px; }
.records { display: flex; gap: calc(var(--space) * 4); color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.records b { display: block; font-size: 34px; line-height: 1; color: var(--reward); letter-spacing: 0; }
a.back { position: fixed; left: 20px; bottom: 16px; color: var(--muted); font-size: var(--text-s); text-decoration: none; z-index: 5; }
a.back:hover, a.back:focus-visible { color: var(--accent); }

/* buttons */
.btn {
  font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); background: rgba(255,255,255,0.05); border: 1px solid var(--edge); padding: 11px 22px; min-height: 48px;
  cursor: pointer; text-align: left; position: relative; transition: background 0.12s, border-color 0.12s, transform 0.12s;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn:hover, .btn.focus { background: rgba(238, 246, 255, 0.14); border-color: rgba(238,246,255,0.6); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; background: rgba(238,246,255,0.14); }
/* primary: a solid accent slab with dark type */
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121a; }
.btn.primary:hover, .btn.primary:focus-visible, .btn.primary.focus { background: #8fe7ff; border-color: #8fe7ff; color: #04121a; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ffb3aa; }
.btn.danger.armed { background: rgba(255, 74, 58, 0.3); border-color: var(--danger); color: #fff; }
.row-end .btn { text-align: center; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--space) * 2); margin-top: calc(var(--space) * 2); }
.card {
  background: var(--surface-2); border: 1px solid var(--edge); border-top: 3px solid var(--card-c, rgba(170,215,245,0.35)); padding: calc(var(--space) * 2.5); cursor: pointer; position: relative; min-height: 44px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform 0.15s, border-color 0.15s, background 0.15s; outline: none;
}
.card:hover, .card:focus-visible, .card.sel { border-color: var(--accent); border-top-color: var(--card-c, var(--accent)); background: rgba(30, 48, 66, 0.96); transform: translateY(-4px); }
.card.sel::after { content: "\2713"; position: absolute; top: 10px; right: 14px; color: var(--accent); font-weight: 800; }
.card h3 { margin-bottom: 4px; color: var(--ink); font-size: 22px; }
.card .tag { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.card p { color: #cfdbe6; font-size: 15px; margin-top: var(--space); }
.card .kbadge { position: absolute; top: 10px; right: 12px; }
.statrow { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); margin: 6px 0; text-transform: uppercase; letter-spacing: 0.08em; }
.statrow .sb { height: 5px; background: rgba(255,255,255,0.08); }
.statrow .sb i { display: block; height: 100%; background: var(--accent); }
.perks .card { min-height: 220px; display: flex; flex-direction: column; }
.perks .card .rar { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; }
.perks .card .icon { width: 56px; height: 56px; margin: 12px 0 6px; }
.perks .card.legendary { border-color: rgba(255,194,74,0.6); box-shadow: inset 0 0 40px rgba(255,194,74,0.12); }
.perks .card.rare { border-color: rgba(200,155,255,0.5); }
.perks .card { animation: dealIn 0.45s cubic-bezier(.2,.9,.3,1.2) both; }
.perks .card:nth-child(2) { animation-delay: 0.08s; }
.perks .card:nth-child(3) { animation-delay: 0.16s; }
html.rm .perks .card { animation: none; }
@keyframes dealIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }

/* briefing */
.brief-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.resolve { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.pip { width: 18px; height: 18px; transform: rotate(45deg); border: 1px solid var(--accent); margin: 0 4px; }
.pip.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pip.lost { border-color: #52606c; background: transparent; }
.route { display: flex; gap: 6px; margin: 10px 0 18px; }
.route .node { flex: 1; padding: 8px 10px; border: 1px solid var(--edge); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: rgba(255,255,255,0.02); }
.route .node.won { border-color: rgba(93,255,154,0.5); color: var(--good); }
.route .node.lost { border-color: rgba(255,74,58,0.5); color: #ff9a8a; }
.route .node.cur { border-color: var(--accent); color: var(--ink); background: rgba(63,212,255,0.12); }
.route .node b { display: block; font-size: 16px; color: inherit; }
.brief-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bcell { background: var(--surface-2); border: 1px solid var(--edge); padding: 16px; }
.bcell .lbl { margin-top: 0; }
.bcell .big { font-size: 26px; font-weight: 800; margin-bottom: 6px; text-transform: uppercase; line-height: 1.05; }
.bcell p { font-size: 14px; color: #bccad6; margin: 0; }
.perklist { display: flex; flex-wrap: wrap; gap: 8px; }
.perkchip { padding: 6px 10px; border: 1px solid var(--edge); font-size: 13px; background: rgba(255,255,255,0.03); }
.perkchip .x { color: var(--reward); margin-left: 4px; }

/* results */
.result-title { font-size: 104px; font-weight: 800; font-style: italic; letter-spacing: 0.02em; line-height: 0.95; margin: 0; text-transform: uppercase; }
.result-title.win { color: var(--accent); text-shadow: 0 0 40px rgba(63,212,255,0.5); }
.result-title.loss { color: var(--danger); text-shadow: 0 0 40px rgba(255,74,58,0.4); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 20px 0; }
.stat { background: var(--surface-2); border: 1px solid var(--edge); padding: 12px 14px; }
.stat span { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat b { font-size: 40px; line-height: 1.05; color: var(--reward); font-variant-numeric: tabular-nums; }

/* scoreboard */
#scoreboard { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.sb-panel { background: var(--surface); border: 1px solid var(--edge); padding: 20px; width: min(900px, 94vw); }
.sb-head { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.sb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sb-team table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sb-team th { text-align: right; font-size: 10px; letter-spacing: 0.15em; color: var(--muted); font-weight: 600; padding: 4px 6px; text-transform: uppercase; }
.sb-team th:first-child, .sb-team td:first-child { text-align: left; }
.sb-team td { text-align: right; padding: 5px 6px; border-top: 1px solid rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }
.sb-team .tn { font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.sb-team.ally .tn { color: var(--accent); }
.sb-team.enemy .tn { color: var(--enemy); }
.sb-team tr.me td { color: var(--reward); }
.sb-team tr.dead td { opacity: 0.5; }

/* ------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,0.75), 0 0 10px rgba(0,0,0,0.35); }
.hud-top { position: absolute; top: 14px; left: 18px; right: 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 16px; }
.chip-row { text-shadow: 0 1px 3px rgba(0,0,0,0.9); display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.chip-row b { color: var(--ink); letter-spacing: 0.1em; }
.scorebar { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--edge); clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 100%, 0 100%); }
.scorebar .team { display: flex; align-items: center; gap: 12px; padding: 6px 18px; min-width: 190px; }
.scorebar .team.ally { justify-content: flex-end; border-bottom: 2px solid var(--accent); }
.scorebar .team.enemy { justify-content: flex-start; border-bottom: 2px solid var(--enemy); }
.scorebar .team b { font-size: 42px; font-weight: 800; line-height: 1; }
.scorebar .ally b { color: var(--accent); }
.scorebar .enemy b { color: var(--enemy); }
.scorebar .tname { font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #b8c8d6; }
.scorebar .mid { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 18px; min-width: 130px; background: rgba(0,0,0,0.25); }
.scorebar .mid b { font-size: 32px; font-weight: 800; line-height: 1; }
.scorebar .mid span { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.scorebar .mid b.low { color: var(--danger); }
#objIcons { display: flex; gap: 6px; margin-top: 3px; min-height: 10px; }
#objIcons i { width: 10px; height: 10px; display: block; transform: rotate(45deg); border: 1px solid #aab; }
#objIcons i.a { background: var(--accent); border-color: var(--accent); }
#objIcons i.e { background: var(--enemy); border-color: var(--enemy); }
#objIcons i.warn { animation: blink 0.6s steps(2) infinite; }
#objIcons .gbar { width: 60px; height: 5px; background: rgba(255,255,255,0.1); transform: none; border: 0; }
#objIcons .gbar u { display: block; height: 100%; }
@keyframes blink { 50% { opacity: 0.25; } }
html.rm #objIcons i.warn { animation: none; }
#killfeed { justify-self: end; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kf { background: rgba(8, 14, 22, 0.8); border-right: 3px solid var(--muted); padding: 4px 12px; font-size: 16px; font-weight: 700; letter-spacing: 0.02em; animation: slideIn 0.2s ease-out; white-space: nowrap; }
.kf .a { color: var(--accent); font-weight: 600; }
.kf .e { color: var(--enemy); font-weight: 600; }
.kf .w { color: var(--muted); margin: 0 7px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.kf.me { border-right-color: var(--reward); background: rgba(40, 30, 6, 0.6); }
.kf .ma { color: var(--reward); font-size: 10px; letter-spacing: 0.14em; margin-left: 6px; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

#banner { position: absolute; top: 108px; left: 50%; transform: translateX(-50%); font-size: 34px; font-weight: 800; font-style: italic; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; opacity: 0; transition: opacity 0.25s; text-shadow: 0 2px 12px rgba(0,0,0,0.8); white-space: nowrap; }
#banner.show { opacity: 1; }
#banner.good { color: var(--accent); }
#banner.bad { color: var(--enemy); }
#banner small { display: block; font-size: 15px; font-style: normal; letter-spacing: 0.08em; color: var(--ink); opacity: 0.85; margin-top: 2px; font-weight: 600; }
#tip { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); max-width: 560px; padding: 10px 18px; background: rgba(6, 14, 22, 0.78); border: 1px solid var(--accent); border-left-width: 4px; font-size: 16px; letter-spacing: 0.02em; animation: tipIn 0.35s ease-out; white-space: nowrap; }
#tip .kbd { font-size: 0.9em; }
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
html.rm #tip { animation: none; }
#popups { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pop { font-weight: 800; font-style: italic; letter-spacing: 0.06em; font-size: 30px; color: var(--reward); text-shadow: 0 0 16px rgba(255,194,74,0.6); animation: popUp 1.3s ease-out forwards; }
.pop.small { font-size: 18px; font-style: normal; color: var(--ink); text-shadow: 0 1px 3px #000; }
@keyframes popUp { 0% { opacity: 0; transform: scale(1.4); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
html.rm .pop { animation: popFade 1.3s linear forwards; }
@keyframes popFade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

#respawn { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); text-align: center; background: rgba(4, 8, 12, 0.6); padding: 16px 28px; border: 1px solid var(--edge); }
.rs-title { font-size: 34px; font-weight: 800; font-style: italic; letter-spacing: 0.04em; text-transform: uppercase; color: var(--danger); }
#rsBy { color: var(--muted); margin: 6px 0; }
.rs-count b { color: var(--ink); font-size: 30px; }
#oob { position: absolute; top: 42%; left: 50%; transform: translateX(-50%); color: var(--danger); font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; animation: blink 0.8s steps(2) infinite; }

.hud-bottom { position: absolute; left: 22px; right: 22px; bottom: 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 18px; }
.vitals { display: flex; flex-direction: column; gap: 6px; max-width: 340px; }
.armorName { font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #b8c8d6; }
.bar { position: relative; height: 22px; background: rgba(4, 10, 16, 0.6); border: 1px solid var(--edge); clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left; transition: width 0.12s linear; background-image: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0,0,0,0.35) 9px 11px); }
.bar.hp i { background-color: #5dff9a; box-shadow: 0 0 14px rgba(93,255,154,0.5); }
.bar.hp.low i { background-color: #ff5a4a; }
.bar.en i { background-color: #58c8ff; box-shadow: 0 0 14px rgba(88,200,255,0.5); }
.bar.en.low i { background-color: #8a9aaa; }
.bar-label { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 18px; font-weight: 800; text-shadow: 0 1px 2px #000; letter-spacing: 0.02em; }
.bar-label .glyph { opacity: 0.8; font-size: 11px; }
.speedo { text-align: center; min-width: 220px; }
.spd b { font-size: 62px; font-weight: 800; font-style: italic; letter-spacing: 0; line-height: 1; text-shadow: 0 0 20px rgba(63,212,255,0.35); }
.spd span { font-size: 15px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); margin-left: 6px; text-transform: uppercase; }
.spd.slow b { color: #b9cad8; text-shadow: none; }
.spd.fast b { color: var(--reward); text-shadow: 0 0 22px rgba(255,194,74,0.5); }
.spd.hot b { color: #ff7a4a; text-shadow: 0 0 24px rgba(255,110,60,0.6); }
.spdbar { height: 3px; background: rgba(255,255,255,0.1); margin: 2px 20px 6px; }
.spdbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--reward)); }
.states { display: flex; justify-content: center; gap: 6px; }
.st { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; padding: 2px 9px; border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.25); }
.st.on { color: #04121a; background: var(--accent); border-color: var(--accent); }
#stJet.on { background: #ffb347; border-color: #ffb347; }
#stAir.on { background: #e9f4ff; border-color: #e9f4ff; }
.weapons { justify-self: end; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.wslot { position: relative; display: flex; gap: 10px; align-items: center; padding: 6px 14px; min-width: 220px; background: rgba(8,14,22,0.72); border: 1px solid rgba(255,255,255,0.08); color: var(--muted); font-size: 17px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; overflow: hidden; }
.wslot .k { font-size: 14px; opacity: 0.7; }
.wslot.on { color: var(--ink); border-color: var(--accent); background: rgba(63,212,255,0.12); }
.wslot .cd { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); }
#perkStrip { position: absolute; left: 18px; top: 74px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 260px; }
#perkStrip span { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border: 1px solid rgba(255,255,255,0.12); color: var(--muted); background: rgba(4,10,16,0.45); }

#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--surface-2); border: 1px solid var(--edge); padding: 8px 16px; font-size: 14px; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
#toast.show { opacity: 1; }

/* settings */
.set-grid { display: grid; gap: 14px; }
.set-row { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: 12px; font-size: 16px; }
.set-row label { color: var(--muted); letter-spacing: 0.06em; }
.set-row output { text-align: right; font-variant-numeric: tabular-nums; color: var(--reward); }
.set-row input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.seg { display: flex; gap: 4px; }
.seg button { flex: 1; font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 8px; min-height: 36px; background: rgba(255,255,255,0.04); border: 1px solid var(--edge); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: #04121a; border-color: var(--accent); }
.seg button:focus-visible { outline: 2px solid var(--accent); }
.toggle { position: relative; width: 52px; height: 28px; border-radius: 14px; background: rgba(255,255,255,0.1); border: 1px solid var(--edge); cursor: pointer; padding: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #8ea6ba; transition: left 0.15s; }
.toggle.on { background: rgba(63,212,255,0.35); }
.toggle.on::after { left: 27px; background: #fff; }
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.help-grid p { font-size: 14px; color: #c7d6e2; }

@media (max-width: 900px) {
  .cards, .brief-grid, .help-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .scorebar .team { min-width: 130px; }
}

/* ------------------------------------------------ Rift Lanes */
.btn .new { font-size: 13px; letter-spacing: 0.08em; color: var(--reward); margin-left: 8px; border: 1px solid rgba(255,194,74,0.5); padding: 1px 5px; vertical-align: middle; }
.midbox { display: flex; flex-direction: column; align-items: center; }
#hud.lanes .speedo { display: none; }
#hud:not(.lanes):not(.holdout) .lvlbox { display: none; }
/* Holdout: level + XP and a hostile count; no gold, shop or draft keys */
#hud.holdout .speedo { display: none; }
#hud.holdout .lvlbox .gold, #hud.holdout #riftRow, #hud.holdout #draftHint, #hud.holdout #shopHint { display: none !important; }
#hud.holdout #objIcons { display: none; }
.cart.gunart img { object-fit: contain; padding: 14px 40px; }
.lvlbox { text-align: center; min-width: 260px; }
.lvlrow { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 0 4px; }
.lvl { font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lvl b { font-size: 44px; font-weight: 800; font-style: italic; line-height: 1; color: var(--ink); letter-spacing: 0; margin-left: 4px; }
.gold { position: relative; font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.gold b { font-size: 32px; font-weight: 800; color: var(--reward); letter-spacing: 0; margin-right: 4px; }
#goldGain { position: absolute; right: 0; top: -18px; font-style: normal; font-size: 16px; font-weight: 800; color: var(--reward); opacity: 0; transition: opacity 0.3s; }
#goldGain.show { opacity: 1; transition: none; }
.xpbar { height: 5px; background: rgba(255,255,255,0.1); margin: 4px 0 7px; border: 1px solid rgba(255,255,255,0.08); }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b58cff, #e3c7ff); box-shadow: 0 0 10px rgba(181,140,255,0.6); transition: width 0.2s; }
.st.hot { color: #04121a; background: var(--reward); border-color: var(--reward); animation: blink 0.9s steps(2) infinite; }
html.rm .st.hot { animation: none; }
.lanepip { display: flex; align-items: center; gap: 3px; margin: 0 4px; }
.lanepip b { font-size: 13px; letter-spacing: 0.06em; color: var(--muted); margin-right: 2px; font-weight: 600; }
#objIcons .lanepip i { width: 7px; height: 7px; }
#objIcons .lanepip i.dead { background: transparent; opacity: 0.35; }
.shopcards { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.shopcards .card { padding: 12px 14px; min-height: 0; }
.shopcards .card { border-top: 1px solid var(--edge); border-left: 3px solid var(--card-c, var(--reward)); }
.shopcards .card h3 { font-size: 19px; }
.shopcards .card p { font-size: 14px; margin-top: 4px; }
.shopcards .card .cost { color: var(--reward); font-weight: 800; font-size: 17px; letter-spacing: 0.04em; }
.shopcards .card.owned { border-color: rgba(93,255,154,0.6); }
.shopcards .card.owned .cost { color: #5dff9a; }
.shopcards .card.cant { opacity: 0.45; }
.aspect-card .swatch { height: 4px; margin: -2px 0 10px; }
.card .lvtag { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--reward); margin-top: auto; padding-top: 10px; }
.card.evo { border-color: rgba(255,194,74,0.7); box-shadow: inset 0 0 40px rgba(255,194,74,0.14); }
@media (max-width: 900px) { .shopcards { grid-template-columns: repeat(2, 1fr); } }
#shop .panel { max-height: calc(100vh - 32px); overflow: auto; }
.diffrow { max-width: 520px; margin-top: calc(var(--space) * 2); }
.wslot.low { color: #ff7a6a; }

/* gun kit picker */
.guns { margin-top: calc(var(--space) * 2); }
.gunhead { display: flex; gap: 12px; align-items: baseline; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.gunhead .muted { font-family: var(--font-ui); }
.gunhead .muted { text-transform: none; letter-spacing: 0; font-size: 13px; }
.gunrow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.gun { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px 10px 12px; background: rgba(4,10,16,0.55); border: 1px solid rgba(255,255,255,0.1); color: #c7d6e2; font: inherit; cursor: pointer; min-height: 118px; }
.gun b { color: var(--ink); font-size: 18px; font-weight: 800; text-transform: uppercase; line-height: 1.05; padding-right: 22px; }
.gun .gtags { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gun .gblurb { font-size: 12px; line-height: 1.3; }
.gun:hover, .gun:focus-visible { border-color: rgba(63,212,255,0.6); outline: none; }
.gun.sel { border-color: var(--accent); background: rgba(63,212,255,0.14); box-shadow: inset 0 3px 0 var(--accent); }
.gun .slot { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; background: var(--accent); color: #041018; font-family: var(--font-display); font-size: 15px; font-weight: 800; display: grid; place-items: center; clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 1250px) { .gunrow { grid-template-columns: repeat(4, minmax(0, 1fr)); } .gun .gblurb { display: none; } .gun { min-height: 0; } }

/* laser rifle scope */
#scope { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.12s; z-index: 4;
  background: radial-gradient(circle at 50% 50%, transparent 0 34vh, rgba(0,0,0,0.92) 34.4vh),
    linear-gradient(rgba(233,250,255,0.55), rgba(233,250,255,0.55)) 50% 50% / 1px 60vh no-repeat,
    linear-gradient(90deg, rgba(233,250,255,0.55), rgba(233,250,255,0.55)) 50% 50% / 60vh 1px no-repeat; }
#scope.on { opacity: 1; }
@media (max-height: 820px) { .gun .gblurb { display: none; } .gun { min-height: 0; } }

/* loadout icons (assets/icons/icons.js); cards stay text-only without them */
.gun .gicon { width: 56px; height: 56px; object-fit: contain; margin: -2px 0 2px -2px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.card .cicon { float: right; width: 72px; height: 72px; object-fit: contain; margin: 0 0 6px 10px; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5)); }
.wslot .wicon { width: 26px; height: 26px; object-fit: contain; margin: -4px 0; }
@media (max-height: 820px) { .gun .gicon { position: absolute; right: 6px; bottom: 6px; width: 34px; height: 34px; margin: 0; } .gun { padding-bottom: 12px; } .gun .gtags { padding-right: 34px; } .card .cicon { width: 56px; height: 56px; } }

/* ============================ touch (iPad, iPhone; landscape) */
.touch-help { display: none; }
html.touch .touch-help { display: block; }
html.touch, html.touch body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
html.touch canvas { touch-action: none; }
#touch { position: fixed; inset: 0; z-index: 9; touch-action: none; --tscale: 1; --topacity: 0.55; --ts: calc(var(--tscale) * 1); }
#touch.hidden { display: none; }
#touch .t-stick { position: absolute; left: 0; top: 0; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%; border: 2px solid rgba(233,244,255,0.35); background: rgba(4,10,16,0.25); opacity: 0; pointer-events: none; transition: opacity 0.12s; }
#touch .t-stick.on { opacity: 1; }
#touch .t-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(63,212,255,0.55); box-shadow: 0 0 14px rgba(63,212,255,0.6); }
#touch .t-btn { position: absolute; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(233,244,255,0.5); background: rgba(4,10,16,0.45); color: var(--ink); font: 700 calc(12px * var(--ts)) Lexend, system-ui, sans-serif; letter-spacing: 0.08em; opacity: var(--topacity); touch-action: none; padding: 0; }
#touch .t-btn.on { background: rgba(63,212,255,0.45); border-color: var(--accent); opacity: 1; }
#touch .t-btn.hidden { display: none; }
#touch .t-cluster { position: absolute; right: calc(env(safe-area-inset-right) + 10px); bottom: calc(env(safe-area-inset-bottom) + 10px); width: calc(290px * var(--ts)); height: calc(250px * var(--ts)); pointer-events: none; }
#touch .t-cluster .t-btn { pointer-events: auto; }
#touch .t-fire { right: calc(14px * var(--ts)); bottom: calc(26px * var(--ts)); width: calc(96px * var(--ts)); height: calc(96px * var(--ts)); border-color: rgba(255,120,90,0.8); font-size: calc(14px * var(--ts)); }
#touch.simple .t-fire { width: calc(74px * var(--ts)); height: calc(74px * var(--ts)); right: calc(24px * var(--ts)); bottom: calc(36px * var(--ts)); }
#touch .t-jet { right: calc(124px * var(--ts)); bottom: calc(8px * var(--ts)); width: calc(84px * var(--ts)); height: calc(84px * var(--ts)); border-color: rgba(120,200,255,0.8); }
#touch .t-jump { right: calc(30px * var(--ts)); bottom: calc(140px * var(--ts)); width: calc(64px * var(--ts)); height: calc(64px * var(--ts)); }
#touch .t-ski { right: calc(130px * var(--ts)); bottom: calc(112px * var(--ts)); width: calc(56px * var(--ts)); height: calc(56px * var(--ts)); border-color: rgba(125,255,154,0.8); color: #bfffcf; }
#touch .t-ski.off { border-color: rgba(233,244,255,0.35); color: var(--muted); text-decoration: line-through; }
#touch .t-zoom { right: calc(210px * var(--ts)); bottom: calc(92px * var(--ts)); width: calc(60px * var(--ts)); height: calc(60px * var(--ts)); }
#touch .t-pause { left: calc(env(safe-area-inset-left) + 12px); top: calc(env(safe-area-inset-top) + 10px); width: 44px; height: 44px; border-radius: 10px; font-size: 13px; }
#touch .t-lanes { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 104px); transform: translateX(-50%); display: flex; gap: 10px; }
#touch .t-lanes .t-btn { position: static; width: auto; height: 44px; padding: 0 16px; border-radius: 10px; opacity: 0.9; border-color: var(--reward); color: var(--reward); }
#touch .t-lanes .t-shop { border-color: var(--accent); color: var(--accent); }

/* HUD on touch: safe areas, tappable weapon column on the right edge */
html.touch #hud .hud-top { top: calc(env(safe-area-inset-top) + 10px); left: calc(env(safe-area-inset-left) + 66px); right: calc(env(safe-area-inset-right) + 14px); }
html.touch #hud .hud-bottom { left: calc(env(safe-area-inset-left) + 16px); right: calc(env(safe-area-inset-right) + 16px); bottom: calc(env(safe-area-inset-bottom) + 12px); grid-template-columns: 1fr auto 1fr; }
html.touch #hud .weapons { position: fixed; right: calc(env(safe-area-inset-right) + 10px); top: 30%; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
html.touch #hud .wslot { min-width: 0; width: auto; min-height: 44px; padding: 4px 10px; pointer-events: auto; }
html.touch #hud .wslot .wn { display: none; }
html.touch #hud .wslot .wicon { width: 34px; height: 34px; }
html.touch #hud .scorebar { pointer-events: auto; }
html.touch #clickToPlay { display: none !important; }
html.touch .kbd { display: none; }

/* phones in landscape: compact HUD */
@media (max-height: 500px) {
  html.touch #hud .scorebar .team { min-width: 0; padding: 3px 10px; gap: 6px; }
  html.touch #hud .scorebar .team b { font-size: 20px; }
  html.touch #hud .scorebar .tname { display: none; }
  html.touch #hud .scorebar .mid { min-width: 70px; padding: 2px 10px; }
  html.touch #hud .scorebar .mid b { font-size: 16px; }
  html.touch #hud #killfeed, html.touch #hud #sectorTag, html.touch #perkStrip { display: none; }
  html.touch #hud .vitals { max-width: 200px; gap: 3px; }
  html.touch #hud .armorName { display: none; }
  html.touch #hud .weapons { top: 22%; gap: 4px; }
  html.touch #hud .wslot { min-height: 40px; padding: 2px 8px; }
  #touch { --ts: calc(var(--tscale) * 0.8); }
}

/* menus scroll on short screens instead of clipping */
html.touch .screen { align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: calc(env(safe-area-inset-top) + 16px); padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
html.touch .screen > .panel { margin: auto; }
html.touch .btn { min-height: 44px; }

/* landscape only on touch devices */
#rotate { display: none; position: fixed; inset: 0; z-index: 60; background: var(--bg); color: var(--ink); align-items: center; justify-content: center; text-align: center; }
#rotate.show { display: flex; }
#rotate > div { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 24px; }
#rotate b { font-size: 22px; letter-spacing: 0.06em; }
#rotate span { color: var(--muted); }
#rotate .rot-icon { width: 46px; height: 76px; border: 3px solid var(--accent); border-radius: 9px; animation: spf-rot 1.8s ease-in-out infinite; }
@keyframes spf-rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
html.touch .desk-only { display: none; }
/* phones: compact menus, the main action always in reach */
@media (max-height: 500px) {
  html.touch .logo.big { font-size: 52px; margin: 0 0 8px; }
  html.touch .title-wrap .lede, html.touch .title-wrap .hint, html.touch .title-wrap .records { display: none; }
  html.touch .title-wrap .menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 520px; }
  html.touch a.back { position: static; display: inline-block; margin-top: 8px; }
  html.touch #title { flex-direction: column; justify-content: center; }
  html.touch .panel { padding: 16px 18px; }
  html.touch .panel h2 { font-size: 20px; margin-bottom: 8px; }
  html.touch .row-end { position: sticky; bottom: 0; margin-top: 12px; padding: 8px 0 0; background: linear-gradient(transparent, var(--surface) 30%); z-index: 2; }
}
#touch.lanes .t-ski { display: none; }
.sound-credits p { font-size: 13px; color: var(--muted); }

/* Rift Lanes: Wyrm timer and buff chips above the level bar */
.riftrow { display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; margin-bottom: 5px; }
.riftrow:empty { display: none; }
.riftrow .chip { font: 700 12px/1 "Barlow Condensed", Lexend, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 8px 3px; background: rgba(8, 14, 22, 0.82); border-left: 3px solid var(--c, var(--accent)); color: var(--ink); white-space: nowrap; }
.riftrow .chip b { color: var(--c, var(--accent)); font-weight: 800; margin-left: 4px; font-variant-numeric: tabular-nums; }
.riftrow .chip.up { animation: chipPulse 1.2s ease-in-out infinite; }
@keyframes chipPulse { 50% { background: rgba(80, 40, 130, 0.85); } }

/* a curse card's catch */
.card p.curse { color: var(--danger); font-weight: 600; margin-top: 4px; }
.card p.curse::before { content: "Catch: "; text-transform: uppercase; font-size: 0.8em; letter-spacing: 0.08em; }

/* phones in landscape: the esports type scale, one step down */
@media (max-height: 500px) {
  #banner { font-size: 22px; top: 64px; }
  #banner small { font-size: 12px; }
  .spd b { font-size: 42px; }
  .lvl b { font-size: 30px; }
  .gold b { font-size: 22px; }
  .scorebar .team b { font-size: 28px; }
  .scorebar .mid b { font-size: 22px; }
  .pop { font-size: 22px; }
  .result-title { font-size: 64px; }
  .logo.big { font-size: clamp(56px, 11vw, 96px); }
  h2 { font-size: 26px; }
}

/* ------------------------------------------------ phones (touch, landscape, short)
   Owner feedback 2026-09-30 (iPhone 13): menus stacked into long lists with the
   buttons fading over the text, and the HUD piled up at the top. Phones keep
   three-across cards, compact type, and a solid footer bar for the buttons. */
@media (max-height: 500px) {
  html.touch .screen { padding: calc(env(safe-area-inset-top) + 6px) calc(env(safe-area-inset-right) + 8px) calc(env(safe-area-inset-bottom) + 6px) calc(env(safe-area-inset-left) + 8px); align-items: center; }
  html.touch .screen > .panel, html.touch .panel, html.touch .panel.wide { max-width: none; width: 100%; min-width: 0; max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px); padding: 12px 16px 0; --cut: 10px; }
  html.touch .panel.small { max-width: 460px; }
  html.touch .panel .eyebrow { font-size: 12px; margin-bottom: 0; }
  html.touch .panel h2 { font-size: 24px; margin-bottom: 6px; }
  html.touch .panel p, html.touch .hint { font-size: 13px; line-height: 1.35; }
  html.touch .lbl { font-size: 12px; margin: 8px 0 4px; }
  /* the buttons live in their own solid bar at the bottom of the panel */
  html.touch .row-end { position: sticky; bottom: 0; z-index: 3; margin: 10px -16px 0; padding: 8px 16px 10px; background: #0e1620; border-top: 1px solid var(--edge); }
  html.touch .row-end .btn, html.touch .btn { min-height: 40px; padding: 8px 18px; font-size: 17px; }
  /* cards stay three across */
  html.touch .cards, html.touch .brief-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
  html.touch .card { padding: 10px 11px; border-top-width: 3px; }
  html.touch .card h3 { font-size: 17px; margin-bottom: 2px; }
  html.touch .card .tag, html.touch .card .rar, html.touch .card .lvtag { font-size: 11px; }
  html.touch .card p { font-size: 12.5px; line-height: 1.3; margin-top: 4px; }
  html.touch .card .cicon { width: 44px; height: 44px; margin: 0 0 2px 6px; }
  html.touch .statrow { grid-template-columns: 54px 1fr; font-size: 11px; margin: 2px 0; }
  html.touch .statrow .sb { height: 4px; }
  html.touch .perks .card { min-height: 0; }
  html.touch .perks .card .icon { width: 30px; height: 30px; margin: 4px 0 2px; }
  html.touch .card .kbadge { display: none; }
  html.touch .shopcards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  html.touch .shopcards .card { padding: 7px 9px; }
  html.touch .shopcards .card h3 { font-size: 15px; }
  html.touch .shopcards .card p { font-size: 11.5px; }
  html.touch .shopcards .card .cost { font-size: 14px; }
  /* gun kit: seven compact tiles in one row */
  html.touch .gunrow { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
  html.touch .gun { padding: 6px 6px 7px; min-height: 0; }
  html.touch .gun b { font-size: 13px; padding-right: 16px; }
  html.touch .gun .gtags, html.touch .gun .gblurb { display: none; }
  html.touch .gun .gicon { width: 38px; height: 38px; margin: 0; }
  html.touch .gun .slot { width: 17px; height: 17px; font-size: 12px; top: 5px; right: 5px; }
  html.touch .gunhead .muted { display: none; }
  /* briefing and results */
  html.touch .bcell { padding: 9px 10px; }
  html.touch .bcell .big { font-size: 18px; }
  html.touch .bcell p { font-size: 12px; }
  html.touch .route { margin: 6px 0 8px; }
  html.touch .route .node { padding: 5px 7px; font-size: 11px; }
  html.touch .route .node b { font-size: 13px; }
  html.touch .result-title { font-size: 52px; }
  html.touch .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
  html.touch .stat { padding: 7px 9px; }
  html.touch .stat span { font-size: 11px; }
  html.touch .stat b { font-size: 26px; }
  html.touch .set-row { grid-template-columns: 120px 1fr 48px; font-size: 14px; }
  html.touch .help-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  html.touch .help-grid p { font-size: 12.5px; }
  /* HUD: banner below the compass, lane buttons above the level box, no
     keyboard hints, guns clear of the minimap */
  html.touch #banner { top: 86px; font-size: 22px; }
  html.touch #banner small { font-size: 12px; }
  html.touch #touch .t-lanes { top: auto; bottom: calc(env(safe-area-inset-bottom) + 88px); }
  html.touch #touch .t-lanes .t-btn { height: 38px; font-size: 14px; }
  html.touch #draftHint, html.touch #shopHint { display: none !important; }
  html.touch #hud .speedo .states { display: none; }
  html.touch #hud .midbox .spd b { font-size: 40px; }
  html.touch #hud .lvlbox { min-width: 200px; }
  html.touch #hud .lvl b { font-size: 30px; }
  html.touch #hud .gold b { font-size: 22px; }
  html.touch #hud .riftrow .chip { font-size: 11px; padding: 3px 6px 2px; }
  html.touch #hud .scorebar .mid span { font-size: 10px; }
  html.touch #tip { bottom: 110px; font-size: 13px; white-space: normal; max-width: 60vw; }
  html.touch #respawn { top: 28%; padding: 10px 18px; }
  html.touch .rs-title { font-size: 24px; }
  html.touch #popups { top: 62%; }
}

/* ------------------------------------------------ Codex UI art (notes/art/ui-brief.md)
   Mockups: notes/art/ui-mockups/. Only painted art ships as images; frames,
   type and bars stay CSS. */
.logo.big { font-style: normal; font-weight: 800; letter-spacing: 0.02em; }
/* draft: "choose 1 of 3" over the battle, cards with painted family art */
#draft .panel { background: transparent; border-color: transparent; box-shadow: none; clip-path: none; max-width: 1040px; }
#draft .panel::before { display: none; }
#draft .eyebrow, #draft h2.drafth, #draft .hint { text-align: center; }
#draft h2.drafth { display: flex; align-items: center; gap: 18px; font-size: 40px; letter-spacing: 0.06em; }
#draft h2.drafth::before, #draft h2.drafth::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--edge)); }
#draft h2.drafth::after { background: linear-gradient(90deg, var(--edge), transparent); }
.perks .card { padding-top: 0; overflow: hidden; }
.card .cart { margin: 0 calc(var(--space) * -2.5) 10px; height: 150px; overflow: hidden; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--card-c, #3fd4ff) 22%, #0b1119), #0b1119 70%); border-bottom: 1px solid var(--edge); }
.card .cart img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 0.25s; }
.card:hover .cart img, .card:focus-visible .cart img { transform: scale(1.05); }
.perks .card .kbadge { top: 160px; }
/* briefing: the mode banner on the right of the header, fading left */
.brief .bbanner { position: absolute; top: 0; right: 0; width: 62%; height: 190px; background: right center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%), linear-gradient(180deg, #000 60%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0%, #000 45%), linear-gradient(180deg, #000 60%, transparent); mask-composite: intersect; pointer-events: none; opacity: 0.95; }
.brief .brief-top, .brief .route, .brief .brief-grid, .brief .lbl, .brief .perklist, .brief .row-end, .brief .hint { position: relative; z-index: 1; }
.brief .bbanner:not(.hidden) ~ .brief-top { min-height: 118px; }
.brief .bbanner:not(.hidden) ~ .brief-top .resolve { background: rgba(8, 14, 22, 0.7); padding: 4px 8px; }
/* Rift chips: painted portraits */
.riftrow .chip { display: inline-flex; align-items: center; gap: 5px; }
.riftrow .chip img.cp { width: 22px; height: 22px; margin: -5px 0 -5px -4px; object-fit: contain; }
/* results: centred like the mockup, with the score line and MVP */
#results .panel { text-align: center; }
#results .row-end { justify-content: center; }
#results .sb-cols { text-align: left; }
.rscore { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 4px; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; }
.rscore span { font-size: 17px; letter-spacing: 0.1em; }
.rscore b { font-size: 44px; line-height: 1; }
.rscore i { width: 28px; height: 2px; background: var(--muted); }
.rscore .a { color: var(--accent); }
.rscore .e { color: var(--enemy); }
/* Codex UI art round 2 (notes/art/ui-brief-2.md) */
.rscore .remb { width: 46px; height: 46px; }
.scorebar .tname { display: inline-flex; align-items: center; gap: 6px; }
.scorebar .temb { width: 24px; height: 24px; }
.bcell .big { display: flex; align-items: center; gap: 10px; }
.bcell .temb, .bcell .bbadge { width: 42px; height: 42px; flex: none; }
#shopCards .card .iicon { float: right; width: 58px; height: 58px; margin: -4px -6px 0 8px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
#shopCards .card.cant .iicon { filter: grayscale(0.7) brightness(0.7); }
#perkStrip span { display: inline-flex; align-items: center; gap: 5px; }
#perkStrip .sicon { width: 18px; height: 18px; margin: -2px 0; }
.kf .w { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.kf .kg { width: 18px; height: 18px; }
/* painted key art: the loading screen and the final run victory */
#loading { background: linear-gradient(90deg, rgba(4, 7, 11, 0.88) 0%, rgba(4, 7, 11, 0.55) 45%, rgba(4, 7, 11, 0.15) 100%), url("assets/icons/keyart/loading.webp") center / cover no-repeat, #04070b; }
/* the key art keeps its left third calm for the logo */
#loading { align-items: flex-start; padding-left: max(8vw, calc(env(safe-area-inset-left) + 24px)); }
#loading .logo { text-shadow: 0 4px 24px rgba(0, 0, 0, 0.8); }
/* iPad: the upgrade and item list sits under the minimap, not on it */
html.touch #perkStrip { top: calc(env(safe-area-inset-top) + 272px); left: calc(env(safe-area-inset-left) + 14px); }
#runover.won { background: linear-gradient(180deg, rgba(3, 7, 12, 0.25), rgba(3, 7, 12, 0.85) 75%), url("assets/icons/keyart/victory.webp") center 30% / cover no-repeat, #04070b; }
.mvp { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: -6px 0 12px; }
.mvp b { color: var(--reward); }
/* shop: tier colour strips */
@media (max-height: 500px) {
  html.touch .card .cart { height: 82px; margin: 0 -11px 6px; }
  html.touch .perks .card .kbadge { display: none; }
  html.touch #draft h2.drafth { font-size: 24px; }
  html.touch .brief .bbanner { height: 120px; width: 55%; }
  html.touch .brief .bbanner:not(.hidden) ~ .brief-top { min-height: 70px; }
  html.touch .rscore b { font-size: 30px; }
  html.touch .rscore span { font-size: 13px; }
  html.touch .rscore .remb { width: 30px; height: 30px; }
  html.touch .bcell .temb, html.touch .bcell .bbadge { width: 28px; height: 28px; }
  html.touch #shopCards .card .iicon { width: 40px; height: 40px; }
  html.touch .mvp { font-size: 13px; margin: -2px 0 6px; }
}
/* touch has UPGRADE and SHOP buttons: no keyboard hints on any touch screen */
html.touch #draftHint, html.touch #shopHint { display: none !important; }
