:root {
  --ink: #1e1b33;
  --orange: #e2662e;
  --violet: #4a3b57;
  --bone: #f2e9da;
  --paper: #ece1cd;
  --paper-deep: #ddcfb6;
  --tatami: #6e8b5a;
  --crimson: #c0304a;
  --gold: #e0a73c;
  --display: "Big Shoulders Stencil", Impact, sans-serif;
  --text: "Zen Kaku Gothic New", "Helvetica Neue", sans-serif;
  --num: "Chakra Petch", ui-monospace, monospace;
  --bar: 54px;
  --side: clamp(300px, 19vw, 356px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #6f5a4c;
}

body {
  font-family: var(--text);
  color: var(--ink);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#app {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: #6f5a4c;
  isolation: isolate;
}

/* ---------------------------------- STAGE --------------------------------- */

#arena {
  position: absolute;
  inset: 0 0 var(--bar) 0;
  overflow: hidden;
  background: #8c6a52;
}

.stage { position: absolute; inset: 0; overflow: hidden; }

.stage-photo {
  position: absolute;
  inset: -2.5% -4%;
  background-color: #9b795c;
  background-image: url("assets/stage/stage_clean.webp");
  background-size: cover;
  background-position: 50% 56%;
  transform: translate3d(0, 0, 0) scale(1.02);
  will-change: transform;
  filter: saturate(1.16) contrast(1.10) brightness(1.03);
}
.stage-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 12% 42%, rgba(255, 214, 158, 0.16), rgba(255, 214, 158, 0) 48%),
    linear-gradient(to bottom, rgba(30, 27, 51, 0.06), rgba(30, 27, 51, 0) 24%, rgba(30, 27, 51, 0.1));
}

.stage-skywash {
  position: absolute;
  inset: 0 0 34% 0;
  background: radial-gradient(ellipse at 16% 28%, rgba(255, 209, 141, 0.1), rgba(255, 209, 141, 0) 46%);
  pointer-events: none;
  mix-blend-mode: screen;
}

.stage-fore {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -2%;
  height: 17%;
  background-color: transparent;
  background-image: url("assets/stage/stage_fore.webp");
  background-size: 100% auto;
  background-position: 50% 100%;
  opacity: 0.92;
  filter: blur(2.2px);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  pointer-events: none;
}
.stage-fore::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(30, 27, 51, 0.18), rgba(30, 27, 51, 0.55));
  mix-blend-mode: multiply;
}

.floor-mist {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 6%;
  height: 42%;
  z-index: 6;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 34% 72%, rgba(226, 102, 46, 0.10), rgba(226, 102, 46, 0) 58%),
    radial-gradient(ellipse at 64% 78%, rgba(74, 59, 87, 0.2), rgba(74, 59, 87, 0) 66%),
    linear-gradient(to top, rgba(74, 59, 87, 0.14), rgba(74, 59, 87, 0) 52%);
}

.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(30, 27, 51, 0.12), rgba(30, 27, 51, 0) 16%),
    radial-gradient(ellipse at 50% 44%, rgba(30, 27, 51, 0) 52%, rgba(30, 27, 51, 0.26) 100%),
    linear-gradient(to right, rgba(30, 27, 51, 0) 80%, rgba(30, 27, 51, 0.18) 100%);
}

.stage-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.65'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.dust { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.front-dust {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}
.front-mote {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 224, 174, 0.5);
  filter: blur(1.4px);
  animation: front-drift var(--dur, 24s) linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes front-drift {
  0% { transform: translate3d(0, 20px, 0) scale(var(--sc, 1)); opacity: 0; }
  18% { opacity: var(--alpha, 0.34); }
  76% { opacity: var(--alpha, 0.34); }
  100% { transform: translate3d(-46px, -130px, 0) scale(var(--sc, 1)); opacity: 0; }
}
.mote {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 231, 190, 0.72);
  box-shadow: 0 0 5px rgba(255, 231, 190, 0.45);
  animation: mote-drift var(--dur, 16s) linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes mote-drift {
  0% { transform: translate3d(0, 16px, 0) scale(var(--sc, 1)); opacity: 0; }
  14% { opacity: var(--alpha, 0.7); }
  78% { opacity: var(--alpha, 0.7); }
  100% { transform: translate3d(40px, -110px, 0) scale(var(--sc, 1)); opacity: 0; }
}

#fight-canvas {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}
#fight-canvas canvas {
  display: block;
  filter: saturate(1.05) contrast(1.055) brightness(1.005);
}

/* one air and one light over backdrop and fighters alike, so the roster and
   the arena read as a single painted frame. The sun bloom stays local to the
   left, and violet sits in the shadows instead of an orange wash over all. */
.stage-grade {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 13% 38%, rgba(255, 204, 132, 0.16), rgba(255, 204, 132, 0) 30%);
  mix-blend-mode: screen;
  opacity: 0.74;
}
.arena-grain {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.13;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23g)' opacity='0.8'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}
.ui-scrim {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(30, 27, 51, 0.46) 0, rgba(30, 27, 51, 0.22) 7%, rgba(30, 27, 51, 0) 17%),
    linear-gradient(to top, rgba(30, 27, 51, 0.44) 0, rgba(30, 27, 51, 0.2) 10%, rgba(30, 27, 51, 0) 24%);
}
.stage-grade::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(74, 59, 87, 0), rgba(74, 59, 87, 0.12) 88%),
    linear-gradient(to bottom, rgba(74, 59, 87, 0.03), rgba(74, 59, 87, 0) 26%, rgba(58, 44, 78, 0.16));
  mix-blend-mode: multiply;
}

.flash {
  position: absolute;
  inset: 0;
  z-index: 26;
  background: #fffaf0;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.flash.on { animation: hard-flash 120ms steps(1, end); }
@keyframes hard-flash {
  0% { opacity: 0.35; }
  24% { opacity: 0.06; }
  100% { opacity: 0; }
}

/* --------------------------------- TOP HUD -------------------------------- */

.top-hud {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 14;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(240px, auto) minmax(0, 1fr) 86px;
  grid-template-areas: "pl hl title hr pr";
  gap: 12px;
  align-items: start;
  pointer-events: none;
}
.portrait-left { grid-area: pl; }
.portrait-right { grid-area: pr; }
.health-left { grid-area: hl; }
.health-right { grid-area: hr; }
.title-block { grid-area: title; }

.portrait-frame {
  width: 86px;
  height: 100px;
  background: #241d33;
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px #e8dcc8, inset 0 0 0 4px rgba(30, 27, 51, 0.55), 3px 4px 0 rgba(30, 27, 51, 0.28);
  overflow: hidden;
  border-radius: 3px 2px 4px 2px;
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(20, 16, 32, 0) 30%, rgba(20, 16, 32, 0.44) 88%),
    linear-gradient(160deg, rgba(226, 102, 46, 0.1), rgba(74, 59, 87, 0.12));
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
  display: block;
  transform: scale(1.08);
}

.health { min-width: 0; padding-top: 3px; }
.health-id {
  font-family: var(--text);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--bone);
  text-shadow: 1px 1px 0 var(--ink), 2px 2px 0 rgba(30, 27, 51, 0.55);
  margin: 0 2px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.health-right .health-id { text-align: right; }

