:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  --ink: #ecf5fc;
  --muted: #a7bbc9;
  --accent: #79edc9;
  --button: #7ce7c6;
  --button-ink: #133c37;
  --surface: rgba(15, 32, 52, 0.97);
  --solid: #1b334a;
  --glass: rgba(11, 28, 47, 0.75);
  --field: rgba(28, 48, 68, 0.87);
  --line: rgba(197, 224, 243, 0.17);
  --back: #101e32;
  --danger: #ff99b0;
  --shadow: rgba(2, 9, 22, 0.3);
  --edge: 18px;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
}
:root[data-theme='light'] {
  color-scheme: light;
  --ink: #203b46;
  --muted: #546d76;
  --accent: #157d70;
  --button: #1a7f71;
  --button-ink: #f2fff4;
  --surface: rgba(245, 248, 237, 0.97);
  --solid: #e8eee4;
  --glass: rgba(244, 248, 237, 0.85);
  --field: rgba(255, 255, 249, 0.82);
  --line: rgba(44, 74, 76, 0.18);
  --back: #e6e8dc;
  --danger: #ae3a5a;
  --shadow: rgba(39, 61, 65, 0.14);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  background: var(--back);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  padding: 0;
  border: 0;
}
#arena {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: 0;
  cursor: crosshair;
}
body:not(.in-game) #arena {
  cursor: default;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, var(--back) 0%, var(--back) 23%, transparent 77%);
  opacity: 0.97;
  transition: opacity 0.3s;
}
body.in-game::before {
  opacity: 0;
}
.menu-brand {
  position: fixed;
  z-index: 4;
  top: calc(28px + var(--st));
  left: 48px;
  width: 420px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  font-size: 27px;
  font-weight: 850;
  letter-spacing: -1.2px;
  color: var(--ink);
  text-decoration: none;
  gap: 0;
}
.wordmark > span {
  color: var(--accent);
}
.wordmark img {
  width: 34px;
  height: 34px;
  margin-right: 9px;
}
.shell {
  position: fixed;
  left: 48px;
  bottom: 35px;
  z-index: 3;
  width: 420px;
  max-height: calc(100dvh - 125px - var(--st) - var(--sb));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding-right: 3px;
}
.shell:not([data-view='home']) {
  top: calc(100px + var(--st));
  bottom: auto;
  width: min(480px, calc(100vw - 64px));
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 16px 60px var(--shadow);
}
.shell section:not([hidden]) {
  animation: arrive 0.23s ease-out;
}
h1 {
  font-size: 76px;
  line-height: 0.98;
  font-weight: 810;
  letter-spacing: -4.5px;
  margin: 0 0 16px;
}
h1 em {
  font-style: normal;
  color: var(--accent);
}
h2 {
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -1.2px;
  margin: 4px 0 16px;
}
h3 {
  font-size: 15px;
  margin: 0 0 10px;
}
.intro {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px;
}
.intro.small {
  font-size: 13px;
  margin-bottom: 15px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 750;
  margin: 0 0 12px;
}
.fineprint {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
  margin: 9px 0;
}
.disclosure,
.composition-note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin: 12px 0 8px;
}
.disclosure strong {
  font-weight: 650;
  color: var(--ink);
}
.micro-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 750;
  color: var(--muted);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  margin: 0 0 14px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.015em;
}
input:not([type='checkbox']),
select {
  height: 44px;
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 15px;
  line-height: 1.3;
  user-select: text;
  -webkit-user-select: text;
}
input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
select option {
  background: var(--solid);
  color: var(--ink);
}
.skin-field {
  padding: 0;
  margin: 0 0 16px;
  border: 0;
}
.skin-field legend {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
}
.skins {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.skin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 59px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  transition:
    border-color 0.16s,
    background 0.16s;
}
.skin.selected {
  border-color: var(--accent);
  background: var(--field);
  color: var(--ink);
}
.skin-swatch {
  display: block;
  width: 35px;
  height: 17px;
  border-radius: 99px;
  background: var(--skin);
  box-shadow:
    inset 0 3px 4px #ffffff65,
    inset 0 -3px 3px #08213940,
    0 3px 8px var(--shadow);
}
#skin-description {
  font-size: 10px;
  margin: 7px 0 0;
}
.primary,
.secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  margin: 8px 0;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  transition:
    transform 0.16s,
    background 0.16s,
    opacity 0.16s;
}
.primary {
  background: var(--button);
  color: var(--button-ink);
  box-shadow: 0 5px 20px var(--shadow);
  font-size: 15px;
}
.secondary {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
  font-size: 13px;
}
.primary:disabled,
.secondary:disabled {
  opacity: 0.45;
}
.primary:active:not(:disabled),
.secondary:active:not(:disabled) {
  transform: scale(0.98);
}
.button-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.button-pair > .primary,
.button-pair > .secondary {
  margin: 0;
}
.text-button {
  min-height: 40px;
  padding: 9px 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}
