/* ============================================================
   INKFIST mobile v3 — DESIGN SYSTEM (part 1: tokens, screens, base UI)
   Canvas renders fights only; every screen here is DOM.
   ============================================================ */
:root {
  --bg: #070a12;
  --panel: rgba(14, 18, 30, 0.92);
  --panel2: rgba(22, 28, 44, 0.9);
  --line: rgba(130, 160, 220, 0.16);
  --ink: #f2f5fb;
  --mut: #8a97b4;
  --red: #ff2a2a;
  --red2: #c81e33;
  --yel: #ffd23a;
  --cy: #00f0ff;
  --ok: #7dff6a;
  --disp: 'Oswald', 'Arial Black', Impact, system-ui, sans-serif;
  --anton: 'Anton', Impact, 'Arial Black', sans-serif;
  --body: 'Rajdhani', system-ui, 'Segoe UI', Arial, sans-serif;
  --neon-red: #ff2a2a;
  --neon-cyan: #00f0ff;
  --glass-bg: rgba(15, 15, 20, 0.65);
  --glass-line: rgba(255, 255, 255, 0.1);
  --pad: 1; /* CONTROL SIZE multiplier (Pad.applyScale overrides on <html>) */
  --saT: env(safe-area-inset-top, 0px);
  --saB: env(safe-area-inset-bottom, 0px);
  --saL: env(safe-area-inset-left, 0px);
  --saR: env(safe-area-inset-right, 0px);
}
#ui, #ui * { box-sizing: border-box; }
#ui { font-family: var(--body); -webkit-tap-highlight-color: transparent; }
:where(#ui) button { font-family: inherit; }
:where(#ui) :is(.btn, .mitem, .scard, .stCard, .tsCard, .hqRow, .hqTab, .navarrow, .tgl, button) { touch-action: manipulation; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0; z-index: 30;
  display: none;
  flex-direction: column;
  padding: calc(10px + var(--saT)) calc(14px + var(--saR)) calc(10px + var(--saB)) calc(14px + var(--saL));
  background:
    radial-gradient(120vmin 70vmin at 15% 0%, rgba(200, 30, 51, 0.14), transparent 60%),
    radial-gradient(120vmin 70vmin at 100% 100%, rgba(40, 90, 200, 0.12), transparent 60%),
    var(--bg);
  overflow: hidden;
}
.screen.on { display: flex; animation: scrIn 0.22s ease-out; }
@keyframes scrIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- typography ---------- */
.kicker { font-size: 11px; letter-spacing: 0.22em; color: var(--mut); text-transform: uppercase; }
.h1 { font-family: var(--disp); font-size: clamp(26px, 6vmin, 44px); letter-spacing: 0.04em; color: var(--ink); }
.h2 { font-family: var(--disp); font-size: clamp(15px, 3vmin, 22px); letter-spacing: 0.06em; color: var(--ink); }
.dim { color: var(--mut); }

/* ---------- panels & buttons ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px;
  font-family: var(--disp); font-size: 15px; letter-spacing: 0.08em; color: var(--ink);
  background: linear-gradient(180deg, var(--panel2), rgba(10, 13, 22, 0.95));
  border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; touch-action: manipulation; user-select: none;
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.btn:active { transform: scale(0.96); border-color: rgba(255, 120, 130, 0.6); }
.btn.primary {
  background: linear-gradient(180deg, var(--red), var(--red2));
  border-color: rgba(255, 150, 160, 0.5);
  box-shadow: 0 6px 22px rgba(255, 51, 68, 0.35);
}
.btn.ok { background: linear-gradient(180deg, #2f8f46, #1d5f2e); border-color: rgba(140, 255, 150, 0.4); }
.btn.ghost { background: rgba(255, 255, 255, 0.04); }
.btn.danger { background: linear-gradient(180deg, #7a1420, #4a0c14); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.bar { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }

/* ---------- boot / loading ---------- */
#boot { align-items: center; justify-content: center; gap: 14px; z-index: 40; }
#boot .logo { font-family: var(--disp); font-size: clamp(48px, 13vmin, 96px); letter-spacing: 0.02em;
  color: var(--ink); text-shadow: 0 0 34px rgba(255, 51, 68, 0.5); }
#boot .logo span { color: var(--red); }
#boot .tagline { font-size: clamp(12px, 2.4vmin, 18px); letter-spacing: 0.5em; color: var(--yel); }
.loadbar { width: min(46vmin, 280px); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.loadbar i { display: block; width: 40%; height: 100%; border-radius: 4px; background: var(--red);
  animation: ldslide 1.1s ease-in-out infinite alternate; }
@keyframes ldslide { from { transform: translateX(-60%); } to { transform: translateX(260%); } }
#boot .bootTap { margin-top: 10px; font-family: var(--disp); font-size: 17px; letter-spacing: 0.2em; color: var(--ink);
  animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- portrait blocker ---------- */
#rotate { position: absolute; inset: 0; z-index: 90; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; background: var(--bg); text-align: center; }
#rotate .rIco { font-size: 54px; font-style: normal; animation: rspin 1.6s ease-in-out infinite; color: var(--red); }
@keyframes rspin { 50% { transform: rotate(90deg); } }
@media (orientation: portrait) {
  #rotate { display: flex; }
  #ui > *:not(#rotate) { display: none !important; }
}

/* ---------- cinematic tap pill ---------- */
#cine { position: absolute; inset: 0; display: none; pointer-events: none; z-index: 20; }
#cine.on { display: block; }
.cine-pill { position: absolute; right: calc(18px + var(--saR)); bottom: calc(16px + var(--saB));
  pointer-events: auto; padding: 10px 20px; border-radius: 999px;
  font-family: var(--disp); font-size: 13px; letter-spacing: 0.15em; color: var(--ink);
  background: rgba(10, 13, 22, 0.72); border: 1px solid rgba(255, 210, 58, 0.4);
  animation: pulse 1.6s ease-in-out infinite; }

/* ---------- toast ---------- */
#toast { position: absolute; left: 50%; bottom: calc(18px + var(--saB)); transform: translate(-50%, 20px);
  z-index: 80; max-width: 86%; padding: 10px 18px; border-radius: 12px; text-align: center;
  font-size: 13px; line-height: 1.45; color: var(--ink); background: rgba(20, 12, 16, 0.94);
  border: 1px solid rgba(255, 90, 100, 0.45); opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
/* ---------- stage select ---------- */
#scr-stage { gap: 10px; }
.stRow { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 0; }
.stCard { flex: 1; position: relative; min-width: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.stCard canvas { width: 100%; height: 100%; display: block; object-fit: cover; }
.stName { position: absolute; left: 12px; bottom: 34px; font-family: var(--disp); font-size: 18px;
  color: #fff; text-shadow: 0 2px 8px #000; letter-spacing: 0.06em; }
.stKr { position: absolute; left: 12px; bottom: 14px; font-size: 12px; color: var(--yel); text-shadow: 0 1px 4px #000; }
.stLock { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px; background: rgba(4,6,10,0.72); color: var(--mut); font-size: 12px; }
.stLock b { font-family: var(--disp); color: #aab; font-size: 15px; }
.stCard.locked .stLock { display: flex; }
.navarrow { flex: 0 0 52px; align-self: stretch; display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: var(--mut); border-radius: 12px; }
.navarrow:active { color: var(--ink); background: rgba(255,255,255,0.06); }
.stDots { display: flex; gap: 8px; justify-content: center; }
.stDots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.18); transition: all 0.15s; }
.stDots i.on { background: var(--yel); transform: scale(1.25); }

/* ---------- tournament size / bracket / podium ---------- */
#scr-tsize { justify-content: center; align-items: center; gap: 14px; }
.tsRow { display: flex; gap: 12px; }
.tsCard { width: 130px; padding: 16px 10px; text-align: center; border-radius: 14px; border: 2px solid transparent; }
.tsCard.sel { border-color: var(--yel); }
.tsCard .n { font-family: var(--disp); font-size: 34px; color: var(--ink); }
.tsCard .p { font-size: 11px; color: var(--ok); }
#scr-bracket, #scr-podium { justify-content: center; align-items: center; gap: 12px; }
.brGrid { display: flex; flex-direction: column; gap: 6px; width: min(92vw, 700px); }
.brRow { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--panel); }
.brRow.mine { border: 1px solid rgba(255,90,90,0.7); box-shadow: 0 0 14px rgba(255,60,70,0.35); }
.brRow .r { font-size: 11px; color: var(--mut); min-width: 86px; }
.brRow .nm { font-family: var(--disp); font-size: 14px; color: var(--ink); flex: 1; }
.brRow .sc { font-size: 12px; color: var(--yel); }
.brRow .vs { color: var(--mut); font-size: 11px; letter-spacing: 0.1em; }
/* ---------- results ---------- */
#scr-results { justify-content: center; gap: 10px; }
.resBanner { text-align: center; animation: resIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes resIn { from { transform: scale(0.6); opacity: 0; } }
.resBanner .big { font-family: var(--disp); font-size: clamp(34px, 9vmin, 64px); letter-spacing: 0.03em; }
.resBanner .sub { font-size: 12px; letter-spacing: 0.3em; color: var(--mut); }
.resLines { display: flex; flex-direction: column; gap: 5px; align-self: center; width: min(92vw, 560px);
  padding: 12px 16px; }
.resLines .rl { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink); }
.resLines .rl b { color: var(--yel); font-family: var(--disp); }
.resLines .rl.unl { color: var(--ok); text-align: center; font-family: var(--disp); font-size: 13px; }
.resBar { display: flex; gap: 10px; justify-content: center; }

/* ---------- HQ (shop / gym / system) ---------- */
#scr-hq { gap: 10px; }
.hqHead { display: flex; align-items: center; gap: 12px; }
.hqTabs { display: flex; gap: 8px; }
.hqTab { padding: 8px 18px; border-radius: 10px; font-family: var(--disp); font-size: 13px; letter-spacing: 0.1em;
  color: var(--mut); border: 1px solid transparent; }
.hqTab.on { color: var(--ink); background: var(--panel); border-color: var(--line); }
.hqBody { flex: 1; display: flex; gap: 12px; min-height: 0; }
.hqList { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; padding: 2px; }
.hqRow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid transparent; }
.hqRow.sel { border-color: rgba(255,210,58,0.7); }
.hqRow .n { font-family: var(--disp); font-size: 15px; color: var(--ink); flex: 1; }
.hqRow .p { font-family: var(--disp); color: var(--ok); font-size: 15px; }
.hqRow .st { font-size: 11px; color: var(--mut); }
.hqMsg { min-height: 20px; text-align: center; font-size: 12px; color: var(--yel); }

/* ---------- records ---------- */
#scr-records { gap: 10px; }
.recGrid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; overflow-y: auto; touch-action: pan-y; padding: 2px; }
.recCard { padding: 10px 12px; border-radius: 12px; background: var(--panel); }
.recCard .n { font-family: var(--disp); font-size: 13px; color: var(--ink); }
.recCard .s { font-size: 10px; color: var(--mut); margin-top: 2px; }