.health-track {
  position: relative;
  height: 30px;
  background: rgba(236, 225, 205, 0.93);
  border: 3px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.38), inset 0 -3px 0 rgba(30, 27, 51, 0.16), 3px 3px 0 rgba(30, 27, 51, 0.25);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  border-radius: 2px;
}
.health-right .health-track {
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 0 100%);
}
.health-fill {
  height: 100%;
  width: 100%;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 42%),
    linear-gradient(90deg, #8d1b31, var(--crimson) 52%, #d94a44);
  box-shadow: inset 0 0 0 1px rgba(30, 27, 51, 0.25);
  transition: width 170ms ease-out;
}
.health-right .health-fill { margin-left: auto; }
.health.is-low .health-fill { animation: low-pulse 850ms ease-in-out infinite; }
@keyframes low-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}
.hp-readout {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-family: var(--num);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bone);
  text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink);
  pointer-events: none;
}
.health.hit .health-track { animation: bar-hit 200ms ease-out; }
@keyframes bar-hit {
  0% { transform: translate(0, 0); }
  30% { transform: translate(-3px, 1px); }
  65% { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0); }
}

/* title */
.title-block {
  position: relative;
  text-align: center;
  padding-top: 2px;
  pointer-events: none;
  transition: opacity 220ms ease;
}
#app.is-finishing .title-block,
#app.is-over .title-block { opacity: 0; }

.title-block h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 3.6vw, 62px);
  line-height: 0.8;
  letter-spacing: 0.02em;
  color: var(--bone);
  -webkit-text-stroke: clamp(1.5px, 0.16vw, 3px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 4px 0 rgba(30, 27, 51, 0.62);
  text-transform: uppercase;
}
.title-block h1 span { color: #f7e3b9; }
.title-rule {
  width: 72%;
  height: 2px;
  margin: 7px auto 5px;
  background: linear-gradient(90deg, rgba(192, 48, 74, 0), var(--crimson) 12%, var(--gold) 88%, rgba(224, 167, 60, 0));
}
.title-block p {
  margin: 0;
  font-size: clamp(7px, 0.6vw, 10px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--bone);
  text-shadow: 1px 1px 0 var(--ink);
  white-space: nowrap;
}
.pause-pair {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0;
  position: fixed;
  top: 108px;
  right: 14px;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease;
}
#app.is-live .pause-pair { display: flex; opacity: 1; visibility: visible; pointer-events: auto; }
.ink-btn {
  position: relative;
  width: 50px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  outline: 2px solid var(--paper);
  border-radius: 2px 4px 3px 3px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 45%),
    linear-gradient(148deg, var(--paper), var(--paper-deep));
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28), 3px 4px 0 rgba(30, 27, 51, 0.35);
  transition: background 120ms ease, transform 120ms ease, color 120ms ease;
}
.ink-btn::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 22%;
  right: 22%;
  height: 2px;
  background: var(--crimson);
  opacity: 0.7;
}
.ink-btn svg { width: 20px; height: 20px; fill: currentColor; color: var(--ink); }
.ink-btn:hover { background: var(--crimson); color: var(--bone); }
.ink-btn:hover svg { color: var(--bone); }
.ink-btn:hover::before { background: var(--bone); opacity: 0.7; }
.ink-btn:active { transform: translateY(1px); }
.ink-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* -------------------------------- SIDE PANEL ------------------------------ */

.side-panel {
  position: absolute;
  top: clamp(190px, 25vh, 300px);
  right: 14px;
  bottom: calc(var(--bar) + 14px);
  width: var(--side);
  z-index: 30;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 44%),
    radial-gradient(ellipse at 30% 10%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 60%),
    var(--paper);
  border: 3px solid var(--ink);
  border-radius: 4px 2px 5px 3px;
  box-shadow:
    inset 0 0 0 2px var(--paper),
    inset 0 0 0 4px rgba(30, 27, 51, 0.36),
    5px 6px 0 rgba(30, 27, 51, 0.3);
  padding: 14px 15px 13px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: opacity 160ms ease, visibility 160ms ease;
}
.side-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(30, 27, 51, 0.018) 0 2px, transparent 2px 7px);
}
.side-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 2px solid var(--ink);
  padding: 0 0 7px;
  margin-bottom: 10px;
}
.side-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 2.3vw, 42px);
  line-height: 0.85;
  letter-spacing: 0.03em;
}
.side-head span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.45;
  color: var(--violet);
  text-align: right;
  padding-top: 3px;
}

.stats { position: relative; }
.stat { position: relative; margin-bottom: 10px; }
.stat-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.stat-line label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
}
.stat-line output {
  font-family: var(--num);
  font-size: clamp(28px, 2vw, 34px);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 2.1em;
  text-align: right;
}
.stat-track {
  position: relative;
  height: 18px;
  margin-top: 4px;
  border: 2px solid var(--ink);
  background: var(--paper-deep);
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.34);
}
.stat-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(30, 27, 51, 0.22) calc(10% - 1px) 10%);
  pointer-events: none;
}
.stat-fill {
  height: 100%;
  width: 75%;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 46%),
    var(--col, var(--gold));
  transition: width 90ms linear, background-color 140ms ease;
}
.stat input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: -4px;
  right: -4px;
  top: 22px;
  width: calc(100% + 8px);
  height: 34px;
  margin: 0;
  background: transparent;
  cursor: grab;
  z-index: 3;
}
.stat input[type="range"]:active { cursor: grabbing; }
.stat input[type="range"]::-webkit-slider-runnable-track { height: 34px; background: transparent; }
.stat input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--bone);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 3px var(--col, var(--gold)), 2px 3px 0 rgba(30, 27, 51, 0.4);
  transition: box-shadow 140ms ease;
}
.stat input[type="range"]::-moz-range-track { height: 34px; background: transparent; }
.stat input[type="range"]::-moz-range-thumb {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--bone);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 3px var(--col, var(--gold)), 2px 3px 0 rgba(30, 27, 51, 0.4);
}
.stat input[type="range"]:focus-visible { outline: 3px solid var(--crimson); outline-offset: 4px; }
.stat.is-tuned output { animation: stat-tick 260ms ease-out; }
@keyframes stat-tick {
  0% { color: var(--crimson); transform: translateY(-3px); }
  100% { color: var(--ink); transform: translateY(0); }
}

.reserved {
  position: relative;
  flex: 1;
  min-height: 100px;
  margin-top: auto;
  border: 2px dashed rgba(30, 27, 51, 0.5);
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, rgba(30, 27, 51, 0.11) 27px 28px),
    linear-gradient(160deg, rgba(255, 255, 255, 0.26), rgba(30, 27, 51, 0.03));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 16px 10px 10px;
  text-align: center;
}
.reserved-title {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.1em;
  color: rgba(30, 27, 51, 0.62);
}
.reserved-sub {
  font-family: var(--num);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: rgba(30, 27, 51, 0.46);
}
.reserved-rule {
  width: 52%;
  height: 1px;
  margin-top: 5px;
  background: rgba(30, 27, 51, 0.24);
}
.reserved-fold {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, transparent 48%, rgba(30, 27, 51, 0.16) 50%);
  border-top: 1px solid rgba(30, 27, 51, 0.24);
  border-left: 1px solid rgba(30, 27, 51, 0.24);
}

/* -------------------------------- SELECT DOCK ----------------------------- */

