:root {
  color-scheme: dark;
  --void: #02060d;
  --night: #030914;
  --panel: #071629;
  --cyan: #56efe6;
  --cyan-dim: #1b8f96;
  --red: #ff536f;
  --red-deep: #8b183d;
  --amber: #ffb74a;
  --ink: #e8f0f1;
  --silver: #a8b7bd;
  --muted: #697b85;
  --line: rgba(151, 201, 207, 0.22);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--void); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(52, 117, 137, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 117, 137, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 48% 20%, #0c2539 0, var(--night) 38%, var(--void) 75%);
  background-size: 52px 52px, 52px 52px, auto;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.arena-page { width: min(1440px, 100%); min-height: 100vh; margin: 0 auto; padding: 18px clamp(14px, 3vw, 42px) 22px; }

.topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 46px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font: 700 11px/1 "Courier New", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topline a { color: var(--silver); text-decoration: none; }
.topline a:hover { color: var(--amber); }
.station-mark { display: flex; align-items: baseline; gap: 12px; }
.station-mark span { color: var(--muted); }
.station-mark b { color: var(--ink); font-size: 13px; }
.text-button { justify-self: end; padding: 8px 0 8px 12px; border: 0; color: var(--muted); background: transparent; cursor: pointer; letter-spacing: inherit; }
.text-button b { color: var(--cyan); }

.cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  border: 1px solid rgba(160, 207, 213, 0.32);
  background: rgba(2, 9, 18, 0.9);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48);
}
.stage-column { min-width: 0; border-right: 1px solid var(--line); }
.stage-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 83, 111, 0.06), transparent 48%, rgba(86, 239, 230, 0.06));
  font: 700 10px/1 "Courier New", monospace;
  letter-spacing: 0.12em;
}
.stage-bar p { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.stage-bar p i { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }
.stage-bar p i.is-online { border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.stage-bar strong { color: var(--silver); font-size: 10px; }
.stage-bar time { justify-self: end; color: white; font-size: 19px; letter-spacing: 0.06em; }

.viewport-shell { position: relative; overflow: hidden; background: #020713; isolation: isolate; }
.viewport-shell::after { position: absolute; z-index: 6; inset: 0; border: 0 solid rgba(255, 83, 111, 0); content: ""; pointer-events: none; }
.viewport-shell.is-under-attack::after { animation: incoming-hit 720ms ease-out; }
@keyframes incoming-hit {
  0% { border-width: 8px; border-color: rgba(255, 83, 111, 0.95); box-shadow: inset 0 0 80px rgba(255, 83, 111, 0.42); }
  100% { border-width: 1px; border-color: rgba(255, 83, 111, 0); box-shadow: inset 0 0 16px rgba(255, 83, 111, 0); }
}
#arenaCanvas { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; background: #03091a; touch-action: none; }
.scanlines { position: absolute; z-index: 4; inset: 0; pointer-events: none; opacity: 0.12; background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.62) 4px); mix-blend-mode: multiply; }
.camera-stamp { position: absolute; z-index: 5; right: 12px; bottom: 10px; color: rgba(205, 229, 233, 0.44); font: 700 8px/1 "Courier New", monospace; letter-spacing: 0.12em; pointer-events: none; }
.object-legend { position: absolute; z-index: 7; top: 14px; right: 14px; display: flex; gap: 13px; padding: 7px 9px; border: 1px solid rgba(168, 206, 211, .28); color: rgba(225, 242, 244, .88); background: rgba(1, 7, 16, .76); font: 700 9px/1 "Courier New", monospace; pointer-events: none; }
.object-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.object-legend i { position: relative; display: inline-grid; width: 14px; height: 14px; place-items: center; font-style: normal; font-weight: 900; }
.legend-energy { color: #173000; background: #baff42; box-shadow: 0 0 8px rgba(95, 255, 225, .76); transform: rotate(45deg); }
.legend-energy::before { content: "+"; transform: rotate(-45deg); }
.legend-obstacle::before, .legend-obstacle::after { position: absolute; bottom: 1px; width: 0; height: 0; border-right: 5px solid transparent; border-bottom: 12px solid #f05cff; border-left: 5px solid transparent; content: ""; filter: drop-shadow(0 0 3px rgba(240, 92, 255, .7)); }
.legend-obstacle::before { left: -1px; }
.legend-obstacle::after { right: -2px; height: 0; transform: scale(.82); transform-origin: bottom; }
body:not([data-view="playing"]) .object-legend { display: none; }

.lobby-panel, .waiting-panel, .result-panel {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: clamp(18px, 5vw, 62px);
  width: min(590px, calc(100% - 36px));
  padding: clamp(22px, 3vw, 38px);
  border-left: 3px solid var(--red);
  background: linear-gradient(90deg, rgba(2, 7, 16, 0.97), rgba(3, 10, 22, 0.91) 82%, transparent);
  transform: translateY(-50%);
}
.eyebrow { margin: 0; color: var(--cyan); font: 700 10px/1 "Courier New", monospace; letter-spacing: 0.19em; }
.lobby-panel h1, .waiting-panel h2, .result-panel h2 { margin: 13px 0 0; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(38px, 5.1vw, 72px); font-weight: 900; line-height: 0.94; letter-spacing: 0.01em; text-transform: uppercase; }
.lobby-panel h1 span { color: transparent; -webkit-text-stroke: 1px rgba(232, 240, 241, 0.72); }
.lobby-copy { max-width: 570px; margin: 18px 0 0; color: var(--silver); font-size: 14px; line-height: 1.75; }
.lobby-actions { display: grid; grid-template-columns: 190px minmax(220px, 1fr); gap: 20px; align-items: end; margin-top: 24px; }
.primary-action { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 48px; padding: 0 15px; border: 1px solid var(--red); color: white; background: linear-gradient(90deg, var(--red-deep), #541535); box-shadow: 5px 5px 0 rgba(86, 239, 230, 0.28); cursor: pointer; font-weight: 900; }
.primary-action:hover { filter: brightness(1.13); }
kbd { padding: 2px 5px; border: 1px solid currentColor; color: inherit; font: 700 9px/1 "Courier New", monospace; }
.join-form label { display: block; margin-bottom: 7px; color: var(--muted); font: 700 9px/1 "Courier New", monospace; letter-spacing: 0.12em; }
.join-form > div { display: grid; grid-template-columns: 1fr 66px; }
.join-form input, .join-form button { min-width: 0; height: 48px; border: 1px solid rgba(168, 206, 211, 0.42); }
.join-form input { padding: 0 12px; color: white; background: rgba(0, 5, 13, 0.86); font: 700 16px/1 "Courier New", monospace; letter-spacing: 0.13em; text-transform: uppercase; }
.join-form button { border-left: 0; color: var(--night); background: var(--cyan); cursor: pointer; font-weight: 900; }
.lobby-message { min-height: 17px; margin: 13px 0 0; color: var(--muted); font-size: 11px; }
.lobby-message.is-error { color: #ff8c9e; }

.waiting-panel, .result-panel { left: 50%; width: min(480px, calc(100% - 36px)); border-right: 1px solid rgba(86, 239, 230, 0.44); transform: translate(-50%, -50%); text-align: center; }
.waiting-panel h2, .result-panel h2 { font-size: clamp(38px, 5vw, 58px); }
.room-code { display: block; width: 100%; margin: 24px 0 13px; padding: 14px; border: 1px solid var(--cyan); color: var(--amber); background: rgba(1, 7, 15, 0.92); cursor: copy; font: 900 clamp(31px, 6vw, 52px)/1 "Courier New", monospace; letter-spacing: 0.18em; }
.share-action { width: min(290px, 100%); margin: 0 auto 14px; }
.waiting-panel > p:not(.eyebrow), .result-panel > p:not(.eyebrow) { color: var(--silver); font-size: 13px; line-height: 1.6; }
.quiet-action { margin-top: 12px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.result-panel .result-reason { margin: 18px 0 6px; color: var(--amber); font-weight: 800; }
.rematch-status { min-height: 17px; margin: 15px 0 0 !important; color: var(--cyan) !important; font: 700 10px/1.5 "Courier New", monospace !important; }
.result-actions { display: grid; grid-template-columns: minmax(210px, 1fr) auto; gap: 18px; align-items: center; margin-top: 15px; }
.result-actions .primary-action { width: 100%; }
.result-actions .quiet-action { margin-top: 0; white-space: nowrap; }
.result-actions .primary-action:disabled { cursor: wait; opacity: .58; }

.briefing-panel {
  position: absolute;
  z-index: 9;
  inset: 16px;
  overflow: auto;
  padding: clamp(18px, 2.6vw, 30px);
  border: 1px solid rgba(86, 239, 230, 0.58);
  border-left: 5px solid var(--cyan);
  background:
    linear-gradient(90deg, rgba(86, 239, 230, 0.08) 0 1px, transparent 1px 100%),
    rgba(2, 8, 18, 0.97);
  background-size: 32px 100%, auto;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58), inset 0 0 54px rgba(21, 95, 115, 0.09);
}
.briefing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.briefing-head h2 { margin: 8px 0 0; font: 900 clamp(30px, 4vw, 48px)/0.95 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; letter-spacing: 0.02em; }
.briefing-head > strong { margin-top: -12px; color: rgba(86, 239, 230, 0.1); font: 900 clamp(76px, 12vw, 132px)/0.8 Impact, sans-serif; -webkit-text-stroke: 1px rgba(86, 239, 230, 0.38); }
.identity-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: -10px; padding: 10px 13px; border-block: 1px solid rgba(168, 206, 211, 0.24); color: var(--ink); background: rgba(2, 14, 26, 0.86); font: 800 11px/1.2 "Courier New", monospace; }
.identity-strip span { display: inline-flex; align-items: center; gap: 8px; }
.identity-strip i { width: 11px; height: 11px; transform: rotate(45deg); }
.identity-local { background: var(--red); box-shadow: 0 0 9px rgba(255, 83, 111, 0.65); }
.identity-rival { background: var(--cyan); box-shadow: 0 0 9px rgba(86, 239, 230, 0.55); }
.briefing-lead { max-width: 760px; margin: 14px 0 0; color: var(--silver); font-size: 13px; line-height: 1.65; }
.briefing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 16px; background: rgba(86, 239, 230, 0.24); }
.briefing-grid article { min-height: 112px; padding: 14px 15px; background: rgba(2, 10, 20, 0.98); }
.briefing-grid b { color: var(--amber); font: 800 9px/1 "Courier New", monospace; letter-spacing: 0.12em; }
.briefing-grid strong { display: block; margin-top: 9px; color: white; font-size: 14px; line-height: 1.35; }
.briefing-grid p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.briefing-ready { position: sticky; bottom: -1px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding-top: 12px; background: linear-gradient(transparent, rgba(2, 8, 18, 0.98) 26%); }
.briefing-ready p { margin: 0; color: var(--cyan); font: 700 10px/1.5 "Courier New", monospace; }
.briefing-ready .primary-action { flex: 0 0 min(310px, 55%); }
.briefing-ready .primary-action:disabled { cursor: wait; opacity: 0.58; }

.arena-toast { position: absolute; z-index: 9; top: 18px; left: 50%; min-width: 180px; padding: 9px 14px; border: 1px solid var(--amber); color: var(--amber); background: rgba(2, 8, 17, 0.92); opacity: 0; transform: translate(-50%, -7px); transition: opacity 120ms ease, transform 120ms ease; font: 700 11px/1 "Courier New", monospace; letter-spacing: 0.07em; text-align: center; pointer-events: none; }
.arena-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.arena-toast.is-damage { border-color: var(--red); color: var(--red); }
.threat-rail {
  position: absolute;
  z-index: 9;
  top: 58px;
  left: 50%;
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 9px;
  min-width: 246px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 83, 111, .78);
  color: #ffd7df;
  background: rgba(25, 3, 14, .88);
  box-shadow: 0 0 25px rgba(255, 83, 111, .14);
  transform: translateX(-50%);
  font: 800 10px/1 "Courier New", monospace;
  letter-spacing: .05em;
  pointer-events: none;
}
.threat-rail i { width: 8px; height: 8px; background: var(--red); box-shadow: 0 0 11px var(--red); transform: rotate(45deg); animation: threat-pulse 520ms ease-in-out infinite alternate; }
.threat-rail b { min-width: 30px; color: white; font-size: 13px; text-align: right; }
@keyframes threat-pulse { to { opacity: .3; transform: rotate(45deg) scale(.72); } }
.mobile-duel-strip { display: none; }
.countdown-display { position: absolute; z-index: 10; inset: 50% auto auto 50%; color: white; filter: drop-shadow(0 0 18px rgba(86, 239, 230, 0.72)); transform: translate(-50%, -50%); font: 900 clamp(86px, 16vw, 150px)/1 "Arial Narrow", Impact, sans-serif; }
.control-hint { position: absolute; z-index: 7; left: 50%; bottom: 12px; padding: 8px 12px; border: 1px solid rgba(86, 239, 230, 0.45); color: var(--silver); background: rgba(1, 7, 15, 0.82); transform: translateX(-50%); font: 700 10px/1 "Courier New", monospace; letter-spacing: 0.06em; white-space: nowrap; pointer-events: none; }
.control-hint b { color: var(--cyan); }
.control-hint span { margin: 0 7px; color: var(--muted); }

.local-strip { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); min-height: 74px; border-top: 1px solid var(--line); }
.local-strip > div:not(.combo-track) { padding: 13px 17px; }
.local-strip > div + div:not(.combo-track) { border-left: 1px solid var(--line); }
.local-strip small { display: block; color: var(--muted); font: 700 8px/1 "Courier New", monospace; letter-spacing: 0.14em; }
.local-strip strong { display: block; margin-top: 7px; color: white; font: 700 22px/1 "Courier New", monospace; }
.local-strip .incoming-cell strong { color: var(--amber); }
.combo-track { position: absolute; inset: auto 0 0; height: 3px; background: rgba(255,255,255,.06); }
.combo-track i { display: block; width: 0; height: 100%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.rival-console { display: flex; flex-direction: column; min-height: 0; background: linear-gradient(180deg, rgba(9, 29, 47, 0.92), rgba(2, 8, 16, 0.98)); }
.rival-console > header { padding: 21px 20px; border-bottom: 1px solid var(--line); }
.rival-console header p, .rival-console header h2 { margin: 0; }
.rival-console header p { color: var(--muted); font: 700 9px/1 "Courier New", monospace; letter-spacing: 0.16em; }
.rival-console header h2 { margin-top: 6px; color: var(--cyan); font-size: 22px; }
#peerStatus { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--muted); font: 700 10px/1 "Courier New", monospace; }
#peerStatus i { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }
#peerStatus.is-online { color: var(--cyan); }
#peerStatus.is-online i { background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.rival-vitals { padding: 21px 20px; border-bottom: 1px solid var(--line); }
.body-readout small { color: var(--muted); font: 700 8px/1 "Courier New", monospace; letter-spacing: 0.11em; }
.body-readout strong { display: block; margin-top: 5px; font: 900 55px/.9 "Arial Narrow", sans-serif; }
#rivalSegments { display: flex; flex-wrap: wrap; gap: 4px; min-height: 15px; margin-top: 12px; }
#rivalSegments i { width: 13px; height: 5px; background: var(--cyan); box-shadow: 0 0 6px rgba(86,239,230,.35); }
.rival-vitals dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 0; }
.rival-vitals dl div + div { padding-left: 9px; border-left: 1px solid var(--line); }
.rival-vitals dt { color: var(--muted); font: 700 7px/1 "Courier New", monospace; }
.rival-vitals dd { margin: 6px 0 0; font: 700 16px/1 "Courier New", monospace; }
.link-log { flex: 1; min-height: 170px; padding: 20px; border-bottom: 1px solid var(--line); overflow: hidden; }
.link-log > p, .rules-card > p { margin: 0 0 13px; color: var(--muted); font: 700 8px/1 "Courier New", monospace; letter-spacing: 0.16em; }
.link-log ol { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.link-log li { display: grid; grid-template-columns: 42px 1fr; gap: 8px; color: var(--silver); font: 700 9px/1.35 "Courier New", monospace; }
.link-log time { color: var(--cyan-dim); }
.link-log li.is-attack span { color: var(--amber); }
.link-log li.is-damage span { color: var(--red); }
.rules-card { padding: 20px; }
.rules-card ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--silver); font-size: 11px; }
.rules-card b { display: inline-block; min-width: 69px; color: var(--ink); font: 700 10px/1 "Courier New", monospace; }

.control-bar { display: flex; align-items: center; gap: 26px; min-height: 54px; color: var(--muted); font: 700 10px/1.4 "Courier New", monospace; }
.control-bar p { margin: 0; }
.control-bar b { color: var(--silver); }
.dpad { position: fixed; z-index: 30; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); display: none; margin: 0; grid-template-columns: repeat(2, 66px); grid-template-rows: 52px; gap: min(20vw, 96px); transform: translateX(-50%); }
.dpad button { width: 66px; height: 52px; border: 1px solid rgba(86, 239, 230, 0.68); color: var(--cyan); background: rgba(3, 13, 25, 0.88); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38); touch-action: manipulation; font-size: 24px; }
.dpad button:active { color: var(--night); background: var(--cyan); }
body[data-view="playing"] .lobby-panel, body[data-view="playing"] .waiting-panel, body[data-view="playing"] .result-panel { display: none; }
body[data-view="playing"] .stage-bar time { color: var(--cyan); text-shadow: 0 0 12px rgba(86,239,230,.4); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 980px) {
  .arena-page { padding: 12px; }
  .cockpit { grid-template-columns: minmax(0, 1fr) 238px; }
  .lobby-actions { grid-template-columns: 165px 1fr; }
  .rules-card { display: none; }
}
@media (max-width: 760px) {
  .topline { grid-template-columns: 1fr auto; }
  .station-mark { display: none; }
  .cockpit { display: block; }
  .stage-column { border-right: 0; }
  .rival-console { display: grid; grid-template-columns: 1fr 1.4fr; }
  .rival-console > header { grid-row: span 2; }
  .rival-vitals, .link-log { border-left: 1px solid var(--line); }
  .link-log { min-height: 130px; }
  .lobby-panel { left: 15px; width: calc(100% - 30px); padding: 20px; }
  .lobby-panel h1 { font-size: clamp(32px, 8vw, 54px); }
  .lobby-copy { max-height: 70px; overflow: hidden; }
  .lobby-actions { grid-template-columns: 1fr; gap: 13px; margin-top: 17px; }
  .primary-action { min-height: 43px; }
  .join-form input, .join-form button { height: 43px; }
  body[data-view="playing"] .dpad { display: grid; }
}
@media (hover: none), (pointer: coarse) {
  body[data-view="playing"] .dpad { display: grid; }
}
@media (max-width: 520px) {
  .arena-page { padding: 8px; }
  .stage-bar { grid-template-columns: 1fr auto; padding: 0 9px; }
  .stage-bar strong { display: none; }
  #arenaCanvas { aspect-ratio: 4 / 3; object-fit: cover; }
  .lobby-copy { display: none; }
  .lobby-panel h1 { margin-top: 9px; }
  .local-strip > div:not(.combo-track) { padding: 10px 8px; }
  .local-strip strong { font-size: 17px; }
  .rival-console { display: block; }
  .rival-console > header, .rival-vitals { padding: 14px; }
  .rival-vitals { border-left: 0; }
  .link-log { display: none; }
  .control-bar p:nth-child(2) { display: none; }
  .object-legend { top: 7px; right: 7px; gap: 8px; padding: 5px 6px; font-size: 7px; }
  .object-legend i { width: 11px; height: 11px; }
  .briefing-panel { position: fixed; inset: 58px 8px 10px; padding: 12px 12px 16px; }
  .briefing-head h2 { margin-top: 5px; font-size: 28px; }
  .briefing-head > strong { display: none; }
  .identity-strip { gap: 7px 14px; margin-top: 10px; padding: 8px 9px; font-size: 9px; }
  .identity-strip i { width: 9px; height: 9px; }
  .briefing-lead { margin-top: 9px; font-size: 10px; line-height: 1.45; }
  .briefing-grid { grid-template-columns: 1fr; margin-top: 10px; }
  .briefing-grid article { min-height: 0; padding: 9px 10px; }
  .briefing-grid strong { margin-top: 4px; font-size: 12px; }
  .briefing-grid p { margin-top: 3px; font-size: 9px; line-height: 1.4; }
  .briefing-ready { position: static; align-items: stretch; flex-direction: column; gap: 7px; margin-top: 10px; padding-top: 0; background: none; }
  .briefing-ready p { font-size: 9px; }
  .briefing-ready .primary-action { flex-basis: auto; width: 100%; }
  .result-actions { grid-template-columns: 1fr; gap: 9px; }
  body[data-view="briefing"] .stage-bar,
  body[data-view="briefing"] .local-strip,
  body[data-view="briefing"] .rival-console,
  body[data-view="briefing"] .control-bar { visibility: hidden; }

  body[data-view="playing"] { height: 100dvh; min-height: 0; overflow: hidden; overscroll-behavior: none; }
  body[data-view="playing"] .arena-page { width: 100%; height: 100dvh; min-height: 0; padding: 0; }
  body[data-view="playing"] .topline,
  body[data-view="playing"] .rival-console,
  body[data-view="playing"] .local-strip { display: none; }
  body[data-view="playing"] .control-bar { position: fixed; z-index: 29; inset: 0; min-height: 0; pointer-events: none; }
  body[data-view="playing"] .control-bar > p { display: none; }
  body[data-view="playing"] .control-bar .dpad { pointer-events: auto; }
  body[data-view="playing"] .cockpit { height: 100dvh; border: 0; }
  body[data-view="playing"] .stage-column { display: flex; height: 100%; flex-direction: column; }
  body[data-view="playing"] .stage-bar { z-index: 12; flex: 0 0 44px; min-height: 44px; background: rgba(2, 9, 18, .94); }
  body[data-view="playing"] .stage-bar time { font-size: 16px; }
  body[data-view="playing"] .viewport-shell { flex: 1 1 auto; min-height: 0; }
  body[data-view="playing"] #arenaCanvas { width: 100%; height: 100%; aspect-ratio: auto; object-fit: fill; }
  body[data-view="playing"] .scanlines { opacity: .075; }
  body[data-view="playing"] .mobile-duel-strip {
    position: absolute;
    z-index: 8;
    top: 7px;
    right: 7px;
    left: 7px;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 68px;
    align-items: center;
    min-height: 43px;
    border: 1px solid rgba(86, 239, 230, .35);
    background: rgba(1, 8, 18, .8);
    backdrop-filter: blur(7px);
  }
  .mobile-duel-strip > div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; padding: 6px 8px; }
  .mobile-duel-strip > div:last-child { text-align: right; }
  .mobile-duel-strip small { grid-row: 1 / span 2; align-self: center; margin-right: 6px; color: var(--cyan); font: 800 8px/1 "Courier New", monospace; }
  .mobile-duel-strip b { color: white; font: 900 17px/1 "Arial Narrow", sans-serif; }
  .mobile-duel-strip span { color: var(--muted); font: 700 7px/1 "Courier New", monospace; }
  .mobile-duel-strip p { margin: 0; padding: 0 7px; overflow: hidden; color: var(--amber); font: 800 8px/1.3 "Courier New", monospace; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-duel-strip p.is-damage { color: #ff8ba0; }
  body[data-view="playing"] .object-legend { top: 58px; opacity: .92; }
  body[data-view="playing"] .threat-rail { top: 91px; min-width: 220px; padding: 7px 9px; }
  body[data-view="playing"] .arena-toast { top: 128px; max-width: calc(100% - 28px); }
  body[data-view="playing"] .control-hint { bottom: 88px; max-width: calc(100% - 18px); overflow: hidden; font-size: 8px; text-overflow: ellipsis; }
  body[data-view="playing"] .camera-stamp { display: none; }
  body[data-view="playing"] .dpad { bottom: calc(17px + env(safe-area-inset-bottom)); grid-template-columns: repeat(2, 74px); grid-template-rows: 58px; gap: min(31vw, 122px); }
  body[data-view="playing"] .dpad button { width: 74px; height: 58px; border-width: 1.5px; background: rgba(3, 13, 25, .8); backdrop-filter: blur(5px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