/* ---------- controls / key config ---------- */
#scr-controls { gap: 10px; }
.ctlGrid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  align-content: start; touch-action: pan-y; padding: 2px; }
.ctlRow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--panel); }
.ctlRow .an { font-family: var(--disp); font-size: 13px; color: var(--ink); flex: 1; }
.ctlRow .kb { font-size: 11px; color: var(--cy); border: 1px solid rgba(106,208,255,0.4);
  border-radius: 8px; padding: 5px 10px; min-width: 72px; text-align: center; }
.ctlRow.listening .kb { color: var(--yel); border-color: var(--yel); animation: pulse 0.9s infinite; }
/* ---------- settings ---------- */
#scr-settings { justify-content: center; gap: 10px; }
.setList { display: flex; flex-direction: column; gap: 8px; width: min(94vw, 480px); align-self: center; }
.setRow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; }
.setRow .sl { flex: 1; font-size: 14px; color: var(--ink); }
.slider { -webkit-appearance: none; appearance: none; width: 130px; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.14); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--red); border: 2px solid rgba(255,255,255,0.15); }
.tgl { width: 52px; height: 28px; border-radius: 999px; background: rgba(255,255,255,0.12); position: relative; transition: background 0.15s; }
.tgl.on { background: var(--red); }
.tgl::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; transition: left 0.15s; }
.tgl.on::after { left: 27px; }

/* ---------- pause ---------- */
#scr-pause { justify-content: center; align-items: center; gap: 12px; background: rgba(4, 6, 10, 0.82); }
#scr-pause .pzTitle { font-family: var(--disp); font-size: clamp(26px, 7vmin, 44px); color: var(--ink); letter-spacing: 0.12em; }
.pzList { display: flex; flex-direction: column; gap: 8px; width: min(80vw, 360px); }
.movesBox { max-height: 60vh; overflow-y: auto; padding: 14px 18px; touch-action: pan-y; font-size: 12px; line-height: 1.8; color: var(--ink); }
.movesBox b { color: var(--cy); }