.text-button:hover {
  color: var(--ink);
}
.back {
  padding-top: 0;
  margin-bottom: 8px;
}
.home-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
details {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
summary {
  min-height: 24px;
  cursor: pointer;
  font-weight: 650;
  color: var(--ink);
}
#online-actions {
  padding: 0;
  border: 0;
}
#online-actions summary {
  padding: 10px 0;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
}
:root[data-online='false'] #online-actions {
  display: none;
}
.scene-caption {
  position: fixed;
  right: 30px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: right;
  pointer-events: none;
  color: var(--muted);
  font-size: 11px;
}
.scene-caption strong {
  color: var(--ink);
  font-weight: 650;
}
.scene-caption span {
  font-size: 10px;
}
/* Gameplay is edge text and small controls, not permanent dashboard panels. */
.hud {
  position: fixed;
  inset: calc(15px + var(--st)) max(var(--edge), env(safe-area-inset-right)) auto
    max(var(--edge), env(safe-area-inset-left));
  z-index: 6;
  pointer-events: none;
}
.score-panel {
  max-width: 195px;
  text-shadow: 0 1px 3px var(--shadow);
}
.score-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}
.score-line strong {
  font-size: 35px;
  font-weight: 800;
  letter-spacing: -1.3px;
  line-height: 1.13;
  font-variant-numeric: tabular-nums;
}
.score-line > span {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
#composition {
  display: block;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 5px;
}
.match-strip {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
}
#match-clock {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
#mode-label {
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.hud-actions {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}
.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 10px;
  background: var(--glass);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 25px;
  line-height: 1;
}
.icon-button svg,
.rank-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rank-button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  font-size: 11px;
  font-weight: 750;
}
.rank-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.5;
}
.leaderboard {
  position: fixed;
  right: var(--edge);
  top: calc(68px + var(--st));
  width: 181px;
  z-index: 8;
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 25px var(--shadow);
  animation: arrive 0.18s ease-out;
}
.leaderboard ol {
  list-style: none;
  counter-reset: rank;
  padding: 0;
  margin: 12px 0 0;
}
.leaderboard li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0;
  font-size: 11px;
  color: var(--muted);
}
.leaderboard li::before {
  content: counter(rank);
  font-size: 9px;
  opacity: 0.6;
  width: 11px;
}
.leaderboard li > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard li strong {
  font-size: 10px;
  white-space: nowrap;
}
.leaderboard li.me {
  color: var(--accent);
}
#worm-labels {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
#worm-labels span {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100px;
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #07192cb0;
  color: #f0f8ff;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.1;
  will-change: transform;
}
#worm-labels .is-you {
  font-size: 8px;
  letter-spacing: 0.11em;
  background: #184746ba;
  color: #d7ffec;
}
.hint {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--sb));
  transform: translateX(-50%);
  z-index: 5;
  max-width: calc(100vw - 34px);
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  pointer-events: none;
  animation: fade 0.24s ease-out;
}
.protection {
  position: fixed;
  left: 50%;
  top: calc(50% + 47px);
  transform: translateX(-50%);
  z-index: 4;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  color: var(--accent);
  font-size: 10px;
  pointer-events: none;
}
.pickup-flow {
  position: fixed;
  left: var(--edge);
  top: calc(94px + var(--st));
  z-index: 4;
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--accent);
  text-shadow: 0 1px 3px var(--shadow);
  pointer-events: none;
  animation: arrive 0.2s ease-out;
}
.pickup-flow span {
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.13em;
}
.pickup-flow strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.pickup-flow small {
  font-size: 10px;
  opacity: 0.7;
}
.bottom-controls {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}
.skill-dock {
  position: absolute;
  right: max(var(--edge), env(safe-area-inset-right));
  bottom: calc(22px + var(--sb));
  width: 112px;
  pointer-events: none;
}
.reserve-slots {
  display: flex;
  gap: 10px;
  align-items: center;
}
.skill-slot {
  --skill: var(--accent);
  --reserve: 0;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--glass);
  color: var(--skill);
  box-shadow: 0 3px 14px var(--shadow);
  pointer-events: auto;
  transition:
    opacity 0.17s,
    background 0.17s;
}
.skill-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(var(--skill) calc(var(--reserve) * 360deg), var(--line) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
  pointer-events: none;
}
.skill-slot[data-empty='true'] {
  opacity: 0.2;
  pointer-events: none;
}
.skill-slot:disabled:not([data-empty='true']) {
  opacity: 0.6;
  pointer-events: none;
}
.skill-symbol {
  display: grid;
  place-items: center;
}
.skill-symbol svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skill-time {
  position: absolute;
  bottom: -1px;
  right: -1px;
  min-width: 18px;
  height: 18px;
  padding: 2px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--solid);
  color: var(--ink);
  font-size: 9px;
  line-height: 12px;
  font-variant-numeric: tabular-nums;
}
.skill-slot.expiring .skill-time {
  color: var(--danger);
  border-color: var(--danger);
}
.skill-slot.expiring::before {
  animation: breathe 1.25s ease-in-out infinite;
}
[data-ability='overdrive'] {
  --skill: #ffcd76;
}
[data-ability='coil'] {
  --skill: #73e4c9;
}
[data-ability='shed'] {
  --skill: #c1a9ff;
}
:root[data-theme='light'] [data-ability='overdrive'] {
  --skill: #946617;
}
:root[data-theme='light'] [data-ability='coil'] {
  --skill: #137f71;
}
:root[data-theme='light'] [data-ability='shed'] {
  --skill: #785ab5;
}
.active-ability {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: 153px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--glass);
  color: var(--skill);
  pointer-events: none;
  animation: arrive 0.2s ease-out;
}
#active-name {
  flex: 1;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
