:root {
  color-scheme: dark;
  --bg: #0b101a;
  --panel: #111824;
  --line: #313c4c;
  --text: #eef2f9;
  --muted: #a6b3c6;
  --blue: #70d2f7;
  --orange: #ffad70;
  --focus: #a2edff;
  font-family: Arial, Helvetica, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 280px;
  background: radial-gradient(ellipse at 50% 0, #172035 0, transparent 62%), var(--bg);
  color: var(--text);
}
button,
a,
summary {
  font: inherit;
}
button,
summary {
  cursor: pointer;
}
button {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}
.masthead {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 19px 26px;
}
.brand {
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}
.brand:hover {
  color: var(--blue);
}
.crumb {
  color: #6e7d92;
}
h1 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
  color: #bac6d7;
}
.quiet {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 13px;
}
.quiet:hover {
  background: var(--panel);
}
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 26px 26px;
}
.arena {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 15px 40px #05081255;
}
.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 4vw, 64px);
  padding: 13px clamp(14px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: #141d2a;
}
.seat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  --seat: var(--blue);
}
.seat.player {
  --seat: var(--orange);
  flex-direction: row-reverse;
  text-align: right;
}
.marker {
  width: 5px;
  height: 29px;
  flex-shrink: 0;
  background: var(--seat);
  border-radius: 2px;
}
.seat-name {
  display: grid;
  gap: 2px;
}
.seat-name span,
.clock span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 700;
}
.seat-name strong {
  font-size: clamp(13px, 1.7vw, 18px);
  line-height: 1.1;
  white-space: nowrap;
}
.seat output,
.clock time {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  font-size: clamp(22px, 3.5vw, 38px);
  letter-spacing: -0.045em;
}
.seat output {
  color: var(--seat);
  margin-inline: 4px;
}
.clock {
  text-align: center;
  display: grid;
  gap: 3px;
}
.clock time {
  font-size: clamp(19px, 2.6vw, 30px);
  line-height: 1;
}
#ping {
  color: #bdcad7;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.stage {
  position: relative;
  height: clamp(335px, min(58vw, 59vh), 640px);
  isolation: isolate;
  background: #101725;
}
.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hit-notices {
  position: absolute;
  inset: clamp(6px, 2.5%, 18px) 5% auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  pointer-events: none;
}
.hit-notice {
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--blue);
  line-height: 1;
}
#hit-opponent {
  grid-column: 1;
  grid-row: 1;
}
#hit-player {
  grid-column: 2;
  grid-row: 1;
  color: var(--orange);
}
.hit-notice strong {
  font-size: clamp(35px, 7.4vw, 86px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.08em;
  -webkit-text-stroke: 1px #101722;
  paint-order: stroke fill;
  text-shadow:
    2px 3px #121923,
    3px 4px #121923,
    0 3px 10px #000b;
}
.hit-notice span {
  max-width: 100%;
  padding: 4px 8px;
  border-left: 3px solid currentColor;
  border-radius: 2px;
  background: #101722ee;
  font-size: clamp(10px, 1.3vw, 15px);
  font-weight: 800;
  text-align: center;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  padding: clamp(12px, 2.3vw, 30px);
  background: linear-gradient(0deg, #08101b75, transparent 58%);
}
.prompt {
  width: min(100%, 455px);
  text-align: center;
  padding: 13px 20px 15px;
  border: 1px solid #3d4c61;
  background: #111c2cf2;
  border-radius: 10px;
  box-shadow: 0 10px 25px #0005;
  pointer-events: auto;
}
h2 {
  letter-spacing: -0.035em;
  font-size: clamp(21px, 3vw, 31px);
  margin: 0 0 5px;
  line-height: 1.07;
}
.prompt p {
  font-size: 14px;
  line-height: 1.4;
  color: #b8c7da;
  margin: 0 auto 10px;
  max-width: 390px;
}
.primary {
  background: var(--orange);
  color: #171a20;
  border: 0;
  border-radius: 7px;
  padding: 10px 18px;
  font-weight: 750;
  font-size: 15px;
}
.primary span {
  margin-left: 7px;
}
.primary:hover {
  background: #ffc89f;
}
.primary:disabled {
  cursor: wait;
  opacity: 0.7;
}
.status-line {
  flex-wrap: wrap;
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: #111925;
  font-size: 13px;
  color: #c4cddd;
}
.signal {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7f8fa3;
}
.signal.active {
  background: #82dfbf;
  box-shadow: 0 0 7px #82dfbf66;
}
#input-device {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
#last-strike:empty,
#score-event:empty {
  display: none;
}
#last-strike {
  color: var(--muted);
}
#last-strike[data-kind='credited'] {
  color: #9ee6c6;
  font-weight: 700;
}
.controls {
  padding: 14px 4px;
}
.control-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--muted);
}
.assist,
.camera,
.key-hint {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.assist,
.camera select {
  color: var(--text);
}
.assist input {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
}
.camera select {
  font: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px;
}
#move-state {
  display: none;
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 48%;
  width: max-content;
  padding: 4px 8px;
  border-radius: 4px;
  background: #101722e8;
  color: #ffce9b;
  font-size: clamp(10px, 1.2vw, 13px);
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}
.playing #move-state {
  display: block;
}
#score-event {
  color: #fff0b9;
  font-weight: 700;
}
.credit {
  display: inline-block;
  font-size: 11px;
  margin-top: 12px;
  color: var(--muted);
}
kbd {
  font:
    600 11px Arial,
    sans-serif;
  min-width: 20px;
  text-align: center;
  background: #1c2838;
  border: 1px solid #41506a;
  border-radius: 4px;
  box-shadow: 0 1px 0 #000;
  padding: 3px 5px;
  color: #edf1f7;
}
.mappings {
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
}
.mappings summary {
  width: fit-content;
  color: #b7d7ec;
}
.mappings dl {
  line-height: 1.45;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
}
.mappings dt {
  font-weight: 700;
  color: var(--text);
}
.mappings dd {
  margin: 0;
}
.touch-controls {
  display: none;
}
.playfield {
  position: relative;
}
.right-pad,
.move-pad {
  display: grid;
  justify-items: center;
  gap: 5px;
}
.pad-label,
.turn-caption {
  color: #c1c9d0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(52px, 1fr));
  gap: 4px 8px;
}
.touch-controls button {
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  border: 1px solid #6d808f;
  color: #f2f5f9;
  box-shadow: 0 1px 3px #020812a0;
}
.quick-actions button {
  min-width: 44px;
  min-height: 44px;
  padding: 3px 7px;
  border-radius: 18px;
  background: #283548ef;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 700;
}
.quick-actions button.in-motion,
.quick-actions button:active {
  border-color: var(--orange);
  background: #593a27;
}
.quick-actions button.locked:not(.in-motion) {
  color: #bac4ce;
  background: #18212ddd;
}
.thumb-axis {
  position: relative;
  background: #142133db;
  overflow: hidden;
}
.thumb-axis.pressed {
  border-color: #b3e1ef;
}
.move-stick {
  width: clamp(82px, 22vw, 106px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(transparent 49%, #d2e9f82c 49%, #d2e9f82c 51%, transparent 51%),
    linear-gradient(90deg, transparent 49%, #d2e9f82c 49%, #d2e9f82c 51%, transparent 51%),
    #142133db;
}
.thumb-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #8ca6bc;
  border: 1px solid #e0edf7;
  box-shadow: 0 2px 4px #050d18a0;
  pointer-events: none;
}
.turn-strip {
  height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-radius: 22px;
}
.turn-strip .thumb-knob {
  display: grid;
  place-items: center;
  width: 40px;
  height: 28px;
  border-radius: 16px;
  font-size: 10px;
  font-weight: 700;
  color: #0b1824;
}
.turn-caption {
  font-size: 18px;
}
.touch-controls button:disabled {
  opacity: 0.65;
}
.moves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.moves button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 5px;
  font-size: 12px;
  font-weight: 650;
  background: #172335;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  touch-action: manipulation;
}
.moves button.locked {
  color: #afbfcc;
  background: #141c28;
}
.moves button.in-motion {
  color: #fff5dd;
  border-color: var(--orange);
  background: #463124;
}
.moves button:not(:disabled):hover {
  border-color: #adbac7;
}
.moves button:disabled {
  opacity: 0.72;
  cursor: default;
}
@media (pointer: coarse), (max-width: 700px) {
  .key-hint,
  .moves kbd {
    display: none;
  }
  .touch-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px clamp(12px, 6vw, 38px);
    border-top: 1px solid var(--line);
    background: #141d2b;
  }
  .moves {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }
}
@media (max-width: 590px) {
  .masthead {
    padding: 11px 12px;
    min-height: 47px;
    gap: 9px;
  }
  main {
    padding: 0 8px 12px;
  }
  .arena {
    border-radius: 9px;
  }
  .scoreboard {
    padding: 9px;
    gap: 7px;
  }
  .seat {
    gap: 5px;
  }
  .marker {
    width: 3px;
    height: 23px;
  }
  .seat-name span,
  .clock span {
    font-size: 8px;
    letter-spacing: 0.08em;
  }
  .seat-name strong {
    font-size: 13px;
  }
  .seat output {
    margin-inline: 2px;
  }
  .stage {
    height: clamp(220px, 43svh, 410px);
  }
  .prompt {
    padding: 10px 14px;
    max-width: 340px;
  }
  .prompt p {
    font-size: 12px;
  }
  .status-line {
    padding: 7px 9px;
    min-height: 31px;
    font-size: 12px;
  }
  .controls {
    padding: 10px 2px 4px;
  }
  .mappings {
    margin-top: 9px;
  }
  .control-bar {
    gap: 6px 10px;
    font-size: 12px;
  }
  .moves button {
    font-size: 11px;
  }
}
@media (max-height: 520px) and (min-width: 590px) {
  .stage {
    height: 310px;
  }
  .masthead {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .scoreboard {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  main {
    padding-inline: max(8px, env(safe-area-inset-left), env(safe-area-inset-right));
  }
  .stage {
    height: clamp(158px, calc(100svh - 138px), 400px);
  }
  .touch-controls {
    display: none;
  }
  .playing .touch-controls {
    display: flex;
    position: absolute;
    inset: auto 0 4px;
    padding: 4px clamp(8px, 3vw, 24px);
    pointer-events: none;
    background: none;
    border: 0;
    align-items: end;
  }
  .playing .thumb-axis,
  .playing .quick-actions {
    pointer-events: auto;
  }
  .pad-label {
    text-shadow: 0 1px 3px #000;
  }
  .move-stick {
    width: clamp(74px, 12vw, 104px);
  }
  .controls {
    padding-top: 4px;
  }
  #move-state {
    max-width: 38%;
  }
}
