:root {
  color-scheme: dark;
  --bg: #05060a;
  --panel: #11131b;
  --panel-strong: #171923;
  --line: #33384b;
  --text: #f6f7fb;
  --muted: #a9afc3;
  --cyan: #34d9ff;
  --yellow: #ffd65a;
  --pink: #ff4fa3;
  --green: #63ff96;
  --red: #ff655d;
  --desktop-chrome-height: 144px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: grid;
  place-items: start center;
  min-height: 100dvh;
  padding: 18px;
  background:
    linear-gradient(180deg, #05060a 0%, #0b0d12 48%, #090812 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
}

.game-shell {
  width: min(100%, 900px);
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.topbar,
.statusbar,
.touch-toggle,
.touch-controls {
  width: 100%;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(17, 19, 27, 0.94);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 18px rgba(52, 217, 255, 0.58), inset 0 0 12px rgba(255, 79, 163, 0.45);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
  min-width: min(100%, 420px);
}

.stat {
  display: grid;
  gap: 3px;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #090a10;
}

.stat span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
}

.stat strong {
  color: var(--yellow);
  font-size: 1.05rem;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sound-button,
.primary-button,
.touch-toggle,
.touch-button {
  border: 0;
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sound-button {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.sound-button.is-muted {
  color: var(--red);
}

.settings-button {
  color: var(--cyan);
}

.guide-button {
  color: var(--yellow);
}

.stage-panel {
  position: relative;
  width: min(100%, calc((100dvh - var(--desktop-chrome-height)) * 9 / 16));
  margin-inline: auto;
  aspect-ratio: 9 / 16;
  min-height: min(640px, calc(100dvh - var(--desktop-chrome-height)));
  border: 1px solid var(--line);
  overflow: hidden;
  background: #040408;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  touch-action: none;
  overscroll-behavior: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 6, 10, 0.54);
  transition: opacity 140ms ease, visibility 140ms ease;
}

.overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.settings-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #05060a;
  transition: opacity 140ms ease, visibility 140ms ease;
}

.stage-panel.are-key-settings-open > .overlay,
.stage-panel.are-key-settings-open > .touch-toggle,
.stage-panel.are-key-settings-open > .touch-controls,
.stage-panel.are-key-settings-open > .statusbar,
.stage-panel.are-guide-open > .overlay,
.stage-panel.are-guide-open > .touch-toggle,
.stage-panel.are-guide-open > .touch-controls,
.stage-panel.are-guide-open > .statusbar {
  visibility: hidden;
}

.settings-modal.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.settings-panel {
  width: min(640px, 100%);
  max-height: min(760px, calc(100% - 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0c0d14;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.guide-panel {
  width: min(620px, 100%);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.settings-header,
.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #0c0d14;
}

.settings-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  justify-content: flex-end;
}

.settings-header h2 {
  margin: 0;
  color: var(--cyan);
  font-size: 1.05rem;
  line-height: 1;
  text-transform: uppercase;
}

.settings-close,
.settings-action,
.key-bind-button,
.gamepad-bind-button,
.key-choice-button {
  border: 1px solid var(--line);
  background: rgba(17, 19, 27, 0.94);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.settings-close {
  width: 36px;
  height: 36px;
  color: var(--pink);
}

.settings-action {
  min-width: 84px;
  height: 38px;
  padding: 0 14px;
}

.settings-action.is-primary {
  background: var(--cyan);
  color: #05060a;
}

.key-settings-rows {
  min-height: 0;
  display: grid;
  align-content: start;
  overflow: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  background: #0c0d14;
}

.key-setting-row {
  display: grid;
  grid-template-columns: minmax(94px, 0.8fr) minmax(0, 1.6fr);
  align-items: start;
  gap: 10px;
  min-height: 70px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.key-setting-name {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.key-setting-bindings {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.binding-group {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.binding-group-label {
  width: 28px;
  flex: 0 0 28px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 900;
  text-align: right;
}

.key-bind-button,
.gamepad-bind-button {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-bind-button,
.gamepad-bind-button {
  min-width: 58px;
  height: 34px;
  padding: 0 8px;
  color: var(--yellow);
  font-size: 0.74rem;
}

.gamepad-bind-button {
  color: var(--cyan);
}

.key-bind-button.is-empty,
.gamepad-bind-button.is-empty {
  color: var(--muted);
}

.key-bind-button.is-listening,
.gamepad-bind-button.is-listening {
  color: #05060a;
  background: var(--yellow);
}

.key-choice-panel {
  display: grid;
  gap: 8px;
  padding: 9px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #08090f;
}

.guide-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
  overflow: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  background: #0c0d14;
}

.guide-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

.guide-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--guide-color) 58%, rgba(255, 255, 255, 0.2));
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--guide-color) 34%, transparent), transparent 62%),
    rgba(5, 6, 10, 0.88);
  color: var(--guide-color);
  font-size: 0.62rem;
  font-weight: 900;
  box-shadow: 0 0 16px color-mix(in srgb, var(--guide-color) 28%, transparent);
}

.guide-icon.boost {
  --guide-color: var(--green);
}

.guide-icon.charge {
  --guide-color: var(--cyan);
}

.guide-icon.orbit {
  --guide-color: #9b7cff;
}

.guide-icon.bomb {
  --guide-color: var(--pink);
}

.guide-icon.burst {
  --guide-color: var(--yellow);
}

.guide-item h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1;
  text-transform: uppercase;
}

.guide-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: keep-all;
}

.key-choice-panel.is-hidden {
  display: none;
}

.key-choice-hint {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.key-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.key-choice-button {
  position: relative;
  z-index: 1;
  min-width: 54px;
  height: 30px;
  padding: 0 8px;
  color: var(--cyan);
  font-size: 0.66rem;
  font-weight: 900;
}

.overlay-panel {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 13, 20, 0.82);
  text-align: center;
  backdrop-filter: blur(10px);
}

.overlay-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.overlay-panel p {
  margin: 12px auto 18px;
  max-width: 32ch;
  color: var(--muted);
  line-height: 1.45;
}

.primary-button {
  min-width: 148px;
  height: 48px;
  padding: 0 22px;
  background: var(--pink);
  color: white;
  font-weight: 900;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 12px 36px rgba(255, 79, 163, 0.34);
}

.primary-button:hover,
.touch-toggle:hover,
.touch-button:hover,
.sound-button:hover {
  filter: brightness(1.08);
}

.primary-button:active,
.touch-toggle:active,
.touch-button:active,
.touch-button.is-down,
.sound-button:active {
  transform: translateY(1px);
}

.key-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.key-row span {
  min-width: 58px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: #08090f;
  color: var(--muted);
  font-size: 0.74rem;
}

.touch-toggle {
  display: none;
  position: absolute;
  z-index: 6;
  right: 12px;
  bottom: 126px;
  width: auto;
  min-width: 56px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(52, 217, 255, 0.42);
  background: rgba(9, 10, 16, 0.88);
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.touch-controls {
  position: absolute;
  z-index: 5;
  left: 18px;
  right: 18px;
  bottom: 54px;
  width: auto;
  --touch-opacity: 0.78;
  opacity: var(--touch-opacity);
  display: none;
  grid-template-columns: 112px 128px;
  grid-template-rows: auto 24px;
  gap: 8px 12px;
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
}

.virtual-joystick {
  --stick-x: 0px;
  --stick-y: 0px;
  position: relative;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(52, 217, 255, 0.36);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(52, 217, 255, 0.12) 0 20%, rgba(17, 19, 27, 0.5) 21% 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), inset 0 0 28px rgba(52, 217, 255, 0.08);
  pointer-events: auto;
  touch-action: none;
}

.virtual-joystick::before,
.virtual-joystick::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 72%;
  height: 1px;
  background: rgba(52, 217, 255, 0.18);
  transform: translate(-50%, -50%);
}

