@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/space-mono-regular.ttf") format("truetype");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/space-mono-bold.ttf") format("truetype");
}

@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/vt323-regular.ttf") format("truetype");
}

.connection-status {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #66d991;
  font-family: var(--pixel);
  font-size: 16px;
}

.connection-status[data-offline="true"] {
  color: #ff6b74;
}

.connection-status[data-quality="medium"] {
  color: #ffd166;
}

.connection-status[data-quality="weak"] {
  color: #ff9a62;
}

.signal-bars {
  padding-bottom: 2px;
  display: flex;
  height: 16px;
  align-self: flex-end;
  align-items: flex-end;
  gap: 2px;
  image-rendering: pixelated;
}

.signal-bars i {
  width: 4px;
  background: repeating-linear-gradient(
    to top,
    currentColor 0 3px,
    transparent 3px 5px
  );
  box-shadow: 1px 0 #100e24;
}

.signal-bars i:nth-child(1) {
  height: 4px;
}

.signal-bars i:nth-child(2) {
  height: 8px;
}

.signal-bars i:nth-child(3) {
  height: 12px;
}

.signal-bars i:nth-child(4) {
  height: 16px;
}

.connection-status[data-quality="unknown"] .signal-bars i,
.connection-status[data-quality="offline"] .signal-bars i,
.connection-status[data-quality="weak"] .signal-bars i:nth-child(n + 2),
.connection-status[data-quality="medium"] .signal-bars i:nth-child(n + 3) {
  opacity: 0.25;
}

.connection-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 0;
  background: currentColor;
  box-shadow:
    inset 2px 2px #ffffff66,
    inset -2px -2px #00000055;
  animation: connection-blink 1.5s steps(2, end) infinite;
}

@keyframes connection-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .connection-dot {
    animation: none !important;
  }
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: #100e24;
  color: #b6ff62;
  pointer-events: none;
  animation: splash-dismiss 1s ease-out forwards;
}

.app-splash img {
  image-rendering: pixelated;
}

.app-splash strong {
  font-family: var(--pixel);
  font-size: 36px;
}

@keyframes splash-dismiss {
  0%,
  75% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@media (max-width: 999px) {
  #connection-label {
    display: none;
  }

  .signal-bars {
    padding-bottom: 3px !important;
  }
}

:root {
  --pixel-bomb: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2014%2014'%20shape-rendering='crispEdges'%3E%3Crect%20x='1'%20y='0'%20width='1'%20height='1'%20fill='%23b6ff62'/%3E%3Crect%20x='10'%20y='0'%20width='1'%20height='1'%20fill='%23ffe27a'/%3E%3Crect%20x='0'%20y='1'%20width='1'%20height='1'%20fill='%23b6ff62'/%3E%3Crect%20x='1'%20y='1'%20width='1'%20height='1'%20fill='%23b6ff62'/%3E%3Crect%20x='2'%20y='1'%20width='1'%20height='1'%20fill='%23b6ff62'/%3E%3Crect%20x='9'%20y='1'%20width='1'%20height='1'%20fill='%23ffe27a'/%3E%3Crect%20x='10'%20y='1'%20width='1'%20height='1'%20fill='%23ffffff'/%3E%3Crect%20x='11'%20y='1'%20width='1'%20height='1'%20fill='%23ffe27a'/%3E%3Crect%20x='1'%20y='2'%20width='1'%20height='1'%20fill='%23b6ff62'/%3E%3Crect%20x='10'%20y='2'%20width='1'%20height='1'%20fill='%23ffe27a'/%3E%3Crect%20x='1'%20y='3'%20width='1'%20height='1'%20fill='%23b6ff62'/%3E%3Crect%20x='9'%20y='3'%20width='1'%20height='1'%20fill='%23c9a26b'/%3E%3Crect%20x='7'%20y='4'%20width='1'%20height='1'%20fill='%23c9a26b'/%3E%3Crect%20x='8'%20y='4'%20width='1'%20height='1'%20fill='%23c9a26b'/%3E%3Crect%20x='4'%20y='5'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='5'%20y='5'%20width='1'%20height='1'%20fill='%238f87a8'/%3E%3Crect%20x='6'%20y='5'%20width='1'%20height='1'%20fill='%238f87a8'/%3E%3Crect%20x='7'%20y='5'%20width='1'%20height='1'%20fill='%238f87a8'/%3E%3Crect%20x='8'%20y='5'%20width='1'%20height='1'%20fill='%238f87a8'/%3E%3Crect%20x='9'%20y='5'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='3'%20y='6'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='4'%20y='6'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='5'%20y='6'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='6'%20y='6'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='7'%20y='6'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='8'%20y='6'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='9'%20y='6'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='10'%20y='6'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='2'%20y='7'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='3'%20y='7'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='4'%20y='7'%20width='1'%20height='1'%20fill='%238b6cc0'/%3E%3Crect%20x='5'%20y='7'%20width='1'%20height='1'%20fill='%238b6cc0'/%3E%3Crect%20x='6'%20y='7'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='7'%20y='7'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='8'%20y='7'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='9'%20y='7'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='10'%20y='7'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='11'%20y='7'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='1'%20y='8'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='2'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='3'%20y='8'%20width='1'%20height='1'%20fill='%238b6cc0'/%3E%3Crect%20x='4'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='5'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='6'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='7'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='8'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='9'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='10'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='11'%20y='8'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='12'%20y='8'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='1'%20y='9'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='2'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='3'%20y='9'%20width='1'%20height='1'%20fill='%238b6cc0'/%3E%3Crect%20x='4'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='5'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='6'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='7'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='8'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='9'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='10'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='11'%20y='9'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='12'%20y='9'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='1'%20y='10'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='2'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='3'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='4'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='5'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='6'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='7'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='8'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='9'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='10'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='11'%20y='10'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='12'%20y='10'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='1'%20y='11'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='2'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='3'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='4'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='5'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='6'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='7'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='8'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='9'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='10'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='11'%20y='11'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='12'%20y='11'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='2'%20y='12'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='3'%20y='12'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='4'%20y='12'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='5'%20y='12'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='6'%20y='12'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='7'%20y='12'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='8'%20y='12'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='9'%20y='12'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='10'%20y='12'%20width='1'%20height='1'%20fill='%232b1c3a'/%3E%3Crect%20x='11'%20y='12'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='3'%20y='13'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='4'%20y='13'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='5'%20y='13'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='6'%20y='13'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='7'%20y='13'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='8'%20y='13'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='9'%20y='13'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3Crect%20x='10'%20y='13'%20width='1'%20height='1'%20fill='%230f0a18'/%3E%3C/svg%3E");
  color-scheme: dark;
  font-family: "Space Mono", monospace;
  background: #100e24;
  color: #edeafc;
  --mint: #b6ff62;
  --muted: #89839f;
  --pixel: "VT323", "Courier New", monospace;
  --retro-cursor: url("/assets/cursor.svg") 3 1, auto;
}

.trophies h2,
.statistics h2 {
  margin: 0;
  font-size: 22px;
}

.badge-control {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
}

.badge-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge-choice {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 4px;
  border: 1px solid #49345e;
  background: #100e24;
  color: var(--muted);
  cursor: var(--retro-cursor);
}

.badge-choice:hover:not(:disabled),
.badge-choice[aria-pressed="true"] {
  border-color: var(--mint);
  box-shadow: 0 0 8px #b6ff6266;
  color: var(--mint);
}

.badge-choice:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.badge-choice:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pixel-badge {
  width: 18px;
  height: 20px;
  flex: 0 0 auto;
  image-rendering: pixelated;
  vertical-align: middle;
}

.pixel-badge .badge-rim {
  fill: #171326;
}

.badge-registered .badge-face {
  fill: #d3ddf2;
}

.badge-first-game .badge-face,
.badge-score-1000 .badge-face,
.badge-daily-first .badge-face {
  fill: #cf8b56;
}

.badge-games-10 .badge-face,
.badge-score-5000 .badge-face,
.badge-daily-streak-7 .badge-face {
  fill: #ffd34e;
}

.badge-score-10000 .badge-face,
.badge-daily-10 .badge-face,
.badge-daily-streak-30 .badge-face {
  fill: #b6ff62;
}

.pixel-badge .badge-mark {
  fill: #fff4bc;
}

.badge-score-100000 .badge-face {
  fill: #a76bff;
}

.badge-story-act-1 .badge-face,
.badge-story-act-2 .badge-face,
.badge-story-hits-1000 .badge-face {
  fill: #19c8e0;
}

