:root {
  --bg-0: #03070d;
  --bg-1: #09131f;
  --bg-2: #132232;
  --bg-3: #1b3145;
  --ink: #edf7ff;
  --muted: #9fb8c9;
  --line: rgba(120, 181, 210, 0.24);
  --line-strong: rgba(180, 220, 245, 0.34);
  --panel: rgba(6, 14, 24, 0.86);
  --panel-strong: rgba(8, 18, 30, 0.94);
  --cyan: #7be7ff;
  --teal: #3fbac5;
  --gold: #ffcc62;
  --amber: #f29c38;
  --coral: #ff7455;
  --lime: #b7ff90;
  --danger: #ff5b7c;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
  --space-bg-image: url("../assets/site/space-background.png");
}

* {
  box-sizing: border-box;
  letter-spacing: 0 !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Trebuchet MS", "Yu Gothic UI", sans-serif;
  background-color: var(--bg-0);
  background-image:
    linear-gradient(180deg, rgba(1, 6, 13, 0.2), rgba(1, 6, 13, 0.72)),
    radial-gradient(circle at 50% 42%, rgba(7, 13, 22, 0.1) 0%, rgba(7, 13, 22, 0.5) 58%, rgba(3, 7, 13, 0.82) 100%),
    var(--space-bg-image),
    linear-gradient(135deg, #11181e 0%, #081019 48%, #04070d 100%);
  background-position: center top, center, center, center;
  background-repeat: no-repeat;
  background-size: cover;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(160, 214, 242, 0.06) calc(100% - 1px)),
    linear-gradient(180deg, transparent 0, transparent calc(100% - 1px), rgba(160, 214, 242, 0.04) calc(100% - 1px));
  background-size: 96px 96px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.68rem 0.92rem;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.04em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(123, 231, 255, 0.14), rgba(242, 156, 56, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
    linear-gradient(135deg, rgba(123, 231, 255, 0.24), rgba(242, 156, 56, 0.22));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.2);
}

button,
.touch-button {
  touch-action: manipulation;
}

.page-shell {
  width: min(1540px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 8px 0 32px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 6px 2px 10px;
  border-bottom: 1px solid rgba(174, 218, 242, 0.14);
}

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

.brand-mark {
  display: block;
  width: min(160px, 32vw);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

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

.brand-tagline-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.header-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
  color: rgba(224, 239, 248, 0.9);
  font-size: 0.82rem;
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1;
}

.icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: max-content;
  padding: 0.38rem 0.52rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eef9ff;
  background: rgba(5, 10, 18, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  font-size: 0.76rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.icon-button:hover::after,
.icon-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.stage-frame::after,
.panel::after {
  display: none;
}

.stage-frame::before,
.panel::before {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  justify-items: center;
  transition: grid-template-columns 220ms ease, gap 220ms ease;
}

.stage-frame,
.panel {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.014)),
    rgba(6, 12, 20, 0.94);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

.stage-frame {
  overflow: hidden;
  width: 100%;
  max-width: 840px;
  justify-self: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014)),
    rgba(7, 13, 22, 0.97);
}

.panel {
  padding: 12px 16px;
}

body[data-runtime-state]:not([data-runtime-state="title"]) .layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

#game-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  image-rendering: auto;
  cursor: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(9, 16, 31, 0.98), rgba(2, 4, 10, 1));
  filter: saturate(1.06) contrast(1.04);
}

.tagline-pause-button {
  display: none;
}

