/* CAGE CHAOS — UI styles */
@font-face { font-family: 'Bebas Neue'; src: url('../fonts/bebas-neue-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --bg: #0b0b0e;
  --panel: rgba(14, 14, 18, 0.92);
  --panel-2: rgba(28, 28, 34, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f1ea;
  --muted: #a3a0a8;
  --red: #e11d2e;
  --red-d: #9b1020;
  --blue: #2563eb;
  --gold: #f5b301;
  --green: #3ddc84;
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --ui: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--ui); overflow: hidden; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; }
#app { position: fixed; inset: 0; }
#stage, #stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
button { font-family: inherit; color: inherit; cursor: pointer; }
kbd { display: inline-block; min-width: 1.6em; padding: 0.05em 0.4em; margin: 0 0.1em; border: 1px solid rgba(255,255,255,0.28); border-bottom-width: 2px; border-radius: 4px; background: rgba(255,255,255,0.08); font-family: var(--ui); font-weight: 700; font-size: 0.9em; text-align: center; line-height: 1.35; }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 0.3em; justify-content: center; }
.logo h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(56px, 11vw, 150px); letter-spacing: 0.02em; line-height: 0.9; text-shadow: 0 4px 0 #000, 0 0 40px rgba(225, 29, 46, 0.35); }
.logo h1 b { color: var(--red); font-weight: 400; }
.logo .bolt { width: 0.55em; height: 0.9em; font-size: clamp(56px, 11vw, 150px); background: var(--red); clip-path: polygon(38% 0, 100% 0, 66% 40%, 92% 40%, 18% 100%, 40% 54%, 10% 54%); filter: drop-shadow(0 0 18px rgba(225,29,46,0.6)); }
.logo.small h1, .logo.small .bolt { font-size: clamp(40px, 6vw, 72px); }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: none; z-index: 20; }
.screen.active { display: flex; }
.overlay-dim { background: rgba(5, 5, 8, 0.72); backdrop-filter: blur(3px); align-items: center; justify-content: center; }

#scr-loading { background: var(--bg); flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.loadbar { width: min(420px, 70vw); height: 6px; background: #222; border-radius: 3px; overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red-d), var(--red)); transition: width 0.25s; }