.virtual-joystick::after {
  width: 1px;
  height: 72%;
}

.joystick-ring {
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.joystick-stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(52, 217, 255, 0.72);
  border-radius: 50%;
  background: rgba(9, 10, 16, 0.72);
  box-shadow: 0 0 20px rgba(52, 217, 255, 0.34), inset 0 0 14px rgba(159, 123, 255, 0.2);
  transform: translate(calc(-50% + var(--stick-x)), calc(-50% + var(--stick-y)));
}

.virtual-joystick.is-active .joystick-stick {
  border-color: rgba(99, 255, 150, 0.82);
  box-shadow: 0 0 24px rgba(99, 255, 150, 0.45), inset 0 0 14px rgba(52, 217, 255, 0.24);
}

.touch-actions {
  position: relative;
  width: 128px;
  height: 128px;
  justify-self: end;
  align-self: end;
  pointer-events: none;
}

.touch-button {
  position: absolute;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(17, 19, 27, 0.84);
  color: var(--cyan);
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  touch-action: none;
  pointer-events: auto;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32), inset 0 0 12px rgba(255, 255, 255, 0.08);
}

.touch-button.charge {
  top: 0;
  left: 40px;
  color: #05060a;
  background: rgba(52, 217, 255, 0.86);
}

.touch-button.boost {
  top: 40px;
  left: 0;
  color: #05060a;
  background: rgba(99, 255, 150, 0.86);
}