.badge-story-flawless .badge-face,
.badge-story-powerless .badge-face,
.badge-story-combo-50 .badge-face {
  fill: #ff5d8a;
}

.badge-story-complete .badge-face {
  fill: #ffb000;
}

.badge-story-hard-act-2 .badge-face,
.badge-story-hard-complete .badge-face,
.badge-story-hard-perfect .badge-face {
  fill: #c4213f;
}

.badge-control .pixel-badge {
  width: 20px;
  height: 22px;
}

.badge-empty {
  display: grid;
  width: 20px;
  height: 22px;
  place-items: center;
  border: 1px dashed currentColor;
  font-family: var(--pixel);
  font-size: 22px;
  line-height: 1;
}

.trophy-notification {
  position: fixed;
  z-index: 20;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  display: grid;
  width: min(420px, calc(100vw - 24px));
  gap: 5px;
  padding: 20px 36px 14px;
  border: 2px solid var(--mint);
  background: #100e24f2;
  box-shadow: 0 0 24px #b6ff6280;
  text-align: center;
  transform: translateX(-50%);
}

.trophy-notification[hidden] {
  display: none;
}

.trophy-notification strong {
  color: var(--mint);
  font-size: 10px;
}

.trophy-notification > span {
  font-family: var(--pixel);
  font-size: 24px;
}

.trophy-notification small {
  color: var(--muted);
  font-size: 9px;
}

.trophy-notification-close {
  position: absolute;
  top: 4px;
  right: 6px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--mint);
  font-size: 24px;
  cursor: pointer;
}

.trophy-notification-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.trophy-notification.is-entering {
  animation: trophy-pop-in 260ms steps(5, end);
}

@keyframes trophy-pop-in {
  from {
    opacity: 0;
    transform: translate(-50%, -140%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .trophy-notification {
    animation: none;
  }
}

#trophy-list {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0 6px 0 0;
  margin: 10px 0 0;
}

#trophy-list.obscured,
#statistics-list.obscured {
  user-select: none;
}

#trophy-list.obscured .trophy small,
#statistics-list.obscured dd {
  filter: blur(4px);
}

.trophy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 9px;
}

.trophy > span:first-child {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.trophy.unlocked > span:first-child,
.trophy.unlocked strong {
  color: var(--mint);
}

.trophy.locked {
  opacity: 0.55;
}

.trophy > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trophy strong,
.trophy small {
  display: block;
}

.trophy small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

* {
  box-sizing: border-box;
  touch-action: manipulation;
  scrollbar-color: #675282 #100e24;
  scrollbar-width: thin;
}

body {
  cursor: var(--retro-cursor);
  margin: 0;
  background: radial-gradient(ellipse at 50% 35%, #24183a88, transparent 65%);
  min-height: 100dvh;
}

html,
body {
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* iOS auto-zooms on focus when form fields are smaller than 16px. */
@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

button {
  font: inherit;
  cursor: var(--retro-cursor);
}

button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 6px;
}

button:disabled {
  opacity: 0.35;
  cursor: var(--retro-cursor);
}

[hidden] {
  display: none !important;
}

.maintenance-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.maintenance-card {
  width: min(100%, 640px);
  padding: clamp(20px, 5vw, 48px);
  text-align: center;
  border: 3px solid var(--mint);
  box-shadow: 8px 8px #0005;
}

.maintenance-icon {
  display: block;
  width: 64px;
  height: 64px;
  margin: 24px auto;
  color: var(--mint);
}

.maintenance-card h1 {
  font-size: clamp(32px, 7vw, 56px);
  line-height: 1;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
}

.maintenance-card p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.8;
}

.maintenance-card .primary-button {
  max-width: 100%;
  margin-top: 16px;
}

:root[data-theme="light"] .maintenance-card {
  --maintenance-bg: #f8f7fc;
}

.arcade {
  width: min(1500px, calc(100% - 40px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  min-height: 100dvh;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-title {
  text-align: center;
  padding: 16px 0;
  position: relative;
}

.settings {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: left;
  z-index: 10;
}

.settings summary {
  list-style: none;
  cursor: var(--retro-cursor);
  color: var(--mint);
  font-size: 8px;
  padding-inline: 3px;
  padding: 10px;
  border: 1px solid currentColor;
}

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

.settings summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(290px, calc(100vw - 28px));
  box-shadow: 4px 4px #0005;
}

.settings-panel label:not(.setting-toggle) {
  display: block;
  font-size: 11px;
  margin: 0 0 5px;
}

.settings-panel select {
  width: 100%;
  background: #100e24;
  color: #edeafc;
  border: 1px solid #6f5486;
  font: inherit;
  font-size: 12px;
  padding: 8px;
  margin-bottom: 14px;
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  cursor: var(--retro-cursor);
}

.setting-toggle input {
  accent-color: var(--mint);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.settings-panel :is(input, select):focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.settings-version {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #ffffff18;
  margin: 14px 0 0;
  padding-top: 10px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
}

.settings-version strong {
  color: var(--mint);
  font: inherit;
}

.eyebrow {
  color: var(--mint);
  font-size: 9px;
  letter-spacing: 2px;
  margin: 0 0 13px;
}

h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--pixel);
  font-size: 66px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 4px;
  margin: 0;
  text-shadow: 4px 4px #5a376a;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-self: center;
  image-rendering: pixelated;
  transform: translateY(2px);
}

.brand-name {
  display: block;
  color: inherit;
  line-height: 1;
}

.brand-name > span {
  color: var(--mint);
  text-shadow: 4px 4px #3e5933;
}

.brand-name sup {
  font:
    12px "Space Mono",
    monospace;
  vertical-align: top;
  display: inline-block;
  margin: 10px 0 0 5px;
  color: var(--muted);
  text-shadow: none;
}

.env-label {
  color: var(--mint);
  font:
    12px "Space Mono",
    monospace;
  letter-spacing: 0;
  text-shadow: none;
}

.workspace {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(210px, 0.85fr) minmax(350px, 2fr) minmax(
      265px,
      1fr
    );
  gap: 16px;
  flex: 1 0 auto;
  min-height: auto;
}

.workspace > * {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-area {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-width: 0;
}

.profile-area > [role="tabpanel"] {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.profile-area > .account[hidden] {
  display: block !important;
  visibility: hidden;
}

.profile-area > .trophies,
.profile-area > .statistics {
  contain: size;
  overscroll-behavior: contain;
}

.profile-area > .profile-tabs {
  grid-row: 1;
}

.statistics-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.statistics-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
}

.statistics-list dt {
  color: var(--muted);
  font-size: 9px;
}

.statistics-list dd {
  margin: 0;
  font-family: var(--pixel);
  font-size: 18px;
  white-space: nowrap;
}

.panel {
  background: #191428;
  border: 1px solid #49345e;
  padding: 14px;
}

.cabinet {
  display: flex;
  flex-direction: column;
  border: 1px solid #554365;
  padding: 7px;
  background: #211a33;
  box-shadow:
    0 7px 0 #090915,
    0 0 0 4px #151123,
    0 20px 70px #0003;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #171326;
  border: 1px solid #382d4c;
  padding: 12px 10px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  padding-left: 10px;
  border-left: 1px solid #ffffff0d;
}

.stat:first-child {
  padding-left: 0;
  border: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.5px;
}

.stat strong {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 1px;
}

#score {
  color: var(--mint);
}

#lives {
  display: flex;
  gap: 3px;
  color: #ff6e96;
  font-size: 22px;
  padding-top: 3px;
}

#lives .lost {
  color: #443047;
}