#scr-title { flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.65) 75%); }
.title-wrap { text-align: center; }
.tagline { font-family: var(--ui); font-weight: 700; letter-spacing: 0.5em; font-size: clamp(14px, 1.8vw, 22px); margin: 14px 0 46px; color: #e7e2d8; text-shadow: 0 2px 8px #000; padding-left: 0.5em; }
.press-start { background: none; border: 2px solid rgba(255,255,255,0.75); padding: 14px 34px; font-family: var(--display); font-size: clamp(22px, 2.6vw, 32px); letter-spacing: 0.12em; animation: pulse 1.4s ease-in-out infinite; color: #fff; }
.press-start:hover { background: var(--red); border-color: var(--red); animation: none; }
@keyframes pulse { 50% { opacity: 0.35; } }
.title-foot { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 22px; color: rgba(255,255,255,0.55); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }

#scr-menu { align-items: center; justify-content: flex-start; background: linear-gradient(90deg, rgba(5,5,8,0.92) 0%, rgba(5,5,8,0.75) 38%, rgba(5,5,8,0) 70%); }
.menu-wrap { padding: 0 6vw; display: flex; flex-direction: column; gap: 34px; align-items: flex-start; }
.menu-wrap .logo { justify-content: flex-start; }
.menu { display: flex; flex-direction: column; gap: 10px; min-width: min(380px, 80vw); }
.menu button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: rgba(255,255,255,0.04); border: 0; border-left: 4px solid transparent; padding: 12px 20px; transition: background 0.12s, border-color 0.12s, transform 0.12s; }
.menu button b { font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: 0.05em; line-height: 1; }
.menu button span { color: var(--muted); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; }
.menu button.focus, .menu button:hover { background: linear-gradient(90deg, rgba(225,29,46,0.85), rgba(225,29,46,0.12)); border-left-color: #fff; transform: translateX(6px); }
.menu button.focus span, .menu button:hover span { color: #ffe9eb; }
.menu.compact button b { font-size: 28px; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--red); padding: 26px 30px; width: min(640px, 94vw); max-height: 92vh; max-height: 92dvh; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.panel.narrow { width: min(380px, 92vw); }
.panel.wide { width: min(980px, 96vw); }
.panel h2 { margin: 0 0 18px; font-family: var(--display); font-weight: 400; font-size: 44px; letter-spacing: 0.04em; }
.panel h3 { font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: 0.06em; color: var(--gold); margin: 18px 0 8px; }
.btn { background: var(--panel-2); border: 1px solid rgba(255,255,255,0.18); padding: 12px 26px; font-family: var(--display); font-size: 24px; letter-spacing: 0.08em; transition: background 0.12s, transform 0.08s; }
.btn:hover:not([disabled]), .btn.focus { background: #2c2c34; transform: translateY(-1px); }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.red:hover:not([disabled]), .btn.red.focus { background: #f2283a; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: 0.35; cursor: default; }
.res-btns { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------- select ---------- */
#scr-select { flex-direction: column; justify-content: space-between; pointer-events: none; }
#scr-select > * { pointer-events: auto; }
.sel-head { text-align: center; padding-top: 14px; background: linear-gradient(180deg, rgba(5,5,8,0.85), rgba(5,5,8,0)); pointer-events: none !important; }
.sel-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4vw, 52px); letter-spacing: 0.05em; text-shadow: 0 3px 0 #000; }
.sel-head p { margin: 2px 0 0; font-size: 15px; letter-spacing: 0.05em; }
.sel-cards { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 0 1.5vw; pointer-events: none !important; min-height: 0; }
.fcard { width: min(330px, 30vw); background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--red); padding: 14px 16px; pointer-events: auto; max-height: 100%; overflow: hidden; }
.fcard.right { border-top-color: var(--blue); }
.fcard.empty { opacity: 0.45; }
.fcard .fc-corner { font-weight: 800; letter-spacing: 0.2em; font-size: 12px; color: var(--red); }
.fcard.right .fc-corner { color: #6ea0ff; }
.fcard h3 { margin: 2px 0 0; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 0.95; letter-spacing: 0.02em; }
.fcard .fc-nick { color: var(--gold); font-weight: 700; letter-spacing: 0.06em; font-size: 17px; text-transform: uppercase; }
.fcard .fc-meta { display: grid; grid-template-columns: repeat(4, auto); gap: 2px 12px; margin: 8px 0; font-size: 13px; color: var(--muted); }
.fcard .fc-meta b { display: block; color: var(--text); font-size: 17px; }
.fcard .fc-bio { font-size: 14.5px; line-height: 1.3; color: #d8d4cc; margin: 6px 0 8px; }
.fcard .fc-sig { font-size: 13px; letter-spacing: 0.05em; color: var(--muted); text-transform: uppercase; }
.fcard .fc-sig b { color: var(--gold); }
.stats { display: grid; grid-template-columns: 74px 1fr 26px; gap: 3px 8px; align-items: center; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }
.stats .sb { height: 7px; background: rgba(255,255,255,0.09); position: relative; }
.stats .sb i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--red-d), var(--red)); }
.fcard.right .stats .sb i { background: linear-gradient(90deg, #1e3a8a, #3b82f6); }
.stats span:last-child { text-align: right; }
.sel-bottom { background: linear-gradient(0deg, rgba(5,5,8,0.95) 30%, rgba(5,5,8,0)); padding: 18px 2vw 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.grid { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tile { width: clamp(52px, 6.6vw, 98px); aspect-ratio: 1 / 1.15; background: #15151a; border: 2px solid rgba(255,255,255,0.12); position: relative; overflow: hidden; padding: 0; transition: transform 0.1s, border-color 0.1s; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .tn { position: absolute; left: 0; right: 0; bottom: 0; font-family: var(--display); font-size: clamp(11px, 1.1vw, 16px); letter-spacing: 0.04em; background: linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0)); padding: 10px 3px 2px; text-align: center; }
.tile.random { display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 44px; color: var(--muted); }
.tile.cur { border-color: #fff; transform: translateY(-4px); }
.tile.p0 { border-color: var(--red); box-shadow: 0 0 0 2px var(--red) inset; }
.tile.p1 { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset; }
.tile.p0.p1 { border-color: #a855f7; }
.tile .tag { position: absolute; top: 3px; left: 3px; font-weight: 800; font-size: 11px; padding: 1px 5px; letter-spacing: 0.08em; }
.tile .tag.t0 { background: var(--red); }
.tile .tag.t1 { background: var(--blue); left: auto; right: 3px; }
.sel-opts { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
.opt { font-weight: 800; letter-spacing: 0.1em; font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
select, .settings input[type=range] { background: #1c1c22; color: var(--text); border: 1px solid rgba(255,255,255,0.2); font-family: var(--ui); font-weight: 700; font-size: 16px; padding: 5px 8px; }
.sel-btns { display: flex; gap: 10px; }

/* ---------- tale of the tape ---------- */
.tape { width: min(860px, 96vw); text-align: center; }
.tape h2 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 72px); margin: 0 0 12px; letter-spacing: 0.06em; text-shadow: 0 4px 0 #000; }
.tape-grid { display: grid; grid-template-columns: 1fr auto 1fr; background: var(--panel); border: 1px solid var(--line); }
.tape-grid .th { padding: 14px 10px; font-family: var(--display); font-size: clamp(22px, 3vw, 34px); letter-spacing: 0.03em; line-height: 1; }
.tape-grid .th.l { border-top: 4px solid var(--red); } .tape-grid .th.r { border-top: 4px solid var(--blue); }
.tape-grid .th small { display: block; font-family: var(--ui); font-weight: 700; color: var(--gold); font-size: 15px; letter-spacing: 0.08em; margin-top: 4px; }
.tape-grid .th img { width: 92px; height: 92px; object-fit: cover; display: block; margin: 0 auto 8px; border: 2px solid rgba(255,255,255,0.2); }
.tape-grid .k { padding: 7px 18px; font-weight: 800; letter-spacing: 0.15em; color: var(--muted); font-size: 13px; background: rgba(255,255,255,0.03); display: flex; align-items: center; justify-content: center; }
.tape-grid .v { padding: 7px 10px; font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); }
.tape-grid .v.adv { color: var(--gold); }

/* ---------- stat comparison ---------- */
.statcmp { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; margin-top: 8px; }
.statcmp .h { font-family: var(--display); font-size: 24px; padding: 6px 4px; letter-spacing: 0.03em; }
.statcmp .h.l { color: #ff6b77; text-align: right; } .statcmp .h.r { color: #7aa7ff; }
.statcmp .k { font-weight: 800; letter-spacing: 0.12em; font-size: 13px; color: var(--muted); padding: 5px 16px; text-align: center; border-top: 1px solid var(--line); }
.statcmp .v { font-size: 20px; font-weight: 700; padding: 3px 6px; border-top: 1px solid var(--line); }
.statcmp .v.l { text-align: right; }
.statcmp .v.win { color: var(--gold); }

/* ---------- results ---------- */
.res-top { display: flex; gap: 20px; align-items: center; margin-bottom: 12px; }
.res-top img { width: 120px; height: 120px; object-fit: cover; border: 3px solid var(--gold); background: #111; }
.res-label { color: var(--gold); font-weight: 800; letter-spacing: 0.3em; font-size: 14px; }
.res-top h2 { margin: 0 !important; font-size: clamp(34px, 5vw, 56px) !important; line-height: 0.95; }
.res-method { font-size: 22px; font-weight: 700; letter-spacing: 0.05em; color: #e7e2d8; margin-top: 4px; }
.cards { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.card { background: #f2efe7; color: #111; padding: 8px 14px; min-width: 150px; text-align: center; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
.card .cj { font-size: 12px; letter-spacing: 0.15em; color: #555; }
.card .cs { font-family: var(--display); font-size: 34px; letter-spacing: 0.04em; }

/* ---------- settings / howto ---------- */
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; }
.settings label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); font-size: 14px; text-transform: uppercase; }
.settings label.chk { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 17px; text-transform: none; }
.settings input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--red); }
.settings input[type=range] { accent-color: var(--red); padding: 0; }
.howto-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.keys { border-collapse: collapse; width: 100%; font-size: 15.5px; }
.keys td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.keys td:first-child { white-space: nowrap; color: #fff; font-weight: 700; }
.tips { padding-left: 18px; margin: 0; line-height: 1.35; font-size: 15.5px; color: #dcd8cf; }
.tips li { margin-bottom: 6px; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); gap: 10px; }
.hud-side { width: min(420px, 38vw); }
.hud-namebar { display: flex; align-items: center; gap: 8px; background: linear-gradient(90deg, rgba(10,10,14,0.88), rgba(10,10,14,0.55)); padding: 4px 12px; clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%); }
.hud-side.right .hud-namebar { justify-content: flex-end; background: linear-gradient(270deg, rgba(10,10,14,0.88), rgba(10,10,14,0.55)); clip-path: polygon(0 0, 100% 0, 100% 100%, 4% 100%); }
.corner { width: 10px; height: 26px; }
.corner.red { background: var(--red); } .corner.blue { background: var(--blue); }
.hud-name { font-family: var(--display); font-size: clamp(22px, 2.6vw, 32px); letter-spacing: 0.04em; line-height: 1.05; }
.hud-rec { color: var(--gold); font-weight: 700; letter-spacing: 0.06em; font-size: clamp(12px, 1.2vw, 15px); }
.hud-bars { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.hud-side.right .hud-bars { justify-content: flex-end; }
.hud-body { width: 34px; height: 64px; background: rgba(10,10,14,0.7); padding: 3px; border-radius: 4px; }
.body-svg { width: 100%; height: 100%; }
.body-svg circle, .body-svg path { fill: #3ddc84; stroke: rgba(0,0,0,0.6); stroke-width: 1.2; transition: fill 0.3s; }
.hud-side.rocked .body-svg .bp-head { animation: blink 0.35s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.hud-meters { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.bar { position: relative; height: 14px; background: rgba(10,10,14,0.75); border: 1px solid rgba(255,255,255,0.12); overflow: hidden; }
.bar i { position: absolute; top: 0; bottom: 0; left: 0; transition: width 0.15s linear; }
.hud-side.right .bar i { left: auto; right: 0; }
.bar.stamina i { background: linear-gradient(90deg, #11a85a, #3ddc84); }
.bar.stamina.low i { background: linear-gradient(90deg, #b45309, #f59e0b); }
.bar.stamina.gassed { animation: gassed 0.45s ease-in-out infinite alternate; }
.bar.stamina.gassed i { background: linear-gradient(90deg, #991b1b, #ef4444); }
@keyframes gassed { from { box-shadow: 0 0 0 rgba(239, 68, 68, 0); } to { box-shadow: 0 0 10px rgba(239, 68, 68, 0.85); } }
.bar.stamina b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: rgba(255,255,255,0.75); }
.hud-side.right .bar.stamina b { transform: scaleX(-1); }
.hud-side.right .bar.stamina { direction: rtl; }
.bar label { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 800; letter-spacing: 0.18em; color: rgba(255,255,255,0.8); text-shadow: 0 1px 2px #000; }
.hud-side.right .bar label { left: auto; right: 6px; }
.bar.hype { height: 9px; }
.bar.hype label { display: none; }
.bar.hype i { background: linear-gradient(90deg, #a16207, var(--gold)); }
.bar.hype em { display: none; position: absolute; inset: 0; font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: 0.15em; text-align: center; line-height: 9px; color: #1a1300; }
.bar.hype.ready { box-shadow: 0 0 12px rgba(245,179,1,0.8); animation: glow 0.8s ease-in-out infinite alternate; height: 13px; }
.bar.hype.ready em { display: block; line-height: 13px; }
@keyframes glow { to { box-shadow: 0 0 22px rgba(245,179,1,1); } }
.hud-clock { text-align: center; background: rgba(10,10,14,0.85); padding: 4px 18px 6px; border-bottom: 3px solid var(--red); min-width: 120px; }
.hud-round { font-weight: 800; letter-spacing: 0.18em; font-size: 12px; color: var(--muted); }
.hud-time { font-family: var(--display); font-size: clamp(32px, 3.6vw, 46px); line-height: 1; letter-spacing: 0.04em; }
.hud-time.low { color: var(--red); }
.hud-callouts { position: absolute; left: 0; right: 0; top: 24%; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 3vw; }
.callout-side { width: 30%; display: flex; flex-direction: column; gap: 4px; }
.callout-side.right { align-items: flex-end; }
.co { font-family: var(--display); font-size: clamp(18px, 2.2vw, 28px); letter-spacing: 0.06em; padding: 2px 12px; background: rgba(10,10,14,0.7); animation: coIn 1.5s ease forwards; white-space: nowrap; }
.co-minor { color: #d8d4cc; font-size: clamp(15px, 1.8vw, 22px); }
.co-info { color: #fff; border-left: 3px solid var(--gold); }
.callout-side.right .co-info { border-left: 0; border-right: 3px solid var(--gold); }
@keyframes coIn { 0% { opacity: 0; transform: translateY(8px); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.callout-center { flex: 1; display: flex; justify-content: center; }
.co-big { font-family: var(--display); font-size: clamp(44px, 7vw, 96px); letter-spacing: 0.04em; color: #fff; text-shadow: 0 4px 0 #000, 0 0 30px rgba(225,29,46,0.8); animation: bigIn 1.7s cubic-bezier(.2,1.4,.4,1) forwards; text-align: center; line-height: 0.95; }
.co-big.co-counter, .co-big.co-info { font-size: clamp(30px, 4.5vw, 60px); text-shadow: 0 3px 0 #000, 0 0 22px rgba(245,179,1,0.7); color: var(--gold); }
.co-big.co-sig { color: var(--gold); }
@keyframes bigIn { 0% { opacity: 0; transform: scale(1.8); } 10% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(0.96); } }
.hud-sub { position: absolute; left: 50%; bottom: 16%; transform: translateX(-50%); width: min(560px, 86vw); text-align: center; }
.sub-name { font-family: var(--display); font-size: clamp(26px, 3.4vw, 40px); letter-spacing: 0.05em; text-shadow: 0 3px 0 #000; color: var(--gold); }
.sub-track { position: relative; height: 26px; background: rgba(10,10,14,0.85); border: 2px solid rgba(255,255,255,0.3); margin: 6px 0; }
.sub-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(225,29,46,0.3), var(--red)); }
.sub-mark { position: absolute; top: -6px; bottom: -6px; width: 4px; background: #fff; transform: translateX(-2px); box-shadow: 0 0 10px #fff; }
.sub-tap, .sub-escape { position: absolute; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 12px; letter-spacing: 0.2em; color: rgba(255,255,255,0.8); }
.sub-tap { right: 8px; } .sub-escape { left: 8px; z-index: 1; }
.sub-prompt { font-weight: 800; letter-spacing: 0.12em; font-size: clamp(14px, 1.6vw, 18px); animation: pulse 0.5s infinite; }
.hud-ground { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%); background: rgba(10,10,14,0.82); padding: 6px 14px; font-size: 15px; letter-spacing: 0.03em; text-align: center; border-top: 2px solid var(--gold); max-width: 96vw; }
.hud-ground b { color: var(--gold); margin-right: 6px; }
.hud-hints { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: 13px; color: rgba(255,255,255,0.78); background: rgba(10,10,14,0.55); padding: 5px 12px; width: max-content; max-width: 96vw; }
.hud-hints .dim { opacity: 0.6; }

/* ---------- banners & overlays ---------- */
#banner { position: absolute; left: 0; right: 0; top: 38%; transform: translateY(-50%); text-align: center; z-index: 15; pointer-events: none; }
.banner-main { font-family: var(--display); font-size: clamp(64px, 12vw, 170px); letter-spacing: 0.04em; line-height: 0.9; text-shadow: 0 6px 0 #000, 0 0 50px rgba(225,29,46,0.7); animation: bannerIn 0.5s cubic-bezier(.2,1.4,.4,1); }
.banner-sub { font-weight: 800; letter-spacing: 0.4em; font-size: clamp(14px, 1.8vw, 22px); margin-top: 6px; color: #e7e2d8; text-shadow: 0 2px 6px #000; }
#banner.red .banner-main { color: var(--red); text-shadow: 0 6px 0 #000, 0 0 60px rgba(255,255,255,0.4); }
@keyframes bannerIn { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: none; } }
#introcard { position: absolute; left: 5vw; bottom: 12vh; z-index: 15; pointer-events: none; border-left: 8px solid var(--red); background: linear-gradient(90deg, rgba(10,10,14,0.92), rgba(10,10,14,0.5)); padding: 14px 40px 16px 20px; animation: slideIn 0.45s ease-out; }
#introcard.blue { border-left-color: var(--blue); }
#introcard .ic-corner { font-weight: 800; letter-spacing: 0.25em; font-size: 14px; color: var(--muted); }
#introcard .ic-name { font-family: var(--display); font-size: clamp(40px, 6vw, 80px); line-height: 0.95; letter-spacing: 0.02em; }
#introcard .ic-nick { color: var(--gold); font-weight: 800; letter-spacing: 0.12em; font-size: clamp(18px, 2vw, 26px); }
#introcard .ic-meta { color: #d4d0c8; font-size: clamp(14px, 1.5vw, 18px); letter-spacing: 0.06em; margin-top: 4px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
#replaytag { position: absolute; top: 18px; left: 22px; z-index: 15; pointer-events: none; display: flex; flex-direction: column; }
#replaytag span { font-family: var(--display); font-size: 40px; color: var(--red); letter-spacing: 0.08em; animation: pulse 1s infinite; text-shadow: 0 2px 0 #000; }
#replaytag em { font-style: normal; color: rgba(255,255,255,0.7); letter-spacing: 0.1em; font-size: 14px; }
#whiteflash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 14; transition: opacity 0.6s; }
#vignette { position: absolute; inset: 0; pointer-events: none; z-index: 9; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%); }
#vignette.hurt { background: radial-gradient(ellipse at center, rgba(120,0,0,0) 45%, rgba(150,0,0,0.5) 100%); }
#rotate { position: absolute; inset: 0; z-index: 60; background: rgba(6,6,9,0.95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
#rotate h2 { font-family: var(--display); font-weight: 400; font-size: 46px; letter-spacing: 0.06em; margin: 18px 0 0; }
#rotate p { margin: 0 0 14px; color: var(--muted); font-size: 18px; letter-spacing: 0.04em; }
.rot-phone { width: 56px; height: 96px; border: 4px solid #fff; border-radius: 12px; position: relative; animation: rotPhone 2s ease-in-out infinite; }
.rot-phone i { position: absolute; left: 50%; bottom: 6px; width: 14px; height: 4px; margin-left: -7px; border-radius: 2px; background: currentColor; color: #fff; }
@keyframes rotPhone { 0%, 18% { transform: rotate(0deg); } 50%, 82% { transform: rotate(-90deg); border-color: var(--red); } 100% { transform: rotate(0deg); } }
.fs-btn { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 45; width: 46px; height: 46px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.3); background: rgba(10,10,14,0.65); display: flex; align-items: center; justify-content: center; color: #fff; padding: 0; }
.fs-btn:active { background: var(--red); }
body:not(.touch) .touch-only { display: none; }
.noscript { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* ---------- online fights ---------- */
.layer { position: absolute; inset: 0; display: none; z-index: 30; }
.layer.active { display: flex; }
.netwait { align-items: center; justify-content: center; background: rgba(5, 5, 8, 0.45); pointer-events: none; }
.netwait .panel { text-align: center; pointer-events: auto; }
#scr-netmenu { z-index: 34; }                 /* (over the waiting card: you can always give up) */
.screen.over-net { z-index: 40; }             /* controls / settings opened from the online menu */
.netwait h2 { margin-bottom: 8px !important; }
.netwait p { font-size: 18px; line-height: 1.35; color: #e7e2d8; margin: 0; }
#netnote { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; background: rgba(10,10,14,0.88); border-left: 3px solid var(--gold); padding: 7px 16px; font-weight: 700; letter-spacing: 0.04em; font-size: 16px; pointer-events: none; max-width: 92vw; text-align: center; }
#cc-invite { position: absolute; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 20px); background: rgba(14,14,18,0.96); border: 1px solid rgba(255,255,255,0.14); border-top: 3px solid var(--red); padding: 10px 14px; box-shadow: 0 16px 50px rgba(0,0,0,0.6); animation: slideDown 0.3s ease-out; }
#cc-invite.hidden { display: none; }
@keyframes slideDown { from { transform: translate(-50%, -16px); } to { transform: translate(-50%, 0); } }   /* (no fade: shows even on a busy device) */
#cc-invite .btn { padding: 8px 16px; font-size: 20px; }
.ci-txt { min-width: 0; }
.ci-txt b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: 0.04em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-txt small { display: block; color: var(--gold); font-weight: 700; letter-spacing: 0.04em; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av { --s: 38px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; background: #2a2a33 center / cover no-repeat; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-size: calc(var(--s) * 0.5); color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.15); overflow: hidden; }
.av.p0 { box-shadow: 0 0 0 2px var(--red); } .av.p1 { box-shadow: 0 0 0 2px var(--blue); }
.mi-badge { display: inline-block; margin-left: 10px; background: var(--red); color: #fff; font-family: var(--ui); font-style: normal; font-weight: 800; font-size: 13px; line-height: 1.5; padding: 0 8px; border-radius: 10px; letter-spacing: 0.06em; vertical-align: 0.5em; }
.menu button.focus .mi-badge, .menu button:hover .mi-badge { background: #fff; color: var(--red); }
.tape-status { margin: 14px auto 0; text-align: center; font-family: var(--display); font-size: clamp(22px, 2.6vw, 32px); letter-spacing: 0.06em; color: #fff; text-shadow: 0 2px 0 #000; }
.tape-status::before { content: ''; display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--red); margin-right: 0.45em; vertical-align: 0.12em; animation: pulse 1s infinite; }
.hud-tag { display: block; width: max-content; margin-top: 3px; padding: 1px 10px; background: rgba(10,10,14,0.75); font-weight: 800; font-size: clamp(11px, 1.1vw, 14px); letter-spacing: 0.12em; color: #d8d4cc; text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-tag.you { color: var(--gold); }
.hud-side.right .hud-tag { margin-left: auto; }
.res-net { text-align: center; font-weight: 800; letter-spacing: 0.06em; font-size: 19px; margin: 6px 0 2px; color: var(--gold); }
.res-net small { display: block; color: var(--muted); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; }
#scr-results.online .local-only, #scr-results:not(.online) .net-only, #scr-results.watching .fight-only { display: none; }

.lobby { position: relative; width: min(1180px, 97vw); padding-top: 18px; }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lb-head h2 { margin: 0 !important; }
.lb-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.16); font-weight: 800; letter-spacing: 0.08em; font-size: 15px; white-space: nowrap; }
.chip.gold { color: var(--gold); border-color: rgba(245,179,1,0.45); }
.chip-btn { background: var(--red); border-color: var(--red); color: #fff; cursor: pointer; font-family: var(--ui); }
.lb-lead { margin: 6px 0 10px; color: #d8d4cc; font-size: 16.5px; }
.lb-msg { margin: 0 0 10px; padding: 8px 12px; background: rgba(225,29,46,0.15); border-left: 3px solid var(--red); font-weight: 700; font-size: 16px; }
.lb-msg.ok { background: rgba(61,220,132,0.12); border-left-color: var(--green); }
.lb-cols { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 18px; align-items: start; }
.lb-col { min-width: 0; }
.lb-sec { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 6px; font-family: var(--display); font-size: 21px; letter-spacing: 0.08em; color: var(--gold); }
.lb-sec:first-child { margin-top: 0; }
.lb-n { font-family: var(--ui); font-weight: 800; font-size: 14px; color: var(--muted); letter-spacing: 0.06em; }
.lb-guest p { margin: 0 0 10px; color: #d8d4cc; font-size: 15.5px; line-height: 1.35; }
.lb-guest .btn { display: inline-block; text-decoration: none; }
.lb-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.lb-grid button { position: relative; padding: 0; border: 2px solid rgba(255,255,255,0.12); background: #15151a; aspect-ratio: 1 / 1.1; overflow: hidden; }
.lb-grid button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-grid button.on { border-color: var(--red); box-shadow: 0 0 0 2px var(--red) inset; }
.lb-grid button:hover { border-color: #fff; }
.lb-pick { margin: 6px 0 0; font-weight: 700; font-size: 15px; color: #d8d4cc; letter-spacing: 0.03em; }
.lb-pick b { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 0.04em; color: #fff; margin-right: 6px; }
.lb-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lb-mode { text-align: left; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); padding: 8px 12px; }
.lb-mode b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 0.06em; }
.lb-mode small { display: block; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.lb-mode[aria-checked="true"] { border-color: var(--red); background: rgba(225,29,46,0.18); box-shadow: inset 0 0 0 1px var(--red); }
.lb-pot { margin: 6px 0 0; font-size: 14.5px; color: #d8d4cc; line-height: 1.3; }
.lb-mine { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; background: rgba(225,29,46,0.14); border: 1px solid rgba(225,29,46,0.5); }
.lb-mine .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; animation: pulse 1s infinite; }
.lb-mine .t { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; }
.lb-mine .t small { display: block; color: var(--muted); font-size: 13px; }
.lb-hint { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
#lb-anyone { width: 100%; }
.lb-list { display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow-y: auto; }
.lb-empty { color: var(--muted); font-size: 14.5px; padding: 4px 2px; }
.lb-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); min-height: 46px; }
.lb-row .av { --s: 32px; }
.lb-row .t { flex: 1; min-width: 0; }
.lb-row .t b { display: block; font-weight: 800; font-size: 16px; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row .t small { display: block; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row .btn { padding: 5px 12px; font-size: 18px; flex: none; }
.lb-row .tag { flex: none; font-weight: 800; font-size: 12px; letter-spacing: 0.1em; color: var(--muted); }
.lb-row.win .t small { color: var(--green); } .lb-row.loss .t small { color: #ff8a94; }
.lb-tabs { margin-left: auto; display: inline-flex; gap: 2px; }
.lb-tabs button { background: transparent; border: 1px solid rgba(255,255,255,0.18); padding: 2px 8px; font-family: var(--ui); font-weight: 800; font-size: 12px; letter-spacing: 0.1em; color: var(--muted); }
.lb-tabs button.on { background: var(--red); border-color: var(--red); color: #fff; }
.lb-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 300px; overflow-y: auto; }
.lb-board li { display: grid; grid-template-columns: 26px 30px 1fr auto; gap: 8px; align-items: center; padding: 4px 8px; background: rgba(255,255,255,0.04); font-size: 15px; }
.lb-board li .rk { font-family: var(--display); font-size: 20px; color: var(--muted); text-align: center; }
.lb-board li:nth-child(1) .rk { color: var(--gold); }
.lb-board li .av { --s: 28px; }
.lb-board li .nm { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-board li .rec { font-weight: 700; color: #d8d4cc; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-board li .rec em { font-style: normal; color: var(--gold); margin-left: 6px; }
.lb-board li.me { box-shadow: inset 3px 0 0 var(--gold); background: rgba(245,179,1,0.08); }
.lb-board li.lb-empty { display: block; background: none; padding: 4px 2px; }
.lb-you { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.lb-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5,5,8,0.82); z-index: 5; padding: 16px; }
.lb-over.hidden { display: none; }
.lb-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--gold); padding: 18px 22px; max-width: 640px; max-height: 100%; overflow-y: auto; }
.lb-card h3 { margin-top: 0 !important; }
@media (max-width: 1000px) {
  .lb-cols { grid-template-columns: 1fr 1fr; }
  .lb-cols .lb-col:last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px), (max-height: 520px) and (max-width: 900px) {
  .lb-cols { grid-template-columns: 1fr; gap: 6px; }
  .lb-grid { grid-template-columns: repeat(6, 1fr); }
  .lobby { padding: 14px 12px; }
  .lb-lead { font-size: 14.5px; }
  .lb-list, .lb-board { max-height: none; }
  #cc-invite { flex-wrap: wrap; justify-content: center; }
  #cc-invite .ci-txt { flex: 1 1 60%; }
}
@media (max-height: 520px) and (min-width: 641px) {
  .lb-grid { grid-template-columns: repeat(12, 1fr); gap: 4px; }   /* phones on their side: the fighters in one row */
  .lobby .lb-sec { margin: 8px 0 4px; font-size: 19px; }
}

/* ---------- touch controls ---------- */
.touch-ui { position: absolute; inset: 0; z-index: 12; pointer-events: none; --tcw: clamp(56px, 8.2vw, 74px); --tch: clamp(50px, 13.5vh, 66px); --tcg: 7px; --tcs: clamp(124px, 34vh, 168px); --tcr: max(12px, env(safe-area-inset-right)); --tcl: max(18px, env(safe-area-inset-left)); --tcb: max(14px, env(safe-area-inset-bottom)); }
.touch-ui > * { pointer-events: auto; }
.tc-stick { position: absolute; left: var(--tcl); bottom: calc(var(--tcb) + 8px); width: var(--tcs); height: var(--tcs); border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.11) 100%); border: 2px solid rgba(255,255,255,0.24); touch-action: none; }
.tc-zone { position: absolute; left: 0; bottom: 0; width: 46%; height: 74%; touch-action: none; }
.tc-stick.held { border-color: rgba(255,255,255,0.45); }
.tc-knob { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(255,255,255,0.35); border: 2px solid rgba(255,255,255,0.65); box-shadow: 0 2px 10px rgba(0,0,0,0.5); pointer-events: none; }
.tc-buttons { position: absolute; right: var(--tcr); bottom: var(--tcb); display: grid; grid-template-columns: repeat(3, var(--tcw)); gap: var(--tcg); }
.tc-b { height: var(--tch); border-radius: 12px; border: 2px solid rgba(255,255,255,0.3); background: rgba(20,20,26,0.55); font-weight: 800; font-size: 12px; letter-spacing: 0.06em; line-height: 1.05; touch-action: none; color: #fff; text-shadow: 0 1px 2px #000; padding: 0; }
.tc-b.on { background: rgba(225,29,46,0.8); border-color: #fff; transform: scale(0.94); }
.tc-kick { background: rgba(80,40,10,0.55); }
.tc-block { background: rgba(30,60,140,0.6); }
.tc-td { background: rgba(20,90,50,0.55); }
.tc-low, .tc-sig { position: absolute; right: calc(var(--tcr) + 3 * var(--tcw) + 3 * var(--tcg) + 2px); width: var(--tcw); }
.tc-low { bottom: var(--tcb); }
.tc-sig { bottom: calc(var(--tcb) + var(--tch) + var(--tcg)); background: rgba(120,90,0,0.6); }
.tc-sig.ready { background: linear-gradient(180deg, #f5b301, #c2410c); border-color: #fff; color: #111; text-shadow: none; animation: sigPulse 0.8s ease-in-out infinite; }
@keyframes sigPulse { 50% { box-shadow: 0 0 22px 4px rgba(245,179,1,0.75); } }
.tc-pause { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%) translateY(84px); width: 48px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.3); background: rgba(10,10,14,0.6); font-weight: 800; }
@media (orientation: portrait) {
  .touch-ui { --tcw: min(16vw, 66px); --tch: min(14vw, 58px); --tcg: 6px; --tcs: min(34vw, 140px); --tcl: max(14px, env(safe-area-inset-left)); --tcb: max(16px, env(safe-area-inset-bottom)); }
  .tc-low, .tc-sig { right: auto; width: calc(var(--tcs) / 2 - 3px); bottom: calc(var(--tcb) + var(--tcs) + 18px); }
  .tc-low { left: var(--tcl); }
  .tc-sig { left: calc(var(--tcl) + var(--tcs) / 2 + 3px); }
  .tc-zone { width: 50%; height: 55%; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .fcard { width: 46vw; padding: 10px 12px; }
  .fcard .fc-bio { display: none; }
  .fcard h3 { font-size: 26px; }
  .howto-cols { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .hud-hints { display: none; }
}
@media (max-height: 520px) {
  .fcard .fc-bio, .fcard .fc-meta { display: none; }
  .stats { font-size: 11px; gap: 1px 6px; }
  .sel-head p { display: none; }
  .tile { width: clamp(46px, 6vw, 74px); }
  .sel-bottom { padding-top: 8px; gap: 6px; }
  .menu button { padding: 6px 14px; }
  .menu button b { font-size: 26px; }
  .menu-wrap { gap: 14px; }
  .hud-body { height: 50px; width: 28px; }
  .panel { padding: 16px 18px; }
  .panel h2 { font-size: 32px; margin-bottom: 8px; }
}
@media (max-height: 430px) {
  /* phones on their side: six menu entries without their subtitles */
  .menu button span { display: none; }
  .menu button { padding: 5px 14px; }
  .menu button b { font-size: 25px; }
  .menu { gap: 5px; }
  .menu-wrap { gap: 8px; }
  .logo.small h1, .logo.small .bolt { font-size: 40px; }
  .menu.compact button b { font-size: 22px; }
}
@media (orientation: portrait) and (max-width: 640px) {
  .hud-top { padding-left: 8px; padding-right: 8px; gap: 6px; }
  .hud-side { width: 37vw; }
  .hud-namebar { padding: 3px 8px; }
  .hud-name { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .hud-rec, .hud-body { display: none; }
  .hud-clock { min-width: 62px; padding: 2px 6px 4px; }
  .hud-time { font-size: 28px; }
  .hud-round { font-size: 9px; letter-spacing: 0.08em; }
  .hud-ground { bottom: auto; top: 136px; font-size: 13px; }
  #introcard { left: 4vw; right: 4vw; bottom: 26vh; padding: 10px 16px 12px 14px; }
  #banner .banner-main { font-size: 18vw; }
}
@media (max-width: 600px) {
  .sel-cards { padding: 0 6px; }
  .fcard { width: 47vw; }
  .fcard .fc-meta { grid-template-columns: repeat(2, auto); }
  .hud-side { width: 40vw; }
  .hud-clock { min-width: 80px; padding: 2px 8px; }
  .title-foot { flex-direction: column; align-items: center; gap: 4px; font-size: 11px; }
}

/* ---- phones: "swipe up for full screen" (v2.5.2). iPhones have no full-screen API for pages, but scrolling the page
   makes the browser tuck its bars away: give the page a little room to scroll (the game itself stays fixed). */
html.swipefs, html.swipefs body { height: auto; overflow: visible; }
html.swipefs body { min-height: calc(100vh + 240px); min-height: calc(100lvh + 240px); }
#fs-hint { position: absolute; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 46; display: flex; align-items: center; gap: 9px; padding: 10px 18px 10px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.28); background: rgba(12,12,16,0.86); color: #fff; font-family: var(--ui); font-weight: 800; font-size: 15px; letter-spacing: 0.07em; white-space: nowrap; touch-action: pan-y; box-shadow: 0 10px 30px rgba(0,0,0,0.55); }
#fs-hint.hidden { display: none; }
#fs-hint .fs-arrow { display: inline-flex; color: var(--gold); animation: fsBob 1.1s ease-in-out infinite; }
#fs-hint.in-fight { top: calc(max(12px, env(safe-area-inset-top)) + 60px); padding: 7px 14px 7px 11px; font-size: 12px; opacity: 0.88; }
@keyframes fsBob { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-4px); } }

/* ---- the member login, inside the game (v2.5.2) */
#lb-loginbox { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: rgba(8,8,11,0.97); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#lb-loginbox.hidden { display: none; }
.lgb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 8px 16px; border-bottom: 3px solid var(--red); }
.lgb-title { font-family: var(--display); font-size: 26px; letter-spacing: 0.05em; line-height: 1; }
.lgb-x { width: 44px; height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); color: #fff; font-size: 20px; padding: 0; }
.lgb-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
/* our own form; the site's login page does the work behind it (shown as it is only when the form can't drive it) */
.lgb-form { width: min(420px, 92vw); margin: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px 0; }
.lgb-lead { margin: 0; color: var(--muted, #9aa0aa); font-size: 15px; line-height: 1.4; }
.lgb-field { display: flex; flex-direction: column; gap: 5px; font-weight: 800; letter-spacing: 0.08em; font-size: 14px; }
.lgb-field input { font: 600 18px var(--ui, sans-serif); color: #fff; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.25); border-radius: 6px; padding: 10px 12px; width: 100%; box-sizing: border-box; }
.lgb-field input:focus { outline: 2px solid var(--red); border-color: transparent; }
.lgb-pw { display: flex; gap: 6px; }
.lgb-show { flex: none; padding: 0 12px; font-weight: 800; letter-spacing: 0.08em; font-size: 13px; color: #fff; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25); border-radius: 6px; }
.lgb-err { margin: 0; color: #ff8a8a; font-weight: 700; font-size: 15px; }
.lgb-err.hidden, .lgb-foot .hidden { display: none; }
.lgb-go { font-size: 24px; padding: 10px; }
.lgb-go[disabled] { opacity: 0.6; }
#lb-loginframe { border: 0; background: #0b0b0e; }
#lb-loginframe.lgb-engine { position: absolute; left: -10000px; top: 0; width: 600px; height: 800px; opacity: 0; pointer-events: none; }
#lb-loginbox.page .lgb-form { display: none; }
#lb-loginbox.page #lb-loginframe { position: static; flex: 1; width: 100%; height: auto; opacity: 1; pointer-events: auto; }
.chip.me { gap: 8px; padding: 3px 12px 3px 4px; border-color: rgba(34,197,94,0.55); text-transform: uppercase; }
.chip.me .av { --s: 26px; }
.mm-who { display: inline-flex; align-items: center; gap: 10px; }
.mm-who .av { --s: 30px; }
.lgb-foot { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px 14px; color: var(--muted, #9aa0aa); font-size: 14px; text-align: center; }
.lgb-foot .btn { padding: 8px 16px; font-size: 18px; }
/* main menu: member login / who is logged in */
.mm-member { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: min(560px, 88vw); margin-top: -14px; }
.mm-member.hidden, .mm-member .hidden { display: none; }
.mm-member .btn { padding: 8px 22px; font-size: 22px; }
.mm-who { font-weight: 800; letter-spacing: 0.06em; font-size: 15px; padding: 7px 14px; background: rgba(255,255,255,0.06); border-left: 3px solid #22c55e; text-transform: uppercase; }
.mm-why { color: var(--muted); font-size: 14px; letter-spacing: 0.02em; flex: 1 1 220px; }
@media (max-height: 420px) { .lgb-title { font-size: 20px; } .lgb-bar { padding: 4px 8px 4px 12px; } .lgb-x { width: 38px; height: 38px; } .lgb-foot { padding: 4px 10px; font-size: 12px; }
  .lgb-form { gap: 6px; padding: 8px 0; } .lgb-lead { font-size: 12px; } .lgb-field input { padding: 6px 10px; font-size: 16px; } .lgb-go { font-size: 20px; padding: 6px; } }