.select-dock {
  position: absolute;
  left: 14px;
  bottom: calc(var(--bar) + 12px);
  width: min(48%, 700px);
  z-index: 32;
  min-width: 0;
}
.select-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  min-width: 0;
}
.select-title {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--bone);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}
.select-count {
  font-family: var(--num);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--bone);
  text-shadow: 1px 1px 0 var(--ink);
  white-space: nowrap;
}
.kind-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  pointer-events: auto;
}
.kind-tab {
  height: 34px;
  min-width: 44px;
  padding: 0 9px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 14.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(30, 27, 51, 0.32);
}
.kind-tab.is-on { background: var(--ink); color: var(--bone); border-color: var(--bone); outline: 2px solid var(--ink); }
.kind-tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.roster-wrap { position: relative; }
.roster-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 6px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.roster-scroll::-webkit-scrollbar { display: none; }

.fighter-card {
  flex: none;
  width: 118px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  scroll-snap-align: center;
  font-family: var(--text);
}
.card-pic {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.06;
  background:
    radial-gradient(ellipse at 24% 32%, rgba(226, 102, 46, 0.55), rgba(74, 59, 87, 0.2) 55%, rgba(30, 27, 51, 0.9) 100%),
    #2a2239;
  border: 3px solid var(--ink);
  overflow: hidden;
  box-shadow: 3px 4px 0 rgba(30, 27, 51, 0.34);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 160ms ease, border-color 160ms ease;
}
.card-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
  filter: saturate(1.02) contrast(1.03);
}
.card-pic::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(20, 16, 32, 0) 22%, rgba(20, 16, 32, 0.52) 78%),
    linear-gradient(to top, rgba(20, 16, 32, 0.72), rgba(20, 16, 32, 0) 52%),
    linear-gradient(155deg, rgba(226, 102, 46, 0.18), rgba(74, 59, 87, 0.1));
  pointer-events: none;
}
.card-pic::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 30px solid var(--crimson);
  border-right: 30px solid transparent;
  opacity: 0;
  transition: opacity 140ms ease;
}
.fighter-card:hover .card-pic { transform: translateY(-4px); }
.fighter-card:focus-visible { outline: none; }
.fighter-card:focus-visible .card-pic { outline: 3px solid var(--gold); outline-offset: 3px; }
.fighter-card[aria-pressed="true"] .card-pic {
  transform: translateY(-7px);
  box-shadow: 3px 6px 0 rgba(30, 27, 51, 0.34);
}
.fighter-card[aria-pressed="true"] .card-pic::after { opacity: 1; }
.roster-tail { flex: 0 0 auto; align-self: flex-start; height: 0; pointer-events: none; }
.card-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(236, 225, 205, 0.96);
  border-top: 2px solid var(--ink);
  text-align: center;
  pointer-events: none;
}
.card-name {
  display: block;
  padding: 2px 4px 0;
  font-family: var(--display);
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-kind {
  display: block;
  padding: 0 4px 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.19em;
  color: var(--violet);
}
.scroll-arrow {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  z-index: 4;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--bone);
  outline: 2px solid var(--ink);
  background: rgba(30, 27, 51, 0.86);
  color: var(--bone);
  cursor: pointer;
  padding: 0;
}
.scroll-arrow svg { width: 18px; height: 18px; }
.scroll-left { left: -12px; }
.scroll-right { right: -12px; }
.scroll-arrow:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.scroll-arrow:disabled { opacity: 0.34; }

/* ---------------------------------- METER --------------------------------- */

.meter-dock {
  position: absolute;
  right: calc(var(--side) + 30px);
  bottom: calc(var(--bar) + 14px);
  width: 340px;
  z-index: 14;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.burst-mark {
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--gold);
  filter: drop-shadow(2px 2px 0 var(--ink));
}
.burst-mark svg { width: 100%; height: 100%; fill: currentColor; stroke: var(--ink); stroke-width: 2; }
.meter-main { flex: 1; min-width: 0; }
.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}
.meter-label {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--bone);
  text-shadow: 2px 2px 0 var(--ink);
}
.meter-pct {
  font-family: var(--num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 1px 1px 0 var(--ink);
}
.meter-state {
  font-family: var(--num);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--bone);
  text-shadow: 1px 1px 0 var(--ink);
}
.meter-track {
  position: relative;
  height: 16px;
  background: rgba(30, 27, 51, 0.8);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(242, 233, 218, 0.62), 3px 3px 0 rgba(30, 27, 51, 0.32);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 50%),
    linear-gradient(90deg, #9e6c1b, var(--gold) 62%, #f6d27a);
  transition: width 140ms linear;
}
.meter-notch {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 80%;
  width: 2px;
  background: var(--bone);
  opacity: 0.9;
}
.meter-dock.is-ready .meter-fill { animation: meter-ready 700ms ease-in-out infinite; }
.meter-dock.is-ready .meter-state { color: var(--gold); }
@keyframes meter-ready {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.6); }
}
.finish-slot {
  flex: none;
  width: 68px;
  height: 50px;
  border: 3px solid var(--bone);
  outline: 2px solid var(--ink);
  border-radius: 3px;
  background: rgba(30, 27, 51, 0.85);
  color: rgba(242, 233, 218, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  pointer-events: auto;
}
.finish-title { font-family: var(--display); font-size: 16px; letter-spacing: 0.05em; }
.finish-key { font-family: var(--num); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; }
.finish-slot:disabled {
  background: rgba(30, 27, 51, 0.28);
  border-color: rgba(242, 233, 218, 0.3);
  outline-color: rgba(30, 27, 51, 0.4);
  color: transparent;
}
.finish-slot:disabled .finish-title,
.finish-slot:disabled .finish-key { opacity: 0; }
.finish-slot:not(:disabled) .finish-title,
.finish-slot:not(:disabled) .finish-key { opacity: 1; }
.finish-slot:not(:disabled) {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--ink);
  outline-color: var(--bone);
  box-shadow: 0 0 0 3px rgba(224, 167, 60, 0.28);
}
.finish-slot:disabled { cursor: default; }
.finish-slot:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------------------------------- BANNER -------------------------------- */

.round-banner {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms ease;
}
.round-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.round-banner.out { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
.banner-small {
  font-family: var(--num);
  font-size: clamp(10px, 1vw, 15px);
  font-weight: 600;
  letter-spacing: 0.4em;
  color: var(--bone);
  text-shadow: 1px 1px 0 var(--ink), 2px 2px 0 var(--crimson);
  padding-left: 0.4em;
}
.banner-big {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(64px, 9vw, 148px);
  line-height: 0.8;
  letter-spacing: 0.03em;
  color: var(--bone);
  -webkit-text-stroke: clamp(2px, 0.36vw, 5px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 7px 0 var(--crimson), 8px 10px 0 rgba(30, 27, 51, 0.35);
  text-transform: uppercase;
  white-space: nowrap;
}

.comic-layer {
  position: absolute;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  overflow: hidden;
}
.comic-word {
  position: absolute;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 6.4vw, 104px);
  line-height: 0.8;
  letter-spacing: 0.02em;
  color: var(--bone);
  -webkit-text-stroke: clamp(2px, 0.34vw, 4px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 6px 0 var(--crimson);
  transform: translate(-50%, -50%) rotate(var(--rot, -6deg)) scale(0.35);
  animation: comic-pop 950ms cubic-bezier(0.16, 0.9, 0.3, 1) forwards;
  white-space: nowrap;
}
.comic-word.comic-mini {
  font-size: clamp(22px, 4vw, 48px);
  -webkit-text-stroke: clamp(1.5px, 0.2vw, 3px) var(--ink);
  text-shadow: 3px 4px 0 var(--crimson);
  letter-spacing: 0.03em;
}
.comic-word.comic-name {
  font-size: clamp(24px, 3.8vw, 58px);
  -webkit-text-stroke: clamp(1.5px, 0.2vw, 3px) var(--ink);
  text-shadow: 3px 4px 0 var(--gold);
  letter-spacing: 0.05em;
  background: rgba(30, 27, 51, 0.9);
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px rgba(242, 233, 218, 0.85), 6px 7px 0 rgba(30, 27, 51, 0.3);
  padding: 0.06em 0.28em 0.12em;
  border-radius: 2px;
}
@keyframes comic-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot, -6deg)) scale(0.3); }
  18% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot, -6deg)) scale(1.18); }
  32% { transform: translate(-50%, -50%) rotate(var(--rot, -6deg)) scale(0.97); }
  74% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -58%) rotate(var(--rot, -6deg)) scale(1.03); }
}