.tagline-pause-button:disabled {
  opacity: 0.48;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  color: #eef9ff;
  background:
    radial-gradient(circle at center, rgba(123, 231, 255, 0.1), transparent 38%),
    rgba(3, 7, 13, 0.82);
  text-align: center;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(237, 247, 255, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(123, 231, 255, 0.22);
  animation: loadingSpin 900ms linear infinite;
}

.loading-copy {
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff7da;
}

.touch-console {
  display: none;
  position: fixed;
  left: max(12px, calc(env(safe-area-inset-left) + 12px));
  right: auto;
  bottom: max(12px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 48;
  pointer-events: none;
}

body[data-mobile-loadout-position="left"] .touch-console {
  left: max(12px, calc(env(safe-area-inset-left) + 12px));
  right: auto;
}

body[data-mobile-loadout-position="right"] .touch-console {
  left: auto;
  right: max(12px, calc(env(safe-area-inset-right) + 12px));
}

.touch-cluster {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    rgba(8, 14, 24, 0.9);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.touch-label {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(223, 237, 248, 0.82);
}

.touch-weapon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: min(48vw, 240px);
}

.touch-button {
  min-height: 46px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.touch-button-weapon {
  min-width: 0;
  min-height: 52px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(123, 231, 255, 0.16), rgba(242, 156, 56, 0.18));
}

.touch-button-weapon[data-selected="true"] {
  border-color: rgba(255, 225, 154, 0.42);
  color: #fff9df;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(255, 204, 98, 0.38), rgba(255, 116, 85, 0.24));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 28px rgba(242, 156, 56, 0.16);
}

.touch-button:active {
  transform: translateY(1px) scale(0.985);
}

.control-deck {
  display: grid;
  gap: 16px;
}

.panel-pilot {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(6, 12, 20, 0.94);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
}

.pilot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pilot-grid div,
.pilot-secondary div {
  position: relative;
  overflow: hidden;
  padding: 14px 14px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.025);
}

.pilot-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent);
  opacity: 0.55;
}

.pilot-grid div::before,
.pilot-secondary div::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(123, 231, 255, 0.52), rgba(255, 204, 98, 0));
  opacity: 0.82;
}

.pilot-grid div:nth-child(2n)::before,
.pilot-secondary div:nth-child(2n)::before {
  background: linear-gradient(90deg, rgba(255, 204, 98, 0.52), rgba(123, 231, 255, 0));
}

.pilot-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.pilot-grid strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1.15;
  color: #fff9e8;
  text-wrap: balance;
}

.pilot-card-stage,
.pilot-card-main-score {
  min-height: 74px;
}

.pilot-card-stage strong {
  font-size: 1.55rem;
  color: #f8fcff;
  text-shadow: 0 0 16px rgba(123, 231, 255, 0.1);
}

.pilot-card-main-score strong,
.pilot-card-area-score dd {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.pilot-card-main-score strong {
  color: #fff4d7;
  text-shadow: 0 0 16px rgba(255, 204, 98, 0.12);
}

.pilot-card-weapon {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.028);
}

.pilot-card-weapon strong {
  font-size: 1.26rem;
  color: #fbfdff;
  line-height: 1.08;
}