.arena {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  flex: 1;
  min-height: 260px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: #121222;
  background-image:
    linear-gradient(#aca0f008 1px, transparent 1px),
    linear-gradient(90deg, #aca0f008 1px, transparent 1px),
    radial-gradient(ellipse at center, #2a1e3d66, transparent 75%);
  background-size:
    32px 32px,
    32px 32px,
    100% 100%;
  margin-top: 7px;
  border: 1px solid #392e4e;
}

.arena::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  background: repeating-linear-gradient(transparent 0 3px, #00000013 3px 4px);
}

.arena-label {
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #726782;
  pointer-events: none;
}

.arena-corner {
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: #7a638d;
  border-style: solid;
  opacity: 0.6;
  pointer-events: none;
}

.top-left {
  top: 8px;
  left: 8px;
  border-width: 2px 0 0 2px;
}

.top-right {
  top: 8px;
  right: 8px;
  border-width: 2px 2px 0 0;
}

.bottom-left {
  bottom: 8px;
  left: 8px;
  border-width: 0 0 2px 2px;
}

.bottom-right {
  bottom: 8px;
  right: 8px;
  border-width: 0 2px 2px 0;
}

.targets {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.targets.fixed-viewport {
  outline: 2px solid var(--mint);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px #b6ff6280;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: #121222a8;
  padding: 16px;
}

.start-card {
  text-align: center;
}

.demo-target.target {
  position: relative;
  display: grid;
  width: 60px;
  height: 60px;
  padding: 4px;
  margin: 0 auto 22px;
  place-items: center;
}

.demo-target .target-face {
  width: 52px;
  height: 52px;
}

h2 {
  font: 34px var(--pixel);
  letter-spacing: 1px;
  margin: 0 0 12px;
}

#overlay-description {
  font-size: 10px;
  line-height: 1.9;
  color: #a39bb5;
  margin: 0 0 23px;
}

.primary-button {
  background: var(--mint);
  color: #20232a;
  border: 0;
  padding: 14px 28px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow:
    0 4px #557936,
    4px 0 #557936,
    -4px 0 #557936;
  transition: background 0.15s;
}

.primary-button:hover {
  background: #d3ff9f;
}

.primary-button:active {
  transform: translateY(3px);
  box-shadow:
    4px 0 #557936,
    -4px 0 #557936;
}

.primary-button span {
  margin-right: 10px;
}

.start-hint {
  display: block;
  color: #777087;
  font-size: 8px;
  letter-spacing: 1px;
  margin-top: 20px;
}

.combo-status {
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 5;
  margin: 0;
  padding: 4px;
  background: #121222e6;
  text-align: right;
  color: #b6ff62;
  font-size: 10px;
  line-height: 1.5;
  pointer-events: none;
}

.cabinet[data-mode="duel"] .combo-status {
  display: none;
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 6px;
  min-height: 41px;
}

.speed {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
}

.speed-icon {
  font-size: 20px;
  color: var(--mint);
}

.speed strong {
  color: var(--mint);
  font-weight: 400;
}

.speed-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 13px;
  margin-left: 3px;
}

.speed-bars i {
  width: 4px;
  background: #463854;
  height: 5px;
}

.speed-bars i:nth-child(2) {
  height: 7px;
}

.speed-bars i:nth-child(3) {
  height: 9px;
}

.speed-bars i:nth-child(4) {
  height: 11px;
}

.speed-bars i:nth-child(5) {
  height: 13px;
}

.speed-bars i.active {
  background: var(--mint);
}

.powerup-status {
  color: var(--mint);
  font-size: 9px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.text-button {
  background: none;
  border: 1px solid #b5aac8;
  color: #b5aac8;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 5px;
}

.instructions {
  display: grid;
  gap: 12px;
  flex: 1;
  align-content: center;
}

.mode-tabs.rules-tabs {
  display: none;
}

.instructions > .rules-content {
  display: contents;
}

.story-rules {
  display: grid;
  gap: 12px;
}

.story-rule {
  display: flex;
  align-items: center;
  gap: 12px;
}

.story-boss-icon,
.story-energy-icon,
.story-power-icon {
  font: 24px var(--pixel);
  color: #19f0ff;
}

.story-boss-icon {
  border: 2px solid #7a638d;
  color: #ff5d8a;
}

.story-energy-icon {
  border: 2px solid #19f0ff;
}

.instructions h2,
.account h2 {
  font-size: 25px;
  margin: 0 0 6px;
}

.rules-content > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.advanced-rules {
  border: 1px solid var(--muted);
}

.advanced-rules summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  list-style: none;
  color: var(--mint);
  cursor: var(--retro-cursor);
  font-size: 9px;
  letter-spacing: 0.8px;
  line-height: 1.5;
}

.advanced-rules summary::-webkit-details-marker {
  display: none;
}

.advanced-rules summary::before {
  content: "+";
  font-size: 16px;
  line-height: 1;
}

.advanced-rules[open] summary::before {
  content: "−";
}

.advanced-rules summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: -3px;
}

.instructions .advanced-rules p {
  padding: 0 12px 12px;
}

.instructions .advanced-rules strong {
  font-weight: 700;
}

.instructions .advanced-rules p span {
  white-space: pre-line;
}

.rule-target {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
}

.target.target-preview {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 2px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.target.target-preview .target-face {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.target.target-preview .target-face::before {
  width: 24px;
  height: 24px;
  border-width: 3px;
  font-size: 28px;
}

.target.target-preview.armored .target-face {
  font-size: 28px;
}

.target.target-preview.armored .target-hit-count {
  position: relative;
  z-index: 1;
}

.target:not(.target-preview):hover .target-face {
  background: #ffc185;
  border-color: #ffe3b2;
}

.instructions p {
  margin: 0;
}

.instructions strong {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.8px;
  display: block;
  margin-bottom: 7px;
}

.instructions p span {
  font-size: 9px;
  line-height: 1.5;
  display: block;
  color: var(--muted);
}

.instructions .panel-note {
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
}

.instructions .panel-note span {
  font: inherit;
}

.page-footer {
  border-top: 1px solid #ffffff12;
  padding: 10px 0;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 16px;
}

.page-footer > span:first-child {
  text-align: left;
}

.page-footer > span:nth-child(2) {
  text-align: right;
}

.data-disclaimer {
  grid-column: 1 / -1;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.coin {
  color: #e8ba74;
  margin-left: 5px;
}

.target {
  position: absolute;
  width: 60px;
  height: 68px;
  padding: 4px 4px 12px;
  border: 0;
  color: #291a35;
  background: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.target-face {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: #ff719d;
  border: 4px solid #ffa5c0;
  box-shadow:
    4px 0 #6e345a,
    -4px 0 #6e345a,
    0 4px #6e345a,
    0 -4px #6e345a,
    0 0 22px #ff719d30;
}

.target-face::before {
  content: "+";
  border: 4px solid #45213e;
  width: 28px;
  height: 28px;
  font: 36px var(--pixel);
  display: grid;
  place-items: center;
  line-height: 0.5;
}

.target-timer {
  position: absolute;
  bottom: 0;
  left: 4px;
  height: 4px;
  width: 52px;
  background: #b6ff62;
  transform-origin: left;
}

.target.urgent .target-face {
  border-color: #fff0bc;
}

.hit-burst {
  position: absolute;
  pointer-events: none;
  color: var(--mint);
  font: 27px var(--pixel);
  text-shadow: 2px 2px #121222;
  animation: score-pop 0.5s steps(8) forwards;
  z-index: 2;
}

.hit-multiplier {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  text-align: center;
  color: #ffd76a;
  font-size: 22px;
  text-shadow:
    2px 2px #121222,
    0 0 8px #ffc24780;
}

.target-destruction {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 2;
  animation: destruction-end 360ms steps(6) forwards;
}

.target-destruction i {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--fragment-color);
  box-shadow:
    inset -3px -3px #0005,
    inset 3px 3px #fff5;
  animation: pixel-shatter 360ms steps(6) forwards;
}

.target-destruction.explosion i {
  box-shadow: 0 0 8px #ffad52;
}

.target-hit .target-face {
  animation: block-impact 160ms steps(3);
}

.target.armored .target-face {
  position: relative;
}

.target.armored .target-face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  pointer-events: none;
  opacity: 0;
  clip-path: polygon(
    28% 0,
    38% 0,
    50% 30%,
    37% 48%,
    57% 70%,
    48% 100%,
    38% 100%,
    46% 73%,
    26% 48%,
    39% 28%
  );
}

.target.armored[data-damage="1"] .target-face::after,
.target.armored[data-damage="2"] .target-face::after {
  opacity: 0.85;
}

.target.armored[data-damage="2"] .target-face::after {
  clip-path: polygon(
    20% 0,
    34% 0,
    48% 24%,
    65% 15%,
    100% 28%,
    100% 40%,
    66% 28%,
    53% 37%,
    42% 52%,
    64% 75%,
    53% 100%,
    39% 100%,
    50% 78%,
    28% 55%,
    0 68%,
    0 55%,
    29% 42%,
    36% 27%
  );
}

.target-hit-count {
  position: relative;
  z-index: 1;
  text-shadow: 1px 1px #fff9;
}

@keyframes pixel-shatter {
  to {
    transform: translate(var(--dx), var(--dy)) rotate(45deg) scale(0.25);
    opacity: 0;
  }
}

@keyframes destruction-end {
  to {
    opacity: 0;
  }
}

@keyframes block-impact {
  25% {
    transform: translateX(-3px);
    filter: brightness(1.5);
  }
  75% {
    transform: translateX(3px);
  }
}

@keyframes duel-opponent-hit {
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

.cabinet.duel-opponent-hit {
  animation: duel-opponent-hit 240ms steps(4);
}

@media (prefers-reduced-motion: reduce) {
  .target-destruction,
  .target-destruction i,
  .target-hit .target-face,
  .hit-burst {
    animation-duration: 1ms;
  }
}

.feedback {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.feedback[data-time-effect="slow"] {
  animation: slow-glow 2.4s ease-in-out infinite alternate;
}

.feedback[data-time-effect="speed"] {
  animation: speed-glow 0.65s ease-in-out infinite alternate;
}

.feedback[data-shield="true"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/powerup-shield.svg") center / min(70%, 320px) auto
    no-repeat;
  opacity: 0.14;
}

.feedback.miss::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80%, 340px);
  aspect-ratio: 1;
  background:
    linear-gradient(#fff5bc, #fff5bc) center / 26% 26% no-repeat,
    linear-gradient(#ffd46a, #ffd46a) center / 52% 52% no-repeat,
    #ff6645;
  clip-path: polygon(
    40% 0,
    60% 0,
    60% 20%,
    70% 20%,
    70% 10%,
    80% 10%,
    80% 30%,
    90% 30%,
    90% 40%,
    100% 40%,
    100% 60%,
    80% 60%,
    80% 70%,
    90% 70%,
    90% 80%,
    70% 80%,
    70% 90%,
    60% 90%,
    60% 100%,
    40% 100%,
    40% 80%,
    30% 80%,
    30% 90%,
    20% 90%,
    20% 70%,
    10% 70%,
    10% 60%,
    0 60%,
    0 40%,
    20% 40%,
    20% 30%,
    10% 30%,
    10% 20%,
    30% 20%,
    30% 10%,
    40% 10%
  );
  animation: damage 0.45s steps(6) forwards;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.target.bomb .target-face {
  background: #fa674e;
  border-color: #ffb08b;
}

.target.bomb .target-face::before {
  content: "X";
  border-color: #59212a;
}

.target.bonus {
  z-index: 1;
}

.target.bonus .target-face {
  background: #ffda66;
  border-color: #fff3ac;
  box-shadow:
    4px 0 #896229,
    -4px 0 #896229,
    0 4px #896229,
    0 -4px #896229,
    0 0 24px #ffda6650;
}

.target.bonus .target-face::before {
  content: "$";
  border-color: #775220;
}

.hit-burst.penalty {
  color: #ff806b;
}

.target.armored .target-face {
  background: #75c9e8;
  border-color: #c5efff;
  color: #17364b;
  font: 36px var(--pixel);
  box-shadow:
    4px 0 #315575,
    -4px 0 #315575,
    0 4px #315575,
    0 -4px #315575;
}

.target.armored .target-face::before {
  content: none;
}

.target:is(.slow, .speed, .shield, .core) .target-face {
  width: 52px;
  height: 52px;
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 0 4px #0008);
}

.target:is(.slow, .speed, .shield, .core) .target-face::before {
  content: "";
  width: 100%;
  height: 100%;
  border: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.target.slow .target-face::before {
  background-image: url("/assets/powerup-slow.svg");
}

.target.speed .target-face::before {
  background-image: url("/assets/powerup-turbo.svg");
}

.target.shield .target-face::before {
  background-image: url("/assets/powerup-shield.svg");
}

.target.target-preview:is(.slow, .speed, .shield) .target-face {
  width: 40px;
  height: 40px;
}

.target:not(.target-preview):is(.slow, .speed, .shield):hover .target-face {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

[data-colorblind="true"] .target.armored .target-face {
  background: #c6b0ff;
  border-color: #ece1ff;
  color: #291a35;
}

.score-form {
  margin: -8px auto 18px;
  max-width: 310px;
}

#score-owner {
  color: var(--mint);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.score-form .text-button {
  color: var(--mint);
  border: 1px solid #6f5486;
}

#save-status {
  font-size: 9px;
  color: #dfb4ff;
  margin: 8px 0 0;
}

.overlay.game-over .demo-target,
.overlay.game-over .start-hint {
  display: none;
}

.leaderboard-heading {
  order: -1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.leaderboard-heading > div {
  min-width: 0;
}

.leaderboard-heading .eyebrow {
  overflow-wrap: anywhere;
}

.leaderboard-heading h2 {
  margin: 0;
  font-size: 28px;
}

.daily-streak {
  display: grid;
  gap: 5px;
  width: fit-content;
  margin: 16px auto;
  padding: 12px 20px;
  border: 2px solid var(--mint);
  box-shadow: 4px 4px 0 #090915;
  color: var(--mint);
  font-size: 8px;
  letter-spacing: 1px;
}

.daily-streak strong {
  font: 48px/1 var(--pixel);
  text-shadow: 3px 3px #3e5933;
}

.leaderboard {
  position: relative;
}

.leaderboard-content {
  display: contents;
}

.leaderboard-personal {
  flex: 0 0 auto;
  min-width: 0;
  container-type: inline-size;
}

.leaderboard-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.pixel-spinner,
.loading-indicator::after {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 6px solid var(--mint);
  border-right-color: transparent;
  border-bottom-color: transparent;
  animation: pixel-spin 800ms steps(4) infinite;
}

.loading-indicator::after {
  content: "";
  vertical-align: middle;
}

#start.loading-indicator {
  min-width: 200px;
  opacity: 1;
}

#start.loading-indicator::after {
  width: 16px;
  height: 16px;
  border-width: 3px;
  border-top-color: #20232a;
  border-left-color: #20232a;
}

.statistics,
.trophies {
  position: relative;
}

#statistics-status.loading-indicator,
#trophies-status.loading-indicator {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  pointer-events: none;
}

.statistics:has(.loading-indicator:not([hidden])) .statistics-list,
.trophies:has(.loading-indicator:not([hidden])) #trophy-list {
  visibility: hidden;
}

@keyframes pixel-spin {
  to {
    transform: rotate(360deg);
  }
}

.leaderboard[aria-busy="true"] .table-scroll {
  visibility: hidden;
}

.leaderboard table {
  font-variant-numeric: tabular-nums;
}

#leaderboard-status {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
}

#leaderboard-status.error {
  color: #ff806b;
}

.table-scroll {
  min-width: 0;
  container-type: inline-size;
}

.leaderboard table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
}

.leaderboard th {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.3px;
  padding: 8px 3px;
  border-bottom: 1px solid #49345e;
}

.leaderboard th:first-child,
.leaderboard .personal-entry td:first-child {
  width: 12%;
}

.leaderboard th:nth-child(2),
.leaderboard .personal-entry td:nth-child(2) {
  width: 36%;
}

.leaderboard th:nth-child(3),
.leaderboard .personal-entry td:nth-child(3) {
  width: 26%;
}

.leaderboard th:nth-child(4),
.leaderboard .personal-entry td:nth-child(4) {
  width: 16%;
}

.leaderboard th:last-child,
.leaderboard .personal-entry td:last-child {
  width: 10%;
  text-align: center;
}

.device-cell {
  text-align: center;
}

.device-icon {
  width: 16px;
  height: 16px;
  fill: var(--muted);
  vertical-align: middle;
}

.leaderboard td {
  padding: 7px 3px;
  font-size: 10px;
  border-bottom: 1px solid #ffffff0a;
}

.leaderboard th,
.leaderboard td {
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard td:first-child {
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: clamp(8px, 3cqw, 10px);
}

.leaderboard td:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard td:nth-child(3) {
  color: var(--mint);
  font-family: var(--pixel);
  font-size: 18px;
}

.leaderboard tr:first-child td:first-child {
  color: #ffda66;
}

.leaderboard .personal-entry-label td {
  padding-top: 14px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.5px;
  border-bottom: 0;
}

.leaderboard .personal-entry td {
  background: #b6ff6212;
  border-top: 1px solid var(--mint);
  border-bottom: 1px solid var(--mint);
}

.ranked-player {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.ranked-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.medal {
  width: 1em;
  height: 1.25em;
  flex-shrink: 0;
  --medal-edge: #916018;
  --medal-center: #ffd45b;
}

.medal-2 {
  --medal-edge: #667182;
  --medal-center: #d7e1ef;
}

.medal-3 {
  --medal-edge: #79472b;
  --medal-center: #db995b;
}

.medal-ribbon {
  fill: #b94869;
}

.medal-edge {
  fill: var(--medal-edge);
}

.medal-center {
  fill: var(--medal-center);
}

.medal-shine {
  fill: #fff3d4;
}

.leaderboard .podium-1 td {
  font-size: 14px;
  padding-block: 12px;
}

.leaderboard .podium-2 td {
  font-size: 12px;
  padding-block: 10px;
}

.leaderboard .podium-3 td {
  font-size: 11px;
  padding-block: 8px;
}

.leaderboard .podium-1 td:nth-child(3) {
  font-size: clamp(18px, 8cqw, 28px);
}

.leaderboard .podium-2 td:nth-child(3) {
  font-size: clamp(17px, 7cqw, 24px);
}

.leaderboard .podium-3 td:nth-child(3) {
  font-size: clamp(16px, 6cqw, 21px);
}

.leaderboard td:last-child,
.leaderboard .podium td:last-child {
  font-size: clamp(8px, 3cqw, 10px);
}

.account .eyebrow {
  margin-bottom: 6px;
}

#identity-name {
  color: var(--mint);
  font-size: 12px;
  overflow-wrap: anywhere;
  display: block;
}

.panel-note {
  font-size: 9px;
  line-height: 1.3;
  color: #a49db7;
  margin: 8px 0;
}

#auth-status:empty {
  display: none;
}

#auth-controls {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.account label {
  display: block;
  font-size: 9px;
  color: #c1b6d2;
  margin: 7px 0 4px;
}

