@font-face { font-family: "Saira Condensed"; src: url(../assets/fonts/saira-condensed-latin-700-normal.woff2?v=eb1cf59a1f) format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Saira Condensed"; src: url(../assets/fonts/saira-condensed-latin-800-normal.woff2?v=5afa98eefc) format("woff2"); font-weight: 800; font-display: block; }
@font-face { font-family: "Saira Condensed"; src: url(../assets/fonts/saira-condensed-latin-900-normal.woff2?v=28e7f85ac4) format("woff2"); font-weight: 900; font-display: block; }
@font-face { font-family: "Chakra Petch"; src: url(../assets/fonts/chakra-petch-latin-500-normal.woff2?v=36ad966cb6) format("woff2"); font-weight: 500; font-display: block; }
@font-face { font-family: "Chakra Petch"; src: url(../assets/fonts/chakra-petch-latin-600-normal.woff2?v=a5888696e9) format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Chakra Petch"; src: url(../assets/fonts/chakra-petch-latin-700-normal.woff2?v=ce5095dc1c) format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Barlow"; src: url(../assets/fonts/barlow-latin-400-normal.woff2?v=b0a8ad37ac) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Barlow"; src: url(../assets/fonts/barlow-latin-600-normal.woff2?v=4b52ddd483) format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Barlow"; src: url(../assets/fonts/barlow-latin-700-normal.woff2?v=2d797dd8b3) format("woff2"); font-weight: 700; font-display: block; }

:root {
  --bg: #0E1318; --bg2: #11171E; --panel: #1B2129; --panel2: #232B34; --steel: #2C3742;
  --blue: #2BB8F0; --blue-deep: #1689C2; --orange: #FF7A1A; --amber: #FFC400; --gold: #E8B23A;
  --ink: #E8EEF3; --ink-dim: #9FB0BD; --ink-faint: #6C7B88; --line: #34414D;
  --red: #ff3b30; --blue-c: #3a76ff; --green: #2fc46d;
  --display: "Saira Condensed", "Arial Narrow", sans-serif; --tech: "Chakra Petch", monospace; --body: "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--ink); font-family: var(--body); cursor: none; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

#boot { position: fixed; inset: 0; z-index: 50; background: radial-gradient(ellipse at 50% 40%, #16202a 0%, #0E1318 60%, #07090c 100%); display: grid; place-items: center; transition: opacity .8s; }
#boot.hide { opacity: 0; pointer-events: none; }
.boot-inner { width: min(560px, 80vw); text-align: center; }
.boot-title { font: 900 72px/1 var(--display); letter-spacing: .02em; color: var(--ink); }
.boot-title span { color: var(--blue); }
.boot-bar { height: 6px; background: var(--panel2); margin: 26px 0 12px; border-radius: 3px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 5%; background: linear-gradient(90deg, var(--blue), var(--orange)); transition: width .4s; }
#boot-msg { font: 600 15px var(--tech); color: var(--ink-dim); letter-spacing: .08em; text-transform: uppercase; }

/* ===================================================================== game UI (1rem = 16 px at 1080 p) */
html { font-size: calc(100vh / 67.5); }
.layer { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; }
.layer.show { opacity: 1; visibility: visible; }
.btn { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; border-radius: 50%; font: 700 .85rem/1 var(--tech); color: #fff; margin: 0 .25rem; vertical-align: middle; box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }
.b-a { background: #d8322e; } .b-b { background: #e8b81d; color: #222; } .b-x { background: #2e7fd6; } .b-y { background: #2fa84f; }
.b-sh { background: #9aa0a8; color: #1b1f24; border-radius: .5rem; min-width: 2rem; height: 1.3rem; }
.b-pill { background: #4a4e57; border-radius: 1rem; padding: 0 .55rem; height: 1.3rem; font-size: .7rem; letter-spacing: .06em; }
.b-dpad { background: #2c2f36; border-radius: .35rem; font-size: 1.05rem; }
/* keyboard mode (website on a computer, 10 Oct): body.kb shows player 1's key on every glyph, as a keycap in the
   button's colour, the keyboard picture instead of the pad, and keyboard wording (hud.js kp()) */
.btn i { font-style: normal; }
.btn .gk, .say-kb, .say-touch, .kb-only, .ctl li.kb-only, .kbd { display: none; }
body.touch .say-touch { display: inline; } body.touch .say-pad.no-touch { display: none; }
body.kb .btn .gp, body.kb .say-pad, body.kb .btn.kb-hide, body.kb .pad { display: none; }
body.kb .btn .gk, body.kb .say-kb { display: inline; }
body.kb .kbd, body.kb p.kb-only { display: block; }
body.kb .ctl li.kb-only { display: flex; }
body.kb .btn { border-radius: .35rem; min-width: 1.75rem; height: 1.5rem; padding: 0 .4rem; font: 700 .8rem/1 var(--tech); letter-spacing: .02em; box-shadow: inset 0 -.2rem 0 rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.14); }
.kbd { width: 100%; height: auto; } .kbd .kk { font: 700 15px var(--tech); text-anchor: middle; }
.ctl li.p2 { font: 800 1.05rem var(--display); letter-spacing: .08em; color: var(--ink-dim); } .ctl li.p2 .btn { margin: 0 0 0 .4rem; }

/* ---------- attract ---------- */
#ly-attract .att-hero { position: absolute; left: 50%; top: 3.5rem; transform: translateX(-50%); width: min(58vw, 105vh); aspect-ratio: 1536 / 1024; border-radius: 1.4rem; overflow: hidden; box-shadow: 0 2rem 6rem rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.08); transition: opacity .8s, transform .8s; }
#ly-attract .att-hero object { width: 100%; height: 100%; display: block; pointer-events: none; }
#ly-attract.demo .att-hero { opacity: 0; transform: translateX(-50%) scale(.92); }
#ly-attract.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(14,19,24,.35), rgba(7,9,12,.88) 75%); }
#ly-attract .att-press { position: absolute; left: 0; right: 0; bottom: 6.2rem; text-align: center; }
#ly-attract.demo .att-press { bottom: 3.6rem; }
.press { font: 900 4.6rem/1 var(--display); letter-spacing: .06em; color: var(--amber); text-shadow: 0 0 1.4rem rgba(255,196,0,.55), 0 .3rem 0 #000; animation: pulse 1.2s ease-in-out infinite; }
#ly-attract.demo .press { font-size: 3.2rem; }
.press-sub { font: 600 1.1rem var(--tech); letter-spacing: .22em; color: var(--ink); opacity: .85; margin-top: .6rem; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.97); } }
.att-side { position: absolute; top: 3.5rem; left: 1.2rem; right: 1.2rem; display: flex; justify-content: space-between; align-items: flex-start; transition: opacity .6s; }
.att-side .att-card { width: 21rem; }
#ly-attract.demo .att-side { opacity: 0; }
.att-card { background: rgba(17,23,30,.86); border: 1px solid var(--line); border-radius: .9rem; padding: 1rem 1.2rem; backdrop-filter: blur(6px); }
.att-card h3 { margin: 0 0 .6rem; font: 800 1.35rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.pad { width: 100%; height: auto; }
.pad .pk, .pad .pb, .pad .ps { font: 700 13px var(--tech); fill: #fff; text-anchor: middle; } .pad .pk { fill: #1b1f24; } .pad .ps { fill: #444; font-size: 10px; }
.ctl { list-style: none; margin: .5rem 0 0; padding: 0; font: 500 .95rem var(--body); }
.ctl li { display: flex; align-items: center; margin: .35rem 0; } .ctl li span { margin-right: .6rem; }
.att-roster .ro { display: grid; grid-template-columns: 2.4rem 1fr; grid-template-rows: auto auto; column-gap: .6rem; margin: .45rem 0; }
.att-roster .ro .wi { grid-row: span 2; color: var(--orange); } .wi svg { width: 100%; height: 100%; }
.att-roster .ro b { font: 800 1.25rem/1 var(--display); letter-spacing: .04em; text-transform: uppercase; } .att-roster .ro span { font: 500 .85rem var(--body); color: var(--ink-dim); }
.fine { font: 500 .75rem var(--body); color: var(--ink-faint); margin: .6rem 0 0; }
.att-demo-tag { position: absolute; left: 1.6rem; bottom: 1.2rem; font: 700 .95rem var(--tech); letter-spacing: .14em; color: var(--ink); background: rgba(17,23,30,.8); padding: .45rem .9rem; border-radius: 2rem; border: 1px solid var(--line); opacity: 0; transition: opacity .6s; }
#ly-attract.demo .att-demo-tag { opacity: 1; }
.att-demo-tag .dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #ff3b30; margin-right: .55rem; animation: pulse 1s infinite; }
.att-ticker { position: absolute; left: 0; right: 0; bottom: 0; height: 2.2rem; background: linear-gradient(90deg, var(--blue-deep), var(--blue)); color: #06121a; font: 800 1.1rem/2.2rem var(--display); letter-spacing: .1em; white-space: nowrap; overflow: hidden; display: flex; }
.att-ticker span { animation: tick 38s linear infinite; padding-right: 0; }
#ly-attract.demo .att-ticker { opacity: 0; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ---------- menus ---------- */
#ly-menu { background: linear-gradient(180deg, rgba(7,9,12,.82) 0%, rgba(7,9,12,.35) 30%, rgba(7,9,12,.35) 60%, rgba(7,9,12,.9) 100%); }
.menu-head { position: absolute; top: 1.8rem; left: 0; right: 0; text-align: center; }
.menu-head .brand { font: 800 1.1rem var(--tech); letter-spacing: .3em; color: var(--ink-dim); } .menu-head .brand span { color: var(--orange); }
.menu-head h1 { margin: .3rem 0 0; font: 900 4rem/1 var(--display); letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 .3rem 1.4rem rgba(0,0,0,.8); }
.menu-body { position: absolute; left: 0; right: 0; top: 9rem; bottom: 4.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; }
.menu-foot { position: absolute; left: 0; right: 0; bottom: 1.4rem; text-align: center; font: 600 1.1rem var(--tech); color: var(--ink-dim); letter-spacing: .06em; }
.mode-row, .arena-row { display: flex; gap: 3rem; }
.mcard, .acard { width: 26rem; padding: 2rem; border-radius: 1.2rem; background: rgba(27,33,41,.9); border: 2px solid var(--line); text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; }
.mcard.sel, .acard.sel { border-color: var(--amber); transform: translateY(-.4rem) scale(1.04); box-shadow: 0 0 0 .3rem rgba(255,196,0,.18), 0 1.4rem 3rem rgba(0,0,0,.6); }
.mcard h2, .acard h2 { margin: 1rem 0 .3rem; font: 900 2.8rem/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.mcard p, .acard p { margin: .3rem 0; font: 500 1.15rem var(--body); color: var(--ink-dim); }
.mi { display: flex; justify-content: center; align-items: center; gap: .8rem; }
.pp { display: inline-block; padding: .35rem .8rem; border-radius: .4rem; font: 800 1.5rem/1 var(--display); letter-spacing: .06em; background: var(--steel); }
.pp.red { background: #c21f18; } .pp.blue { background: #1f4fc9; } .pp.cpu { background: #3d4752; } .pp.off { opacity: .45; font-size: 1rem; }
.vs { font: 900 1.4rem var(--display); color: var(--orange); }
.diff-row { display: flex; align-items: center; gap: .8rem; font: 700 1.1rem var(--tech); }
.diff-row.dim { opacity: .3; } .diff-row .lbl { color: var(--ink-dim); letter-spacing: .14em; margin-right: .6rem; } .diff-row .hint { color: var(--ink-faint); font-size: .9rem; margin-left: 1rem; }
.chip { padding: .45rem 1.1rem; border-radius: 2rem; border: 2px solid var(--line); letter-spacing: .1em; } .chip.on { border-color: var(--blue); background: rgba(43,184,240,.18); color: #fff; }
.wait-p2 { font: 700 1.4rem var(--tech); color: var(--amber); animation: pulse 1.2s infinite; }
.joined { display: flex; gap: 1rem; } .joined .pp { font-size: 1.1rem; }
.arena-svg { width: 13rem; height: 13rem; } .arena-svg .pitlbl { font: 800 9px var(--display); fill: var(--amber); text-anchor: middle; }
#ly-menu.m-robots { background: linear-gradient(180deg, rgba(7,9,12,.75) 0%, rgba(7,9,12,0) 22%, rgba(7,9,12,0) 45%, rgba(7,9,12,.92) 75%); }
#ly-menu.m-robots .menu-body { justify-content: flex-end; gap: 1.2rem; }
.robot-row { display: flex; gap: 1.2rem; }
.rcard { position: relative; width: 19rem; padding: 1.1rem 1.2rem 1rem; border-radius: 1rem; background: rgba(27,33,41,.92); border: 2px solid var(--line); transition: transform .15s, border-color .15s; }
.rcard.sel { transform: translateY(-.5rem); } .rcard.sel.red { border-color: #ff3b30; } .rcard.sel.blue { border-color: #3a76ff; } .rcard.sel.red.blue { border-color: var(--amber); }
.rcard .wi { display: block; width: 2.8rem; height: 2.8rem; color: var(--orange); }
.rcard h2 { margin: .3rem 0 0; font: 900 2.2rem/1 var(--display); text-transform: uppercase; }
.rcard .wt { margin: .25rem 0 .6rem; font: 600 .95rem var(--tech); color: var(--blue); }
.rcard .by { margin: .6rem 0 0; font: 500 .8rem var(--body); color: var(--ink-faint); }
.sb { display: grid; grid-template-columns: 5.5rem 1fr; align-items: center; font: 600 .8rem var(--tech); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-dim); margin: .22rem 0; }
.sb i { display: flex; gap: .2rem; } .sb em, .sb u { display: block; flex: 1; height: .55rem; border-radius: .15rem; background: var(--orange); } .sb u { background: var(--steel); }
.marks { position: absolute; top: -1rem; right: .8rem; display: flex; gap: .4rem; }
.cur { padding: .25rem .6rem; border-radius: .35rem; font: 800 1rem/1 var(--display); letter-spacing: .06em; } .cur.red { background: #c21f18; } .cur.blue { background: #1f4fc9; }
.cur.lock::after { content: " ✓"; }
.rdetails { width: 100%; display: flex; justify-content: space-between; padding: 0 3rem; }
.rdetail { width: 30rem; padding: 1rem 1.3rem; border-radius: 1rem; background: rgba(17,23,30,.85); border-left: .45rem solid #c21f18; }
.rdetail.blue { border-left: none; border-right: .45rem solid #1f4fc9; text-align: right; }
.rdetail .who { font: 700 .9rem var(--tech); letter-spacing: .16em; color: var(--ink-dim); } .rdetail .who b { color: var(--green); }
.rdetail h2 { margin: .2rem 0; font: 900 2.6rem/1 var(--display); text-transform: uppercase; }
.rdetail p { margin: .2rem 0 .5rem; font: 500 1.05rem var(--body); color: var(--ink); }
.liv { font: 600 .95rem var(--tech); color: var(--ink-dim); display: flex; align-items: center; gap: .4rem; } .rdetail.blue .liv { justify-content: flex-end; }
.liv .sw { width: 1.1rem; height: 1.1rem; border-radius: .25rem; border: 1px solid rgba(255,255,255,.3); } .liv em { font-style: normal; margin-left: .6rem; }

/* ---------- fight HUD ---------- */
.hud-top { position: absolute; top: 1rem; left: 1rem; right: 1rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 1.2rem; }
.board { position: relative; width: 32rem; height: 8rem; border-radius: .5rem; overflow: hidden; background: #000; box-shadow: 0 0 0 .3rem #111, 0 .8rem 2rem rgba(0,0,0,.7); }
.board canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; filter: brightness(1.15) saturate(1.2); }
.board .dots { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 52%, rgba(0,0,0,.85) 58%); background-size: .25rem .25rem; pointer-events: none; }
.pl { position: relative; padding: .8rem 1.1rem; border-radius: .8rem; background: rgba(14,19,24,.82); border-top: .35rem solid #c21f18; max-width: 34rem; min-height: 9rem; }
.pl.blue { border-top-color: #1f4fc9; justify-self: end; width: 100%; text-align: right; } .pl.red { width: 100%; }
.pl-top { display: flex; align-items: baseline; gap: .7rem; } .pl.blue .pl-top { flex-direction: row-reverse; }
.pl .tag { font: 800 1.1rem var(--display); padding: .15rem .55rem; border-radius: .3rem; background: #c21f18; } .pl.blue .tag { background: #1f4fc9; }
.pl .name { font: 900 2.2rem/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.pl-sub { font: 600 .85rem var(--tech); color: var(--ink-dim); letter-spacing: .12em; margin: .15rem 0 .45rem; }
.bar { position: relative; height: 1.15rem; background: #222a33; border-radius: .25rem; overflow: hidden; margin: .3rem 0; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(90deg, #2fc46d, #8be24a); transition: width .25s; }
.pl.blue .bar i { left: auto; right: 0; }
.bar.low i { background: linear-gradient(90deg, #ff3b30, #ff7a1a); animation: pulse .8s infinite; }
.bar.weapon { height: 1rem; } .bar.weapon i { background: linear-gradient(90deg, var(--blue-deep), var(--blue)); transition: width .08s; }
.bar > span { position: absolute; left: .5rem; top: 0; font: 700 .75rem/1.15rem var(--tech); letter-spacing: .14em; color: rgba(255,255,255,.9); text-shadow: 0 1px 2px #000; } .pl.blue .bar > span { left: auto; right: .5rem; }
.bar.weapon > span { font-size: .72rem; line-height: 1rem; }
.chips { min-height: 1.4rem; margin-top: .35rem; display: flex; gap: .35rem; flex-wrap: wrap; } .pl.blue .chips { justify-content: flex-end; }
.chips b { font: 700 .75rem var(--tech); letter-spacing: .1em; padding: .2rem .5rem; border-radius: .25rem; background: var(--steel); }
.c-bad { background: #b3261e !important; } .c-warn { background: #b37a00 !important; color: #fff; } .c-good { background: #1d7f45 !important; } .c-dim { opacity: .7; }
.pl .ko { position: absolute; top: .3rem; right: 1rem; font: 900 6.5rem/1 var(--display); color: #fff; text-shadow: 0 0 1.2rem rgba(255,59,48,.9); } .pl.blue .ko { right: auto; left: 1rem; }
.pl.counting { animation: flashb .5s infinite alternate; } @keyframes flashb { from { box-shadow: 0 0 0 0 rgba(255,59,48,0); } to { box-shadow: 0 0 0 .3rem rgba(255,59,48,.7); } }
.hud-bottom { position: absolute; left: 0; right: 0; bottom: 1.4rem; text-align: center; }
.readyup { position: absolute; left: 0; right: 0; bottom: 6.5rem; text-align: center; font: 900 5.2rem/1 var(--display); letter-spacing: .04em; color: var(--amber); text-shadow: 0 0 1.6rem rgba(255,196,0,.75), 0 .35rem 0 #000; animation: readyflash 1s ease-in-out infinite; pointer-events: none; }
.readyup:empty { display: none; }
.readyup .who { display: block; margin-top: .6rem; font: 800 1.8rem var(--tech); letter-spacing: .25em; text-shadow: 0 .2rem .6rem #000; }
.readyup .r { color: #ff5b52; } .readyup .b { color: #6f9bff; }
@keyframes readyflash { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.hud-bottom .hint { display: inline-block; font: 700 1.3rem var(--tech); letter-spacing: .06em; background: rgba(14,19,24,.75); padding: .5rem 1.4rem; border-radius: 2rem; }
.hud-bottom .hint:empty { display: none; }
.hint .ok { color: var(--green); } .hint .wait { color: var(--amber); } .hint .r { color: #ff5b52; } .hint .b { color: #6f9bff; }

/* ---------- intro card / centre text ---------- */
#ly-intro .icard { position: absolute; left: 4rem; bottom: 5rem; padding: 1.2rem 2.4rem 1.4rem 1.6rem; background: linear-gradient(90deg, rgba(194,31,24,.95), rgba(194,31,24,.65) 70%, rgba(194,31,24,0)); min-width: 50rem; clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%); animation: slidein .45s cubic-bezier(.2,.9,.2,1); }
#ly-intro.blue .icard { left: auto; right: 4rem; text-align: right; background: linear-gradient(270deg, rgba(31,79,201,.95), rgba(31,79,201,.65) 70%, rgba(31,79,201,0)); clip-path: polygon(0 0, 100% 0, 100% 100%, 4% 100%); animation-name: slideinr; }
#ly-intro .corner { font: 800 1.3rem var(--tech); letter-spacing: .3em; opacity: .9; }
#ly-intro h1 { margin: .2rem 0; font: 900 7rem/0.95 var(--display); text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 .4rem 1.2rem rgba(0,0,0,.5); }
#ly-intro .meta { display: flex; gap: 1.4rem; font: 600 1.1rem var(--tech); letter-spacing: .08em; } #ly-intro.blue .meta { justify-content: flex-end; }
@keyframes slidein { from { transform: translateX(-30%); opacity: 0; } } @keyframes slideinr { from { transform: translateX(30%); opacity: 0; } }
#ly-center { display: grid; place-items: center; }
.bigtxt { font: 900 16rem/1 var(--display); letter-spacing: .02em; color: #fff; text-shadow: 0 0 2.5rem rgba(255,122,26,.8), 0 .6rem 0 #000; animation: pop .45s cubic-bezier(.2,1.6,.4,1); text-transform: uppercase; text-align: center; }
.bigtxt.fight { color: var(--amber); font-size: 18rem; } .bigtxt.small { font-size: 6rem; } .bigtxt.warn { color: var(--amber); font-size: 7rem; text-shadow: 0 0 2rem rgba(255,196,0,.8), 0 .4rem 0 #000; }
.bigtxt.red { color: #ff5b52; } .bigtxt.blue { color: #6f9bff; }
.bigtxt .sub { display: block; font: 700 2rem var(--tech); letter-spacing: .2em; margin-top: 1rem; color: var(--ink); text-shadow: 0 .2rem .6rem #000; }
@keyframes pop { from { transform: scale(2.2); opacity: 0; } }

/* ---------- results ---------- */
#ly-results { background: radial-gradient(ellipse at 50% 40%, rgba(7,9,12,.15), rgba(7,9,12,.85) 70%); }
.res { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3rem 0 2rem; }
.res-head { text-align: center; } .wlbl { font: 800 1.8rem var(--tech); letter-spacing: .5em; color: var(--gold); }
.res-head h1 { margin: .2rem 0; font: 900 9rem/0.95 var(--display); text-transform: uppercase; text-shadow: 0 .5rem 2rem rgba(0,0,0,.7); }
.res.red .res-head h1 { color: #ff5b52; } .res.blue .res-head h1 { color: #6f9bff; }
.method { font: 700 1.6rem var(--tech); letter-spacing: .2em; }
.res-body { display: flex; gap: 2rem; align-items: flex-end; }
.rs { width: 24rem; padding: 1rem 1.4rem; border-radius: 1rem; background: rgba(17,23,30,.88); border-top: .35rem solid #c21f18; } .rs.blue { border-top-color: #1f4fc9; }
.rs h3 { margin: 0; font: 900 2rem var(--display); text-transform: uppercase; } .rs .who { font: 600 .85rem var(--tech); color: var(--ink-dim); letter-spacing: .14em; }
.rs dl { display: grid; grid-template-columns: 1fr auto; margin: .6rem 0 0; font: 500 1.05rem var(--body); row-gap: .25rem; } .rs dd { margin: 0; font: 700 1.05rem var(--tech); text-align: right; } .rs dt { color: var(--ink-dim); }
.judges { padding: 1rem 1.6rem; border-radius: 1rem; background: rgba(17,23,30,.92); border: 1px solid var(--gold); }
.judges h3 { margin: 0 0 .5rem; font: 800 1.4rem var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); text-align: center; }
.judges table { border-collapse: collapse; font: 700 1.3rem var(--tech); } .judges td, .judges th { padding: .3rem 1.1rem; text-align: center; } .judges td:first-child { text-align: left; color: var(--ink-dim); font-weight: 600; }
.judges th.red { color: #ff5b52; } .judges th.blue { color: #6f9bff; } .judges tr.tot td { border-top: 1px solid var(--line); font-size: 1.6rem; color: #fff; }
.res-foot { font: 700 1.3rem var(--tech); letter-spacing: .06em; background: rgba(14,19,24,.8); padding: .7rem 1.6rem; border-radius: 2rem; }

/* ---------- pause / operator ---------- */
#ly-pause, #ly-operator { display: grid; place-items: center; background: rgba(7,9,12,.6); }
.panel-menu { min-width: 34rem; padding: 1.6rem 2rem; border-radius: 1.2rem; background: rgba(17,23,30,.96); border: 1px solid var(--line); box-shadow: 0 2rem 5rem rgba(0,0,0,.7); }
.panel-menu h1 { margin: 0 0 1rem; font: 900 2.8rem/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.panel-menu ul { list-style: none; margin: 0; padding: 0; }
.panel-menu li { display: flex; justify-content: space-between; gap: 2rem; padding: .55rem 1rem; border-radius: .5rem; font: 600 1.3rem var(--tech); color: var(--ink-dim); }
.panel-menu li.sel { background: rgba(43,184,240,.16); color: #fff; box-shadow: inset .3rem 0 0 var(--blue); } .panel-menu li.dim { opacity: .45; }
.panel-menu li em { font-style: normal; color: var(--amber); }
.panel-menu .foot { margin-top: 1rem; font: 600 1rem var(--tech); color: var(--ink-faint); }

/* ---------- toast ---------- */
#ly-toast { pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 11rem; gap: .6rem; }
.toast { font: 700 1.3rem var(--tech); letter-spacing: .06em; padding: .7rem 1.6rem; border-radius: 2rem; background: rgba(17,23,30,.92); border: 1px solid var(--blue); transform: translateY(-1rem); opacity: 0; transition: all .35s; }
.toast.in { transform: none; opacity: 1; }
.fps { position: fixed; right: .6rem; bottom: .4rem; max-width: calc(100vw - 1.2rem); text-align: right; font: 600 .8rem var(--tech); color: var(--ink-faint); z-index: 60; }

/* ===================================================================== website edition (body.web) */
@media (max-aspect-ratio: 16/9) { html { font-size: min(calc(100vh / 67.5), calc(100vw / 120)); } }
html.web { touch-action: none; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body.web { cursor: auto; touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.web #ui [data-act] { pointer-events: auto; cursor: pointer; }
body.web #ly-attract.show { pointer-events: auto; }
body.web #ly-attract [data-act] { cursor: pointer; }
body.web .mcard:hover, body.web .acard:hover, body.web .rcard:hover { border-color: var(--blue); }
body.web .menu-foot [data-act], body.web .res-foot [data-act] { padding: .25rem .5rem; border-radius: .5rem; }
body.web .menu-foot [data-act]:hover, body.web .res-foot [data-act]:hover { background: rgba(43,184,240,.18); color: #fff; }
body.web .panel-menu li:hover { background: rgba(43,184,240,.1); color: #fff; }
body.web .panel-menu li em b { padding: 0 .45rem; border-radius: .3rem; color: var(--ink); }
body.web .panel-menu li em b:hover { background: rgba(43,184,240,.3); }
.panel-menu li em b { font-weight: 700; }
.web-corner { position: absolute; right: 1rem; bottom: 1rem; display: flex; gap: .5rem; z-index: 8; }
.web-corner button { width: 2.6rem; height: 2.6rem; border-radius: .6rem; border: 1px solid var(--line); background: rgba(17,23,30,.75); color: var(--ink); font: 700 1.3rem/1 var(--body); cursor: pointer; pointer-events: auto; }
.web-corner button:hover { border-color: var(--blue); color: #fff; }
.web-corner button:focus { outline: none; } .web-corner button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* phones / tablets (10 Oct): top-right corner on the menus and results (they used to sit over the robot cards and the
   results buttons), under the blue driver's panel in a match; at least 34 px to tap */
body.touch .web-corner { bottom: auto; top: max(.8rem, 8px); right: max(1rem, env(safe-area-inset-right)); transform: none; gap: max(.5rem, 6px); }
body.touch[data-screen="match"] .web-corner, body.touch[data-screen="attract"] .web-corner { top: max(12.5rem, 96px); flex-direction: column; }
body.touch .web-corner button { width: max(2.6rem, 34px); height: max(2.6rem, 34px); border-radius: max(.6rem, 8px); font-size: max(1.3rem, 17px); }

/* start card over the loading screen */
#boot.ready { background: radial-gradient(ellipse at 50% 40%, rgba(22,32,42,.55) 0%, rgba(14,19,24,.78) 60%, rgba(7,9,12,.92) 100%); pointer-events: auto; }
.web-start { margin-top: 2rem; display: flex; flex-direction: column; align-items: center; gap: 1.3rem; }
.ws-buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.web-start button { font: 900 2rem/1 var(--display); letter-spacing: .08em; padding: 1rem 2.4rem; border-radius: .8rem; border: 2px solid var(--line); background: rgba(27,33,41,.92); color: var(--ink); cursor: pointer; }
.web-start .ws-play { background: var(--amber); color: #111; border-color: var(--amber); font-size: 2.6rem; padding: 1.1rem 3.2rem; box-shadow: 0 0 2rem rgba(255,196,0,.35); animation: pulse 1.6s ease-in-out infinite; }
.web-start button:hover { border-color: var(--blue); }
.web-start .ws-play:hover { filter: brightness(1.08); }
.ws-how { font: 500 1rem/1.5 var(--body); color: var(--ink-dim); max-width: 46rem; text-align: center; }
.ws-how b { color: var(--ink); }
.ws-robots { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.ws-robots span { font: 800 1rem var(--display); letter-spacing: .08em; text-transform: uppercase; padding: .3rem .7rem; border-radius: .4rem; background: rgba(43,184,240,.12); color: var(--blue); }
.ws-back { font: 600 .95rem var(--tech); color: var(--ink-faint); text-decoration: none; letter-spacing: .08em; }
.ws-back:hover { color: var(--ink); }

/* on-screen pad (phones / tablets) */
#touchpad { position: fixed; inset: 0; z-index: 7; pointer-events: none; }
#touchpad b, #touchpad .tp-dpad { pointer-events: auto; touch-action: none; }
.tp-dpad { position: absolute; left: max(1.2rem, env(safe-area-inset-left)); bottom: 1.4rem; width: min(34vh, 15rem); height: min(34vh, 15rem); border-radius: 50%; background: rgba(17,23,30,.38); border: 1px solid rgba(255,255,255,.12); }
.tp-dpad span { position: absolute; background: rgba(44,47,54,.85); border: 1px solid rgba(255,255,255,.18); }
.tp-dpad .u, .tp-dpad .d { left: 36%; width: 28%; height: 34%; } .tp-dpad .u { top: 4%; border-radius: .5rem .5rem 0 0; } .tp-dpad .d { bottom: 4%; border-radius: 0 0 .5rem .5rem; }
.tp-dpad .l, .tp-dpad .r { top: 36%; height: 28%; width: 34%; } .tp-dpad .l { left: 4%; border-radius: .5rem 0 0 .5rem; } .tp-dpad .r { right: 4%; border-radius: 0 .5rem .5rem 0; }
.tp-dpad i { position: absolute; left: 36%; top: 36%; width: 28%; height: 28%; background: rgba(44,47,54,.85); }
.tp-dpad span.on { background: var(--blue); }
.tp-face { position: absolute; right: max(1.2rem, env(safe-area-inset-right)); bottom: 1.4rem; width: min(36vh, 16rem); height: min(36vh, 16rem); }
.tp-face b { position: absolute; width: 34%; height: 34%; border-radius: 50%; display: grid; place-items: center; font: 800 1.6rem var(--tech); color: #fff; opacity: .85; box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); }
.tp-face .x { left: 33%; top: 0; background: #2e7fd6; } .tp-face .y { left: 0; top: 33%; background: #2fa84f; }
.tp-face .a { right: 0; top: 33%; background: #d8322e; width: 38%; height: 38%; } .tp-face .b { left: 33%; bottom: 0; background: #e8b81d; color: #222; width: 38%; height: 38%; }
.tp-face b.on { opacity: 1; transform: scale(.92); }
.tp-mid { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; gap: .8rem; }
.tp-mid b { font: 700 .8rem var(--tech); letter-spacing: .1em; color: #fff; background: rgba(74,78,87,.88); padding: .55rem 1rem; border-radius: 1.2rem; }
.tp-mid b.on { background: var(--blue); }
body.touch .hud-bottom { bottom: auto; top: 11rem; }
/* the pad is only needed in the arena: the start card and the menus are tapped directly, so it hides there (10 Oct; on
   tablets it covered the outer robot cards) and the menus show their tappable button bar instead */
body.touch[data-screen="boot"] #touchpad, body.touch[data-screen="mode"] #touchpad, body.touch[data-screen="arena"] #touchpad,
body.touch[data-screen="robots"] #touchpad, body.touch[data-screen="results"] #touchpad { display: none; }
/* ...and while nothing can be pressed: CPU demos (tap PRESS START to play), the robot intros, time-up and the result */
body.touch[data-screen="attract"] #touchpad, body.touch[data-screen="match"][data-phase="ARMING"] #touchpad,
body.touch[data-screen="match"][data-phase="JUDGING"] #touchpad, body.touch[data-screen="match"][data-phase="RESULT"] #touchpad { display: none; }

/* phone held upright: everything waits behind this (10 Oct: sized to the screen's width; it was 5 px text) */
#rotate-hint { display: none; }
@media (orientation: portrait) {
  body.touch #rotate-hint { display: grid; position: fixed; inset: 0; z-index: 60; place-items: center; text-align: center; padding: 8vw; color: var(--ink);
    background: radial-gradient(ellipse at 50% 40%, #16202a 0%, #0E1318 60%, #07090c 100%); }
}
#rotate-hint .rh { display: flex; flex-direction: column; align-items: center; gap: max(10px, 3vw); }
#rotate-hint .rh-icon { width: clamp(110px, 36vw, 220px); height: auto; color: var(--blue); }
#rotate-hint .rh-phone { transform-box: view-box; transform-origin: 60px 54px; animation: rh-turn 2.8s ease-in-out infinite; }
#rotate-hint .rh-arrow { opacity: .6; }
#rotate-hint b { font: 900 clamp(26px, 9vw, 60px)/1.02 var(--display); letter-spacing: .03em; text-transform: uppercase; }
#rotate-hint span { font: 600 clamp(14px, 4.2vw, 24px)/1.3 var(--tech); color: var(--ink-dim); letter-spacing: .05em; }
@keyframes rh-turn { 0%, 22% { transform: rotate(0deg); } 48%, 78% { transform: rotate(90deg); } 100% { transform: rotate(0deg); } }

/* ---- phones and tablets: smallest text (10 Oct). The game's layout is the TV layout scaled to the screen's height,
   which made the smallest text 4-6 px on a phone. On touch screens each small text has a floor in px instead (on a
   tablet most of these change little), plus bigger tap targets. ---- */
body.touch .btn { min-width: max(1.6rem, 15px); height: max(1.6rem, 15px); font-size: max(.85rem, 8.5px); }
body.touch .b-sh, body.touch .b-pill { height: max(1.3rem, 13px); font-size: max(.7rem, 7.5px); }
body.touch .b-dpad { font-size: max(1.05rem, 10px); }
body.touch .menu-head .brand { font-size: max(1.1rem, 9px); }
body.touch .mcard p, body.touch .acard p { font-size: max(1.15rem, 10px); }
body.touch .mcard, body.touch .acard { width: max(26rem, 190px); padding: max(2rem, 12px); }
body.touch .fine { font-size: max(.75rem, 9px); }
body.touch .diff-row { font-size: max(1.1rem, 10px); } body.touch .diff-row .hint { display: none; }
body.touch .chip { padding: max(.45rem, 5px) max(1.1rem, 12px); }
body.touch .joined .pp { font-size: max(1.1rem, 10px); } body.touch .pp.off { font-size: max(1rem, 9px); }
body.touch .wait-p2 { font-size: max(1.4rem, 11px); }
body.touch .menu-foot { font-size: max(1.1rem, 11px); bottom: max(1.4rem, 8px); }
body.touch .menu-foot [data-act], body.touch .res-foot [data-act] { display: inline-block; padding: max(.25rem, 4px) max(.5rem, 8px); }
/* robot select: cards share the full width (no pad on menus now); the designer moves from the card to the panel above */
body.touch .robot-row { gap: max(1.2rem, 8px); }
body.touch .rcard { width: min(24rem, calc((100vw - 4 * max(1.2rem, 8px) - 6vw) / 5)); padding: max(1.1rem, 8px) max(1.2rem, 9px) max(1rem, 8px); }
body.touch .rcard .wi { width: max(2.8rem, 18px); height: max(2.8rem, 18px); }
body.touch .rcard h2 { font-size: max(2.2rem, 15px); }
body.touch .rcard .wt { font-size: max(.95rem, 9px); margin-bottom: max(.6rem, 4px); }
body.touch .sb { font-size: max(.8rem, 8px); letter-spacing: .05em; grid-template-columns: max(5.5rem, 48px) 1fr; margin: max(.22rem, 2px) 0; }
body.touch .sb em, body.touch .sb u { height: max(.55rem, 4px); }
body.touch .rcard .by { display: none; }
body.touch .cur { font-size: max(1rem, 9px); } body.touch .marks { top: min(-1rem, -8px); }
.rdetail .rd-by { display: none; margin: 0 0 .4rem; font: 500 .85rem var(--body); color: var(--ink-faint); }
body.touch .rdetail .rd-by { display: block; font-size: max(.85rem, 9px); }
body.touch .rdetails { padding: 0 max(3rem, 12px); }
body.touch .rdetail { width: min(46vw, 44rem); padding: max(1rem, 7px) max(1.3rem, 10px); }
body.touch .rdetail .who { font-size: max(.9rem, 9px); }
body.touch .rdetail h2 { font-size: max(2.6rem, 17px); }
body.touch .rdetail p { font-size: max(1.05rem, 10px); line-height: 1.3; }
@media (max-height: 500px) { body.touch .rdetail p:not(.rd-by) { display: none; } }   /* phones: the blurb would cover the robots */
@media (max-height: 380px) {    /* 360-375 px tall phones (most Androids, iPhone SE): a little more room for the robots */
  body.touch .rcard .wi, body.touch .rdetail .who { display: none; }
  body.touch .rdetail { padding-top: max(.7rem, 5px); padding-bottom: max(.7rem, 5px); }
}
body.touch .liv { font-size: max(.95rem, 9px); } body.touch .liv .sw { width: max(1.1rem, 10px); height: max(1.1rem, 10px); }
body.touch .liv em { padding: max(.2rem, 3px) max(.5rem, 8px); border-radius: max(.4rem, 6px); background: rgba(43,184,240,.14); }
/* fight HUD, intro card, centre text, toasts */
body.touch .pl { min-height: 0; padding: max(.8rem, 6px) max(1.1rem, 8px); }
body.touch .pl .tag { font-size: max(1.1rem, 9px); }
body.touch .pl .name { font-size: max(2.2rem, 14px); }
body.touch .pl-sub { font-size: max(.85rem, 8.5px); }
body.touch .bar { height: max(1.15rem, 11px); }
body.touch .bar > span { font-size: max(.75rem, 8.5px); line-height: max(1.15rem, 11px); letter-spacing: .08em; }
body.touch .bar.weapon { height: max(1rem, 10px); } body.touch .bar.weapon > span { font-size: max(.72rem, 8px); line-height: max(1rem, 10px); }
body.touch .chips { min-height: max(1.4rem, 12px); } body.touch .chips b { font-size: max(.75rem, 8.5px); }
body.touch .hud-bottom .hint { font-size: max(1.3rem, 10px); }
body.touch #ly-intro .corner { font-size: max(1.3rem, 9px); } body.touch #ly-intro .meta { font-size: max(1.1rem, 9px); }
body.touch .toast { font-size: max(1.3rem, 10px); }
body.touch .att-demo-tag { font-size: max(.95rem, 9px); } body.touch .press-sub { font-size: max(1.1rem, 9px); }
@media (max-height: 500px) { body.touch .att-side { display: none; } }      /* phones: the hero's side cards (pad help, roster) */
/* results */
body.touch .rs { width: max(24rem, 150px); padding: max(1rem, 8px) max(1.4rem, 10px); }
body.touch .rs .who { font-size: max(.85rem, 8.5px); }
body.touch .rs dl, body.touch .rs dd { font-size: max(1.05rem, 9.5px); }
body.touch .judges h3 { font-size: max(1.4rem, 10px); } body.touch .judges table { font-size: max(1.3rem, 10px); }
body.touch .judges tr.tot td { font-size: max(1.6rem, 12px); }
body.touch .method { font-size: max(1.6rem, 10px); }
body.touch .res-foot { font-size: max(1.3rem, 11px); }
/* pause and settings: Settings in two columns so its 15 rows fit a phone; rows and ‹ › are tapped, so no key hints */
body.touch .panel-menu { padding: max(1.6rem, 10px) max(2rem, 14px); }
body.touch .panel-menu h1 { font-size: max(2.8rem, 18px); margin-bottom: max(1rem, 6px); }
body.touch .panel-menu li { font-size: max(1.3rem, 10.5px); padding: max(.55rem, 4px) max(1rem, 8px); }
body.touch .panel-menu .foot { display: none; }
body.touch #ly-operator .panel-menu ul { display: grid; grid-template-rows: repeat(8, auto); grid-auto-flow: column; column-gap: max(1.2rem, 10px); }
body.touch .panel-menu li em b { padding: 0 max(.45rem, 8px); }
/* start card and the pad's middle buttons */
body.touch .ws-how { font-size: max(1rem, 11px); max-width: min(90vw, 560px); }
body.touch .ws-robots span { font-size: max(1rem, 10px); }
body.touch .ws-back { font-size: max(.95rem, 10px); }
body.touch .web-start button { font-size: max(2rem, 15px); padding: max(1rem, 9px) max(2.4rem, 18px); }
body.touch .web-start .ws-play { font-size: max(2.6rem, 20px); padding: max(1.1rem, 10px) max(3.2rem, 26px); }
body.touch .tp-mid b { font-size: max(.8rem, 10px); padding: max(.55rem, 7px) max(1rem, 12px); }
#boot.ready .boot-inner { width: min(980px, 92vw); }
#boot.ready .boot-title { font-size: min(72px, 9vh, 7vw); }

/* website on a computer (kiosk mode): pointer + corner buttons hide when the mouse is idle; sound hint until audio is on */
body.web.idle, body.web.idle * { cursor: none !important; }
body.web .web-corner { transition: opacity .4s; }
body.web.idle .web-corner { opacity: 0; pointer-events: none; }
.sound-hint { position: fixed; top: .8rem; left: 50%; transform: translateX(-50%); z-index: 40; pointer-events: none;
  padding: .35rem .9rem; border-radius: 999px; background: rgba(14,19,24,.82); border: 1px solid rgba(39,170,225,.55);
  color: #e8eef3; font: 600 .85rem/1.2 var(--body); letter-spacing: .02em; transition: opacity .5s; }
.sound-hint.gone { opacity: 0; }