.pilot-card-power {
  background:
    linear-gradient(90deg, rgba(123, 231, 255, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.028);
}

.pilot-card-power strong {
  color: #dffbff;
}

.pilot-card-rank dd {
  color: #fff1cb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pilot-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 0;
}

.pilot-secondary dt {
  margin: 0 0 8px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.pilot-secondary dd {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

body[data-runtime-state="active"] .panel-pilot,
body[data-runtime-state="player-explosion"] .panel-pilot,
body[data-runtime-state="continue"] .panel-pilot {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(6, 12, 20, 0.94);
}

.telemetry-panel summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -2px 0 14px;
  cursor: pointer;
  list-style: none;
}

.telemetry-panel summary::-webkit-details-marker {
  display: none;
}

.telemetry-panel summary span:first-child {
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
}

.telemetry-summary-copy {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.telemetry-panel[open] .telemetry-summary-copy {
  color: #dceef8;
}

.telemetry-note {
  margin-top: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  margin: 0;
}

.stat-grid div {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-grid div::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(123, 231, 255, 0.44), rgba(255, 204, 98, 0));
  opacity: 0.75;
}

.stat-grid div:nth-child(2n)::before {
  background: linear-gradient(90deg, rgba(255, 204, 98, 0.44), rgba(123, 231, 255, 0));
}

.stat-grid dt {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-grid dd {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink);
}

.panel-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  scrollbar-width: none;
}

.modal-dialog::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.modal-dialog::backdrop {
  background: rgba(0, 4, 10, 0.7);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
    rgba(6, 12, 20, 0.98);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.app-language-control,
.help-language-control {
  display: inline-grid;
  min-width: 126px;
}

.app-language-select,
.help-language-select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 2rem 0 0.75rem;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(7, 14, 24, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  outline: none;
}

.app-language-select:focus-visible,
.help-language-select:focus-visible {
  border-color: rgba(123, 231, 255, 0.56);
  box-shadow:
    0 0 0 3px rgba(123, 231, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.app-language-select option,
.help-language-select option {
  color: #0b1320;
  background: #f4f8ff;
}

.modal-close {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 1.2rem;
}

.modal-body {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  gap: 16px;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 18px 34px 18px 18px;
  scrollbar-color: transparent transparent;
  scrollbar-gutter: stable;
  scrollbar-width: none;
}

.modal-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: transparent;
}

.modal-scrollbar {
  position: absolute;
  top: 92px;
  right: 10px;
  bottom: 18px;
  z-index: 2;
  width: 12px;
  border-radius: 8px;
  border: 1px solid rgba(123, 231, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(123, 231, 255, 0.18), rgba(255, 204, 98, 0.12)),
    rgba(4, 9, 16, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 18px rgba(0, 0, 0, 0.28),
    0 0 16px rgba(123, 231, 255, 0.08);
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.modal-scrollbar[hidden] {
  display: none;
}

.modal-scrollbar span {
  position: absolute;
  inset: 1px 2px auto;
  min-height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #9ff2ff 0%, #62d6ec 44%, #ffd36e 100%);
  box-shadow:
    0 0 16px rgba(123, 231, 255, 0.36),
    0 0 18px rgba(255, 204, 98, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  cursor: grab;
  pointer-events: auto;
}

.modal-scrollbar[data-dragging="true"] span {
  cursor: grabbing;
}

.help-content section,
.setting-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.help-content h3,
.setting-copy h3 {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.help-content p,
.setting-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.settings-content {
  gap: 14px;
}

.setting-group {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.setting-copy {
  display: grid;
  gap: 4px;
}

.setting-language-control {
  min-width: 186px;
}

.setting-toggle {
  min-width: 104px;
}

.setting-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 8px;
  min-width: 168px;
}

.setting-option {
  min-width: 0;
  padding-inline: 0.78rem;
}

.setting-option[data-selected="true"] {
  border-color: rgba(255, 225, 154, 0.44);
  color: #fff9df;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(255, 204, 98, 0.36), rgba(123, 231, 255, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 26px rgba(255, 204, 98, 0.12);
}

.range-control {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.range-control output {
  color: #fff8de;
  font-variant-numeric: tabular-nums;
}

.volume-slider {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--cyan);
}

.jukebox-control {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.jukebox-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.jukebox-copy span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.jukebox-copy strong,
.jukebox-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jukebox-copy strong {
  font-size: 0.94rem;
}

.jukebox-copy small {
  color: var(--muted);
  font-size: 0.76rem;
}

.jukebox-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jukebox-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.jukebox-play-button {
  width: 44px;
  min-width: 44px;
}

.jukebox-play-button[data-playing="true"] {
  border-color: rgba(255, 225, 154, 0.44);
  color: #fff9df;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(255, 204, 98, 0.34), rgba(123, 231, 255, 0.18));
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

@keyframes gridDrift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-24px, 18px, 0);
  }
}

@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .app-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    padding-right: 0;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .brand-tagline-row {
    align-items: center;
    width: 100%;
    padding-right: 0;
  }

  .brand-mark {
    width: min(240px, 72vw);
  }

  .header-actions {
    position: absolute;
    top: 14px;
    right: 0;
    justify-content: flex-end;
  }

  .modal-dialog {
    width: min(100vw - 20px, 560px);
  }

  .setting-group {
    grid-template-columns: 1fr;
  }

  .setting-toggle {
    width: 100%;
  }

  .setting-language-control {
    width: 100%;
  }

  .setting-segmented {
    width: 100%;
  }

  .jukebox-control {
    grid-template-columns: 1fr;
  }

  .jukebox-buttons {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    width: 100%;
  }

  .jukebox-button,
  .jukebox-play-button {
    width: 100%;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100vw - 20px, 1280px);
    padding-top: 14px;
  }
}

@media (max-width: 980px), (pointer: coarse) {
  .page-shell {
    touch-action: none;
  }

  #game-canvas {
    touch-action: none;
  }

  .page-shell {
    padding-bottom: max(208px, calc(env(safe-area-inset-bottom) + 208px));
  }

  .touch-console {
    display: block;
  }

  .tagline-pause-button {
    display: inline-grid;
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  body::before,
  .stage-frame,
  .panel,
  .stage-frame::before,
  .panel::before {
    animation: none !important;
  }
}