/* -------------------------------- TOUCH PADS ------------------------------ */

.touch-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 22;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 12px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
#app.is-live .touch-controls { opacity: 1; visibility: visible; }
.pad { display: flex; align-items: flex-end; gap: 7px; pointer-events: none; }
.pad-btn {
  position: relative;
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border-radius: 50% 46% 52% 48%;
  border: 3px solid var(--ink);
  outline: 2px solid rgba(242, 233, 218, 0.9);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 42%),
    linear-gradient(148deg, #f2e9da, #ddcfb6 68%, #c8b99a);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28), 3px 4px 0 rgba(30, 27, 51, 0.38);
  transition: background 90ms ease, transform 90ms ease, color 90ms ease;
}
.pad-btn::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 14%;
  right: 14%;
  height: 2px;
  background: var(--accent, var(--crimson));
  opacity: 0.75;
  border-radius: 1px;
  pointer-events: none;
}
.pad-btn::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: rgba(30, 27, 51, 0.28);
  pointer-events: none;
}
.pad-btn svg { width: 28px; height: 28px; color: var(--ink); }
.pad-btn.pad-small { width: 52px; height: 52px; margin-bottom: 7px; }
.pad-btn.pad-word {
  width: 84px;
  height: 56px;
  border-radius: 3px 7px 4px 6px;
  font-size: 14px;
  color: var(--ink);
  clip-path: polygon(0 7%, 5% 0, 96% 2%, 100% 9%, 98% 93%, 93% 100%, 3% 97%, 0 89%);
}
.pad-btn.pad-word::before {
  top: 0;
  left: 0;
  right: auto;
  width: 16px;
  height: 16px;
  background: var(--accent, var(--crimson));
  clip-path: polygon(0 0, 100% 0, 0 100%);
  border-radius: 0;
  opacity: 1;
}
.pad-btn.pad-word::after {
  left: 14%;
  right: 14%;
  bottom: 5px;
  height: 2px;
  background: var(--accent, var(--crimson));
  opacity: 0.72;
}
.pad-word[data-action="block"] { --accent: var(--tatami); }
.pad-word[data-action="light"], .pad-word[data-action="heavy"] { --accent: var(--crimson); }
.pad-word[data-action="kick"] { --accent: var(--gold); }
.pad-btn.active {
  background: linear-gradient(148deg, var(--accent, var(--crimson)), #1e1b33);
  color: var(--bone);
  border-color: var(--ink);
  transform: translateY(2px) scale(0.97);
  box-shadow: inset 0 0 0 2px rgba(30, 27, 51, 0.3), 1px 2px 0 rgba(30, 27, 51, 0.35);
}
.pad-btn.active svg { color: var(--bone); }
.pad-btn.active::before { background: var(--bone); opacity: 0.8; }
.pad-btn.active::after { background: var(--bone); opacity: 0.4; }

/* -------------------------------- BOTTOM BAR ------------------------------ */

.bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar);
  z-index: 40;
  background: var(--ink);
  color: var(--bone);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  border-top: 2px solid #0f0c1c;
}
.bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}
.chapter {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--gold);
  white-space: nowrap;
  padding-right: 14px;
  border-right: 1px solid rgba(242, 233, 218, 0.28);
}
.hints {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(242, 233, 218, 0.9);
  white-space: nowrap;
  overflow: hidden;
}
.hints span { display: inline-flex; align-items: center; gap: 4px; }
.hints kbd {
  font-family: var(--num);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid rgba(242, 233, 218, 0.46);
  border-radius: 2px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--bone);
}
.hints .hint-finish { color: var(--gold); }
.hints-touch { display: none; }
.builder-slots { display: flex; align-items: center; gap: 7px; flex: none; }
.builder-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(242, 233, 218, 0.5);
  margin-right: 2px;
}
.empty-slot {
  font-family: var(--num);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(242, 233, 218, 0.38);
  width: 58px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(242, 233, 218, 0.26);
  border-radius: 2px;
}

/* -------------------------------- OVERLAYS -------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(22, 17, 35, 0.34);
}
.pause-card,
.end-card {
  position: relative;
  width: min(420px, 90vw);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 4px 2px 5px 3px;
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 4px rgba(30, 27, 51, 0.32), 8px 9px 0 rgba(0, 0, 0, 0.4);
  padding: 20px 22px 18px;
  text-align: center;
  color: var(--ink);
}
.kicker {
  margin: 0 0 4px;
  font-family: var(--num);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--crimson);
  text-transform: uppercase;
}
.pause-card h2 {
  margin: 2px auto 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 7vw, 64px);
  line-height: 0.85;
  letter-spacing: 0.06em;
  color: var(--ink);
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 4px 5px 0 rgba(192, 48, 74, 0.22);
}
.end-winner {
  display: block;
  width: 140px;
  height: 196px;
  object-fit: contain;
  object-position: 50% 100%;
  margin: -6px auto -4px;
  filter: drop-shadow(3px 5px 0 rgba(30, 27, 51, 0.22));
}
.end-card h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(54px, 8vw, 84px);
  line-height: 0.8;
  letter-spacing: 0.03em;
  color: var(--ink);
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 4px 5px 0 rgba(192, 48, 74, 0.22);
}
.end-card h2 { color: var(--crimson); text-shadow: 4px 5px 0 rgba(30, 27, 51, 0.22); }
.end-card.is-loss h2 { color: var(--violet); }
.pause-note,
.end-line {
  margin: 10px auto 4px;
  max-width: 330px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--violet);
}
.overlay-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.solid-btn,
.ghost-btn {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.07em;
  padding: 8px 22px 7px;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: 2px;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}
.solid-btn { background: var(--ink); color: var(--bone); box-shadow: 3px 3px 0 rgba(192, 48, 74, 0.4); }
.solid-btn:hover { background: var(--crimson); }
.ghost-btn { background: transparent; color: var(--ink); }
.ghost-btn:hover { background: var(--ink); color: var(--bone); }
.solid-btn:active, .ghost-btn:active { transform: translateY(1px); }
.solid-btn:focus-visible, .ghost-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 0;
  border-top: 2px solid rgba(30, 27, 51, 0.32);
  border-bottom: 2px solid rgba(30, 27, 51, 0.32);
  padding: 10px 0;
}
.end-stats div { display: flex; flex-direction: column; gap: 2px; }
.end-stats span { font-size: 8px; font-weight: 700; letter-spacing: 0.18em; color: var(--violet); }
.end-stats strong { font-family: var(--num); font-size: 25px; font-weight: 600; letter-spacing: 0.02em; }

/* --------------------------------- GRAIN ---------------------------------- */

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ------------------------------- RESPONSIVE ------------------------------- */