.touch-button.orbit {
  top: 40px;
  right: 0;
  color: white;
  background: rgba(159, 123, 255, 0.88);
}

.touch-button.bomb {
  bottom: 0;
  left: 40px;
  color: white;
  background: rgba(255, 79, 163, 0.88);
}

.touch-opacity {
  grid-column: 1 / -1;
  justify-self: center;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  width: min(260px, 82vw);
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 10, 16, 0.58);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  pointer-events: auto;
  touch-action: pan-x;
}

.touch-opacity input {
  touch-action: pan-x;
}

.touch-opacity input {
  width: 100%;
  accent-color: var(--cyan);
}

.statusbar {
  position: absolute;
  z-index: 5;
  left: 12px;
  right: 12px;
  top: 10px;
  bottom: auto;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  overflow: visible;
  pointer-events: none;
}

.statusbar > span {
  flex: 0 1 auto;
  max-width: min(220px, 42%);
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 10, 16, 0.62);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-icons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  gap: 5px;
  overflow: visible;
  margin-left: auto;
}

.status-empty {
  display: none;
}

.status-icon {
  --accent: var(--cyan);
  --cooldown: 1;
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  color: var(--text);
  isolation: isolate;
}

.status-icon::before,
.status-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
}

.status-icon::before {
  background:
    conic-gradient(var(--accent) calc(var(--cooldown) * 1turn), rgba(255, 255, 255, 0.1) 0),
    rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 48%, transparent);
}

.status-icon::after {
  inset: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 54%, rgba(255, 255, 255, 0.16));
  background: rgba(6, 7, 12, 0.88);
  z-index: 0;
}