.account input {
  width: 100%;
  min-width: 0;
  background: #100e24;
  border: 1px solid #6f5486;
  color: #fff;
  padding: 7px;
  font:
    11px "Space Mono",
    monospace;
}

.account input:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 1px;
}

.account .primary-button {
  width: 100%;
  padding: 9px 5px;
  margin-top: 12px;
  font-size: 9px;
}

#logout {
  margin-top: 8px;
  color: #dfb4ff;
}

#home,
#boss-home,
#pause-home {
  display: block;
  margin: 16px auto 0;
}

.mobile-tabs {
  display: none;
}

.guest-form {
  max-width: 290px;
  margin: auto;
}

.guest-form label {
  display: block;
  color: var(--mint);
  font-size: 10px;
  margin-bottom: 8px;
}

.guest-form input {
  width: 100%;
  padding: 9px;
  border: 1px solid #6f5486;
  background: #100e24;
  color: white;
  font:
    12px "Space Mono",
    monospace;
}

.guest-form input:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.guest-form p {
  font-size: 9px;
  color: #b5aac8;
  line-height: 1.5;
}

.guest-form .primary-button {
  font-size: 9px;
  padding: 12px;
}

.overlay.naming .demo-target,
.overlay.naming .start-hint,
.overlay.naming #overlay-description {
  display: none;
}