@media (max-width: 1280px) {
  :root { --side: 320px; }
  .title-block h1 { font-size: clamp(34px, 3.6vw, 54px); }
  .title-block p { font-size: 10px; letter-spacing: 0.16em; }
  .select-dock { width: min(52%, 650px); }
  .fighter-card { width: 118px; }
  .meter-dock { width: 320px; }
  .health-track { height: 30px; }
  .health-id { font-size: 15px; }
  .hp-readout { font-size: 18px; }
  .portrait-frame { width: 80px; height: 94px; }
  .top-hud { grid-template-columns: 80px minmax(0, 1fr) minmax(230px, auto) minmax(0, 1fr) 80px; gap: 13px; }
  .side-head h2 { font-size: 34px; }
  .side-head span { font-size: 9px; }
  .stat-line label { font-size: 16px; }
  .stat-line output { font-size: clamp(32px, 2.2vw, 35px); }
  .stat-track { height: 24px; }
  .stat { margin-bottom: 16px; }
  .stat input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: 4px; }
  .stat input[type="range"]::-moz-range-thumb { width: 23px; height: 23px; }
  .select-title { font-size: 27px; }
  .select-count { font-size: 10.5px; }
  .kind-tab { height: 44px; min-width: 52px; font-size: 15px; }
  .card-name { font-size: 19px; }
  .card-kind { font-size: 9px; }
  .meter-label { font-size: 17px; }
  .meter-state { font-size: 11.5px; }
  .meter-track { height: 19px; }
  .finish-slot { width: 76px; height: 54px; }
  .finish-title { font-size: 16px; }
  .chapter { font-size: 17px; }
  .hints { font-size: 12px; gap: 12px; }
  .pad-btn { width: 66px; height: 66px; font-size: 14px; }
  .pad-btn svg { width: 28px; height: 28px; }
  .pad-btn.pad-small { width: 54px; height: 54px; }
  .pad-btn.pad-word { width: 88px; height: 58px; font-size: 15px; }
  .reserved-title { font-size: 18px; }
  .reserved-sub { font-size: 10px; }
}

@media (max-width: 1180px) {
  .builder-slots .builder-label { display: none; }
  .empty-slot { width: 46px; }
  .hints span:nth-child(5), .hints span:nth-child(6) { display: none; }
  .select-dock { width: min(48%, 560px); }
  .meter-dock { width: 260px; }
}

/* Upright tablets and narrow tall windows: every panel lives on one screen. */
@media (orientation: portrait) and (max-width: 1200px),
       (max-width: 900px) {
  html, body { height: 100%; overflow: hidden; background: var(--paper); }
  #app {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--paper);
  }
  #arena {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
  }
  .stage-photo { background-position: 38% 54%; }
  .stage-fore { height: 9%; filter: blur(1.2px); }
  .top-hud {
    top: 8px;
    left: 12px;
    right: 12px;
    grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr) 80px;
    grid-template-areas:
      "pl hl hr pr"
      "title title title title";
    gap: 8px 10px;
  }
  .portrait-frame { width: 80px; height: 96px; }
  .health { padding-top: 0; }
  .health-id { font-size: 16.5px; letter-spacing: 0.055em; margin-bottom: 4px; }
  .health-track { height: 29px; border-width: 2.5px; }
  .hp-readout { font-size: 21px; }
  .title-block { grid-area: title; padding-top: 1px; }
  .title-block h1 { font-size: clamp(32px, 5.2vw, 44px); }
  .title-block p { font-size: 11px; letter-spacing: 0.13em; }
  .title-rule { margin: 4px auto 3px; }
  .pause-pair { position: fixed; top: 112px; right: 14px; z-index: 60; margin: 0; }
  .ink-btn { width: 46px; height: 40px; }
  .ink-btn svg { width: 18px; height: 18px; }

  .meter-dock {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 98px;
    width: min(66%, 460px);
  }
  .meter-label { font-size: 18px; }
  .meter-state { font-size: 11px; }
  .meter-track { height: 22px; }
  .finish-slot { width: 84px; height: 58px; }
  .finish-title { font-size: 17px; }
  .finish-key { font-size: 10px; }

  .touch-controls { display: flex; bottom: 12px; padding: 0 14px; }
  .pad { gap: 8px; }
  .pad-btn { width: 68px; height: 68px; font-size: 15px; }
  .pad-btn svg { width: 30px; height: 30px; }
  .pad-btn.pad-small { width: 56px; height: 56px; margin-bottom: 7px; }
  .pad-btn.pad-word { width: 92px; height: 58px; font-size: 15.5px; }

  .select-dock {
    position: static;
    order: 2;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    padding: 8px 12px 2px;
    background: var(--paper);
    border-top: 2px solid var(--ink);
  }
  .select-head { gap: 10px; margin-bottom: 7px; }
  .select-title { color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; font-size: 27px; }
  .select-count { color: var(--violet); text-shadow: none; font-size: 12px; }
  .kind-tab { height: 44px; min-width: 54px; font-size: 15px; }
  .fighter-card { width: calc((100vw - 97px) / 8); }
  .card-pic { aspect-ratio: 1 / 0.88; }
  .card-name { font-size: 19px; }
  .card-kind { font-size: 10.5px; }
  .roster-scroll { gap: 9px; padding: 3px 5px 10px; }
  .scroll-left { left: -4px; }
  .scroll-right { right: -4px; }
  .scroll-arrow { width: 40px; height: 40px; }

  .side-panel {
    position: static;
    order: 3;
    flex: 0 0 auto;
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    border-top: 3px solid var(--ink);
    padding: 10px 16px 10px;
    overflow: hidden;
    min-height: 0;
  }
  .side-head { margin-bottom: 8px; padding-bottom: 4px; }
  .side-head h2 { font-size: 32px; }
  .side-head span { font-size: 12.5px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; row-gap: 0; }
  .stat { margin-bottom: 10px; }
  .stat-line label { font-size: 16px; letter-spacing: 0.13em; }
  .stat-line output { font-size: 32px; }
  .stat-track { height: 22px; }
  .stat input[type="range"] { top: 22px; height: 36px; }
  .stat input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: 3px; }
  .stat input[type="range"]::-moz-range-thumb { width: 23px; height: 23px; }
  .reserved { min-height: 42px; margin-top: 2px; padding: 7px 8px; flex-direction: row; align-items: center; justify-content: center; gap: 10px; }
  .reserved-title { font-size: 18px; }
  .reserved-sub { font-size: 9px; }
  .reserved-rule { display: none; }

  .bottom-bar {
    position: static;
    order: 4;
    flex: 0 0 auto;
    height: auto;
    min-height: var(--bar);
    margin-top: 0;
    flex-wrap: wrap;
    padding: 8px 12px;
  }
  .builder-slots { display: none; }
  .hints-keys { display: none; }
  .hints-touch { display: inline; }
  .chapter { font-size: 16.5px; }
  .hints-touch { font-size: 13px; letter-spacing: 0.06em; }
  .overlay { align-items: flex-end; padding-bottom: 14px; }
  .pause-card, .end-card { width: min(430px, 92vw); }
}

  #app.is-live .title-block h1 { font-size: clamp(22px, 3.4vw, 30px); }
  #app.is-live .title-rule { margin: 4px auto 3px; }