#active-time {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.duration-track {
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 5px;
  height: 2px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.duration-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--skill);
  transform-origin: left;
  transition: transform 0.12s linear;
}
.energy-hud {
  position: absolute;
  left: 50%;
  bottom: calc(24px + var(--sb));
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted);
  opacity: 0.8;
  pointer-events: none;
}
.energy-hud > svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.energy-hud > div {
  width: 78px;
}
#energy-meter {
  height: 4px;
  margin-top: 3px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
#energy-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.12s linear;
}
#energy-caption {
  display: block;
  font-size: 7px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-align: center;
  margin-top: 5px;
  font-weight: 750;
}
.energy-hud.boosting {
  color: var(--accent);
  opacity: 1;
}
#radar {
  position: absolute;
  bottom: calc(22px + var(--sb));
  left: var(--edge);
  width: 64px;
  height: 64px;
  border-radius: 12px;
  opacity: 0.84;
  pointer-events: none;
}
/* Accessibility pads are optional. The rest of the arena always remains usable. */
.joystick,
.boost-wrap {
  display: none;
  pointer-events: auto;
}
.joystick {
  position: absolute;
  left: var(--edge);
  bottom: calc(23px + var(--sb));
  width: 94px;
  height: 94px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--glass);
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.joystick > span {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.7;
  transform: translate(var(--jx, 0px), var(--jy, 0px));
}
.joystick.held > span {
  background: var(--accent);
  opacity: 1;
}
.joystick small {
  display: none;
}
.boost-wrap {
  position: absolute;
  right: var(--edge);
  bottom: calc(23px + var(--sb));
  flex-direction: column;
  gap: 7px;
  align-items: center;
}
.boost {
  width: 78px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--glass);
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  touch-action: none;
}
.boost svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.boost strong {
  font-size: 11px;
}
.boost.held {
  background: var(--solid);
  box-shadow: 0 0 17px var(--shadow);
}
#boost-label {
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-weight: 750;
}
[data-controls='visible'] .joystick,
[data-controls='visible'] .boost-wrap {
  display: flex;
}
[data-controls='visible'] .skill-dock,
[data-controls='visible'] #radar {
  bottom: calc(132px + var(--sb));
}
[data-control-size='small'] .joystick {
  width: 80px;
  height: 80px;
}
[data-control-size='large'] .joystick {
  width: 112px;
  height: 112px;
}
[data-control-size='large'] .boost {
  width: 90px;
  height: 90px;
}
.left-handed .skill-dock {
  left: var(--edge);
  right: auto;
}
.left-handed .active-ability {
  left: 0;
  right: auto;
}
.left-handed .joystick,
.left-handed #radar {
  left: auto;
  right: var(--edge);
}
.left-handed .boost-wrap {
  left: var(--edge);
  right: auto;
}
.status {
  position: fixed;
  z-index: 16;
  left: 50%;
  bottom: calc(136px + var(--sb));
  transform: translateX(-50%);
  max-width: min(390px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 6px 25px var(--shadow);
  animation: fade 0.2s ease-out;
}
.status:empty {
  display: none;
}
.spectate {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: calc(30px + var(--sb));
  transform: translateX(-50%);
  width: min(365px, calc(100vw - 32px));
  padding: 13px 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 17px;
  font-size: 12px;
}
.spectate p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin: 7px 0;
}
.spectate > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.spectate > div > span {
  font-size: 11px;
  color: var(--muted);
}
#performance {
  position: fixed;
  left: 6px;
  bottom: 3px;
  z-index: 14;
  background: var(--glass);
  padding: 3px 5px;
  border-radius: 4px;
  color: var(--muted);
  font:
    9px ui-monospace,
    monospace;
  pointer-events: none;
}
/* Keep established online room flows intact. */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.full {
  grid-column: 1/-1;
}
.lobby-list {
  max-height: 38vh;
  overflow: auto;
  scrollbar-width: thin;
  margin: 12px 0;
}
.lobby-card {
  padding: 14px;
  margin: 9px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
}
.lobby-card > strong {
  font-size: 15px;
}
.lobby-card-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 7px 0;
}
.empty-state {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  padding: 15px 0;
}
.members {
  margin: 17px 0;
  border-block: 1px solid var(--line);
  max-height: 240px;
  overflow: auto;
}
.member {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.member:last-child {
  border: 0;
}
.member-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-swatch {
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.member-state {
  font-size: 10px;
  color: var(--muted);
}
.member-state.ready {
  color: var(--accent);
}
.invite-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 13px 0;
}
.invite-strip strong {
  font-size: 23px;
  letter-spacing: 0.06em;
}
.invite-strip button {
  width: auto;
}
.inline-error,
.connection {
  margin: 12px 0 0;
  padding: 12px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.55;
}
.connection {
  color: var(--muted);
}
dialog {
  width: min(460px, calc(100vw - 30px));
  max-height: calc(100dvh - 36px - var(--st) - var(--sb));
  margin: auto;
  padding: 26px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 90px var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
dialog[open] {
  animation: dialog-in 0.2s ease-out;
}
dialog::backdrop {
  background: rgba(3, 13, 27, 0.62);
  backdrop-filter: blur(5px);
}
:root[data-theme='light'] dialog::backdrop {
  background: rgba(89, 117, 121, 0.38);
}
dialog > p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.dialog-heading h2 {
  margin-bottom: 3px;
}
.dialog-heading .icon-button {
  border: 0;
  background: none;
  width: 37px;
  height: 37px;
  padding: 5px;
}
#settings-menu {
  width: min(560px, calc(100vw - 30px));
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 15px;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.switch-row input {
  appearance: none;
  position: relative;
  flex: none;
  width: 36px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--field);
  cursor: pointer;
  transition: background 0.16s;
}
.switch-row input::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.16s;
}
.switch-row input:checked {
  background: var(--accent);
}
.switch-row input:checked::after {
  transform: translateX(13px);
  background: var(--button-ink);
}
.how-to {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 22px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
.how-to h3 {
  color: var(--ink);
}
.how-to p {
  margin: 10px 0;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 17px 0;
  border-block: 1px solid var(--line);
  margin: 14px 0;
}
.result-stats div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.result-stats strong {
  font-size: 28px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.result-stats span {
  font-size: 10px;
  color: var(--muted);
}
.result-rows {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  max-height: 155px;
  overflow: auto;
}
.result-rows li {
  display: grid;
  grid-template-columns: 19px 1fr auto;
  gap: 8px;
  padding: 6px 0;
  font-size: 11px;
  color: var(--muted);
}
.result-rows li > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-rows li > strong {
  font-size: 10px;
}
.result-rows li.me {
  color: var(--accent);
}
@media (hover: hover) {
  .primary:hover:not(:disabled) {
    filter: brightness(1.04);
    transform: translateY(-1px);
  }
  .secondary:hover:not(:disabled),
  .icon-button:hover,
  .skin:hover,
  .rank-button:hover {
    border-color: var(--accent);
  }
  .skill-slot:hover:not(:disabled) {
    background: var(--solid);
  }
}
@media (max-width: 720px) {
  :root {
    --edge: 15px;
  }
  .menu-brand {
    top: calc(20px + var(--st));
    left: 22px;
    width: calc(100vw - 44px);
  }
  .wordmark {
    font-size: 24px;
  }
  .wordmark img {
    width: 30px;
    height: 30px;
  }
  .shell {
    left: 22px;
    bottom: calc(17px + var(--sb));
    width: calc(100vw - 44px);
    max-height: calc(100dvh - 102px - var(--st) - var(--sb));
    padding-right: 0;
  }
  .shell:not([data-view='home']) {
    top: calc(83px + var(--st));
    left: 16px;
    width: calc(100vw - 32px);
    padding: 19px;
    border-radius: 20px;
  }
  body::before {
    background: linear-gradient(0deg, var(--back) 0%, var(--back) 42%, transparent 91%);
  }
  h1 {
    font-size: 52px;
    letter-spacing: -3px;
    margin-bottom: 12px;
  }
  .intro {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
  }
  .field {
    margin-bottom: 12px;
  }
  .field input,
  .field select {
    font-size: 16px;
  }
  .skin {
    min-height: 49px;
    gap: 5px;
    font-size: 10px;
    border-radius: 11px;
  }
  .skin-swatch {
    width: 30px;
    height: 14px;
  }
  .skin-field {
    margin-bottom: 13px;
  }
  #skin-description {
    font-size: 9px;
  }
  .disclosure {
    font-size: 10px;
  }
  .primary {
    min-height: 48px;
  }
  .home-footer .text-button {
    font-size: 11px;
    min-height: 35px;
  }
  .scene-caption {
    display: none;
  }
  .score-panel {
    max-width: 142px;
  }
  .score-line {
    gap: 3px 7px;
  }
  .score-line strong {
    font-size: 29px;
    letter-spacing: -1px;
  }
  .score-line > span {
    font-size: 9px;
  }
  #composition {
    font-size: 9px;
    max-width: 150px;
  }
  .hud {
    top: calc(13px + var(--st));
  }
  .micro-label {
    font-size: 8px;
  }
  .rank-button {
    padding: 8px 7px;
    font-size: 10px;
  }
  .rank-button svg {
    width: 12px;
  }
  .match-strip {
    padding: 6px 9px;
  }
  #match-clock {
    font-size: 15px;
  }
  .hint {
    font-size: 9px;
    padding: 7px 10px;
  }
  .pickup-flow {
    top: calc(87px + var(--st));
  }
  .leaderboard {
    top: calc(64px + var(--st));
    width: 172px;
  }
  .settings-grid {
    gap: 6px 12px;
  }
  .switch-row {
    font-size: 11px;
  }
}
@media (max-height: 650px) {
  h1 {
    font-size: 48px;
    letter-spacing: -3px;
  }
  .shell {
    bottom: 15px;
    max-height: calc(100dvh - 100px - var(--st));
  }
  .intro {
    margin-bottom: 13px;
  }
  .skin {
    min-height: 46px;
  }
  .score-line strong {
    font-size: 28px;
  }
  .score-panel {
    max-width: 188px;
  }
  .skill-dock {
    bottom: calc(15px + var(--sb));
  }
  .hint {
    bottom: calc(72px + var(--sb));
  }
  .joystick {
    width: 80px;
    height: 80px;
  }
  .boost {
    width: 68px;
    height: 68px;
  }
  [data-controls='visible'] .skill-dock,
  [data-controls='visible'] #radar {
    bottom: calc(115px + var(--sb));
  }
}
@media (max-width: 370px) {
  .menu-brand,
  .shell {
    left: 17px;
    width: calc(100vw - 34px);
  }
  h1 {
    font-size: 46px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .score-panel {
    max-width: 123px;
  }
  .score-line > span {
    display: none;
  }
  .rank-button svg {
    display: none;
  }
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes breathe {
  50% {
    opacity: 0.6;
  }
}
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