.duel-entry {
  margin-top: 10px;
  text-align: center;
  flex-shrink: 0;
}

.mode-tabs,
.leaderboard-tabs,
.auth-tabs {
  display: flex;
}

:is(.mode-tabs, .leaderboard-tabs, .auth-tabs, .mobile-tabs) {
  gap: 6px;
  margin: 0 0 7px;
  flex-shrink: 0;
}

:is(.mode-tabs, .leaderboard-tabs, .auth-tabs, .mobile-tabs) button {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 10px 6px;
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  line-height: 12px;
}

:is(.mode-tabs, .leaderboard-tabs, .auth-tabs, .mobile-tabs)
  button:is([aria-selected="true"], [aria-pressed="true"]) {
  color: var(--mint);
  border-color: var(--mint);
  box-shadow: inset 0 -2px var(--mint);
}

:is(.mode-tabs, .leaderboard-tabs, .auth-tabs, .mobile-tabs)
  button:not(:disabled):hover {
  color: var(--mint);
  border-color: var(--mint);
}

.mode-tabs button[data-daily-state="available"] {
  border-width: 2px;
  animation: daily-ready-border 1.8s ease-in-out infinite;
}

.mode-tabs button[data-daily-state="unavailable"] {
  opacity: 0.65;
}

@keyframes daily-ready-border {
  0%,
  100% {
    border-color: #8a9b70;
    box-shadow:
      0 0 0 1px #b6ff6240,
      0 0 7px 1px #b6ff6233;
  }
  50% {
    border-color: var(--mint);
    box-shadow:
      0 0 0 3px #b6ff6280,
      0 0 20px 4px #b6ff62aa;
  }
}

.cabinet[data-mode="duel"] > .dashboard,
.cabinet[data-mode="duel"] > .game-toolbar {
  display: none;
}

.cabinet[data-mode="story"] > .dashboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cabinet[data-mode="story"] .stat:has(#score),
.cabinet[data-mode="story"] .game-toolbar > .speed {
  display: none;
}

.cabinet[data-mode="story"] .stat:has(#time) {
  padding-left: 0;
  border: 0;
}

.cabinet[data-mode="story"] #pause {
  margin-left: auto;
}

#mode-rules {
  margin: 0 0 12px;
}

.duel-entry .primary-button {
  max-width: 100%;
  font-size: 10px;
}

.duel-entry .panel-note {
  max-width: 360px;
  margin: 8px auto;
  font-size: 9px;
}

.duel-active .dashboard,
.duel-active .game-toolbar,
.duel-active .arena-label {
  display: none;
}

.duel-match {
  margin-bottom: 8px;
  flex-shrink: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px;
}

.workspace:has(.duel-active) {
  flex: 1 0 auto;
  min-height: auto;
}

.duel-scores {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(65px, 0.6fr) minmax(0, 1fr);
  gap: 8px;
  text-align: center;
}

.duel-scores span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.duel-scores > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.duel-scores strong {
  display: block;
  font: 30px var(--pixel);
  color: var(--mint);
  overflow-wrap: anywhere;
  line-height: 1.1;
}

#duel-invitation {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

#duel-status:empty {
  display: none;
}

#duel-overlay {
  overflow: auto;
}

#duel-overlay .start-card {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

#duel-overlay .eyebrow {
  line-height: 1.6;
}

#duel-title {
  line-height: 1.15;
}

#duel-invitation label,
#duel-description {
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
}

#duel-link {
  width: 100%;
  margin-top: 0;
  padding: 8px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: copy;
  font:
    11px "Space Mono",
    monospace;
}

#duel-link:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.duel-active .arena {
  flex: 1 0 auto;
  width: 100%;
  height: auto;
  min-height: 320px;
  aspect-ratio: auto;
}

.duel-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  max-width: calc(100% - 32px);
  width: max-content;
  border-color: var(--mint);
  color: var(--mint);
  box-shadow: 0 4px 16px #0006;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}

:root[data-theme="light"] {
  color-scheme: light;
  background: #f8f7fc;
  color: #211a33;
  --mint: #356211;
  --muted: #62586e;
}

[data-theme="light"] body {
  background: radial-gradient(ellipse at 50% 35%, #e1d8ef88, transparent 65%);
}

[data-theme="light"] h1 {
  text-shadow: 3px 3px #d4c3df;
}

[data-theme="light"] .brand-name > span {
  text-shadow: 3px 3px #d2e8c1;
}

[data-theme="light"] .panel {
  background: #fff;
  border-color: #b6a4c7;
}

[data-theme="light"] .badge-choice {
  border-color: #b6a4c7;
  background: #fff;
}

[data-theme="light"] .cabinet {
  background: #e8e1ef;
  border-color: #a28caf;
  box-shadow:
    0 7px #c5b7d1,
    0 0 0 4px #eee7f5,
    0 20px 70px #0001;
}

[data-theme="light"] .dashboard {
  background: #fff;
  border-color: #c8b7d5;
}

[data-theme="light"] .stat {
  border-color: #211a3320;
}

[data-theme="light"] .arena {
  background-color: #f5f2fa;
  background-image:
    linear-gradient(#38244d0d 1px, transparent 1px),
    linear-gradient(90deg, #38244d0d 1px, transparent 1px);
  border-color: #b6a4c7;
}

[data-theme="light"] .overlay {
  background: #f8f7fce8;
}

[data-theme="light"]
  :is(
    .panel-note,
    #overlay-description,
    .start-hint,
    .text-button,
    .guest-form p,
    .arena-label,
    .page-footer
  ) {
  color: #62516f;
}

[data-theme="light"] :is(#logout, #save-status) {
  color: #713e92;
}

[data-theme="light"] #lives {
  color: #ad2451;
}

[data-theme="light"] #lives .lost {
  color: #cabfcc;
}

[data-theme="light"]
  :is(.account input, .guest-form input, .settings-panel select) {
  color: #211a33;
  background: #fff;
  border-color: #8c739f;
}

[data-theme="light"] .account label {
  color: #62516f;
}

[data-theme="light"] .primary-button {
  background: #356211;
  color: #fff;
  box-shadow:
    0 4px #23420b,
    4px 0 #23420b,
    -4px 0 #23420b;
}

[data-theme="light"] .primary-button:hover {
  background: #284c0c;
}

[data-theme="light"] .leaderboard th {
  border-color: #b6a4c7;
}

[data-theme="light"] .leaderboard td,
[data-theme="light"] .page-footer {
  border-color: #211a3320;
}

[data-theme="light"] .leaderboard tr:first-child td:first-child {
  color: #795800;
}

[data-theme="light"] button:focus-visible {
  outline-color: #211a33;
}

[data-theme="light"] #leaderboard-status.error {
  color: #a92c20;
}