@media (min-width: 800px) and (max-width: 1200px) and (orientation: portrait) {
  .title-block h1 { white-space: nowrap; font-size: clamp(30px, 4vw, 40px); }
  .title-block h1 br { display: none; }
  .title-block h1 span { margin-left: 0.2em; }
  .title-block p { font-size: 9.5px; }
}

@media (min-width: 700px) and (max-width: 1200px) and (orientation: portrait) {
  .side-panel {
    position: absolute;
    top: 164px;
    right: 14px;
    bottom: auto;
    width: min(30%, 260px);
    height: 420px;
    z-index: 30;
    border: 3px solid var(--ink);
    border-radius: 4px 2px 5px 3px;
    box-shadow:
      inset 0 0 0 2px var(--paper),
      inset 0 0 0 4px rgba(30, 27, 51, 0.36),
      5px 6px 0 rgba(30, 27, 51, 0.3);
    padding: 11px 14px;
    overflow: hidden;
    order: 0;
  }
  .stats { display: block; }
  .stat { margin-bottom: 15px; }
  .stat-line label { font-size: 16px; }
  .stat-line output { font-size: 32px; }
  .stat-track { height: 22px; }
  .reserved {
    min-height: 90px;
    margin-top: 4px;
    padding: 9px 8px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
  }
  .reserved-title { font-size: 16px; }
  .reserved-sub { font-size: 8.5px; }
  .reserved-rule { display: block; }
  .select-dock { order: 2; }
  .roster-scroll {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 10px 6px;
    overflow: visible;
    padding: 2px 4px 8px;
    scroll-snap-type: none;
  }
  .fighter-card { width: 100%; }
  .roster-tail { display: none; }
  .scroll-arrow { display: none; }
  .card-name { font-size: 17px; }
  .card-kind { font-size: 10px; }
  .bottom-bar { order: 3; }
  .meter-dock {
    left: 12%;
    right: auto;
    transform: none;
    bottom: 96px;
    width: 44%;
    max-width: 380px;
  }
}

/* Phones held upright: the whole fight, roster and stat tuning on one screen. */
@media (max-width: 600px) and (orientation: portrait) {
  html, body { height: 100%; overflow: hidden; }
  #app { height: 100dvh; min-height: 0; overflow: hidden; }
  #arena { flex: 1 1 auto; height: auto; min-height: 0; }
  .top-hud { grid-template-columns: 66px minmax(0, 1fr) minmax(0, 1fr) 66px; gap: 7px; }
  .portrait-frame { width: 66px; height: 82px; }
  .health-id { font-size: 13px; }
  .opp-tag { display: none; }
  .hp-max { display: none; }
  .health-track { height: 26px; }
  .hp-readout { font-size: 18px; }
  .title-block h1 { font-size: clamp(26px, 7.2vw, 34px); }
  #app.is-live .title-block h1 { font-size: 26px; }
  .title-block p { display: none; }
  .meter-dock { bottom: 82px; width: 74%; }
  .meter-label { font-size: 15px; }
  .finish-slot { width: 72px; height: 50px; }
  .touch-controls { padding: 0 8px; bottom: 10px; }
  .pad { gap: 6px; }
  .pad-btn { width: 54px; height: 54px; }
  .pad-btn.pad-word { width: 47px; height: 50px; font-size: 11px; letter-spacing: 0.02em; }
  .pad-btn.pad-small { width: 42px; height: 42px; }
  .pad-hit { gap: 3px; }

  .select-dock { padding: 5px 10px 8px; }
  .select-head { flex-wrap: wrap; margin-bottom: 4px; gap: 4px 6px; }
  .select-title { font-size: 22px; }
  .select-count { display: inline; font-size: 11px; }
  .kind-tabs { margin-left: 0; width: 100%; gap: 4px; }
  .kind-tab { flex: 1; min-width: 0; height: 36px; font-size: 13px; padding: 0 4px; }
  .roster-scroll { gap: 5px; padding: 2px 4px 6px; }
  .fighter-card { width: calc((100vw - 53px) / 6); }
  .card-name { font-size: 15px; }
  .card-kind { font-size: 10px; }

  .side-panel { padding: 6px 12px 7px; border-top-width: 2px; }
  .side-head { margin-bottom: 5px; padding-bottom: 3px; }
  .side-head h2 { font-size: 24px; }
  .side-head span { font-size: 11px; line-height: 1.15; }
  .stats { column-gap: 14px; }
  .stat { margin-bottom: 6px; }
  .stat-line label { font-size: 15px; letter-spacing: 0.07em; }
  .stat-line output { font-size: 28px; }
  .stat-track { height: 20px; }
  .stat input[type="range"] { top: 19px; height: 34px; }
  .stat input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: 2px; }
  .stat input[type="range"]::-moz-range-thumb { width: 19px; height: 19px; }
  .reserved { display: none; }

  .bottom-bar { min-height: 50px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)); flex-wrap: nowrap; align-items: center; }
  .hints-touch { line-height: 1.3; }
  .chapter { display: none; }
  .hints-touch { font-size: 12px; letter-spacing: 0.02em; white-space: nowrap; }
}

@media (max-width: 900px) and (max-height: 700px) and (orientation: landscape) {
  html, body { height: auto; min-height: 100%; overflow-y: auto; }
  #app { height: auto; min-height: 100dvh; overflow: visible; }
  #arena { flex: 0 0 auto; height: 84dvh; min-height: 300px; }
  .touch-controls { bottom: 10px; }
  .pad-btn { width: 52px; height: 52px; }
  .pad-btn.pad-word { width: 80px; height: 40px; font-size: 13px; }
  .pad-btn.pad-small { width: 42px; height: 42px; }
  .meter-dock { bottom: 50px; width: min(56%, 360px); }
  .meter-track { height: 14px; }
  .meter-label { font-size: 14px; }
  .meter-state, .meter-pct { font-size: 9px; }
  .burst-mark { width: 34px; height: 34px; }
  .finish-slot { width: 62px; height: 40px; }
  .finish-title { font-size: 13px; }
  .finish-key { font-size: 8px; }
}

@media (max-height: 700px) and (orientation: landscape) {
  :root { --bar: 46px; }
  .side-panel { top: 150px; padding: 11px 13px; }
  .side-head h2 { font-size: 26px; }
  .stat { margin-bottom: 8px; }
  .stat-line output { font-size: 23px; }
  .reserved { min-height: 60px; padding: 8px; }
  .top-hud { top: 7px; }
  .title-block h1 { font-size: 34px; }
  .title-block p { font-size: 7px; }
  .pause-pair { margin-top: 4px; }
  .ink-btn { height: 34px; width: 40px; }
  .portrait-frame { width: 66px; height: 78px; }
  .health-track { height: 23px; }
  .hp-readout { font-size: 13px; }
  .select-dock { bottom: calc(var(--bar) + 8px); }
  .fighter-card { width: 94px; }
  .card-name { font-size: 15px; }
  .meter-dock { bottom: calc(var(--bar) + 10px); }
  .select-title { font-size: 20px; }
}

@media (pointer: coarse) {
  .touch-controls { display: flex; }
  .scroll-arrow { display: none; }
  .stat input[type="range"] { height: 40px; }
}

@media (min-width: 901px) and (max-width: 1400px) and (orientation: landscape) {
  .select-dock { width: 420px; }
  .select-head { gap: 8px; margin-bottom: 6px; }
  .select-title { font-size: 26px; }
  .select-count { font-size: 10.5px; }
  .kind-tab { min-width: 44px; height: 42px; padding: 0 4px; font-size: 13.5px; }
  .roster-scroll { gap: 8px; padding: 2px 5px 8px; }
  .fighter-card { width: 96px; }
  .card-name { font-size: 17px; }
  .card-kind { font-size: 9px; }
  .meter-dock {
    left: 450px;
    right: auto;
    width: 240px;
  }
  .burst-mark { display: none; }
}