.status-icon-label,
.status-icon-value,
.status-icon-badge {
  position: relative;
  z-index: 1;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.status-icon-label {
  margin-top: 1px;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 900;
}

.status-icon-value {
  margin-top: -6px;
  color: var(--text);
  font-size: 0.58rem;
  font-weight: 800;
}

.status-icon-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: var(--accent);
  color: #05060a;
  font-size: 0.56rem;
  font-weight: 900;
  z-index: 2;
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  html,
  body {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  body {
    --mobile-safe-top: env(safe-area-inset-top, 0px);
    --mobile-safe-right: env(safe-area-inset-right, 0px);
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-safe-left: env(safe-area-inset-left, 0px);
    --mobile-viewport-height: calc(100dvh - var(--mobile-safe-top) - var(--mobile-safe-bottom));
    --mobile-viewport-width: calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right));
    --mobile-topbar-height: clamp(98px, 14dvh, 116px);
    --mobile-shell-gap: 7px;
    height: 100dvh;
    min-height: 100dvh;
    padding:
      var(--mobile-safe-top)
      var(--mobile-safe-right)
      var(--mobile-safe-bottom)
      var(--mobile-safe-left);
    place-items: center;
  }

  .game-shell {
    width: min(var(--mobile-viewport-width), calc((var(--mobile-viewport-height) - var(--mobile-topbar-height) - var(--mobile-shell-gap)) * 9 / 16));
    height: var(--mobile-viewport-height);
    max-width: var(--mobile-viewport-width);
    max-height: var(--mobile-viewport-height);
    gap: var(--mobile-shell-gap);
    grid-template-rows: var(--mobile-topbar-height) minmax(0, 1fr);
    align-content: center;
    justify-items: center;
    overflow: hidden;
  }

  .topbar {
    width: 100%;
    height: var(--mobile-topbar-height);
    grid-template-columns: 1fr auto auto auto;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: center;
    gap: 8px;
    padding: 6px;
    overflow: hidden;
  }

  .brand-mark {
    width: clamp(24px, 7vw, 30px);
    height: clamp(24px, 7vw, 30px);
  }

  .brand h1 {
    font-size: clamp(1rem, 4.8vw, 1.2rem);
  }

  .brand p {
    display: none;
  }

  .hud {
    grid-column: 1 / -1;
    order: 3;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .stat {
    min-width: 0;
    min-height: 34px;
    padding: 5px 6px;
  }

  .stat span {
    font-size: clamp(0.54rem, 2.6vw, 0.68rem);
  }

  .stat strong {
    font-size: clamp(0.78rem, 4vw, 0.96rem);
  }

  .sound-button {
    width: clamp(42px, 11vw, 52px);
    height: clamp(42px, 11vw, 52px);
    font-size: clamp(0.64rem, 2.9vw, 0.78rem);
  }

  .stage-panel {
    width: 100%;
    height: auto;
    max-height: 100%;
    justify-self: center;
    align-self: center;
    min-height: 0;
    aspect-ratio: 9 / 16;
  }

  .settings-modal {
    padding: 10px;
  }

  .settings-panel {
    max-height: calc(100% - 18px);
  }

  .guide-list {
    gap: 7px;
    padding: 9px;
  }

  .guide-item {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .guide-icon {
    width: 36px;
    height: 36px;
    font-size: 0.56rem;
  }

  .guide-item h3 {
    font-size: 0.74rem;
  }

  .guide-item p {
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .key-setting-row {
    grid-template-columns: minmax(78px, 0.65fr) minmax(0, 1.6fr);
    align-items: center;
    gap: 7px;
    min-height: 82px;
    padding: 7px 9px;
  }

  .key-setting-bindings {
    gap: 5px;
  }

  .binding-group {
    justify-content: flex-start;
    gap: 5px;
    flex-wrap: nowrap;
  }

  .binding-group-label {
    width: 24px;
    flex-basis: 24px;
    text-align: left;
  }

  .key-bind-button,
  .gamepad-bind-button {
    min-width: 44px;
    max-width: 70px;
    height: 32px;
    padding: 0 6px;
    font-size: 0.62rem;
  }

  .key-choice-panel {
    padding: 8px 9px 10px;
  }

  .key-choice-button {
    min-width: 48px;
    height: 30px;
    font-size: 0.6rem;
  }

  .statusbar {
    top: 8px;
    left: 8px;
    right: 8px;
    align-items: flex-start;
  }

  .statusbar > span {
    display: none;
  }

  .status-icons {
    max-width: 58%;
    flex-wrap: wrap;
  }

  .status-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .status-icon-label {
    font-size: 0.54rem;
  }

  .status-icon-value {
    font-size: 0.5rem;
  }

  .overlay-panel {
    padding: 18px 14px;
  }

  .key-row {
    display: none;
  }

  .touch-toggle {
    display: block;
    bottom: 218px;
  }

  .stage-panel.are-touch-controls-hidden .touch-toggle {
    bottom: 54px;
  }

  .touch-controls {
    display: grid;
  }

  .touch-controls.is-hidden {
    display: none;
  }

  .touch-button {
    width: 48px;
    height: 48px;
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .stat {
    padding-inline: 7px;
  }

  .stat strong {
    font-size: 0.94rem;
  }

  .touch-controls {
    left: 12px;
    right: 12px;
    gap: 7px 10px;
    grid-template-columns: 104px 118px;
    grid-template-rows: auto 22px;
  }

  .touch-toggle {
    bottom: 204px;
  }

  .virtual-joystick {
    width: 104px;
    height: 104px;
  }

  .joystick-stick {
    width: 40px;
    height: 40px;
  }

  .touch-actions {
    width: 118px;
    height: 118px;
  }

  .touch-button {
    width: 44px;
    height: 44px;
    font-size: 0.84rem;
  }

  .touch-button.charge,
  .touch-button.bomb {
    left: 37px;
  }

  .touch-button.boost,
  .touch-button.orbit {
    top: 37px;
  }
}