[data-colorblind="true"] {
  --mint: #75d7ff;
  --muted: #b9b3c8;
}

[data-theme="light"][data-colorblind="true"] {
  --mint: #005b87;
  --muted: #51455e;
}

[data-colorblind="true"] .target.normal .target-face {
  background: #55bfff;
  border-color: #c8edff;
  box-shadow:
    4px 0 #16456a,
    -4px 0 #16456a,
    0 4px #16456a,
    0 -4px #16456a,
    0 0 22px #55bfff30;
}

[data-colorblind="true"] .target.bomb .target-face {
  background: #ffad52;
  border-color: #fff0d6;
}

[data-colorblind="true"] .target.bonus .target-face {
  background: #f5e663;
  border-color: #fffbd4;
}

[data-colorblind="true"] .target .target-face::before {
  color: #171322;
  border-color: #171322;
}

[data-colorblind="true"] .target-timer {
  background: #fff;
}

[data-theme="light"][data-colorblind="true"] .target-timer {
  background: #005b87;
}

[data-theme="light"][data-colorblind="true"] .primary-button {
  background: #005b87;
}

[data-colorblind="true"] #lives {
  color: #75d7ff;
}

[data-theme="light"][data-colorblind="true"] #lives {
  color: #005b87;
}

@keyframes score-pop {
  to {
    transform: translateY(-30px);
    opacity: 0;
  }
}

@keyframes damage {
  from {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0.9;
  }
  to {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

@keyframes slow-glow {
  from {
    background: #62e0d122;
    box-shadow: inset 0 0 36px #62e0d133;
  }
  to {
    background: #62e0d144;
    box-shadow: inset 0 0 90px #62e0d166;
  }
}

@keyframes speed-glow {
  from {
    background: #fff0a81a;
    box-shadow: inset 0 0 30px #fff0a833;
  }
  to {
    background: #fff0a84d;
    box-shadow: inset 0 0 80px #fff0a866;
  }
}

@media (max-height: 760px) {
  .arcade {
    gap: 8px;
  }

  .game-title {
    padding: 10px 0;
  }

  h1 {
    font-size: 46px;
  }

  .instructions {
    gap: 8px;
  }

  .instructions h2,
  .account h2 {
    font-size: 22px;
    margin-bottom: 4px;
  }

  .instructions strong {
    font-size: 8px;
    margin-bottom: 3px;
  }

  .instructions p span {
    font-size: 8px;
    line-height: 1.4;
  }

  .instructions .panel-note {
    font-size: 8px;
    line-height: 1.4;
  }

  .rules-content > div {
    gap: 8px;
  }

  .panel-note {
    margin: 5px 0;
    line-height: 1.3;
  }

  .account input {
    padding: 5px;
    font-size: 10px;
  }

  .account label {
    margin: 4px 0 3px;
    font-size: 8px;
  }

  .account .primary-button {
    padding: 7px 4px;
    margin-top: 8px;
  }

  .panel {
    padding: 10px;
  }

  .leaderboard td {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .leaderboard .podium td {
    padding-block: 5px;
  }

  .page-footer {
    padding: 6px 0;
  }
}

@media (max-width: 999px) {
  .arcade {
    width: calc(100% - 28px);
    height: auto;
    min-height: 100dvh;
    gap: 6px;
  }

  .game-title,
  .mobile-tabs,
  .page-footer,
  .dashboard,
  .game-toolbar {
    flex-shrink: 0;
  }

  .cabinet {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  :is(.mode-tabs, .leaderboard-tabs, .auth-tabs, .mobile-tabs) {
    gap: 4px;
  }

  :is(.mode-tabs, .leaderboard-tabs, .auth-tabs, .mobile-tabs) button {
    padding: 4px;
    min-height: 34px;
  }

  .leaderboard.panel {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .leaderboard-content {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 14px;
    border: 1px solid #49345e;
    background: #191428;
  }

  .dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 5px 6px;
  }

  .stat {
    min-width: 0;
    gap: 2px;
    padding-left: 6px;
  }

  .stat-label {
    font-size: 7px;
    line-height: 1;
    letter-spacing: 0;
  }

  .stat strong {
    font-size: clamp(16px, 5vw, 22px);
    line-height: 22px;
    letter-spacing: 0;
  }

  #lives {
    font-size: 18px;
    line-height: 22px;
    padding-top: 0;
    gap: 2px;
  }

  .arena {
    display: grid;
    flex: 1 0 auto;
    width: 100%;
    min-height: 320px;
    margin-top: 4px;
  }

  .arena:has(> .overlay:not([hidden])) {
    touch-action: pan-y;
  }

  .duel-active .arena {
    flex: 1 0 auto;
    min-height: 320px;
    aspect-ratio: auto;
  }

  .overlay {
    position: absolute;
    inset: 0;
    grid-area: 1 / 1;
    min-width: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .start-card {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .game-toolbar {
    min-height: 30px;
    padding: 4px 6px 0;
    gap: 8px;
  }

  .speed {
    gap: 5px;
    font-size: 8px;
    line-height: 1;
    letter-spacing: 0;
  }

  .powerup-status {
    font-size: 7px;
    letter-spacing: 0;
  }

  .speed-icon {
    font-size: 16px;
  }

  .game-toolbar .text-button {
    font-size: 8px;
    letter-spacing: 0;
    padding: 5px;
  }

  .mobile-tabs {
    display: flex;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--muted);
  }

  .workspace {
    grid-template-columns: 1fr;
    flex: 1 0 auto;
    min-height: auto;
  }

  .workspace[data-panel="game"] > .sidebar,
  .workspace[data-panel="game"] > .leaderboard,
  .workspace[data-panel="profile"] > .cabinet,
  .workspace[data-panel="profile"] > .leaderboard,
  .workspace[data-panel="ranking"] > .sidebar,
  .workspace[data-panel="ranking"] > .cabinet,
  .workspace[data-panel="instructions"] > .cabinet,
  .workspace[data-panel="instructions"] > .leaderboard,
  .workspace[data-panel="instructions"] .profile-area,
  .workspace[data-panel="profile"] .instructions {
    display: none;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-content: start;
  }

  .profile-area {
    grid-column: 1 / -1;
  }

  .profile-area > .account[hidden] {
    display: none !important;
  }

  .arcade:has(.workspace[data-panel="ranking"]),
  .arcade:has(.workspace[data-panel="instructions"]),
  .arcade:has(
    .workspace[data-panel="profile"] :is(.trophies, .statistics):not([hidden])
  ) {
    height: 100dvh;
  }

  .workspace[data-panel="ranking"],
  .workspace[data-panel="instructions"],
  .workspace[data-panel="profile"]:has(
      :is(.trophies, .statistics):not([hidden])
    ) {
    flex: 1 1 0;
    min-height: 0;
  }

  .workspace[data-panel="ranking"] > .leaderboard {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .workspace[data-panel="ranking"] .table-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
  }

  .workspace[data-panel="instructions"] > .sidebar,
  .workspace[data-panel="profile"]:has(
      :is(.trophies, .statistics):not([hidden])
    )
    > .sidebar {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
  }

  .profile-area:has(:is(.trophies, .statistics):not([hidden])) {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .instructions {
    align-content: start;
    grid-column: 1 / -1;
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .instructions > .rules-content {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #49345e;
    background: #191428;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  [data-theme="light"] :is(.cabinet, .instructions) {
    background: transparent;
    box-shadow: none;
  }

  [data-theme="light"] .instructions > .rules-content,
  [data-theme="light"] .leaderboard-content {
    background: #fff;
    border-color: #b6a4c7;
  }

  .workspace[data-panel="instructions"] .instructions {
    min-height: 0;
    overflow: hidden;
  }

  .mode-tabs.rules-tabs {
    display: flex;
  }

  .arena-label {
    font-size: 7px;
  }

  h2 {
    font-size: 28px;
  }

  .start-card .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }

  .page-footer {
    font-size: 7px;
    gap: 6px 16px;
    line-height: 1.8;
  }

  .game-title {
    padding-right: 44px;
    padding-left: 44px;
  }

  .settings summary {
    font-size: 18px;
    padding: 0px 7px;
  }

  .settings summary span:last-child {
    display: inline-block;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(30px, 10vw, 46px);
    letter-spacing: 2px;
  }

  .sidebar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .instructions {
    gap: 0;
  }

  .rules-content > div {
    gap: 8px;
  }

  .instructions strong {
    margin-bottom: 3px;
  }

  .instructions h2 {
    font-size: 21px;
    margin-bottom: 0;
  }

  .start-hint {
    font-size: 7px;
    letter-spacing: 0.5px;
  }
}

@media (min-width: 1000px) {
  .arcade {
    height: 100dvh;
  }

  .workspace {
    flex: 1 1 0;
    min-height: 0;
  }

  .sidebar,
  .cabinet,
  .leaderboard {
    min-height: 0;
  }

  .instructions {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    align-content: start;
  }

  .arena,
  .duel-active .arena {
    min-height: 0;
  }

  .leaderboard {
    display: flex;
    flex-direction: column;
  }

  .table-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}

.boss-field {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 4;
  transform-origin: top left;
}

.boss-targets {
  position: absolute;
  inset: 0;
}

.boss-bomb-flying .target-timer {
  visibility: hidden;
}

.boss {
  position: absolute;
  top: 128px;
  left: 50%;
  width: 128px;
  height: 128px;
  margin-left: -64px;
  pointer-events: none;
  animation: boss-hover 1.6s steps(4) infinite alternate;
}

.boss canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.boss.unseen {
  visibility: hidden;
}

.boss.entering {
  animation: boss-enter 1.2s steps(6) both;
}

.boss.hurt canvas {
  animation: boss-hurt 0.25s steps(3);
}

.boss.guarded {
  outline: 2px dashed #19f0ff;
  outline-offset: 4px;
}

.boss.enraged {
  animation: boss-shake 0.2s steps(2) infinite;
}

.boss.defeated {
  animation: boss-defeat 1.2s steps(8) forwards;
}

.boss.fallen {
  visibility: hidden;
}

.boss-hud {
  --boss-bar: #ff5d8a;
  position: absolute;
  top: 52px;
  left: 14px;
  right: 14px;
  padding: 8px 10px 10px;
  background: #171326;
  border: 1px solid #382d4c;
  pointer-events: none;
}

.boss-hud[data-phase="2"] {
  --boss-bar: #ff9d47;
}

.boss-hud[data-phase="3"] {
  --boss-bar: #ff3b3b;
}

.boss-title {
  display: flex;
  justify-content: space-between;
  font: 20px var(--pixel);
  letter-spacing: 1px;
  color: #dcd6f2;
  text-shadow: 2px 2px #121222;
}

.boss-title span {
  color: #ffd76a;
}

.boss-bar {
  position: relative;
  height: 14px;
  background: #1b1530;
  border: 2px solid #7a638d;
  box-shadow: 0 0 0 2px #121222;
}

.boss-bar i {
  position: absolute;
  inset: 0;
  transform-origin: left;
}

.boss-bar-fill {
  background: var(--boss-bar);
}

.boss-bar-trail {
  background: #ffd76a;
  transition: transform 0.5s steps(8) 0.35s;
}

.boss-bar-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #121222;
}

.boss-hud[data-encounter="level"] .boss-bar-tick {
  display: none;
}

.boss-hud[data-encounter="level"] .boss-bar-fill {
  transition: transform 0.2s linear;
}

.boss-hud[data-encounter="level"] .boss-bar-trail {
  transition: transform 0.5s linear 0.35s;
}

.boss-guard {
  height: 6px;
  margin-top: 4px;
  border: 1px solid #19f0ff;
  background: #0b1d2a;
}

.boss-guard i {
  display: block;
  height: 100%;
  background: #19f0ff;
  transform-origin: left;
}

.boss-banner {
  position: absolute;
  z-index: 5;
  top: 46%;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font: 26px var(--pixel);
  letter-spacing: 1px;
  color: #ffd76a;
  text-shadow: 2px 2px #121222;
  /* Floats over the targets: taps must reach the ones underneath. */
  pointer-events: none;
}

.boss-banner.warning {
  color: #ff6645;
  animation: boss-blink 0.25s steps(1) infinite;
}

.boss-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  max-width: 420px;
  margin: 0 auto 18px;
  font-size: 10px;
  line-height: 1.6;
  text-align: left;
}

.boss-summary div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #382d4c;
}

.boss-summary dt {
  color: #a39bb5;
}

.boss-summary dd {
  margin: 0;
  color: var(--mint);
}

#boss-description {
  max-width: 420px;
  margin: 0 auto 23px;
  font-size: 10px;
  line-height: 1.9;
  color: #a39bb5;
}

.arena.boss-active .arena-label {
  display: none;
}

.arena.boss-warning::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border: 4px solid #ff6645;
  animation: boss-blink 0.25s steps(1) infinite;
}