@media (pointer: coarse) and (orientation: landscape) and (min-width: 901px) {
  .select-dock { bottom: calc(var(--bar) + 82px); }
  .side-panel { top: 150px; bottom: calc(var(--bar) + 82px); }
  .meter-dock { bottom: calc(var(--bar) + 82px); }
  .hints-keys { display: none; }
  .hints-touch { display: inline; font-size: 12px; letter-spacing: 0.07em; }
}

#app:not(.is-over) .touch-controls { opacity: 1; visibility: visible; }
#app.is-over .touch-controls { opacity: 1; visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  .mote { animation: none; opacity: 0.35; }
  .health.is-low .health-fill,
  .meter-dock.is-ready .meter-fill { animation: none; }
  .fighter-card[aria-pressed="true"] .card-pic { transform: none; }
  .comic-word { animation-duration: 1ms; }
}

/* Full-arena portrait layout: the painted scene fills the screen, the panels sit on top. */
@media (orientation: portrait) and (max-width: 1200px) {
  html, body { height: 100%; overflow: hidden; background: #6f5a4c; }
  #app {
    display: block;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background: #6f5a4c;
  }
  #arena {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    flex: none;
  }
  .stage-photo { background-position: 38% 57%; filter: saturate(1.16) contrast(1.1) brightness(1.03); }
  .stage-fore { height: 12%; filter: blur(1.6px); }
  .bottom-bar {
    position: absolute;
    order: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bar);
    min-height: var(--bar);
    margin-top: 0;
    flex-wrap: nowrap;
    padding: 0 14px;
    z-index: 40;
  }
  .select-dock {
    position: absolute;
    order: 0;
    left: 14px;
    bottom: calc(var(--bar) + 12px);
    width: min(56%, 560px);
    max-width: none;
    padding: 0;
    background: transparent;
    border-top: 0;
    z-index: 32;
  }
  .select-head { margin-bottom: 5px; }
  .select-title { color: var(--bone); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 2px 2px 0 var(--ink); }
  .select-count { color: var(--bone); text-shadow: 1px 1px 0 var(--ink); }
  .roster-scroll {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 4px 8px;
    scroll-snap-type: x mandatory;
  }
  .fighter-card { width: 96px; }
  .roster-tail { display: block; }
  .scroll-arrow { display: none; }
  .select-count::after { content: " · SWIPE"; color: var(--crimson); }
  .side-panel {
    position: absolute;
    order: 0;
    bottom: auto;
    z-index: 30;
    border: 3px solid var(--ink);
    border-radius: 4px 2px 5px 3px;
    box-shadow:
      inset 0 0 0 2px var(--paper),
      inset 0 0 0 4px rgba(30, 27, 51, 0.36),
      5px 6px 0 rgba(30, 27, 51, 0.3);
    overflow: hidden;
  }
  .stats { display: block; }
  .reserved { display: flex; }
  .meter-dock {
    position: absolute;
    left: auto;
    right: 14px;
    bottom: calc(var(--bar) + 12px);
    transform: none;
    z-index: 31;
  }
  .builder-slots { display: flex; }
  .hints-keys { display: none; }
  .hints-touch { display: inline; white-space: nowrap; }
  .overlay { align-items: flex-end; padding-bottom: 14px; }
}

@media (min-width: 700px) and (max-width: 1200px) and (orientation: portrait) {
  .side-panel {
    top: 200px;
    right: 14px;
    width: min(30%, 250px);
    height: 420px;
    padding: 11px 14px;
  }
  .side-head h2 { font-size: 32px; }
  .side-head span { font-size: 12.5px; }
  .stat { margin-bottom: 15px; }
  .stat-line label { font-size: 16px; letter-spacing: 0.13em; }
  .stat-line output { font-size: 32px; }
  .stat-track { height: 22px; }
  .stat input[type="range"] { top: 22px; height: 36px; }
  .stat input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: 3px; }
  .stat input[type="range"]::-moz-range-thumb { width: 23px; height: 23px; }
  .reserved {
    min-height: 90px;
    margin-top: 4px;
    padding: 9px 8px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
  }
  .reserved-title { font-size: 16px; }
  .reserved-sub { font-size: 8.5px; }
  .reserved-rule { display: block; }
  .select-dock { left: 16px; bottom: calc(var(--bar) + 12px); width: min(56%, 520px); }
  .select-head { gap: 9px; }
  .select-title { font-size: 26px; }
  .select-count { font-size: 11.5px; }
  .kind-tabs { margin-left: auto; }
  .kind-tab { height: 40px; min-width: 50px; font-size: 14px; }
  .roster-scroll { gap: 8px; padding: 2px 4px 8px; }
  .fighter-card { width: 78px; }
  .card-name { font-size: 16px; }
  .card-kind { font-size: 9px; }
  .scroll-arrow { width: 36px; height: 36px; }
  .scroll-left { left: -8px; }
  .scroll-right { right: -8px; }
  .meter-dock { right: 14px; width: 270px; }
  .burst-mark { display: none; }
  .meter-label { font-size: 17px; }
  .meter-state { font-size: 11px; }
  .meter-track { height: 19px; }
  .finish-slot { width: 76px; height: 54px; }
  .touch-controls { bottom: 198px; padding: 0 18px; }
  .pad { gap: 8px; }
  .pad-btn { width: 64px; height: 64px; }
  .pad-btn.pad-small { width: 52px; height: 52px; }
  .pad-btn.pad-word { width: 86px; height: 56px; font-size: 14px; }
  .bottom-bar { padding: 0 16px; }
  .chapter { display: none; }
  #app.is-live .title-block h1 { font-size: 40px; }
  .hints-touch { font-size: 12px; letter-spacing: 0.04em; }
  .builder-slots { gap: 6px; }
  .builder-label { display: inline; }
  .empty-slot { width: 50px; }
}