/* ---------- fight HUD ---------- */
#hud { position: absolute; inset: 0; display: none; z-index: 10; pointer-events: none; }
#hud.on { display: block; }
.hs { position: absolute; top: calc(8px + var(--saT)); width: min(34vw, 300px); }
.hs.l { left: calc(12px + var(--saL)); }
.hs.r { right: calc(12px + var(--saR)); text-align: right; }
.hname { font-family: var(--disp); font-size: 13px; color: var(--ink); letter-spacing: 0.05em;
  text-shadow: 0 1px 4px #000; margin-bottom: 3px; }
.hbar { position: relative; height: 15px; border-radius: 8px; background: #141821; border: 1px solid rgba(0,0,0,0.8); overflow: hidden; }
.hbar i { position: absolute; top: 0; bottom: 0; border-radius: 7px; }
.hbar .hghost { background: #ffffff; opacity: 0.75; }
.hbar .hfill { background: linear-gradient(180deg, #ffd23a, #ff8a30); transition: width 0.1s linear; }
.hbar .hfill.low { background: linear-gradient(180deg, #ff5040, #c81e33); animation: pulse 0.5s infinite; }
.ebar { position: relative; height: 7px; margin-top: 4px; border-radius: 5px; background: #10101a; overflow: hidden; }
.hs.l .ebar { width: 82%; }
.hs.r .ebar { margin-left: auto; }
.ebar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 5px; background: var(--cy); }
.ebar.full i { animation: epulse 0.4s infinite alternate; }
@keyframes epulse { to { filter: brightness(1.7); } }
.pips { margin-top: 5px; display: flex; gap: 6px; }
.hs.r .pips { justify-content: flex-end; }
.pips span { width: 9px; height: 9px; border-radius: 50%; background: #262b38; border: 1px solid #000; }
.pips span.w { background: var(--yel); box-shadow: 0 0 6px var(--yel); }
.hmid { position: absolute; top: calc(8px + var(--saT)); left: 50%; transform: translateX(-50%); text-align: center; }
#hTimer { font-family: var(--disp); font-size: 26px; color: var(--ink); text-shadow: 0 2px 6px #000; }
#hTimer.low { color: #ff4040; }
#hMode { font-size: 9px; letter-spacing: 0.2em; color: var(--mut); text-shadow: 0 1px 3px #000; }
.combo { position: absolute; top: 32%; font-family: var(--disp); color: #ffe14a; text-align: center;
  text-shadow: 0 2px 10px #000; opacity: 0; transition: opacity 0.12s; }
.combo.l { left: 6vw; } .combo.r { right: 6vw; }
.combo.show { opacity: 1; }
.combo .cn { font-size: 40px; } .combo .cs { font-size: 13px; color: #fff; letter-spacing: 0.2em; }
.combo .cd { font-size: 11px; color: #ff9a9a; }
#hudPause { position: absolute; top: calc(6px + var(--saT)); left: 50%; transform: translateX(-50%);
  width: 40px; height: 26px; margin-top: 52px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 12px; color: var(--mut); background: rgba(8,10,16,0.55); border: 1px solid var(--line);
  pointer-events: auto; }
/* ---------- PSP glass fight pad — vmin-sized, safe-area anchored ---------- */
#pad {
  --btn-red: #ff3333; --btn-blue: #3388ff; --btn-yellow: #ffcc00;
  --btn-green: #33cc55; --btn-purple: #bb33ff;
  --glass-bg: rgba(255, 255, 255, 0.08); --glass-border: rgba(255, 255, 255, 0.2);
  --glass-active: rgba(255, 255, 255, 0.25);
  --orb: 'Orbitron', 'Arial Black', Impact, system-ui, sans-serif;
  /* every control derives from two vmin-based sizes (capped for tablets) x the user's CONTROL SIZE pref */
  --dp: calc(var(--pad) * min(40vmin, 210px));     /* analog stick diameter */
  --fd: calc(var(--pad) * min(48vmin, 250px));     /* face-button cluster */
  --fbtn: calc(var(--fd) * 0.34);                  /* H / L / S */
  --fgr: calc(var(--fd) * 0.25);                   /* GR */
  --mx: max(14px, 3vw);                            /* side margin */
  --my: max(10px, 4vh);                            /* bottom margin */
  position: absolute; inset: 0; display: none; z-index: 15;
  pointer-events: none; /* empty space passes taps through (HUD pause etc.) */
}
#pad.on { display: block; }

/* 360 analog stick — glass ring + knob that tracks the thumb */
#dpad { position: absolute; bottom: calc(var(--my) + var(--saB)); left: calc(var(--mx) + var(--saL));
  width: var(--dp); height: var(--dp); border-radius: 50%;
  pointer-events: auto; touch-action: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: 2px solid var(--glass-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 0 26px rgba(0, 0, 0, 0.35); }
#knob { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, 0.14); border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.06s ease; }
/* direction indicators — light up while the engine reads that direction */
.dk { position: absolute; width: calc(var(--dp) * 0.19); height: calc(var(--dp) * 0.19);
  border-radius: 10px; background: var(--glass-bg); border: 2px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  opacity: 0.75; transition: all 0.1s ease; }
.dk::after { content: ''; border: solid rgba(255, 255, 255, 0.6); border-width: 0 3px 3px 0;
  display: inline-block; padding: calc(var(--dp) * 0.028); }
.dk.u { top: 5%; left: 50%; transform: translateX(-50%); }
.dk.u::after { transform: rotate(-135deg); }
.dk.d { bottom: 5%; left: 50%; transform: translateX(-50%); }
.dk.d::after { transform: rotate(45deg); }
.dk.l { left: 5%; top: 50%; transform: translateY(-50%); }
.dk.l::after { transform: rotate(135deg); }
.dk.r { right: 5%; top: 50%; transform: translateY(-50%); }
.dk.r::after { transform: rotate(-45deg); }
.dk.press { opacity: 1; border-color: #aaa;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.2); }
.dk.press::after { border-color: #fff; }

/* face diamond — glass circles with per-button colour glow */
#face { position: absolute; bottom: calc(var(--my) + var(--saB)); right: calc(var(--mx) + var(--saR));
  width: var(--fd); height: var(--fd); pointer-events: none; }
.fb { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%;
  background: var(--glass-bg); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: 2px solid var(--glass-border); color: rgba(255, 255, 255, 0.7);
  display: flex; justify-content: center; align-items: center; cursor: pointer;
  transition: all 0.1s ease; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); user-select: none; -webkit-user-select: none;
  font-family: var(--orb); font-weight: 900; font-size: calc(var(--fbtn) * 0.43); }
.fH, .fL, .fS { width: var(--fbtn); height: var(--fbtn); }
.fH { top: 0; left: 50%; transform: translateX(-50%); color: var(--btn-red); }
.fL { left: 0; top: 50%; transform: translateY(-50%); color: var(--btn-blue); }
.fS { right: 0; top: 50%; transform: translateY(-50%); color: var(--btn-yellow); }
.fG { width: var(--fgr); height: var(--fgr);
  bottom: 0; left: 50%; transform: translateX(-50%);
  font-size: calc(var(--fgr) * 0.35); color: var(--btn-green); }
.fb:active, .fb.press { background: var(--glass-active); color: #fff; }
.fH:active, .fH.press { transform: translateX(-50%) scale(0.92); border-color: var(--btn-red);
  box-shadow: 0 0 20px var(--btn-red), inset 0 0 10px var(--btn-red); }
.fL:active, .fL.press { transform: translateY(-50%) scale(0.92); border-color: var(--btn-blue);
  box-shadow: 0 0 20px var(--btn-blue), inset 0 0 10px var(--btn-blue); }
.fS:active, .fS.press { transform: translateY(-50%) scale(0.92); border-color: var(--btn-yellow);
  box-shadow: 0 0 20px var(--btn-yellow), inset 0 0 10px var(--btn-yellow); }
.fG:active, .fG.press { transform: translateX(-50%) scale(0.92); border-color: var(--btn-green);
  box-shadow: 0 0 20px var(--btn-green), inset 0 0 10px var(--btn-green); }

/* ULTIMATE — centre-low purple pill (sits between stick and diamond) */
.fU { bottom: calc(var(--my) * 0.8 + var(--saB)); left: 50%; transform: translateX(-50%);
  width: calc(var(--fd) * 0.8); max-width: 30vw; height: calc(var(--fd) * 0.25); border-radius: 30px;
  font-size: calc(var(--fd) * 0.075); letter-spacing: 0.18em; color: var(--btn-purple);
  background: rgba(187, 51, 255, 0.1); border-color: rgba(187, 51, 255, 0.4); }
.fU:active, .fU.press { transform: translateX(-50%) scale(0.92); background: var(--glass-active); color: #fff;
  border-color: var(--btn-purple);
  box-shadow: 0 0 25px var(--btn-purple), inset 0 0 15px var(--btn-purple); }
.fU.ready { animation: ultGlow 0.8s infinite alternate; border-color: #fff; }
@keyframes ultGlow {
  from { box-shadow: 0 0 10px rgba(187, 51, 255, 0.5); }
  to { box-shadow: 0 0 26px rgba(187, 51, 255, 0.95), 0 0 40px rgba(255, 255, 255, 0.25); }
}

/* shoulder bars — DG left, TECH right */
.sh { position: absolute; top: calc(max(5vh, 10px) + var(--saT)); width: min(15vw, 26vmin, 160px);
  height: calc(var(--fd) * 0.2); min-height: 30px; border-radius: 25px; pointer-events: auto; touch-action: none;
  background: var(--glass-bg); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: 2px solid var(--glass-border); color: rgba(255, 255, 255, 0.7);
  display: flex; justify-content: center; align-items: center; cursor: pointer;
  transition: all 0.1s ease; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); user-select: none; -webkit-user-select: none;
  font-family: var(--orb); font-weight: 900; font-size: calc(var(--fd) * 0.068); letter-spacing: 0.12em; }
#shL { left: calc(var(--mx) + var(--saL)); border-top-left-radius: 8px; }
#shR { right: calc(var(--mx) + var(--saR)); border-top-right-radius: 8px; }
.sh.press { background: var(--glass-active); transform: scale(0.95); color: #fff;
  border-color: #fff; box-shadow: 0 0 20px rgba(255, 255, 255, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.5); }
/* ---------- responsive: small / short landscape phones ---------- */
@media (max-height: 380px) {
  .btn { min-height: 38px; padding: 7px 16px; font-size: 13px; }
  .hqRow { padding: 7px 12px; }
  .hs { width: min(30vw, 240px); }
  #hTimer { font-size: 20px; }
  .combo .cn { font-size: 30px; }
}
@media (max-width: 700px) {
  .ctlGrid { grid-template-columns: 1fr; }
  .hqBody { flex-direction: column; }
}

/* ============================================================
   v4 PRO POLISH — depth buttons, select/stage layout, HUD bars
   (appended overrides — later rules win at equal specificity)
   ============================================================ */

/* ---- all standard buttons: chunky 3D depth + press ---- */
.btn { border-radius: 10px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn:active { transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.3); }
.btn.primary { box-shadow: 0 4px 0 #6d0e1a, 0 8px 22px rgba(255, 51, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn.primary:active { box-shadow: 0 2px 0 #6d0e1a, 0 4px 12px rgba(255, 51, 68, 0.3); }
.btn.ok { box-shadow: 0 4px 0 #123a1c, 0 6px 16px rgba(0, 0, 0, 0.35); }
.btn.ok:active { box-shadow: 0 2px 0 #123a1c, 0 3px 8px rgba(0, 0, 0, 0.3); }

/* ---- stage select: canvas contained, buttons never covered ---- */
#scr-stage { justify-content: center; }
.stRow { flex: 0 1 auto; min-height: 0; max-height: min(52vh, 380px); }
.stCard { aspect-ratio: 2 / 1; max-height: 100%; }
.stCard canvas { object-fit: cover; }

/* ---- fight HUD: pro bars ---- */
.hname { display: inline-block; padding: 2px 8px; border-radius: 5px;
  background: rgba(8, 10, 16, 0.66); border-left: 3px solid var(--yel); }
.hs.r .hname { border-left: none; border-right: 3px solid var(--cy); }
.hbar { height: 16px; border-radius: 5px;
  background: linear-gradient(180deg, #0e1220, #1a2030);
  border: 1px solid rgba(0, 0, 0, 0.85);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(0, 0, 0, 0.8); }
.hbar i { border-radius: 4px; }
.hbar::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 2px),
    rgba(5, 8, 14, 0.55) calc(10% - 2px), rgba(5, 8, 14, 0.55) 10%); }
.hbar .hghost { background: #ffffff; opacity: 0.55; transition: width 0.3s ease-out; }
.hbar .hfill { background: linear-gradient(180deg, #ffe97a, #ffb830 45%, #ff8a30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 10px rgba(255, 180, 60, 0.4);
  transition: width 0.12s ease-out; }
.hbar .hfill.low { background: linear-gradient(180deg, #ff5040, #c81e33);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 10px rgba(255, 60, 70, 0.55); animation: pulse 0.5s infinite; }
.ebar { height: 9px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.7); background: #0c101a; }
.ebar i { background: linear-gradient(180deg, #a8e6ff, var(--cy));
  box-shadow: 0 0 8px rgba(106, 208, 255, 0.5); transition: width 0.1s linear; }
.ebar.full i { animation: epulse 0.35s infinite alternate; box-shadow: 0 0 14px rgba(106, 208, 255, 0.95); }

/* ---- pointer hover polish (desktop / precise pointers only) ---- */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: rgba(255, 150, 160, 0.55); filter: brightness(1.12); }
  .hqRow:hover, .tsCard:hover { border-color: rgba(255, 210, 58, 0.5); }
  .navarrow:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
}

/* ============================================================
   v5 INKFIST REDESIGN — main menu + character select
   (visual identity from design-menu / character-selection prototypes,
   rebuilt mobile-first: dvh/vh/vmin sizing, safe areas, no fixed heights)
   ============================================================ */
.glass { background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-line); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }

/* ---------- main menu ---------- */
#scr-menu {
  justify-content: space-between; gap: 0;
  padding: calc(8px + var(--saT)) calc(16px + var(--saR)) calc(8px + var(--saB)) calc(16px + var(--saL));
  background:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(90vmin 90vmin at 18% 55%, rgba(255, 42, 42, 0.16), transparent 70%),
    var(--bg);
}
.mhead { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mlogo .kicker { font-size: clamp(8px, 1.9vh, 10px); letter-spacing: 0.3em; font-weight: 700; margin-bottom: 2px; }
.brand { font-family: var(--disp); font-weight: 900; line-height: 0.85; letter-spacing: -1px;
  font-size: clamp(28px, 10vh, 66px); color: #fff; text-shadow: 2px 2px 15px rgba(255, 42, 42, 0.5); }
.brand b { color: var(--neon-red); }

.mpill { display: flex; align-items: center; gap: 12px; border-radius: 16px;
  padding: clamp(4px, 1.6vh, 10px) clamp(10px, 2.6vh, 18px); }
.pcol { display: flex; flex-direction: column; gap: 2px; }
.pcol.right { text-align: right; }
.pcol i { font-style: normal; font-size: clamp(8px, 1.9vh, 10px); letter-spacing: 0.2em; font-weight: 700; color: #9aa4b5; }
.pcol b { font-family: var(--disp); font-weight: 700; font-size: clamp(14px, 4.4vh, 20px); line-height: 1; color: #fff; letter-spacing: 0.03em; }
.pcol em { font-style: normal; font-size: clamp(8px, 1.9vh, 10px); letter-spacing: 0.1em; color: var(--neon-red); }
.pcol .pCash { font-size: clamp(10px, 2.3vh, 12px); font-weight: 700; color: #9aa4b5; }
.pdiv { width: 1px; align-self: stretch; background: rgba(255, 255, 255, 0.22); }

.mmain { flex: 1 1 0; min-height: 0; display: flex; align-items: center; overflow-y: auto; overflow-x: hidden;
  touch-action: pan-y; scrollbar-width: none; padding: 2px 0; }
.mmain::-webkit-scrollbar { display: none; }
.mlist { display: flex; flex-direction: column; justify-content: center; gap: clamp(0px, 0.8vh, 8px);
  width: min(100%, 680px); margin: auto 0; }

.mitem { position: relative; display: flex; align-items: center; min-height: min(56px, 10.5vh);
  padding: 0 0 0 14px; gap: 0; cursor: pointer; user-select: none; touch-action: manipulation;
  background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible;
  animation: mIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
#scr-menu.on .mitem:nth-child(1) { animation-delay: 0.05s; }
#scr-menu.on .mitem:nth-child(2) { animation-delay: 0.10s; }
#scr-menu.on .mitem:nth-child(3) { animation-delay: 0.15s; }
#scr-menu.on .mitem:nth-child(4) { animation-delay: 0.20s; }
#scr-menu.on .mitem:nth-child(5) { animation-delay: 0.25s; }
#scr-menu.on .mitem:nth-child(6) { animation-delay: 0.30s; }
@keyframes mIn { from { opacity: 0; transform: translateX(-46px); } to { opacity: 1; transform: none; } }
.mitem::before { content: ''; position: absolute; left: 0; top: 50%; width: 6px; height: 78%; background: var(--neon-red);
  box-shadow: 0 0 10px var(--neon-red); transform: translateY(-50%) scaleY(0); opacity: 0; transition: all 0.2s ease; }
.mitem .ml { position: relative; font-family: var(--disp); font-weight: 900; font-style: italic; text-transform: uppercase;
  font-size: clamp(1.45rem, min(7vw, 9.2vh), 4.2rem); line-height: 1; letter-spacing: 0.01em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.45);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.mitem .ms { margin-left: 14px; font-family: var(--body); font-weight: 500; font-size: clamp(0.68rem, 2.6vh, 1rem); color: #aab;
  opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; min-width: 0; }
.mitem .mlk { margin-left: 14px; flex: 0 0 auto; font-family: var(--body); font-size: clamp(0.6rem, 2vh, 0.8rem); font-weight: 700;
  letter-spacing: 1px; padding: 2px 8px; border-radius: 4px; color: #888; background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2); }
.mitem .mlk:empty { display: none; }
.mitem:not(.locked):active::before { transform: translateY(-50%) scaleY(1); opacity: 1; }
.mitem:not(.locked):active .ml { -webkit-text-stroke: 0; color: #fff; text-shadow: 2px 2px 0 var(--neon-red);
  transform: translateX(10px) scale(0.98) skewX(-8deg); }
.mitem.locked { opacity: 0.5; }
.mitem.locked .ml { -webkit-text-stroke-color: rgba(255, 255, 255, 0.18); }
@media (hover: hover) and (pointer: fine) {
  .mitem:not(.locked):hover::before { transform: translateY(-50%) scaleY(1); opacity: 1; }
  .mitem:not(.locked):hover .ml { -webkit-text-stroke: 0; color: #fff; text-shadow: 2px 2px 0 var(--neon-red);
    transform: translateX(20px) scale(1.02) skewX(-8deg); }
}

.mfoot { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.msys { display: flex; flex-direction: column; gap: 6px; width: min(300px, 44vw); }
.mdiff { display: flex; justify-content: space-between; align-items: center; border-radius: 12px; padding: 2px 6px 2px 12px; min-height: 36px; }
.mdiff .dl { font-size: clamp(9px, 2.2vh, 12px); font-weight: 700; letter-spacing: 0.2em; color: #9aa4b5; }
.dsel { display: flex; align-items: center; gap: 2px; }
.arrow { min-width: 34px; min-height: 34px; padding: 0; background: none; border: 0; color: #8a93a6; font-size: 12px;
  cursor: pointer; touch-action: manipulation; transition: color 0.2s, transform 0.1s; }
.arrow:active { color: #fff; transform: scale(0.8); }
.dv { width: 4.4em; text-align: center; font-family: var(--disp); font-weight: 500; font-size: clamp(13px, 3.6vh, 16px);
  letter-spacing: 0.06em; color: var(--neon-red); transition: transform 0.15s ease, opacity 0.15s ease; }
.dv.pop { animation: dvPop 0.2s ease-out; }
@keyframes dvPop { 0% { transform: scale(0.75); opacity: 0.4; } 100% { transform: scale(1); opacity: 1; } }
.msubs { display: flex; gap: 6px; }
.sysbtn { flex: 1; min-height: 34px; padding: 0 8px; border-radius: 12px; color: #9aa4b5; cursor: pointer;
  font-family: var(--body); font-weight: 700; font-size: clamp(9px, 2.2vh, 12px); letter-spacing: 0.2em; text-transform: uppercase;
  touch-action: manipulation; transition: transform 0.1s, background 0.1s; }
.sysbtn.gear { flex: 0 0 46px; font-size: 16px; letter-spacing: 0; }
.sysbtn:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.12); }
.mver { font-size: 8px; font-weight: 700; letter-spacing: 0.2em; color: #596075; text-transform: uppercase; }

.hubbtn { display: flex; align-items: center; justify-content: space-between; gap: clamp(12px, 3vw, 28px);
  padding: clamp(8px, 2.2vh, 16px) clamp(14px, 3vw, 30px); border-radius: 16px; cursor: pointer; color: #fff; text-align: left;
  background: linear-gradient(135deg, rgba(255, 42, 42, 0.18) 0%, rgba(10, 10, 15, 0.85) 100%);
  border: 1px solid rgba(255, 42, 42, 0.5); box-shadow: 0 0 20px rgba(255, 42, 42, 0.15);
  touch-action: manipulation; transition: transform 0.1s; }
.hubbtn:active { transform: scale(0.96); }
.hubbtn .ht b { display: block; font-family: var(--disp); font-weight: 700; font-style: italic; letter-spacing: 0.04em;
  font-size: clamp(18px, 5.4vh, 26px); line-height: 1.05; }
.hubbtn .ht i { display: block; font-style: normal; margin-top: 3px; font-size: clamp(8px, 2vh, 10px); letter-spacing: 0.2em;
  color: #9aa4b5; text-transform: uppercase; }
.hubbtn .hgo { flex: 0 0 auto; width: clamp(24px, 6vh, 32px); height: clamp(24px, 6vh, 32px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--neon-red); font-size: 20px; font-weight: 900;
  line-height: 1; transition: transform 0.15s; }
.hubbtn:active .hgo { transform: translateX(6px); }

/* short landscape phones: drop descriptions + version line, tighten chrome */
@media (max-height: 500px) {
  #scr-menu { padding-top: calc(4px + var(--saT)); padding-bottom: calc(4px + var(--saB)); }
  .mitem .ms, .mver { display: none; }
  .msys { gap: 4px; width: min(280px, 42vw); }
  .mdiff, .sysbtn { min-height: 30px; }
  .arrow { min-height: 30px; }
}

/* ---------- character select ---------- */
#scr-select {
  gap: 0; position: absolute;
  padding: calc(6px + var(--saT)) calc(14px + var(--saR)) calc(6px + var(--saB)) calc(14px + var(--saL));
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(90vmin 70vmin at 72% 48%, rgba(255, 42, 42, 0.16), transparent 70%),
    var(--bg);
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(90vmin 70vmin at 72% 48%, color-mix(in srgb, var(--cc, #ff2a2a) 24%, transparent), transparent 70%),
    var(--bg);
}
.selGiant { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 0; pointer-events: none;
  font-family: var(--anton); font-size: min(26vw, 62vh); line-height: 0.8; white-space: nowrap;
  color: rgba(255, 255, 255, 0.03); }
.selHead { position: relative; z-index: 2; flex: 0 0 auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.selTitle .kicker { font-size: clamp(8px, 2vh, 10px); letter-spacing: 0.4em; font-weight: 700; }
.title-glitch { margin: 0; font-family: var(--disp); font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em;
  font-size: clamp(1.05rem, 5.6vh, 2rem); line-height: 1.05; color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 240, 255, 0.5), -2px -2px 0 rgba(255, 42, 42, 0.5); }

.selStage { position: relative; z-index: 1; flex: 1 1 0; min-height: 0; display: flex; }
.selData { flex: 1 1 52%; min-width: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 0 1vw clamp(2px, 1vh, 8px) clamp(2px, 1.5vw, 16px); }
.selPName { font-family: var(--disp); font-weight: 900; font-style: italic; text-transform: uppercase;
  font-size: clamp(2rem, min(10.5vw, 17vh), 6rem); line-height: 0.95; padding-right: 0.15em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  background-image: linear-gradient(to bottom, #fff, var(--cc, #aaa)); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.75)); }
.selPName.lk { background-image: linear-gradient(to bottom, #999, #556); }
.selPStyle { display: flex; align-items: center; gap: 10px; margin: clamp(2px, 0.8vh, 8px) 0 clamp(4px, 2vh, 18px);
  font-size: clamp(0.66rem, 2.6vh, 1.1rem); font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cc, #aaa); text-shadow: 0 0 12px rgba(255, 255, 255, 0.12); min-height: 0; }
.selPStyle::before { content: ''; flex: 0 0 clamp(18px, 4vw, 40px); height: 2px; background: currentColor; }
.selStats { display: grid; gap: clamp(3px, 1.6vh, 12px); width: min(100%, 360px); }
.sttRow { display: flex; align-items: center; gap: 8px; color: var(--cc, #aaa); transition: opacity 0.15s; }
.sttRow.na { opacity: 0.35; }
.sttLab { flex: 0 0 auto; width: 2.9em; font-family: var(--body); font-weight: 700; font-size: clamp(0.62rem, 2.4vh, 0.9rem);
  letter-spacing: 0.14em; color: #8a93a6; }
.sttSegs { flex: 1; display: flex; gap: 4px; height: clamp(6px, 2vh, 12px); transform: skewX(-20deg); }
.sttSegs i { flex: 1; background: rgba(255, 255, 255, 0.1); transition: background 0.25s ease, box-shadow 0.25s ease; }
.sttSegs i.f { background: currentColor; box-shadow: 0 0 10px currentColor; }
.selData .spal { margin-top: clamp(2px, 1vh, 8px); font-size: clamp(8px, 2vh, 10px); letter-spacing: 0.3em; color: #6d7588; }

.selArt { flex: 1 1 48%; position: relative; min-width: 0; min-height: 0; display: flex; align-items: flex-end; justify-content: center; }
.selPrev { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.8)); }
.selData.swap { animation: selSlide 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.selArt.swap { animation: selGlitch 0.3s both; }
@keyframes selSlide { from { transform: translateX(-40px) skewX(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes selGlitch {
  0% { transform: scale(1) translateX(0); filter: hue-rotate(0deg); opacity: 0.8; }
  25% { transform: scale(1.04) translateX(8px); filter: hue-rotate(90deg); opacity: 1; }
  50% { transform: scale(0.97) translateX(-8px); filter: hue-rotate(-90deg); }
  100% { transform: none; filter: none; opacity: 1; }
}

.selRoster { position: relative; z-index: 3; flex: 0 0 auto; display: flex; align-items: flex-end; gap: clamp(6px, 2vw, 18px);
  padding-top: 4px; margin: 0 calc(-14px - var(--saR)) 0 calc(-14px - var(--saL));
  padding-left: calc(14px + var(--saL)); padding-right: calc(14px + var(--saR));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 60%, transparent 100%); }
.sgrid { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; gap: clamp(3px, 1vmin, 8px); overflow-x: auto; overflow-y: hidden;
  padding: clamp(8px, 2.4vh, 14px) 12px 6px 6px; touch-action: pan-x; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent 100%); mask-image: linear-gradient(to right, #000 88%, transparent 100%); }
.sgrid::-webkit-scrollbar { display: none; }
.scard { position: relative; flex: 0 0 auto; width: clamp(48px, 12vmin, 88px); height: clamp(60px, 15vmin, 108px); aspect-ratio: auto;
  border-radius: 0; overflow: hidden; cursor: pointer; user-select: none; touch-action: manipulation;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-line); transform: skewX(-15deg);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5); transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s; }
.scin { position: absolute; top: 0; bottom: 0; left: -16%; right: -16%; transform: skewX(15deg); }
.scard canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)); transition: transform 0.2s; }
.scard .snm { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 2px 2px; text-align: center; font-family: var(--disp);
  font-weight: 500; font-size: clamp(8px, 2.2vh, 11px); letter-spacing: 0.06em; color: #fff; text-transform: uppercase;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent); text-shadow: 0 1px 3px #000; }
.scard.cur { background: rgba(255, 255, 255, 0.1); border: 2px solid var(--pc, #ff5a5a); transform: skewX(-15deg) translateY(-8px);
  box-shadow: 0 0 15px var(--pc, #ff5a5a), inset 0 0 14px rgba(255, 255, 255, 0.08); z-index: 2; }
.scard.cur canvas { transform: scale(1.08); }
.scard:active { transform: skewX(-15deg) scale(0.93); }
.scard.cur:active { transform: skewX(-15deg) translateY(-8px) scale(0.96); }
.scard.locked { filter: grayscale(1) brightness(0.45); }
.scard.locked .snm { color: #667; }
.scard .tag { position: absolute; top: 0; left: 18%; padding: 1px 8px; font-family: var(--disp); font-weight: 700; font-size: 9px;
  letter-spacing: 0.08em; background: #ff5a5a; color: #000; transform: none; }
.scard .tag.t2 { left: auto; right: 18%; background: #5ab0ff; }
@media (hover: hover) and (pointer: fine) {
  .scard:not(.locked):not(.cur):hover { background: rgba(255, 255, 255, 0.15); transform: skewX(-15deg) translateY(-5px); }
}

.selBar { flex: 0 0 auto; display: flex; gap: clamp(6px, 1.4vw, 12px); align-items: flex-end; padding-bottom: clamp(4px, 1.4vh, 10px); }
.selBar .btn { min-height: clamp(34px, 9vh, 46px); padding: 0 clamp(12px, 2.2vw, 22px); font-size: clamp(12px, 3.4vh, 15px); }
.selBar .btn.confirm { font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; border: 0; border-radius: 0;
  padding: 0 clamp(18px, 4vw, 44px); min-height: clamp(38px, 11vh, 54px); font-size: clamp(14px, 4.2vh, 22px);
  transform: skewX(-15deg); background: var(--cc, var(--neon-red)); color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); }
.selBar .btn.confirm .cs { display: block; transform: skewX(15deg); }
.selBar .btn.confirm:active { transform: skewX(-15deg) scale(0.95); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4); }
@media (hover: hover) and (pointer: fine) { .selBar .btn.confirm:hover { transform: skewX(-15deg) scale(1.04); filter: brightness(1.1); } }

/* short landscape phones: keep the roster anchored low, stats never hidden */
@media (max-height: 500px) {
  #scr-select { padding-top: calc(3px + var(--saT)); padding-bottom: calc(3px + var(--saB)); }
  .selHead .kicker { display: none; }
  .scard { width: clamp(44px, 11vmin, 70px); height: clamp(54px, 13.5vmin, 88px); }
  .selStats { gap: clamp(2px, 1vh, 6px); }
}
.selPName[data-len="long"] { font-size: clamp(1.5rem, min(6.6vw, 11vh), 4.4rem); }

/* ============================================================
   v6 — CREW HQ (shop + gym), fight HUD, pause + move list,
   settings / touch customisation, stage select.
   Additive only: nothing above this line (menu / select) is changed.
   Sizing uses dvh / vmin / safe-area vars so it fits <500px landscape.
   ============================================================ */
:root { --pad-opacity: 1; --pad-scale: 1; }

/* ---------- CREW HQ chrome ---------- */
#scr-hq {
  gap: clamp(4px, 1.4dvh, 10px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(90vmin 70vmin at 75% 50%, rgba(255, 42, 42, 0.14), transparent 70%),
    var(--bg);
}
#scr-hq .hqHead { flex: 0 0 auto; }
#scr-hq .title-glitch { font-size: clamp(1.05rem, 5.2dvh, 1.8rem); }
.hqCash { font-family: var(--disp); font-weight: 700; font-size: clamp(14px, 4dvh, 20px); letter-spacing: 0.04em; color: #7dff6a;
  padding: 3px 14px; border-radius: 10px; background: var(--glass-bg); border: 1px solid var(--glass-line); }
#scr-hq .hqTabs { flex: 0 0 auto; gap: 6px; }
.hqTab { font-style: italic; text-transform: uppercase; padding: clamp(5px, 1.6dvh, 9px) clamp(14px, 3vw, 28px);
  transform: skewX(-12deg); border-radius: 0; background: var(--glass-bg); border: 1px solid var(--glass-line);
  touch-action: manipulation; cursor: pointer; transition: all 0.15s ease; }
.hqTab.on { color: #fff; border-color: var(--neon-red); background: linear-gradient(90deg, rgba(255, 42, 42, 0.32), rgba(15, 15, 20, 0.65));
  box-shadow: 0 0 14px rgba(255, 42, 42, 0.35); }
.hqTab:active { transform: skewX(-12deg) scale(0.95); }
#scr-hq .hqBody { flex: 1 1 0; min-height: 0; }
#scr-hq .hqList { min-height: 0; overflow-y: auto; scrollbar-width: none; }
#scr-hq .hqList::-webkit-scrollbar { display: none; }
#scr-hq .hqList.hqt0, #scr-hq .hqList.hqt1 { flex-direction: row; overflow: hidden; }
#scr-hq .hqRow { border-radius: 12px; background: var(--glass-bg); border: 1px solid var(--glass-line); }
#scr-hq .hqRow.done { border-left: 3px solid #7dff6a; }
#scr-hq .hqMsg { align-self: center; margin: auto; font-family: var(--disp); letter-spacing: 0.1em; }

/* ---------- shared showcase (shop + gym) ---------- */
.hqShow { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: stretch; gap: clamp(8px, 2.4vw, 24px); }
.hqArt { position: relative; flex: 0 1 38%; min-width: 0; min-height: 0; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--glass-line);
  background: radial-gradient(75% 60% at 50% 100%, rgba(255, 42, 42, 0.3), transparent 75%), linear-gradient(rgba(10, 10, 15, 0.7), rgba(5, 5, 7, 0.92));
  background: radial-gradient(75% 60% at 50% 100%, color-mix(in srgb, var(--cc, #ff2a2a) 38%, transparent), transparent 75%), linear-gradient(rgba(10, 10, 15, 0.7), rgba(5, 5, 7, 0.92)); }
.hqArt canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.75)); }
.shopArt canvas { filter: drop-shadow(0 0 3px var(--cc, #fff)) drop-shadow(0 0 14px var(--cc, #fff)); }
.hqLockTag { position: absolute; top: 8px; left: 8px; padding: 2px 10px; border-radius: 4px; font-family: var(--disp); font-size: clamp(9px, 2.4dvh, 12px);
  letter-spacing: 0.16em; color: #ccd; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.25); }
.hqInfo { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(3px, 1.3dvh, 10px); }
.hqInfo .kicker { font-size: clamp(8px, 2dvh, 10px); letter-spacing: 0.4em; font-weight: 700; color: var(--neon-red); }
.hqName { font-family: var(--disp); font-weight: 900; font-style: italic; text-transform: uppercase; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; padding-right: 0.15em; line-height: 0.95; font-size: clamp(1.7rem, min(8vw, 14dvh), 4.4rem);
  background-image: linear-gradient(to bottom, #fff, var(--cc, #aaa)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.75)); }
.hqName.sm { font-size: clamp(1.25rem, min(4.6vw, 8.5dvh), 2.5rem); }
.hqStyle { font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cc, #aaa); font-size: clamp(0.62rem, 2.4dvh, 1rem); }
.hqInfo .selStats { width: min(100%, 340px); }
.hqBuy.btn { align-self: flex-start; margin-top: clamp(2px, 1dvh, 8px); transform: skewX(-15deg); border-radius: 0; border: 0;
  min-height: clamp(38px, 10.5dvh, 52px); padding: 0 clamp(18px, 4vw, 40px); font-style: italic; letter-spacing: 0.06em;
  font-size: clamp(14px, 4dvh, 20px); text-transform: uppercase; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.hqBuy.btn .cs { display: block; transform: skewX(15deg); }
.hqBuy.btn b { color: #ffe14a; font-weight: 900; }
.hqBuy.btn:active { transform: skewX(-15deg) scale(0.95); }
.hqBuy.btn.poor { filter: grayscale(0.55) brightness(0.85); }
.hqNav { display: flex; align-items: center; gap: 4px; }
.hqNavN { min-width: 3.6em; text-align: center; font-family: var(--disp); font-size: clamp(12px, 3.4dvh, 15px); letter-spacing: 0.12em; color: #9aa4b5; }

/* ---------- GYM: stat tracks + ghost-fill preview ---------- */
.gymLeft { flex: 0 1 38%; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: clamp(3px, 1dvh, 8px); }
.gymLeft .hqArt { flex: 1 1 0; }
.gymRight { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(5px, 1.6dvh, 12px); }
.gymRow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "top top" "track btn"; align-items: center; gap: 6px 12px;
  padding: clamp(6px, 1.7dvh, 12px) clamp(10px, 2vw, 16px); border-radius: 12px; cursor: pointer; touch-action: manipulation;
  background: var(--glass-bg); border: 1px solid var(--glass-line); transition: border-color 0.15s, box-shadow 0.15s; }
.gymRow.sel { border-color: var(--cc, var(--neon-red)); box-shadow: 0 0 0 1px var(--cc, var(--neon-red)), 0 0 18px rgba(255, 255, 255, 0.07); }
.gymTop { grid-area: top; display: flex; align-items: baseline; gap: 10px; }
.gymTop .gl { font-family: var(--disp); font-weight: 700; font-size: clamp(14px, 4dvh, 20px); letter-spacing: 0.1em; color: var(--cc, #fff); }
.gymTop .gd { flex: 1; min-width: 0; font-size: clamp(9px, 2.3dvh, 12px); letter-spacing: 0.08em; text-transform: uppercase; color: #8a93a6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gymTop .gv { font-family: var(--disp); font-size: clamp(11px, 3dvh, 14px); color: #fff; }
.gTrack { grid-area: track; display: flex; gap: 5px; height: clamp(9px, 3dvh, 16px); transform: skewX(-20deg); min-width: 0; }
.gseg { flex: 1; background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.06); }
.gseg.f { background: var(--cc, var(--neon-red)); border-color: transparent; box-shadow: 0 0 10px var(--cc, var(--neon-red)); }
.gseg.next { outline: 1px dashed rgba(255, 255, 255, 0.25); outline-offset: -1px; }
/* ghost-fill: the NEXT empty segment pulses while its row is selected / hovered / pressed */
.gymRow.sel .gseg.next, .gymRow:hover .gseg.next, .gymRow:active .gseg.next, .gymRow:focus-within .gseg.next {
  background: var(--cc, var(--neon-red)); border-color: transparent; outline: 0;
  animation: ghostFill 0.85s ease-in-out infinite alternate; }
@keyframes ghostFill {
  from { opacity: 0.18; box-shadow: 0 0 2px var(--cc, var(--neon-red)); }
  to { opacity: 0.72; box-shadow: 0 0 16px var(--cc, var(--neon-red)), inset 0 0 6px rgba(255, 255, 255, 0.55); }
}
.gymRow.maxed .gseg.next { display: none; }
.gBtn { grid-area: btn; padding: clamp(5px, 1.4dvh, 9px) clamp(10px, 2vw, 18px); border-radius: 8px; font-family: var(--disp); font-weight: 700;
  font-size: clamp(11px, 3.2dvh, 14px); letter-spacing: 0.08em; color: #fff; white-space: nowrap; touch-action: manipulation; cursor: pointer;
  background: linear-gradient(180deg, var(--red), var(--red2)); box-shadow: 0 3px 0 #6d0e1a; transition: transform 0.08s, box-shadow 0.08s; }
.gBtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #6d0e1a; }
.gBtn.max { background: rgba(255, 255, 255, 0.06); box-shadow: none; color: #8a93a6; pointer-events: none; }

/* ---------- FIGHT HUD: skewed bars, ghost trail, ULT gauge ---------- */
.hs { width: min(37vw, 340px); }
.hname { font-style: italic; text-transform: uppercase; letter-spacing: 0.08em; font-size: clamp(11px, 3.4dvh, 14px); }
.hs .hbar, .hs .ebar { transform: skewX(-20deg); }
.hs .hbar { height: clamp(14px, 4.4dvh, 20px); border-radius: 2px; border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55), inset 0 1px 2px rgba(0, 0, 0, 0.8); }
.hs .hbar i { border-radius: 1px; }
.hs .hbar .hghost { background: #fff; opacity: 0.6; transition: width 0.45s ease-out 0.12s; }   /* delayed damage trail */
.hs.r .hbar i, .hs.r .ebar i { left: auto; right: 0; }                                          /* P2 drains toward the edge */
.hs .ebar { position: relative; height: clamp(7px, 2.2dvh, 11px); margin-top: 5px; border-radius: 2px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0a0e18; overflow: hidden; }
.hs.l .ebar { width: 86%; }
.hs .ebar i { border-radius: 1px; background: linear-gradient(180deg, #a8f4ff, var(--neon-cyan)); box-shadow: 0 0 8px rgba(0, 240, 255, 0.55); }
.hs .ebar::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent calc(25% - 1px), rgba(0, 0, 0, 0.65) calc(25% - 1px) 25%, transparent 25%,
    transparent calc(50% - 1px), rgba(0, 0, 0, 0.65) calc(50% - 1px) 50%, transparent 50%,
    transparent calc(75% - 1px), rgba(0, 0, 0, 0.65) calc(75% - 1px) 75%, transparent 75%); }
.hs .ebar .ulab { position: absolute; z-index: 2; top: 50%; right: 8px; margin: 0; transform: translateY(-50%) skewX(20deg);
  font-family: var(--disp); font-weight: 900; font-style: italic; font-size: clamp(6px, 1.9dvh, 9px); letter-spacing: 0.14em;
  color: #fff; text-shadow: 0 0 6px #000; opacity: 0; }
.hs.r .ebar .ulab { right: auto; left: 8px; }
.hs .ebar.full { border-color: #fff; animation: ultGauge 0.55s ease-in-out infinite alternate; }
.hs .ebar.full i { background: linear-gradient(90deg, #ffffff, var(--neon-cyan) 40%, #ffffff); animation: none; box-shadow: 0 0 14px var(--neon-cyan); }
.hs .ebar.full .ulab { opacity: 1; }
@keyframes ultGauge {
  from { box-shadow: 0 0 4px rgba(0, 240, 255, 0.4); filter: brightness(1); }
  to { box-shadow: 0 0 16px rgba(0, 240, 255, 0.95), 0 0 26px rgba(255, 255, 255, 0.35); filter: brightness(1.35); }
}
.hs .pips span { width: clamp(12px, 3.6dvh, 16px); height: clamp(6px, 1.8dvh, 8px); border-radius: 1px; transform: skewX(-20deg); }
#hTimer { font-family: var(--disp); font-weight: 900; font-style: italic; letter-spacing: 0.02em; font-size: clamp(24px, 8dvh, 44px); line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.9), 0 0 16px rgba(255, 42, 42, 0.55), 0 6px 14px rgba(0, 0, 0, 0.85); }
#hTimer.low { color: #ff3a3a; animation: pulse 0.6s ease-in-out infinite; }
#hMode { font-weight: 700; }
#hudPause { background: var(--glass-bg); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); touch-action: manipulation;
  margin-top: clamp(30px, 10dvh, 50px); }

/* pad: player opacity pref (Settings -> PAD OPACITY) */
#pad { opacity: var(--pad-opacity, 1); }

/* ---------- PAUSE: skewed glass slabs ---------- */
#scr-pause { gap: clamp(5px, 1.6dvh, 12px);
  background: radial-gradient(80vmin 60vmin at 50% 45%, rgba(255, 42, 42, 0.12), transparent 70%), rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#scr-pause .pzTitle { font-family: var(--disp); font-weight: 900; font-style: italic; font-size: clamp(26px, 9dvh, 54px); letter-spacing: 0.12em;
  color: #fff; text-shadow: 2px 2px 0 rgba(0, 240, 255, 0.5), -2px -2px 0 rgba(255, 42, 42, 0.5); }
.pzSub { font-size: clamp(8px, 2dvh, 11px); letter-spacing: 0.4em; text-transform: uppercase; color: var(--mut); margin-top: -4px; }
#scr-pause .pzList { width: min(76vw, 400px); gap: clamp(6px, 1.6dvh, 10px); }
.btn.slab { transform: skewX(-14deg); border-radius: 0; min-height: clamp(36px, 9.5dvh, 50px); font-size: clamp(13px, 3.8dvh, 17px);
  font-style: italic; text-transform: uppercase; letter-spacing: 0.14em; background: var(--glass-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14); border-left: 4px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.btn.slab .cs { display: block; transform: skewX(14deg); }
.btn.slab.primary { border-left-color: var(--neon-red); box-shadow: 0 0 18px rgba(255, 42, 42, 0.35);
  background: linear-gradient(90deg, rgba(255, 42, 42, 0.36), rgba(15, 15, 20, 0.65)); }
.btn.slab:active { transform: skewX(-14deg) scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn.slab:hover { transform: skewX(-14deg) translateX(6px); border-color: var(--neon-cyan); border-left-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.35); filter: none; }
}

/* ---------- MOVE LIST ---------- */
.movesBox { width: min(94vw, 780px); max-height: calc(100dvh - 24px - var(--saT) - var(--saB)); padding: 0; overflow-y: auto; font-size: 13px;
  line-height: 1.3; border-radius: 14px; background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-line); scrollbar-width: none; }
.movesBox::-webkit-scrollbar { display: none; }
.mvHead { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: clamp(5px, 1.6dvh, 10px) 14px; font-family: var(--disp); font-style: italic; font-size: clamp(13px, 3.8dvh, 17px); letter-spacing: 0.1em;
  color: #fff; background: rgba(10, 12, 18, 0.96); border-bottom: 1px solid var(--glass-line); }
.mvHead span { font-family: var(--body); font-style: normal; font-size: 10px; letter-spacing: 0.25em; color: var(--mut); }
.mvGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 6px 14px 10px; }
.mvRow { display: flex; align-items: center; gap: 10px; min-width: 0; padding: clamp(2px, 0.7dvh, 4px) 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.mvk { flex: 0 0 auto; min-width: 9.5em; display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; color: #9aa4b5; }
.mvk em { font-style: normal; color: #fff; font-size: 14px; }
.mvn { min-width: 0; font-size: clamp(11px, 3dvh, 13px); color: #fff; }
.movesBox kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 2em; height: 2em; padding: 0 0.45em; border-radius: 999px;
  font-family: 'Orbitron', 'Arial Black', Impact, sans-serif; font-weight: 900; font-size: 9px; letter-spacing: 0.04em;
  color: var(--kc, #fff); background: rgba(255, 255, 255, 0.07); border: 1.5px solid var(--kc, #fff);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.06), inset 0 0 6px rgba(0, 0, 0, 0.4); }
.movesBox kbd.kL { --kc: #3388ff; } .movesBox kbd.kH { --kc: #ff3333; } .movesBox kbd.kS { --kc: #ffcc00; }
.movesBox kbd.kGR { --kc: #33cc55; } .movesBox kbd.kDG, .movesBox kbd.kTECH { --kc: #e8ecf5; } .movesBox kbd.kULT { --kc: #bb33ff; }

/* ---------- SETTINGS + touch customisation ---------- */
#scr-settings { gap: clamp(4px, 1.4dvh, 10px); justify-content: center; align-items: center;
  background: radial-gradient(80vmin 60vmin at 50% 40%, rgba(255, 42, 42, 0.12), transparent 70%), rgba(5, 7, 12, 0.96); }
.setHead { text-align: center; flex: 0 0 auto; }
.setHead .kicker { font-size: clamp(8px, 2dvh, 10px); letter-spacing: 0.4em; font-weight: 700; }
#scr-settings .setList { width: min(94vw, 540px); gap: clamp(5px, 1.4dvh, 9px); min-height: 0; max-height: calc(100dvh - 70px - var(--saT) - var(--saB));
  overflow-y: auto; scrollbar-width: none; }
#scr-settings .setList::-webkit-scrollbar { display: none; }
.setRow { border-radius: 12px; padding: clamp(6px, 1.6dvh, 12px) 16px; gap: 12px; flex: 0 0 auto; }
.setRow .sl { font-family: var(--disp); font-size: clamp(12px, 3.4dvh, 15px); letter-spacing: 0.1em; flex: 0 0 auto; min-width: 7.5em; }
.setRow .slider { flex: 1; min-width: 90px; width: auto; height: 6px; touch-action: pan-y; cursor: pointer;
  background: linear-gradient(90deg, rgba(255, 42, 42, 0.5), rgba(255, 255, 255, 0.14)); }
.setRow .slider::-webkit-slider-thumb { width: clamp(20px, 5.4dvh, 26px); height: clamp(20px, 5.4dvh, 26px); background: var(--neon-red);
  border: 2px solid #fff; box-shadow: 0 0 12px rgba(255, 42, 42, 0.8); }
.setRow .slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--neon-red); border: 2px solid #fff; }
.setRow .sv { flex: 0 0 auto; min-width: 3.2em; text-align: right; font-family: var(--disp); font-size: clamp(12px, 3.4dvh, 15px); color: var(--neon-cyan); }
.setSub { flex: 0 0 auto; margin-top: 2px; font-size: clamp(8px, 2dvh, 10px); font-weight: 700; letter-spacing: 0.3em; color: var(--neon-red); }
.setBar { flex: 0 0 auto; margin-top: 2px; }

/* ---------- STAGE SELECT ---------- */
#scr-stage { background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(90vmin 70vmin at 50% 50%, rgba(255, 42, 42, 0.14), transparent 70%), var(--bg); }
#scr-stage .selHead { flex: 0 0 auto; }
#scr-stage .stCard { border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 6px; box-shadow: 0 0 22px rgba(255, 42, 42, 0.18), 0 10px 30px rgba(0, 0, 0, 0.5); }
#scr-stage .stName { font-family: var(--disp); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(16px, 5dvh, 26px); }
#scr-stage .navarrow { flex: 0 0 clamp(40px, 10vmin, 56px); transform: skewX(-12deg); border: 1px solid var(--glass-line); background: var(--glass-bg);
  border-radius: 0; touch-action: manipulation; }
#scr-stage .navarrow:active { transform: skewX(-12deg) scale(0.94); }
.stDots i { border-radius: 1px; transform: skewX(-20deg); width: 14px; height: 6px; }
.stDots i.on { background: var(--neon-red); box-shadow: 0 0 10px var(--neon-red); transform: skewX(-20deg) scale(1.2); }
#scr-stage .bar .btn.primary { border-radius: 0; transform: skewX(-15deg); font-style: italic; }
#scr-stage .bar .btn.primary:active { transform: skewX(-15deg) scale(0.95); }

/* ---------- short landscape phones ---------- */
@media (max-height: 500px) {
  .gymRow { gap: 3px 10px; }
  .gymTop .gd { display: none; }
  .hqInfo .kicker { display: none; }
  .mvGrid { gap: 0 12px; }
  #scr-pause .pzSub { display: none; }
}
/* gym fit: nav lives under the portrait, rows stay compact on short screens */
.gymLeft .hqNav { justify-content: center; flex: 0 0 auto; }
.gymLeft .hqNav .arrow { min-height: 26px; }
.gymId .hqStyle { line-height: 1.1; margin-top: 2px; }
@media (max-height: 500px) {
  .gymRow { padding: 5px 12px; }
  .gymTop .gl { font-size: clamp(13px, 3.6dvh, 18px); }
  .gTrack { height: clamp(8px, 2.6dvh, 14px); }
  .gBtn { padding: 4px 12px; }
}
/* DG / TECH shoulder bars sit just below the HUD bars instead of covering them */
.sh { top: calc(max(19dvh, 64px) + var(--saT)); }

/* ---------- secret dev readout: must look completely static ---------- */
.pRankBox, .pRankBox * { cursor: default; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.pRankBox { touch-action: manipulation; transition: none; }
.pRankBox:hover, .pRankBox:active, .pRankBox:focus { transform: none; background: none; box-shadow: none; filter: none; outline: 0; }
.pcol b.pRank.dev { color: var(--neon-cyan); text-shadow: 0 0 6px var(--neon-cyan), 0 0 14px rgba(0, 240, 255, 0.7); }

/* ============================================================
   v7 — TOURNAMENT: size picker, bracket tree, podium
   Additive only (menu / select untouched). dvh / vmin / safe-area sized.
   ============================================================ */
#scr-tsize, #scr-bracket, #scr-podium {
  gap: clamp(5px, 1.8dvh, 14px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(90vmin 70vmin at 50% 45%, rgba(255, 42, 42, 0.15), transparent 70%), var(--bg);
}
.btn.go { transform: skewX(-15deg); border-radius: 0; border: 0; font-style: italic; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0 clamp(18px, 4vw, 40px); }
.btn.go .cs { display: block; transform: skewX(15deg); }
.btn.go:active { transform: skewX(-15deg) scale(0.95); }

/* ---- size picker ---- */
#scr-tsize { justify-content: center; align-items: center; }
.tsHead { text-align: center; }
.tsHead .kicker { font-size: clamp(8px, 2dvh, 10px); letter-spacing: 0.4em; font-weight: 700; color: var(--neon-red); }
.tsRow { display: flex; justify-content: center; gap: clamp(10px, 3vw, 26px); padding: 8px 12px; }
.tsCard { width: clamp(118px, 24vw, 200px); padding: 0; text-align: center; border-radius: 0; cursor: pointer; touch-action: manipulation;
  transform: skewX(-12deg); background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-line); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease; }
.tsIn { transform: skewX(12deg); display: flex; flex-direction: column; align-items: center; gap: clamp(1px, 0.6dvh, 4px);
  padding: clamp(8px, 2.6dvh, 20px) 8px; }
.tsN { font-family: var(--disp); font-weight: 900; font-style: italic; line-height: 0.9; color: transparent;
  font-size: clamp(2.2rem, min(9vw, 17dvh), 4.6rem); -webkit-text-stroke: 1px rgba(255, 255, 255, 0.5); transition: all 0.2s; }
.tsF { font-family: var(--body); font-weight: 700; letter-spacing: 0.35em; font-size: clamp(9px, 2.3dvh, 12px); color: #9aa4b5; padding-left: 0.35em; }
.tsPot { margin-top: clamp(2px, 1dvh, 8px); display: flex; flex-direction: column; align-items: center; }
.tsPot i { font-style: normal; font-size: clamp(7px, 1.9dvh, 9px); letter-spacing: 0.22em; color: #8a93a6; font-weight: 700; }
.tsPot b { font-family: var(--disp); font-weight: 700; font-size: clamp(1.1rem, 4.8dvh, 1.8rem); color: #ffe14a; text-shadow: 0 0 12px rgba(255, 210, 58, 0.4); }
.tsMeta { font-family: var(--body); font-weight: 600; font-size: clamp(8px, 2dvh, 11px); letter-spacing: 0.12em; color: #8a93a6; text-transform: uppercase; }
.tsCard.sel { transform: skewX(-12deg) translateY(-5px); border-color: var(--neon-red);
  background: linear-gradient(180deg, rgba(255, 42, 42, 0.24), rgba(15, 15, 20, 0.68));
  box-shadow: 0 0 0 1px var(--neon-red), 0 0 26px rgba(255, 42, 42, 0.55), 0 10px 30px rgba(0, 0, 0, 0.45); }
.tsCard.sel .tsN { color: #fff; -webkit-text-stroke: 0; text-shadow: 2px 2px 0 var(--neon-red); }
.tsCard:active { transform: skewX(-12deg) scale(0.96); }
@media (hover: hover) and (pointer: fine) { .tsCard:not(.sel):hover { border-color: rgba(255, 42, 42, 0.6); transform: skewX(-12deg) translateY(-3px); } }
.tsBar { display: flex; align-items: center; gap: 14px; }

/* ---- bracket tree ---- */
#scr-bracket { justify-content: flex-start; align-items: stretch; gap: clamp(4px, 1.4dvh, 10px);
  padding-bottom: calc(clamp(58px, 16dvh, 74px) + var(--saB)); }
.brHead { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.brHead .kicker { font-size: clamp(8px, 2dvh, 10px); letter-spacing: 0.4em; font-weight: 700; color: var(--neon-red); }
.brHead .title-glitch { font-size: clamp(1rem, 5dvh, 1.7rem); }
.brNote { text-align: right; font-size: clamp(8px, 2.2dvh, 11px); letter-spacing: 0.14em; color: #7d879a; text-transform: uppercase; }
.bracket-scroll { flex: 0 1 auto; min-height: 0; max-height: 55dvh; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y;
  padding: 10px 14px 12px; border-radius: 14px; border: 1px solid var(--glass-line); background: rgba(10, 12, 18, 0.5);
  scrollbar-width: thin; scrollbar-color: var(--neon-red) transparent; }
.bracket-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.bracket-scroll::-webkit-scrollbar-track { background: transparent; }
.bracket-scroll::-webkit-scrollbar-thumb { background: var(--neon-red); border-radius: 6px; }
.bracket-scroll .brTree { --cg: 30px; --mh: clamp(46px, 14dvh, 68px); display: flex; flex-direction: row; align-items: stretch;
  gap: var(--cg); width: max-content; min-width: 100%; }
.brCol { flex: 0 0 auto; width: clamp(150px, 27vw, 215px); display: flex; flex-direction: column; gap: 6px; }
.brBadge { position: sticky; top: -10px; z-index: 2; align-self: flex-start; padding: 2px 12px; transform: skewX(-12deg);
  font-family: var(--disp); font-weight: 700; font-style: italic; font-size: clamp(9px, 2.5dvh, 12px); letter-spacing: 0.14em; white-space: nowrap;
  color: #8a93a6; background: #12151f; border: 1px solid var(--glass-line); }
.brCol.cur .brBadge { color: #fff; border-color: var(--neon-red); background: linear-gradient(90deg, rgba(255, 42, 42, 0.55), #12151f);
  box-shadow: 0 0 12px rgba(255, 42, 42, 0.45); }
.brCol.past .brBadge { color: #6d7588; }
.brMatches { flex: 1; display: flex; flex-direction: column; }
.brWrap { position: relative; flex: 1 0 auto; min-height: var(--mh); display: flex; align-items: center; padding: 3px 0; }
.brMatch { position: relative; width: 100%; display: flex; flex-direction: column; border-radius: 8px;
  background: rgba(18, 22, 34, 0.88); border: 1px solid rgba(255, 255, 255, 0.1); opacity: 0.55; }
.brCol.cur .brMatch:not(.mine) { opacity: 0.72; }
.brMatch.mine { opacity: 1; border-color: var(--neon-red); z-index: 1;
  background: linear-gradient(180deg, rgba(255, 42, 42, 0.16), rgba(18, 22, 34, 0.94));
  box-shadow: 0 0 0 1px var(--neon-red), 0 0 18px rgba(255, 42, 42, 0.55); }
.brSlot { display: flex; align-items: center; gap: 6px; min-width: 0; padding: clamp(3px, 1dvh, 6px) 8px; font-size: clamp(11px, 3dvh, 14px); }
.brSlot + .brSlot { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.brTag { flex: 0 0 auto; max-width: 5.4em; padding: 1px 5px; border-radius: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--body); font-weight: 700; font-size: clamp(7px, 1.9dvh, 9px); letter-spacing: 0.1em; text-transform: uppercase;
  color: #9aa4b5; background: rgba(255, 255, 255, 0.08); }
.brTag:empty { display: none; }
.brMatch.mine .brSlot:not(.you) .brTag { color: #111; background: #fff; }
.brSlot.you .brTag { color: #fff; background: var(--neon-red); box-shadow: 0 0 8px rgba(255, 42, 42, 0.75); }
.brName { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--disp); font-weight: 500; letter-spacing: 0.03em; color: #e6eaf5; }
.brSlot.you .brName { color: #fff; font-weight: 700; }
.brSlot.empty .brName { color: #56607a; font-style: italic; }
.brSlot.win .brName { color: #7dff6a; }
.brSlot.lose .brName { color: #7a8296; text-decoration: line-through; }
.brMark { flex: 0 0 auto; color: #7dff6a; font-size: 12px; }
/* tree connectors (stubs + pair joins) */
.brCol:not(:last-child) .brWrap::after { content: ''; position: absolute; left: 100%; top: 50%; width: calc(var(--cg) / 2); border-top: 1px solid rgba(255, 255, 255, 0.22); }
.brCol:not(:last-child) .brWrap:nth-child(odd)::before { content: ''; position: absolute; left: calc(100% + var(--cg) / 2); top: 50%; height: 50%; border-left: 1px solid rgba(255, 255, 255, 0.22); }
.brCol:not(:last-child) .brWrap:nth-child(even)::before { content: ''; position: absolute; left: calc(100% + var(--cg) / 2); bottom: 50%; height: 50%; border-left: 1px solid rgba(255, 255, 255, 0.22); }
.brCol:not(:first-child) .brMatch::before { content: ''; position: absolute; right: 100%; top: 50%; width: calc(var(--cg) / 2); border-top: 1px solid rgba(255, 255, 255, 0.22); }
/* frosted, always-visible footer */
.brFoot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: clamp(6px, 1.6dvh, 10px) calc(14px + var(--saR)) calc(clamp(6px, 1.6dvh, 10px) + var(--saB)) calc(14px + var(--saL));
  background: rgba(10, 12, 18, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--glass-line); }
.brFoot .btn { min-height: clamp(34px, 9.5dvh, 46px); }

/* ---- podium ---- */
#scr-podium { justify-content: center; align-items: center; }
#scr-podium .kicker { font-size: clamp(8px, 2dvh, 10px); letter-spacing: 0.4em; font-weight: 700; color: var(--neon-red); }
.pdTitle.champ { color: #ffd23a; text-shadow: 2px 2px 0 rgba(255, 42, 42, 0.6), 0 0 22px rgba(255, 210, 58, 0.6); }
#scr-podium .resLines { border-radius: 14px; }

@media (max-height: 500px) { .brNote { display: none; } }
/* bracket polish: softer scrollbar thumb, muted history */
.bracket-scroll { scrollbar-color: rgba(255, 42, 42, 0.65) transparent; }
.bracket-scroll::-webkit-scrollbar { width: 4px; height: 4px; }
.bracket-scroll::-webkit-scrollbar-thumb { background: rgba(255, 42, 42, 0.65); }
.brCol.past .brMatch.mine { opacity: 0.7; box-shadow: none; }