.arena.boss-shake {
  animation: boss-arena-shake 0.3s steps(4);
}

@keyframes boss-hover {
  to {
    transform: translateY(6px);
  }
}

@keyframes boss-blink {
  50% {
    opacity: 0.25;
  }
}

@keyframes boss-enter {
  from {
    transform: translateY(-90px);
    opacity: 0;
  }
}

@keyframes boss-hurt {
  0%,
  100% {
    transform: translateX(0);
    filter: brightness(1);
  }

  33% {
    transform: translateX(-2px);
    filter: brightness(3);
  }

  66% {
    transform: translateX(2px);
    filter: brightness(2);
  }
}

@keyframes boss-shake {
  50% {
    transform: translate(3px, -2px);
  }
}

@keyframes boss-defeat {
  30% {
    transform: translate(-4px, 0);
    filter: brightness(3);
  }

  to {
    transform: translate(4px, 48px);
    opacity: 0;
  }
}

@keyframes boss-arena-shake {
  25% {
    transform: translate(-4px, 2px);
  }

  75% {
    transform: translate(4px, -2px);
  }
}

.boss-title {
  gap: 10px;
}

.boss-title strong {
  flex: none;
}

.boss-title span:first-of-type {
  margin-left: auto;
}

.boss-situation {
  min-width: 0;
  color: #19f0ff;
  letter-spacing: 1px;
}

.boss-situation.warning {
  color: #ff6645;
  animation: boss-blink 0.25s steps(1) infinite;
}

.boss-banner.ability {
  color: #19f0ff;
}

.boss-banner.go {
  color: var(--mint);
}

.boss-wave {
  position: absolute;
  left: 50%;
  top: 60%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 4px dashed #e9fff3;
  box-sizing: border-box;
  pointer-events: none;
  animation: boss-wave 0.6s steps(8) forwards;
}

.arena.boss-stasis {
  box-shadow: inset 0 0 0 4px #19f0ff;
}

.arena.boss-stasis .boss-targets {
  filter: grayscale(0.5) hue-rotate(150deg) brightness(1.15);
}

.arena.boss-rush {
  animation: boss-rush 0.5s steps(2) infinite alternate;
}

.boss-toolbar {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 5;
}

.boss-abilities {
  display: flex;
  gap: 8px;
}

.boss-ability {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  padding: 0;
  overflow: hidden;
  border: 3px solid #3d3659;
  background: #17122a;
  color: #6f6890;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Dark curtain that drops away as the cooldown runs out. */
.boss-ability::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #05030acc;
  transform: scaleY(var(--cooldown, 0));
  transform-origin: bottom;
  pointer-events: none;
}

.boss-ability kbd,
.boss-ability b {
  position: absolute;
  z-index: 1;
  font: 16px var(--pixel);
  color: inherit;
}

.boss-ability kbd {
  top: 2px;
  left: 5px;
}

.boss-ability b {
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  color: #dcd6f2;
  text-shadow: 2px 2px #121222;
}

@media (hover: none) {
  .boss-ability kbd {
    display: none;
  }
}