@media (max-width: 600px) and (orientation: portrait) {
  :root { --bar: 46px; }
  .stage-photo { background-position: 24% 57%; }
  .stage-fore { height: 13%; filter: blur(1.2px); }
  .side-panel {
    top: 156px;
    left: auto;
    right: 8px;
    width: 190px;
    height: auto;
    padding: 6px 8px 7px;
    border-width: 2.5px;
    border-radius: 3px 2px 4px 2px;
    box-shadow: inset 0 0 0 1px var(--paper), inset 0 0 0 3px rgba(30, 27, 51, 0.32), 3px 4px 0 rgba(30, 27, 51, 0.28);
  }
  .side-head { margin-bottom: 3px; padding-bottom: 2px; gap: 4px; align-items: center; }
  .side-head h2 { font-size: 19px; }
  .side-head span { font-size: 8px; line-height: 1.1; letter-spacing: 0.08em; }
  .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; row-gap: 3px; }
  .stat { margin-bottom: 0; }
  .stat-line label { font-size: 9px; letter-spacing: 0.03em; }
  .stat-line output { font-size: 18px; min-width: 1.7em; }
  .stat-track { height: 9px; margin-top: 1px; border-width: 1.5px; }
  .stat input[type="range"] { left: -3px; right: -3px; top: 9px; width: calc(100% + 6px); height: 26px; }
  .stat input[type="range"]::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: 0; border-width: 2px; box-shadow: 0 0 0 2px var(--col, var(--gold)), 1px 2px 0 rgba(30, 27, 51, 0.4); }
  .stat input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-width: 2px; }
  .reserved { display: none; }

  .select-dock { left: 8px; bottom: calc(var(--bar) + 6px); width: 182px; padding: 0; }
  .select-head { flex-wrap: wrap; gap: 3px 5px; margin-bottom: 3px; }
  .select-title { font-size: 20px; }
  .select-count { font-size: 10px; }
  .kind-tabs { width: 100%; margin-left: 0; gap: 3px; }
  .kind-tab { flex: 1; min-width: 0; height: 27px; font-size: 10.5px; padding: 0 2px; }
  .roster-scroll { gap: 5px; padding: 2px 2px 6px; }
  .fighter-card { width: 56px; }
  .card-name { font-size: 11.5px; padding-top: 1px; }
  .card-kind { font-size: 8px; padding-bottom: 2px; }
  .scroll-arrow { width: 29px; height: 29px; top: 45%; }
  .scroll-arrow svg { width: 13px; height: 13px; }
  .scroll-left { left: -5px; }
  .scroll-right { right: -5px; }

  .meter-dock { right: 12px; bottom: calc(var(--bar) + 6px); width: 184px; gap: 5px; }
  .burst-mark { display: none; }
  .meter-label { font-size: 12px; letter-spacing: 0.08em; }
  .meter-state { font-size: 8px; }
  .meter-pct { font-size: 8px; }
  .meter-track { height: 13px; }
  .finish-slot { width: 50px; height: 43px; }
  .finish-title { font-size: 12.5px; }
  .finish-key { font-size: 8px; }

  .touch-controls { bottom: 190px; padding: 0 8px; }
  .pad { gap: 5px; }
  .pad-btn { width: 48px; height: 48px; }
  .pad-btn.pad-small { width: 38px; height: 38px; margin-bottom: 5px; }
  .pad-btn.pad-word { width: 46px; height: 46px; font-size: 10.5px; letter-spacing: 0.01em; }
  .pad-hit { gap: 3px; }

  .bottom-bar { padding: 0 10px; }
  .chapter { display: none; }
  .builder-slots { display: none; }
  .hints-touch { font-size: 11.5px; letter-spacing: 0.02em; white-space: nowrap; }
  .hints-touch span:nth-child(2), .hints-touch span:nth-child(3) { display: none; }
}

@media (max-width: 1400px) and (orientation: landscape) {
  .chapter { display: none; }
}

/* Landscape phones: full arena, interface laid over it. */
@media (orientation: landscape) and (max-width: 900px) and (max-height: 600px) {
  html, body { height: 100%; overflow: hidden; background: #6f5a4c; }
  #app { display: block; height: 100dvh; min-height: 0; overflow: hidden; background: #6f5a4c; }
  #arena { position: absolute; inset: 0; width: 100%; height: 100%; flex: none; }
  .stage-photo { background-position: 50% 58%; }
  .stage-fore { height: 16%; }
  .top-hud {
    top: 6px; left: 10px; right: 10px;
    grid-template-columns: 66px minmax(0, 1fr) minmax(170px, auto) minmax(0, 1fr) 66px;
    grid-template-areas: "pl hl title hr pr";
    gap: 9px;
  }
  .portrait-frame { width: 66px; height: 78px; }
  .health { padding-top: 0; }
  .health-id { font-size: 12.5px; margin-bottom: 3px; }
  .health-track { height: 24px; border-width: 2.5px; }
  .hp-readout { font-size: 15px; }
  .title-block { grid-area: title; padding-top: 0; }
  .title-block h1, #app.is-live .title-block h1 { font-size: 30px; white-space: nowrap; }
  .title-block h1 br { display: none; }
  .title-block h1 span { margin-left: 0.18em; }
  .title-rule { margin: 3px auto 2px; }
  .title-block p { font-size: 7.5px; letter-spacing: 0.16em; }
  .pause-pair { position: fixed; top: 82px; right: 190px; }
  .ink-btn { width: 42px; height: 36px; }

  .side-panel {
    position: absolute;
    top: 88px;
    right: 10px;
    bottom: auto;
    width: 170px;
    height: auto;
    padding: 6px 8px 7px;
    border: 2.5px solid var(--ink);
    border-radius: 3px;
    box-shadow:
      inset 0 0 0 1px var(--paper),
      inset 0 0 0 3px rgba(30, 27, 51, 0.32),
      3px 4px 0 rgba(30, 27, 51, 0.28);
    overflow: hidden;
    z-index: 30;
  }
  .side-head { margin-bottom: 3px; padding-bottom: 2px; }
  .side-head h2 { font-size: 19px; }
  .side-head span { font-size: 8px; }
  .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; row-gap: 3px; }
  .stat { margin-bottom: 0; }
  .stat-line label { font-size: 9px; letter-spacing: 0.03em; }
  .stat-line output { font-size: 18px; }
  .stat-track { height: 9px; margin-top: 1px; }
  .stat input[type="range"] { left: -3px; right: -3px; top: 9px; width: calc(100% + 6px); height: 26px; }
  .reserved { display: none; }

  .select-dock {
    position: absolute;
    left: 10px;
    bottom: calc(var(--bar) + 6px);
    width: 190px;
    padding: 0;
    background: transparent;
    border: 0;
    z-index: 32;
  }
  .select-head { flex-wrap: wrap; gap: 2px 5px; margin-bottom: 2px; }
  .select-title { font-size: 18px; }
  .select-count { font-size: 9px; }
  .kind-tabs { width: 100%; margin-left: 0; gap: 3px; }
  .kind-tab { flex: 1; min-width: 0; height: 24px; font-size: 9.5px; padding: 0 2px; }
  .roster-scroll { display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 4px; }
  .fighter-card { width: 56px; }
  .card-name { font-size: 11px; }
  .card-kind { font-size: 8px; }
  .scroll-arrow { display: none; }
  .select-count::after { content: " · SWIPE"; color: var(--crimson); }

  .meter-dock {
    position: absolute;
    left: auto;
    right: 10px;
    bottom: calc(var(--bar) + 6px);
    width: 190px;
    transform: none;
    gap: 5px;
    z-index: 31;
  }
  .burst-mark { display: none; }
  .meter-label { font-size: 12px; }
  .meter-state, .meter-pct { font-size: 8px; }
  .meter-track { height: 12px; }
  .finish-slot { width: 50px; height: 42px; }
  .finish-title { font-size: 12px; }
  .finish-key { font-size: 8px; }

  .touch-controls { display: flex; bottom: calc(var(--bar) + 114px); padding: 0 10px; }
  .pad.pad-hit { transform: translateY(30px); }
  .pad { gap: 5px; }
  .pad-btn { width: 46px; height: 46px; }
  .pad-btn.pad-small { width: 36px; height: 36px; margin-bottom: 4px; }
  .pad-btn.pad-word { width: 48px; height: 44px; font-size: 10.5px; }

  .bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bar);
    min-height: var(--bar);
    padding: 0 10px;
    flex-wrap: nowrap;
  }
  .chapter { display: none; }
  .hints-keys { display: none; }
  .hints-touch { display: inline; font-size: 10.5px; letter-spacing: 0.01em; white-space: nowrap; }
  .builder-slots { display: none; }
  .overlay { align-items: flex-end; padding-bottom: 8px; }
}