.boss-ability:not(:disabled) {
  border-color: #19f0ff;
  background: #12304a;
  color: #dffcff;
  cursor: var(--retro-cursor);
}

.boss-ability:not(:disabled):hover {
  background: #1a4a6e;
}

/* A running power: its recharge starts when the effect ends. */
.boss-ability.active {
  border-color: #19f0ff;
  animation: boss-ready 0.5s steps(2) infinite;
}

.boss-ability.suggested {
  animation: boss-suggest 0.6s steps(2) infinite;
}

.boss-ability-icon {
  width: 36px;
  height: 36px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.boss-intro {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05030a;
  transition: background-color 0.8s steps(6);
}

.boss-intro[data-step="2"],
.boss-intro[data-step="3"],
.boss-intro[data-step="4"] {
  background-color: #05030a00;
}

.boss-intro::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: #e9fff3;
  opacity: 0;
  transform: scaleY(0.004);
  pointer-events: none;
}

.boss-intro[data-step="0"]::before {
  animation: boss-power-on 0.9s steps(6) forwards;
}

.boss-intro-log {
  grid-area: 1 / 1;
  margin: 0;
  padding: 0 16px;
  align-self: center;
  justify-self: start;
  max-width: 100%;
  color: #7dffb0;
  font: 22px var(--pixel);
  line-height: 1.5;
  letter-spacing: 1px;
  text-shadow: 2px 2px #121222;
  white-space: pre-wrap;
  transition: opacity 0.4s steps(4);
}

.boss-intro:not(.story-terminal):not([data-step="0"]):not([data-step="1"])
  .boss-intro-log {
  opacity: 0;
}

.boss-intro[data-step="2"] {
  animation: boss-alarm 0.4s steps(2) infinite;
}

.boss-intro-skip {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 4px 10px;
  border: 1px solid #7a638d;
  background: #121222cc;
  color: #a39bb5;
  font: 18px var(--pixel);
  letter-spacing: 1px;
}

.boss-intro.story-terminal {
  background: #050b09;
  animation: none;
}

.boss-intro.story-terminal .boss-intro-log {
  opacity: 1;
  position: absolute;
  inset: 18px 22px 80px;
  max-height: none;
  align-self: stretch;
  justify-self: stretch;
  overflow-y: auto;
  padding: 0;
  font-size: clamp(17px, 3.5vw, 22px);
  overflow-wrap: anywhere;
}

.story-terminal .boss-intro-skip {
  color: #7dffb0;
  border-color: #7dffb0;
  padding: 10px 14px;
}

#story-overlay #boss-description {
  white-space: pre-line;
}

/* Story start, hard mode and retry share one size, stacked and centred. */
#boss-start,
#boss-hard {
  display: block;
  width: min(100%, 280px);
  margin: 0 auto;
}

#boss-hard {
  margin-top: 14px;
  background: #ff5d8a;
  box-shadow:
    0 4px #8a2747,
    4px 0 #8a2747,
    -4px 0 #8a2747;
}

#boss-hard:hover {
  background: #ff8aa9;
}

#boss-hard:active {
  box-shadow:
    4px 0 #8a2747,
    -4px 0 #8a2747;
}

.story-unlock .eyebrow {
  color: #19f0ff;
}

.story-unlock-icon {
  display: block;
  width: 64px;
  height: 64px;
  margin: 4px auto 12px;
  fill: #19f0ff;
  shape-rendering: crispEdges;
  animation: story-unlock-pulse 0.6s steps(2) infinite;
}

#story-unlock-description,
.story-unlock-usage {
  max-width: 420px;
  margin: 0 auto 14px;
  font-size: 10px;
  line-height: 1.9;
}

#story-unlock-description {
  color: var(--mint);
}

.story-unlock-key {
  margin: 0 0 10px;
  font: 18px var(--pixel);
  letter-spacing: 1px;
  color: #ffd76a;
}

.story-unlock-usage {
  margin-bottom: 23px;
  color: #a39bb5;
}

@keyframes story-unlock-pulse {
  50% {
    fill: #ffd76a;
  }
}

@keyframes boss-power-on {
  0% {
    transform: scaleY(0.004);
    opacity: 1;
  }

  60% {
    transform: scaleY(0.004);
    opacity: 1;
  }

  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

@keyframes boss-alarm {
  50% {
    background-color: #3a0a14;
  }
}

@keyframes boss-slam {
  0% {
    transform: translateY(-48px);
    opacity: 0;
  }

  60% {
    transform: translateY(8px);
    opacity: 1;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes boss-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes boss-wave {
  to {
    width: 816px;
    height: 816px;
    margin: -408px 0 0 -408px;
    opacity: 0;
  }
}

@keyframes boss-ready {
  50% {
    border-color: #ffffff;
  }
}

@keyframes boss-suggest {
  50% {
    background: #2a7aa8;
    box-shadow: 0 0 0 3px #ffd76a;
  }
}

@keyframes boss-rush {
  to {
    box-shadow: inset 0 0 0 4px #ff3b3b;
  }
}

/* Story disruptions: from the second act the cabinet tilts and blocks
   take random colours, keeping their own symbol. */
body:has(.arena.story-tilt) {
  overflow-x: clip;
}

.cabinet:has(> .arena.story-tilt) {
  animation: story-tilt 1.1s steps(6) infinite alternate;
}

/* Each block wears a random colour while tilting; symbols never change. */
.arena.story-tilt .target[data-disguise="normal"] .target-face {
  background: #ff719d;
  border-color: #ffa5c0;
  box-shadow:
    4px 0 #6e345a,
    -4px 0 #6e345a,
    0 4px #6e345a,
    0 -4px #6e345a,
    0 0 22px #ff719d30;
}

.arena.story-tilt .target[data-disguise="bomb"] .target-face {
  background: #fa674e;
  border-color: #ffb08b;
  box-shadow:
    4px 0 #6e345a,
    -4px 0 #6e345a,
    0 4px #6e345a,
    0 -4px #6e345a,
    0 0 22px #fa674e30;
}

.arena.story-tilt .target[data-disguise="armored"] .target-face {
  background: #75c9e8;
  border-color: #c5efff;
  box-shadow:
    4px 0 #315575,
    -4px 0 #315575,
    0 4px #315575,
    0 -4px #315575;
}

.arena.story-tilt .target[data-disguise="bonus"] .target-face {
  background: #ffda66;
  border-color: #fff3ac;
  box-shadow:
    4px 0 #896229,
    -4px 0 #896229,
    0 4px #896229,
    0 -4px #896229,
    0 0 24px #ffda6650;
}

/* From the third act targets periodically shrink. */
.boss-targets .target {
  transition: scale 0.3s steps(3);
}

.arena.story-shrink .boss-targets .target {
  scale: 0.55;
}

/* Final boss: slow motion flood and the core that ends the fight. */
.arena.story-slowmo .boss-targets {
  filter: saturate(0.55) hue-rotate(-25deg);
}

.arena.story-slowmo {
  box-shadow: inset 0 0 60px #19f0ff55;
}

.target.core {
  z-index: 3;
  scale: 1.5;
}

.arena.story-slowmo .boss-targets .target.core {
  filter: drop-shadow(0 0 10px #ffd76a);
}

.target.core .target-face {
  animation: story-core 0.4s steps(2) infinite;
}

.target.core .target-face::before {
  background-image: url("/assets/powerup-turbo.svg");
}

.target.core .target-timer {
  display: none;
}

.arena.story-flash {
  animation: story-flash 0.8s steps(4);
}

@keyframes story-tilt {
  from {
    transform: rotate(-1.2deg) translateX(-6px);
  }

  to {
    transform: rotate(1.2deg) translateX(6px);
  }
}

@keyframes story-core {
  50% {
    transform: scale(1.12);
  }
}

@keyframes story-flash {
  from {
    filter: brightness(4);
  }
}

/* Each boss moves in its own way: the daemon twitches, the root floats. */
.boss[data-boss="daemon"]:not(.entering, .enraged, .defeated, .fallen) {
  animation: boss-skitter 0.7s steps(2) infinite;
}

.boss[data-boss="root"]:not(.entering, .enraged, .defeated, .fallen) {
  animation: boss-hover 2.4s steps(6) infinite alternate;
}

.boss[data-boss="root"] canvas {
  filter: drop-shadow(0 0 6px #ffd24a66);
}

@keyframes boss-skitter {
  0%,
  100% {
    transform: translate(-3px, 0);
  }

  50% {
    transform: translate(3px, 2px);
  }
}
