:root {
  color-scheme: dark;
  --bg: #101214;
  --surface: #171c20;
  --surface-2: #20282e;
  --surface-3: #26323a;
  --line: #34444d;
  --muted: #a9b8bf;
  --text: #f5f8f7;
  --cyan: #2dd4bf;
  --teal: #2dd4bf;
  --blue: #64a8ff;
  --violet: #8b5cf6;
  --pink: #ff4fd8;
  --lime: #b7e45f;
  --amber: #f4b740;
  --coral: #ff6f61;
  --ink: #0b1012;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef7fb;
  --surface: #ffffff;
  --surface-2: #e7f1f6;
  --surface-3: #d5e5ec;
  --line: #9bb8c3;
  --muted: #4d6470;
  --text: #07151a;
  --cyan: #008f85;
  --teal: #008f85;
  --blue: #266fe0;
  --violet: #6d43d8;
  --pink: #c01993;
  --lime: #5c9e18;
  --amber: #b46d00;
  --coral: #d34532;
  --ink: #f8fdff;
  --shadow: 0 20px 58px rgba(45, 78, 92, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-height: 100svh;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), transparent 32%),
    linear-gradient(225deg, rgba(255, 79, 216, 0.11), transparent 34%),
    linear-gradient(315deg, rgba(244, 183, 64, 0.1), transparent 38%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    #101214;
  background-size: auto, auto, auto, 42px 42px, 42px 42px, auto;
}

:root[data-theme="light"] body {
  background:
    linear-gradient(135deg, rgba(0, 143, 133, 0.13), transparent 32%),
    linear-gradient(225deg, rgba(192, 25, 147, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(38, 111, 224, 0.12), transparent 38%),
    linear-gradient(90deg, rgba(7, 21, 26, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(7, 21, 26, 0.045) 1px, transparent 1px),
    #eef7fb;
  background-size: auto, auto, auto, 42px 42px, 42px 42px, auto;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

button:focus-visible {
  outline: 3px solid rgba(45, 212, 191, 0.5);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

h1,
h2,
p,
span,
strong,
button {
  overflow-wrap: anywhere;
}

.intro-active {
  overflow: hidden;
}

.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(22px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  color: #f5f8f7;
  background:
    radial-gradient(ellipse at 50% 115%, rgba(244, 183, 64, 0.2), transparent 35%),
    linear-gradient(160deg, rgba(9, 12, 22, 0.96), rgba(20, 12, 32, 0.95) 42%, rgba(5, 24, 27, 0.97)),
    #06090f;
  transition:
    opacity 720ms ease,
    visibility 720ms ease;
}

.intro-splash::before,
.intro-splash::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.intro-splash::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.16) 1px, transparent 1px),
    linear-gradient(transparent 72%, rgba(255, 79, 216, 0.16));
  background-size: 100% 7px, 82px 82px, 100% 100%;
  mix-blend-mode: screen;
  opacity: 0.32;
}

.intro-splash::after {
  background:
    linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.2), transparent),
    linear-gradient(180deg, transparent 0 16%, rgba(255, 79, 216, 0.11) 17%, transparent 18% 48%, rgba(100, 168, 255, 0.13) 49%, transparent 50%);
  background-size: 62% 100%, 100% 220px;
  background-position: -70% 0, 0 0;
  animation: introSweep 2800ms ease-in-out infinite;
  opacity: 0.5;
}

.intro-grid {
  position: absolute;
  left: -18vw;
  right: -18vw;
  bottom: -16vh;
  height: 56vh;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: 50% 100%;
  background:
    linear-gradient(rgba(45, 212, 191, 0.4) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 79, 216, 0.34) 2px, transparent 2px);
  background-size: 64px 64px;
  filter: drop-shadow(0 0 16px rgba(45, 212, 191, 0.38));
  animation: introGridDrift 1350ms linear infinite;
}

.intro-city {
  position: absolute;
  left: 50%;
  bottom: 21vh;
  width: min(78vw, 920px);
  height: min(24vh, 190px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 0.72fr 1.38fr 0.9fr 1.12fr;
  align-items: end;
  gap: clamp(8px, 2vw, 24px);
  opacity: 0.78;
}

.intro-city span {
  display: block;
  border: 1px solid rgba(45, 212, 191, 0.24);
  background:
    linear-gradient(180deg, rgba(100, 168, 255, 0.22), rgba(255, 79, 216, 0.14)),
    rgba(8, 12, 18, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 24px rgba(45, 212, 191, 0.2);
}

.intro-city span:nth-child(1) {
  height: 48%;
}

.intro-city span:nth-child(2) {
  height: 72%;
  border-color: rgba(255, 79, 216, 0.28);
}

.intro-city span:nth-child(3) {
  height: 100%;
}

.intro-city span:nth-child(4) {
  height: 58%;
  border-color: rgba(244, 183, 64, 0.26);
}

.intro-city span:nth-child(5) {
  height: 82%;
}

.intro-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 920px);
  text-align: center;
  animation: introRise 950ms ease-out both;
}

.intro-kicker {
  margin: 0;
  color: #2dd4bf;
  font-size: clamp(0.82rem, 2.8vw, 1rem);
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(45, 212, 191, 0.75);
}

.intro-content h1 {
  margin: 0;
  max-width: 100%;
  font-size: 7rem;
  line-height: 0.9;
  color: #ffffff;
  white-space: nowrap;
  text-transform: uppercase;
  text-shadow:
    2px 0 0 rgba(255, 79, 216, 0.84),
    -2px 0 0 rgba(45, 212, 191, 0.78),
    0 0 26px rgba(255, 79, 216, 0.36),
    0 0 46px rgba(45, 212, 191, 0.28);
}

.intro-content span {
  color: #a9b8bf;
  font-size: clamp(0.95rem, 3.4vw, 1.26rem);
  font-weight: 850;
  text-transform: uppercase;
}

.intro-skip {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2;
  min-width: 84px;
  border: 1px solid rgba(45, 212, 191, 0.38);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.16), rgba(255, 79, 216, 0.1)),
    rgba(10, 15, 18, 0.78);
  color: #f5f8f7;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.18);
  font-weight: 950;
}

.intro-splash.is-exiting {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.intro-splash.is-hidden {
  display: none;
}

.intro-active .app-shell {
  filter: blur(4px);
  transform: scale(0.992);
}

.app-shell {
  transition:
    filter 720ms ease,
    transform 720ms ease;
}

.app-shell {
  width: min(100% - 20px, 1540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
  display: grid;
  align-content: center;
  gap: 10px;
}

.arcade-shell {
  overflow: hidden;
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(35, 21, 55, 0.46), rgba(12, 23, 26, 0.72) 45%, rgba(36, 26, 13, 0.45)),
    rgba(23, 28, 32, 0.94);
  box-shadow:
    0 0 34px rgba(45, 212, 191, 0.2),
    0 0 52px rgba(255, 79, 216, 0.12),
    var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid rgba(45, 212, 191, 0.24);
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.08), rgba(139, 92, 246, 0.08), rgba(255, 79, 216, 0.07)),
    rgba(10, 15, 18, 0.42);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.coming-soon-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.12), rgba(255, 79, 216, 0.1), rgba(244, 183, 64, 0.1)),
    rgba(16, 18, 20, 0.78);
  box-shadow:
    0 0 22px rgba(45, 212, 191, 0.13),
    0 0 34px rgba(255, 79, 216, 0.08);
}

.coming-soon-strip span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.coming-soon-strip strong {
  color: var(--lime);
  font-size: clamp(1rem, 3vw, 1.26rem);
  line-height: 1;
  text-shadow: 0 0 16px rgba(183, 228, 95, 0.35);
  text-transform: uppercase;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(45, 212, 191, 0.48);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(139, 92, 246, 0.2)),
    #11191b;
  box-shadow:
    0 0 18px rgba(45, 212, 191, 0.28),
    0 0 26px rgba(139, 92, 246, 0.18);
}

.brand-mark span {
  width: 20px;
  height: 20px;
  border: 3px solid var(--teal);
  box-shadow: inset 0 0 0 5px #11191b;
  transform: rotate(45deg);
}

.title-block {
  min-width: 0;
}

.eyebrow,
.hud-strip span,
.mission-grid span {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(1.18rem, 3.5vw, 2.28rem);
  line-height: 1.05;
}

.top-actions {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 8px;
  align-items: center;
}

.wallet-button,
.music-button,
.theme-button {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  gap: 8px;
  max-width: 150px;
  padding: 0 12px;
  border: 1px solid rgba(45, 212, 191, 0.34);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(100, 168, 255, 0.1)),
    var(--surface-2);
  box-shadow:
    0 0 18px rgba(45, 212, 191, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.music-button {
  max-width: 132px;
}

.theme-button {
  max-width: 132px;
}

.wallet-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(244, 183, 64, 0.14);
}

.wallet-button.connected .wallet-dot {
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(183, 228, 95, 0.14);
}

.music-icon {
  position: relative;
  width: 14px;
  height: 16px;
  border-left: 3px solid var(--teal);
  border-top: 3px solid var(--teal);
  transform: skewY(-10deg);
}

.music-icon::before,
.music-icon::after {
  position: absolute;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  content: "";
}

.music-icon::before {
  left: -6px;
}

.music-icon::after {
  right: -4px;
}

.music-button.muted .music-icon,
.music-button.missing .music-icon {
  border-color: var(--muted);
}

.music-button.muted .music-icon::before,
.music-button.muted .music-icon::after,
.music-button.missing .music-icon::before,
.music-button.missing .music-icon::after {
  background: var(--muted);
}

.theme-icon {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow:
    inset -5px -3px 0 rgba(10, 15, 18, 0.9),
    0 0 14px rgba(100, 168, 255, 0.4);
}

.theme-icon::before,
.theme-icon::after {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1px solid transparent;
  content: "";
}

.theme-button.is-light .theme-icon {
  background: var(--amber);
  box-shadow:
    0 0 0 3px rgba(180, 109, 0, 0.13),
    0 0 16px rgba(180, 109, 0, 0.35);
}

.theme-button.is-light .theme-icon::before {
  border-color: rgba(180, 109, 0, 0.38);
}

#walletLabel,
#musicLabel,
#themeLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-layout {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.stage-card,
.side-panel > section,
.action-panel {
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(45, 212, 191, 0.06), rgba(139, 92, 246, 0.05) 44%, rgba(244, 183, 64, 0.05)),
    rgba(16, 18, 20, 0.82);
  box-shadow:
    0 0 24px rgba(45, 212, 191, 0.12),
    0 0 36px rgba(255, 79, 216, 0.06);
}

.stage-card {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-areas:
    "hud"
    "progress"
    "arena"
    "powerups"
    "controls";
  grid-template-rows: auto auto minmax(390px, 1fr) auto auto;
  gap: 10px;
  padding: 10px;
}

.hud-strip {
  grid-area: hud;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.hud-strip article {
  position: relative;
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 4px;
  overflow: hidden;
  padding: 7px 9px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.14), rgba(100, 168, 255, 0.1)),
    var(--surface-2);
  border: 1px solid rgba(45, 212, 191, 0.28);
  box-shadow:
    0 0 18px rgba(45, 212, 191, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hud-strip article > span,
.hud-strip article > strong {
  position: relative;
  z-index: 1;
}

.hud-strip article::before {
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  content: "";
}

.hud-strip article:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(100, 168, 255, 0.12)),
    var(--surface-2);
  border-color: rgba(139, 92, 246, 0.36);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.17);
}

.hud-strip article:nth-child(3) {
  background:
    linear-gradient(135deg, rgba(244, 183, 64, 0.16), rgba(255, 79, 216, 0.08)),
    var(--surface-2);
  border-color: rgba(244, 183, 64, 0.34);
  box-shadow: 0 0 18px rgba(244, 183, 64, 0.16);
}

.hud-strip article:nth-child(4) {
  background:
    linear-gradient(135deg, rgba(255, 111, 97, 0.14), rgba(139, 92, 246, 0.1)),
    var(--surface-2);
  border-color: rgba(255, 111, 97, 0.32);
  box-shadow: 0 0 18px rgba(255, 111, 97, 0.14);
}

.hud-strip article:nth-child(5) {
  background:
    linear-gradient(135deg, rgba(183, 228, 95, 0.13), rgba(45, 212, 191, 0.09)),
    var(--surface-2);
  border-color: rgba(183, 228, 95, 0.3);
  box-shadow: 0 0 18px rgba(183, 228, 95, 0.13);
}

.hud-strip strong {
  font-size: clamp(1.05rem, 3vw, 1.58rem);
  line-height: 1;
}

.hud-strip span {
  font-size: 0.66rem;
}

#levelCard.is-level-pop {
  animation: hudLevelPop 620ms cubic-bezier(0.2, 1.35, 0.36, 1);
  z-index: 2;
}

#livesCard.is-life-hit {
  animation: hudLifeHit 620ms ease-out;
  z-index: 2;
}

#livesCard.is-life-boost {
  animation: hudLevelPop 620ms cubic-bezier(0.2, 1.35, 0.36, 1);
  z-index: 2;
}

#bestCard.is-best-fire {
  animation: hudBestPop 880ms cubic-bezier(0.2, 1.2, 0.32, 1);
  z-index: 2;
}

#bestCard.is-best-fire::before {
  opacity: 1;
  background:
    radial-gradient(circle at 18% 86%, rgba(255, 111, 97, 0.95), transparent 28%),
    radial-gradient(circle at 42% 95%, rgba(244, 183, 64, 0.95), transparent 31%),
    radial-gradient(circle at 69% 88%, rgba(255, 79, 216, 0.78), transparent 25%),
    linear-gradient(0deg, rgba(244, 183, 64, 0.74), transparent 62%);
  filter: blur(1px);
  animation: hudFireRise 880ms ease-out both;
}

.race-progress-card {
  grid-area: progress;
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(139, 92, 246, 0.09), rgba(244, 183, 64, 0.08)),
    rgba(16, 18, 20, 0.76);
  box-shadow:
    0 0 18px rgba(45, 212, 191, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.race-progress-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.race-progress-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.race-progress-head strong {
  color: var(--lime);
  font-size: 1.05rem;
  line-height: 1;
  text-shadow: 0 0 14px rgba(183, 228, 95, 0.34);
}

.race-progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(100, 168, 255, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(100, 168, 255, 0.12), rgba(255, 79, 216, 0.08)),
    rgba(7, 12, 16, 0.74);
}

.race-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--lime), var(--amber));
  box-shadow:
    0 0 14px rgba(45, 212, 191, 0.5),
    0 0 22px rgba(244, 183, 64, 0.22);
  transition: width 220ms ease;
}

.race-progress-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
}

.canvas-wrap {
  grid-area: arena;
  position: relative;
  min-height: 390px;
  height: min(62vh, 720px);
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(45, 212, 191, 0.32);
  background: #080d13;
  box-shadow:
    0 0 28px rgba(45, 212, 191, 0.12),
    0 0 42px rgba(139, 92, 246, 0.1),
    inset 0 0 28px rgba(100, 168, 255, 0.08);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.screen-banner {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.14), rgba(139, 92, 246, 0.16), rgba(255, 79, 216, 0.12)),
    rgba(9, 13, 16, 0.7);
  backdrop-filter: blur(5px);
}

.screen-banner p,
.screen-banner h2,
.screen-banner span {
  max-width: 560px;
  margin: 0;
}

.screen-banner h2 {
  font-size: clamp(2rem, 8vw, 4.8rem);
  line-height: 0.98;
}

.screen-banner span {
  color: var(--muted);
  line-height: 1.4;
}

.touch-controls {
  grid-area: controls;
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;
  gap: 8px;
}

.control-button {
  position: relative;
  min-height: 54px;
  border: 1px solid rgba(100, 168, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(100, 168, 255, 0.18), rgba(139, 92, 246, 0.12)),
    var(--surface-2);
  box-shadow:
    0 0 18px rgba(100, 168, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.control-button:active {
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.24), rgba(255, 79, 216, 0.18)),
    #31414a;
  box-shadow:
    0 0 26px rgba(45, 212, 191, 0.28),
    0 0 34px rgba(255, 79, 216, 0.16);
}

.control-button.shield {
  display: grid;
  align-content: center;
  gap: 1px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(183, 228, 95, 0.11)),
    #182422;
  border-color: rgba(45, 212, 191, 0.46);
  box-shadow:
    0 0 20px rgba(45, 212, 191, 0.26),
    0 0 26px rgba(183, 228, 95, 0.1);
}

.control-button small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.powerup-bar {
  grid-area: powerups;
  position: sticky;
  bottom: calc(72px + max(10px, env(safe-area-inset-bottom)));
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 6px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(139, 92, 246, 0.11), rgba(255, 79, 216, 0.08)),
    rgba(7, 12, 16, 0.82);
  box-shadow:
    0 0 22px rgba(45, 212, 191, 0.14),
    0 0 30px rgba(255, 79, 216, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.powerup-button {
  --powerup-accent: var(--teal);
  min-width: 0;
  min-height: 64px;
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 7px 5px;
  border: 1px solid color-mix(in srgb, var(--powerup-accent), transparent 48%);
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--powerup-accent), transparent 82%), rgba(16, 18, 20, 0.76)),
    var(--surface-2);
  box-shadow:
    0 0 16px color-mix(in srgb, var(--powerup-accent), transparent 78%),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  touch-action: manipulation;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.powerup-button::after {
  position: absolute;
  inset: 4px;
  border: 1px solid color-mix(in srgb, var(--powerup-accent), transparent 66%);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  content: "";
}

.powerup-button > span:not(.powerup-control-art),
.powerup-button > small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.powerup-button > span:not(.powerup-control-art) {
  font-size: 0.78rem;
  font-weight: 950;
}

.powerup-button > small {
  color: color-mix(in srgb, var(--powerup-accent), var(--text) 28%);
  font-size: 0.68rem;
  font-weight: 950;
}

.powerup-button:not(:disabled):hover,
.powerup-button:not(:disabled):focus-visible {
  border-color: color-mix(in srgb, var(--powerup-accent), white 18%);
  box-shadow:
    0 0 20px color-mix(in srgb, var(--powerup-accent), transparent 56%),
    0 0 30px color-mix(in srgb, var(--powerup-accent), transparent 72%),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.powerup-button:not(:disabled):active {
  transform: scale(0.96);
}

.powerup-button.is-active {
  border-color: var(--powerup-accent);
  box-shadow:
    0 0 22px color-mix(in srgb, var(--powerup-accent), transparent 42%),
    0 0 34px color-mix(in srgb, var(--powerup-accent), transparent 62%),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.powerup-button.is-active::after,
.powerup-button.is-ready::after {
  opacity: 1;
  animation: powerupButtonPulse 1.35s ease-in-out infinite;
}

.powerup-button.is-empty:not(.is-active) {
  opacity: 0.68;
  filter: saturate(0.78);
}

.powerup-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.side-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.mission-card,
.reward-card,
.database-card {
  padding: 13px;
}

.mission-card h2,
.reward-card h2,
.database-card h2 {
  margin: 5px 0 0;
  font-size: clamp(1.25rem, 5vw, 1.95rem);
  line-height: 1.05;
}

.run-mode-badge {
  display: inline-grid;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  margin-top: 9px;
  padding: 5px 9px;
  border: 1px solid rgba(244, 183, 64, 0.34);
  border-radius: 999px;
  color: var(--amber);
  background: rgba(244, 183, 64, 0.08);
  box-shadow: 0 0 14px rgba(244, 183, 64, 0.12);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.run-mode-badge.is-wallet {
  border-color: rgba(45, 212, 191, 0.42);
  color: var(--cyan);
  background: rgba(45, 212, 191, 0.1);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.18);
}

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

.mission-grid article {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(100, 168, 255, 0.25);
  background:
    linear-gradient(135deg, rgba(100, 168, 255, 0.11), rgba(45, 212, 191, 0.08)),
    var(--surface-2);
  box-shadow: 0 0 16px rgba(100, 168, 255, 0.12);
}

.mission-grid strong {
  font-size: 1.42rem;
}

.mission-grid article:nth-child(3) {
  grid-column: 1 / -1;
}

.shield-meter,
.reward-meter {
  height: 12px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 999px;
  background: #253039;
  border: 1px solid rgba(45, 212, 191, 0.22);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.42);
}

.shield-meter span,
.reward-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--lime), var(--amber));
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.55);
  transition: width 180ms ease;
}

.reward-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  background:
    linear-gradient(135deg, rgba(244, 183, 64, 0.12), rgba(255, 79, 216, 0.08)),
    #1f1d15;
  border-color: rgba(244, 183, 64, 0.36) !important;
  box-shadow:
    0 0 22px rgba(244, 183, 64, 0.16),
    0 0 34px rgba(255, 79, 216, 0.08);
}

.reward-badge {
  width: 58px;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid var(--amber);
  background:
    linear-gradient(45deg, transparent 42%, rgba(244, 183, 64, 0.88) 43% 57%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, rgba(244, 183, 64, 0.88) 43% 57%, transparent 58%),
    #171209;
  box-shadow:
    0 0 18px rgba(244, 183, 64, 0.4),
    0 0 28px rgba(255, 79, 216, 0.16);
}

.reward-card > .reward-meter {
  grid-column: 1 / -1;
}

.reward-card span {
  display: block;
  color: var(--muted);
  line-height: 1.38;
}

.action-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}

.action-panel .primary-button {
  grid-column: 1 / -1;
}

.powerup-shop-button {
  grid-column: 1 / -1;
}

.database-card {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(135deg, rgba(100, 168, 255, 0.1), rgba(45, 212, 191, 0.08), rgba(255, 79, 216, 0.06)),
    #151d21;
}

.database-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.database-heading > strong {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 8px;
  color: var(--lime);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.16), rgba(183, 228, 95, 0.09)),
    rgba(16, 18, 20, 0.72);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.18);
}

.database-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.database-list {
  display: grid;
  gap: 8px;
}

.database-empty,
.database-player {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(100, 168, 255, 0.23);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(100, 168, 255, 0.09), rgba(45, 212, 191, 0.06)),
    rgba(16, 18, 20, 0.62);
}

.database-empty {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.database-player {
  display: grid;
  gap: 6px;
}

.database-player > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.database-player strong {
  color: var(--text);
  font-size: 0.95rem;
}

.database-player span {
  padding: 4px 7px;
  border: 1px solid rgba(183, 228, 95, 0.28);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(183, 228, 95, 0.08);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.database-player small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.database-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-button {
  padding: 0 16px;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  color: var(--ink);
  font-weight: 950;
  box-shadow:
    0 0 20px rgba(45, 212, 191, 0.26),
    0 0 30px rgba(183, 228, 95, 0.12);
}

.ghost-button {
  padding: 0 16px;
  background: rgba(16, 18, 20, 0.62);
  border: 1px solid rgba(255, 79, 216, 0.28);
  font-weight: 900;
  box-shadow: 0 0 18px rgba(255, 79, 216, 0.1);
}

.tank-dialog {
  width: min(96vw, 1120px);
  max-width: 1120px;
  border: 0;
  margin: clamp(10px, 3.8vh, 34px) auto auto;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.tank-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(7px);
}

.tank-panel {
  position: relative;
  isolation: isolate;
  height: min(88vh, 780px);
  max-height: min(88vh, 780px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  padding: clamp(14px, 2.2vw, 22px);
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 8px 8px 0 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 79, 216, 0.2), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(45, 212, 191, 0.2), transparent 30%),
    linear-gradient(145deg, rgba(10, 15, 22, 0.96), rgba(18, 16, 34, 0.96) 46%, rgba(8, 25, 27, 0.97)),
    #0a1016;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), 96% 100%, 4% 100%, 0 calc(100% - 24px));
  box-shadow:
    0 0 34px rgba(45, 212, 191, 0.26),
    0 0 58px rgba(255, 79, 216, 0.16),
    var(--shadow);
  animation: tankDropdown 260ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

.tank-panel::before,
.tank-panel::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.tank-panel::before {
  z-index: -2;
  background:
    linear-gradient(90deg, transparent 0 92%, rgba(45, 212, 191, 0.18) 94%, transparent 100%),
    linear-gradient(0deg, transparent 0 90%, rgba(255, 79, 216, 0.12) 92%, transparent 100%);
  background-size: 54px 54px;
  opacity: 0.32;
  animation: tankHangarDrift 9s linear infinite;
}

.tank-panel::after {
  z-index: -1;
  background:
    radial-gradient(circle at 22% 24%, color-mix(in srgb, var(--pink), transparent 72%), transparent 24%),
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--cyan), transparent 70%), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%, rgba(45, 212, 191, 0.06));
  opacity: 0.86;
}

.tank-panel > * {
  position: relative;
  z-index: 1;
}

.tank-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.tank-panel-header h2 {
  margin: 5px 0 0;
  font-size: clamp(1.55rem, 4.4vw, 2.7rem);
  line-height: 1;
}

.tank-status,
.tank-selected {
  border: 1px solid rgba(100, 168, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(100, 168, 255, 0.08), rgba(45, 212, 191, 0.07)),
    rgba(16, 18, 20, 0.68);
  line-height: 1.4;
}

.tank-status {
  padding: 12px;
  color: var(--muted);
  font-weight: 750;
}

.tank-selected {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.tank-selected-preview {
  min-width: 0;
  min-height: 118px;
}

.tank-selected-preview .tank-ship-visual {
  height: 100%;
  min-height: 118px;
}

.tank-selected-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.tank-selected-copy > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tank-selected-copy > strong {
  color: var(--text);
  font-size: 1.15rem;
}

.tank-selected-copy > p {
  margin: 0;
  color: var(--cyan);
  font-size: 0.86rem;
  font-weight: 850;
}

.tank-picker-toggle {
  display: none;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(45, 212, 191, 0.32);
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.14), rgba(255, 79, 216, 0.08)),
    rgba(16, 18, 20, 0.76);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.12);
  text-align: left;
}

.tank-picker-toggle span,
.tank-picker-toggle strong {
  min-width: 0;
}

.tank-picker-toggle span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tank-picker-toggle strong {
  overflow: hidden;
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tank-picker-toggle::after {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(45, 212, 191, 0.08);
  content: "+";
  font-weight: 1000;
  line-height: 1;
}

.tank-picker-toggle[aria-expanded="true"]::after {
  content: "-";
}

.tank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  grid-auto-rows: max-content;
  align-items: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.tank-card {
  --tank-accent: var(--teal);
  --tank-secondary: var(--blue);
  --quality-color: var(--cyan);
  --ship-scale: 1;
  --ship-visual-height: 118px;
  position: relative;
  min-height: calc(238px + var(--ship-visual-height));
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 10px;
  overflow: hidden;
  padding: 12px 12px 30px;
  border: 1px solid color-mix(in srgb, var(--tank-accent), transparent 48%);
  border-radius: 8px;
  color: var(--text);
  background:
    radial-gradient(circle at 76% 14%, color-mix(in srgb, var(--quality-color), transparent 72%), transparent 28%),
    linear-gradient(145deg, color-mix(in srgb, var(--tank-accent), transparent 80%), rgba(16, 18, 20, 0.76)),
    rgba(16, 18, 20, 0.88);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--quality-color), transparent 76%),
    0 0 26px color-mix(in srgb, var(--tank-accent), transparent 86%),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-align: left;
}

.tank-card[data-quality="starter"] {
  border-color: color-mix(in srgb, var(--quality-color), transparent 56%);
}

.tank-card[data-quality="tuned"] {
  border-color: color-mix(in srgb, var(--quality-color), transparent 48%);
}

.tank-card[data-quality="prime"] {
  border-color: color-mix(in srgb, var(--quality-color), transparent 42%);
}

.tank-card[data-quality="apex"],
.tank-card[data-quality="mythic"] {
  border-color: color-mix(in srgb, var(--quality-color), transparent 30%);
  box-shadow:
    0 0 24px color-mix(in srgb, var(--quality-color), transparent 58%),
    0 0 36px color-mix(in srgb, var(--tank-accent), transparent 78%),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tank-card::before,
.tank-card::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.tank-card::before {
  inset: -55% 40% 42% -20%;
  background: radial-gradient(circle, color-mix(in srgb, var(--quality-color), transparent 26%), transparent 64%);
  opacity: 0.54;
}

.tank-card::after {
  right: 10px;
  bottom: 10px;
  width: 46px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--quality-color), var(--tank-secondary));
  box-shadow: 0 0 18px color-mix(in srgb, var(--quality-color), transparent 42%);
  opacity: 0.72;
}

.tank-card:hover,
.tank-card:focus-visible,
.tank-card.is-selected {
  border-color: var(--tank-secondary);
  box-shadow:
    0 0 22px color-mix(in srgb, var(--tank-accent), transparent 48%),
    0 0 34px color-mix(in srgb, var(--tank-secondary), transparent 62%),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tank-ship-visual,
.tank-card-top,
.tank-card-meta,
.tank-stat-stack,
.tank-card-features {
  position: relative;
  z-index: 1;
}

.tank-ship-visual {
  width: 100%;
  min-height: var(--ship-visual-height);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--tank-secondary), transparent 32%);
  border-radius: 8px;
  background:
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--quality-color), transparent 50%), transparent 18%),
    radial-gradient(circle at 28% 42%, color-mix(in srgb, var(--tank-secondary), transparent 55%), transparent 27%),
    linear-gradient(145deg, color-mix(in srgb, var(--tank-accent), transparent 72%), rgba(4, 8, 14, 0.92));
  box-shadow:
    0 0 18px color-mix(in srgb, var(--quality-color), transparent 50%),
    inset 0 0 18px color-mix(in srgb, var(--quality-color), transparent 88%),
    inset 0 -8px 18px rgba(0, 0, 0, 0.24);
}

.tank-ship-field,
.tank-ship-orbit,
.tank-ship,
.tank-symbol-badge,
.tank-quality-badge {
  position: absolute;
  pointer-events: none;
}

.tank-ship-field {
  inset: -24px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--quality-color), transparent 18%) 0 1px, transparent 2px),
    linear-gradient(115deg, transparent 0 42%, color-mix(in srgb, var(--tank-accent), transparent 70%) 45%, transparent 50%);
  background-size: 28px 28px, 160px 100%;
  opacity: 0.55;
  animation: tankStarSweep 4.8s linear infinite;
}

.tank-ship-orbit {
  width: calc(88px * var(--ship-scale));
  height: calc(88px * var(--ship-scale));
  border: 1px solid color-mix(in srgb, var(--quality-color), transparent 34%);
  border-style: dashed;
  border-radius: 999px;
  box-shadow: 0 0 20px color-mix(in srgb, var(--quality-color), transparent 52%);
  animation: tankOrbitSpin 8s linear infinite;
}

.tank-ship {
  width: 118px;
  height: 58px;
  transform: translateY(1px) scale(var(--ship-scale));
  animation: tankShipHover 1.9s ease-in-out infinite;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--quality-color), transparent 38%));
}

.tank-hull,
.tank-wing,
.tank-cockpit,
.tank-thruster {
  position: absolute;
  display: block;
}

.tank-hull {
  left: 27px;
  top: 19px;
  width: 64px;
  height: 21px;
  background: linear-gradient(90deg, var(--tank-secondary), var(--quality-color), var(--tank-accent));
  clip-path: polygon(0 50%, 18% 0, 78% 0, 100% 50%, 78% 100%, 18% 100%);
  box-shadow: inset 0 -7px 10px rgba(0, 0, 0, 0.22);
}

.tank-wing {
  top: 17px;
  width: 36px;
  height: 24px;
  background: color-mix(in srgb, var(--quality-color), var(--tank-accent) 38%);
  clip-path: polygon(0 50%, 100% 0, 82% 100%);
  opacity: 0.92;
}

.tank-wing-left {
  left: 10px;
  transform: scaleY(-1) rotate(-6deg);
}

.tank-wing-right {
  right: 10px;
  transform: rotate(6deg);
}

.tank-cockpit {
  left: 50px;
  top: 8px;
  width: 22px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px 999px 40% 40%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), color-mix(in srgb, var(--quality-color), transparent 18%));
}

.tank-thruster {
  left: 2px;
  top: 24px;
  width: 32px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--quality-color), var(--tank-accent));
  box-shadow: 0 0 22px color-mix(in srgb, var(--quality-color), transparent 18%);
  animation: tankThrusterPulse 620ms ease-in-out infinite alternate;
}

.tank-symbol-badge,
.tank-quality-badge {
  left: 10px;
  bottom: 8px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--tank-secondary), transparent 22%);
  border-radius: 999px;
  color: #071012;
  background: linear-gradient(135deg, var(--tank-secondary), var(--tank-accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--tank-accent), transparent 46%);
  font-size: 0.72rem;
  font-weight: 1000;
}

.tank-quality-badge {
  inset: 8px 8px auto auto;
  left: auto;
  bottom: auto;
  border-color: color-mix(in srgb, var(--quality-color), transparent 22%);
  background: linear-gradient(135deg, var(--quality-color), color-mix(in srgb, var(--quality-color), var(--tank-accent) 34%));
}

.tank-card[data-quality="tuned"] .tank-wing-left {
  transform: translateX(-3px) scaleY(-1) rotate(-10deg);
}

.tank-card[data-quality="tuned"] .tank-wing-right {
  transform: translateX(3px) rotate(10deg);
}

.tank-card[data-quality="prime"] .tank-thruster,
.tank-card[data-quality="apex"] .tank-thruster,
.tank-card[data-quality="mythic"] .tank-thruster {
  width: 40px;
}

.tank-card[data-quality="prime"] .tank-hull {
  clip-path: polygon(0 50%, 20% 0, 72% 0, 100% 50%, 72% 100%, 20% 100%);
}

.tank-card[data-quality="apex"] .tank-wing,
.tank-card[data-quality="mythic"] .tank-wing {
  width: 42px;
  height: 29px;
}

.tank-card[data-quality="apex"] .tank-hull,
.tank-card[data-quality="mythic"] .tank-hull {
  width: 72px;
  clip-path: polygon(0 50%, 16% 0, 82% 0, 100% 50%, 82% 100%, 16% 100%);
}

.tank-card[data-quality="mythic"] .tank-ship-orbit {
  border-style: solid;
  box-shadow:
    0 0 18px color-mix(in srgb, var(--quality-color), transparent 36%),
    0 0 34px color-mix(in srgb, var(--tank-accent), transparent 62%);
}

.tank-card[data-quality="mythic"] .tank-cockpit {
  width: 28px;
  height: 22px;
}

.tank-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.tank-card-top strong {
  font-size: 0.98rem;
  line-height: 1.12;
}

.tank-card-top em {
  justify-self: end;
  padding: 5px 7px;
  border-radius: 999px;
  color: #071012;
  background: var(--tank-secondary);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.tank-card-meta,
.tank-card-features {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.32;
}

.tank-stat-stack {
  display: grid;
  gap: 7px;
}

.tank-stat-row {
  display: grid;
  gap: 4px;
}

.tank-stat-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.tank-stat-value {
  color: color-mix(in srgb, var(--tank-secondary), var(--text) 30%);
}

.tank-stat-track {
  height: 7px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tank-secondary), transparent 62%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.tank-stat-fill {
  width: var(--stat-value);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tank-secondary), var(--tank-accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--tank-accent), transparent 40%);
  animation: tankStatPulse 1.7s ease-in-out infinite alternate;
}

.tank-card-features {
  color: color-mix(in srgb, var(--tank-secondary), var(--text) 28%);
  padding-right: 48px;
}

.tank-actions {
  order: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  position: relative;
  z-index: 3;
}

.powerup-dialog {
  width: min(96vw, 980px);
  max-width: 980px;
  border: 0;
  margin: clamp(10px, 3.8vh, 34px) auto auto;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.powerup-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(7px);
}

.powerup-panel {
  position: relative;
  isolation: isolate;
  max-height: min(88vh, 760px);
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: clamp(14px, 2.2vw, 22px);
  border: 1px solid rgba(244, 183, 64, 0.32);
  border-radius: 8px 8px 0 0;
  background:
    radial-gradient(circle at 14% 0%, rgba(244, 183, 64, 0.18), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(45, 212, 191, 0.17), transparent 32%),
    linear-gradient(145deg, rgba(11, 14, 20, 0.96), rgba(28, 18, 31, 0.96) 46%, rgba(11, 26, 25, 0.97)),
    #0a1016;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), 97% 100%, 3% 100%, 0 calc(100% - 20px));
  box-shadow:
    0 0 34px rgba(244, 183, 64, 0.18),
    0 0 58px rgba(45, 212, 191, 0.14),
    var(--shadow);
  animation: powerupDropdown 260ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

.powerup-panel::before,
.powerup-panel::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.powerup-panel::before {
  z-index: -2;
  background:
    radial-gradient(circle, rgba(244, 183, 64, 0.16) 0 1px, transparent 2px),
    linear-gradient(90deg, transparent 0 92%, rgba(45, 212, 191, 0.12) 94%, transparent 100%);
  background-size: 34px 34px, 48px 48px;
  opacity: 0.42;
  animation: powerupLabDrift 8s linear infinite;
}

.powerup-panel::after {
  z-index: -1;
  background:
    radial-gradient(circle at 18% 18%, rgba(244, 183, 64, 0.18), transparent 24%),
    radial-gradient(circle at 78% 14%, rgba(255, 79, 216, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 32%, rgba(45, 212, 191, 0.05));
}

.powerup-panel > * {
  position: relative;
  z-index: 1;
}

.powerup-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.powerup-panel-header h2 {
  margin: 5px 0 0;
  font-size: clamp(1.55rem, 4.4vw, 2.7rem);
  line-height: 1;
}

.powerup-status,
.powerup-inventory {
  border: 1px solid rgba(100, 168, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(100, 168, 255, 0.08), rgba(244, 183, 64, 0.07)),
    rgba(16, 18, 20, 0.68);
}

.powerup-status {
  padding: 12px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

.powerup-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
}

.powerup-chip,
.powerup-pack-item {
  --powerup-accent: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 9px 5px 5px;
  border: 1px solid color-mix(in srgb, var(--powerup-accent), transparent 42%);
  border-radius: 999px;
  color: color-mix(in srgb, var(--powerup-accent), var(--text) 18%);
  background: color-mix(in srgb, var(--powerup-accent), transparent 88%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--powerup-accent), transparent 82%);
  font-size: 0.74rem;
  font-weight: 950;
}

.powerup-art,
.powerup-pack-preview-art,
.powerup-chip-art,
.powerup-control-art {
  --powerup-accent: var(--teal);
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--powerup-accent), transparent 34%);
  color: #071012;
  background:
    radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--powerup-accent), white 22%), transparent 22%),
    linear-gradient(145deg, color-mix(in srgb, var(--powerup-accent), transparent 22%), rgba(5, 10, 16, 0.88));
  box-shadow:
    0 0 18px color-mix(in srgb, var(--powerup-accent), transparent 54%),
    inset 0 -9px 16px rgba(0, 0, 0, 0.26);
}

.powerup-art-field,
.powerup-art-ring,
.powerup-art-core,
.powerup-art-glyph,
.powerup-art-spark,
.powerup-pack-preview-count {
  position: absolute;
  pointer-events: none;
}

.powerup-art-field {
  inset: -22%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--powerup-accent), transparent 16%) 0 1px, transparent 2px),
    linear-gradient(115deg, transparent 0 38%, color-mix(in srgb, var(--powerup-accent), transparent 52%) 45%, transparent 52%);
  background-size: 22px 22px, 120px 100%;
  opacity: 0.62;
  animation: powerupImageDrift 4.5s linear infinite;
}

.powerup-art-ring {
  width: 58%;
  height: 58%;
  border: 1px dashed color-mix(in srgb, var(--powerup-accent), white 18%);
  border-radius: 999px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--powerup-accent), transparent 48%);
  animation: powerupRingSpin 6s linear infinite;
}

.powerup-art-core {
  width: 34%;
  height: 34%;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7cf, var(--powerup-accent));
  box-shadow:
    0 0 18px color-mix(in srgb, var(--powerup-accent), transparent 18%),
    inset 0 -6px 10px rgba(0, 0, 0, 0.2);
  animation: powerupCorePulse 1.4s ease-in-out infinite alternate;
}

.powerup-art-glyph {
  z-index: 2;
  color: #071012;
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0;
}

.powerup-art-spark {
  width: 54%;
  height: 8%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fffbd4, var(--powerup-accent), transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--powerup-accent), transparent 22%);
  animation: powerupSparkSweep 1.25s ease-in-out infinite;
}

.powerup-pack-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  min-height: 116px;
  padding: 10px;
  border: 1px solid rgba(100, 168, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(100, 168, 255, 0.08), rgba(244, 183, 64, 0.06)),
    rgba(4, 8, 14, 0.52);
}

.powerup-pack-preview-art {
  min-height: 92px;
  border-radius: 8px;
}

.powerup-pack-preview-count {
  right: 6px;
  bottom: 6px;
  z-index: 3;
  padding: 3px 5px;
  border-radius: 999px;
  color: #071012;
  background: #f9fff0;
  font-size: 0.62rem;
  font-weight: 1000;
}

.powerup-chip-art {
  width: 24px;
  height: 24px;
  border-radius: 999px;
}

.powerup-chip-art .powerup-art-field,
.powerup-chip-art .powerup-art-ring,
.powerup-chip-art .powerup-art-spark {
  opacity: 0.42;
}

.powerup-chip-art .powerup-art-glyph {
  font-size: 0.48rem;
}

.powerup-control-art {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.powerup-control-art .powerup-art-glyph {
  font-size: 0.48rem;
}

.powerup-control-art .powerup-art-ring {
  width: 64%;
  height: 64%;
}

.powerup-art[data-powerup="magnet"] .powerup-art-core,
.powerup-pack-preview-art[data-powerup="magnet"] .powerup-art-core,
.powerup-chip-art[data-powerup="magnet"] .powerup-art-core,
.powerup-control-art[data-powerup="magnet"] .powerup-art-core {
  border-radius: 4px;
  clip-path: polygon(0 0, 38% 0, 38% 58%, 62% 58%, 62% 0, 100% 0, 100% 100%, 72% 100%, 72% 36%, 28% 36%, 28% 100%, 0 100%);
}

.powerup-art[data-powerup="blaster"] .powerup-art-core,
.powerup-pack-preview-art[data-powerup="blaster"] .powerup-art-core,
.powerup-chip-art[data-powerup="blaster"] .powerup-art-core,
.powerup-control-art[data-powerup="blaster"] .powerup-art-core {
  clip-path: polygon(12% 0, 100% 0, 62% 38%, 88% 38%, 28% 100%, 42% 55%, 0 55%);
}

.powerup-art[data-powerup="heal"] .powerup-art-core,
.powerup-pack-preview-art[data-powerup="heal"] .powerup-art-core,
.powerup-chip-art[data-powerup="heal"] .powerup-art-core,
.powerup-control-art[data-powerup="heal"] .powerup-art-core {
  border-radius: 3px;
  clip-path: polygon(34% 0, 66% 0, 66% 34%, 100% 34%, 100% 66%, 66% 66%, 66% 100%, 34% 100%, 34% 66%, 0 66%, 0 34%, 34% 34%);
}

.powerup-art[data-powerup="warp"] .powerup-art-core,
.powerup-pack-preview-art[data-powerup="warp"] .powerup-art-core,
.powerup-chip-art[data-powerup="warp"] .powerup-art-core,
.powerup-control-art[data-powerup="warp"] .powerup-art-core {
  border-radius: 28% 72% 32% 68%;
  transform: rotate(45deg);
}

.powerup-art[data-powerup="surge"] .powerup-art-core,
.powerup-pack-preview-art[data-powerup="surge"] .powerup-art-core,
.powerup-chip-art[data-powerup="surge"] .powerup-art-core,
.powerup-control-art[data-powerup="surge"] .powerup-art-core {
  clip-path: polygon(45% 0, 72% 0, 58% 35%, 90% 35%, 36% 100%, 48% 55%, 18% 55%);
}

.powerup-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 10px;
}

.powerup-pack-card {
  position: relative;
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(45, 212, 191, 0.09), rgba(255, 79, 216, 0.07)),
    rgba(16, 18, 20, 0.78);
  box-shadow:
    0 0 18px rgba(45, 212, 191, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.powerup-pack-card::before {
  position: absolute;
  inset: -22% -18% auto auto;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(244, 183, 64, 0.24), transparent 68%);
  pointer-events: none;
  content: "";
}

.powerup-pack-card.is-free {
  border-color: rgba(183, 228, 95, 0.34);
  box-shadow:
    0 0 20px rgba(183, 228, 95, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.powerup-pack-title {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.powerup-pack-title h3,
.powerup-pack-card p {
  margin: 0;
}

.powerup-pack-title h3 {
  font-size: 1.1rem;
  line-height: 1.15;
}

.powerup-pack-title strong {
  padding: 6px 8px;
  border-radius: 999px;
  color: #071012;
  background: linear-gradient(135deg, var(--lime), var(--amber));
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
}

.powerup-pack-card p {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
  line-height: 1.38;
}

.powerup-pack-contents {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.powerup-pack-card .primary-button,
.powerup-pack-card .ghost-button {
  position: relative;
  z-index: 1;
}

.wallet-dialog {
  width: min(92vw, 520px);
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.wallet-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(5px);
}

.wallet-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(45, 212, 191, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(45, 212, 191, 0.1), rgba(139, 92, 246, 0.12), rgba(255, 79, 216, 0.08)),
    #12181d;
  box-shadow:
    0 0 30px rgba(45, 212, 191, 0.22),
    0 0 46px rgba(255, 79, 216, 0.12),
    var(--shadow);
}

.wallet-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.wallet-panel-header h2 {
  margin: 5px 0 0;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1;
}

.icon-button {
  width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 79, 216, 0.34);
  background: rgba(16, 18, 20, 0.72);
  box-shadow: 0 0 18px rgba(255, 79, 216, 0.12);
  font-weight: 950;
}

.wallet-status,
.wallet-proof {
  padding: 12px;
  border: 1px solid rgba(100, 168, 255, 0.26);
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(100, 168, 255, 0.08), rgba(45, 212, 191, 0.06)),
    rgba(16, 18, 20, 0.7);
  line-height: 1.4;
}

.wallet-options {
  display: grid;
  gap: 8px;
}

.wallet-option {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.1), rgba(255, 79, 216, 0.08)),
    rgba(16, 18, 20, 0.74);
  box-shadow:
    0 0 16px rgba(45, 212, 191, 0.12),
    0 0 22px rgba(255, 79, 216, 0.08);
  text-align: left;
  text-decoration: none;
}

.wallet-option:hover,
.wallet-option:focus-visible {
  border-color: rgba(255, 79, 216, 0.58);
  box-shadow:
    0 0 22px rgba(45, 212, 191, 0.18),
    0 0 30px rgba(255, 79, 216, 0.18);
}

.wallet-option-copy,
.wallet-option-title,
.wallet-option-detail {
  min-width: 0;
}

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

.wallet-option-title {
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.18;
}

.wallet-option-detail {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.wallet-option-action {
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.wallet-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.wallet-detail-grid article {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.12);
}

.wallet-detail-grid span,
.wallet-proof span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.wallet-detail-grid strong {
  min-height: 1.4rem;
  font-size: 1rem;
}

.wallet-proof p {
  margin: 6px 0 0;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

:root[data-theme="light"] .arcade-shell {
  border-color: rgba(0, 143, 133, 0.34);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(231, 245, 249, 0.94) 45%, rgba(242, 236, 255, 0.88)),
    rgba(255, 255, 255, 0.94);
  box-shadow:
    0 0 28px rgba(0, 143, 133, 0.18),
    0 0 48px rgba(192, 25, 147, 0.1),
    var(--shadow);
}

:root[data-theme="light"] .topbar {
  border-bottom-color: rgba(0, 143, 133, 0.22);
  background:
    linear-gradient(90deg, rgba(0, 143, 133, 0.1), rgba(38, 111, 224, 0.08), rgba(192, 25, 147, 0.08)),
    rgba(255, 255, 255, 0.62);
}

:root[data-theme="light"] .coming-soon-strip {
  border-color: rgba(0, 143, 133, 0.24);
  background:
    linear-gradient(90deg, rgba(0, 143, 133, 0.1), rgba(192, 25, 147, 0.07), rgba(244, 183, 64, 0.08)),
    rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .brand-mark {
  background:
    linear-gradient(135deg, rgba(0, 143, 133, 0.16), rgba(38, 111, 224, 0.13)),
    #ffffff;
}

:root[data-theme="light"] .brand-mark span {
  box-shadow: inset 0 0 0 5px #ffffff;
}

:root[data-theme="light"] .wallet-button,
:root[data-theme="light"] .music-button,
:root[data-theme="light"] .theme-button {
  background:
    linear-gradient(135deg, rgba(0, 143, 133, 0.13), rgba(38, 111, 224, 0.1)),
    #ffffff;
}

:root[data-theme="light"] .stage-card,
:root[data-theme="light"] .side-panel > section,
:root[data-theme="light"] .action-panel {
  border-color: rgba(0, 143, 133, 0.22);
  background:
    linear-gradient(145deg, rgba(0, 143, 133, 0.06), rgba(38, 111, 224, 0.05) 44%, rgba(192, 25, 147, 0.05)),
    rgba(255, 255, 255, 0.86);
}

:root[data-theme="light"] .canvas-wrap {
  border-color: rgba(0, 143, 133, 0.36);
  box-shadow:
    0 0 28px rgba(0, 143, 133, 0.18),
    0 0 42px rgba(109, 67, 216, 0.12),
    inset 0 0 28px rgba(38, 111, 224, 0.1);
}

:root[data-theme="light"] .screen-banner {
  background:
    linear-gradient(135deg, rgba(0, 143, 133, 0.18), rgba(109, 67, 216, 0.14), rgba(192, 25, 147, 0.1)),
    rgba(242, 248, 252, 0.78);
}

:root[data-theme="light"] .screen-banner h2,
:root[data-theme="light"] .screen-banner p {
  color: var(--text);
}

:root[data-theme="light"] .hud-strip article,
:root[data-theme="light"] .mission-grid article,
:root[data-theme="light"] .wallet-detail-grid article {
  background:
    linear-gradient(135deg, rgba(0, 143, 133, 0.11), rgba(38, 111, 224, 0.08)),
    var(--surface-2);
}

:root[data-theme="light"] .race-progress-card {
  border-color: rgba(0, 143, 133, 0.24);
  background:
    linear-gradient(135deg, rgba(0, 143, 133, 0.1), rgba(38, 111, 224, 0.07), rgba(244, 183, 64, 0.08)),
    rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .race-progress-track {
  background:
    linear-gradient(90deg, rgba(38, 111, 224, 0.12), rgba(192, 25, 147, 0.08)),
    rgba(255, 255, 255, 0.8);
}

:root[data-theme="light"] .reward-card {
  background:
    linear-gradient(135deg, rgba(180, 109, 0, 0.12), rgba(192, 25, 147, 0.08)),
    #fff8e8;
}

:root[data-theme="light"] .database-card {
  background:
    linear-gradient(135deg, rgba(38, 111, 224, 0.08), rgba(0, 143, 133, 0.07), rgba(192, 25, 147, 0.05)),
    #f8fcff;
}

:root[data-theme="light"] .database-empty,
:root[data-theme="light"] .database-player,
:root[data-theme="light"] .wallet-status,
:root[data-theme="light"] .wallet-proof,
:root[data-theme="light"] .wallet-option {
  background:
    linear-gradient(135deg, rgba(38, 111, 224, 0.08), rgba(0, 143, 133, 0.06)),
    rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .control-button {
  background:
    linear-gradient(135deg, rgba(38, 111, 224, 0.18), rgba(109, 67, 216, 0.1)),
    var(--surface-2);
}

:root[data-theme="light"] .control-button.shield {
  background:
    linear-gradient(135deg, rgba(0, 143, 133, 0.16), rgba(92, 158, 24, 0.12)),
    #e8f7f2;
}

:root[data-theme="light"] .primary-button {
  color: #061315;
}

:root[data-theme="light"] .ghost-button {
  background: rgba(255, 255, 255, 0.76);
}

:root[data-theme="light"] .wallet-dialog::backdrop {
  background: rgba(234, 245, 249, 0.68);
}

:root[data-theme="light"] .tank-dialog::backdrop {
  background: rgba(234, 245, 249, 0.74);
}

:root[data-theme="light"] .powerup-dialog::backdrop {
  background: rgba(234, 245, 249, 0.74);
}

:root[data-theme="light"] .tank-panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(192, 25, 147, 0.13), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(0, 143, 133, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(237, 246, 255, 0.97) 46%, rgba(240, 255, 252, 0.98)),
    #ffffff;
}

:root[data-theme="light"] .tank-status,
:root[data-theme="light"] .tank-selected,
:root[data-theme="light"] .tank-card {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tank-accent, var(--teal)), transparent 91%), rgba(255, 255, 255, 0.88)),
    #ffffff;
}

:root[data-theme="light"] .powerup-button,
:root[data-theme="light"] .powerup-bar,
:root[data-theme="light"] .powerup-panel,
:root[data-theme="light"] .powerup-status,
:root[data-theme="light"] .powerup-inventory,
:root[data-theme="light"] .powerup-pack-card {
  background:
    linear-gradient(145deg, rgba(0, 143, 133, 0.07), rgba(244, 183, 64, 0.06), rgba(192, 25, 147, 0.04)),
    #ffffff;
}

:root[data-theme="light"] .wallet-panel {
  background:
    linear-gradient(145deg, rgba(0, 143, 133, 0.1), rgba(38, 111, 224, 0.09), rgba(192, 25, 147, 0.06)),
    #ffffff;
}

@media (min-width: 720px) {
  .app-shell {
    width: min(100% - 36px, 1540px);
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .topbar,
  .game-layout {
    padding: 18px;
  }

  .stage-card {
    padding: 14px;
  }

  .canvas-wrap {
    min-height: 430px;
    height: min(58vh, 680px);
  }
}

@media (max-width: 720px) {
  .intro-content h1 {
    font-size: 4.85rem;
    white-space: normal;
  }
}

@media (min-width: 1060px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }

  .stage-card {
    grid-template-areas:
      "hud hud"
      "progress progress"
      "arena arena"
      "controls powerups";
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    grid-template-rows: auto auto minmax(320px, 1fr) auto;
    align-items: stretch;
  }

  .canvas-wrap {
    min-height: 320px;
    height: min(43vh, 660px);
  }

  .touch-controls {
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
  }

  .powerup-bar {
    position: relative;
    bottom: auto;
    align-self: stretch;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
}

@media (min-width: 1380px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 390px;
  }

  .canvas-wrap {
    min-height: 390px;
    height: min(50vh, 720px);
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 12px, 1540px);
    align-content: start;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .coming-soon-strip {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 7px;
    text-align: center;
  }

  .wallet-button,
  .theme-button {
    width: 100%;
    max-width: none;
    justify-content: center;
  }

  .top-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .music-button {
    width: 100%;
    max-width: none;
    justify-content: center;
  }

  .game-layout {
    padding: 8px;
  }

  .stage-card {
    grid-template-areas:
      "hud"
      "progress"
      "arena"
      "powerups"
      "controls";
    grid-template-rows: auto auto minmax(360px, 58vh) auto auto;
    padding: 8px;
  }

  .hud-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud-strip article {
    min-height: 50px;
  }

  .race-progress-card {
    padding: 9px;
  }

  .race-progress-card p {
    font-size: 0.72rem;
  }

  .canvas-wrap {
    height: auto;
    min-height: 360px;
  }

  .screen-banner {
    padding: 18px;
  }

  .intro-content {
    gap: 8px;
  }

  .intro-content h1 {
    font-size: 3.55rem;
    line-height: 0.92;
    white-space: normal;
  }

  .intro-content span {
    max-width: 18rem;
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .intro-skip {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .touch-controls {
    grid-template-columns: 1fr 1.08fr 1fr;
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 9;
  }

  .powerup-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    bottom: calc(62px + max(12px, env(safe-area-inset-bottom)));
    gap: 5px;
    padding: 5px;
  }

  .powerup-button {
    min-height: 58px;
    padding-inline: 4px;
  }

  .powerup-button > span:not(.powerup-control-art) {
    font-size: 0.68rem;
  }

  .powerup-button > small {
    font-size: 0.63rem;
  }

  .powerup-control-art {
    width: 26px;
    height: 26px;
  }

  .control-button {
    min-height: 52px;
  }

  .reward-card {
    grid-template-columns: 1fr;
  }

  .action-panel {
    grid-template-columns: 1fr;
  }

  .action-panel .primary-button {
    grid-column: auto;
  }

  .database-actions {
    grid-template-columns: 1fr;
  }

  .wallet-detail-grid {
    grid-template-columns: 1fr;
  }

  .tank-panel {
    height: auto;
    max-height: 92dvh;
    align-content: start;
    gap: 10px;
    overflow: auto;
    padding: 12px;
    clip-path: none;
    border-radius: 8px;
    grid-template-rows: auto auto auto auto auto auto;
  }

  .tank-panel-header {
    gap: 8px;
  }

  .tank-panel-header h2 {
    font-size: 1.45rem;
  }

  .tank-status {
    padding: 9px 10px;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .tank-selected {
    grid-template-columns: minmax(92px, 112px) minmax(0, 1fr);
    gap: 9px;
    padding: 9px;
  }

  .tank-selected-preview {
    min-height: 88px;
  }

  .tank-selected-preview .tank-ship-visual {
    min-height: 88px;
  }

  .tank-selected-preview .tank-quality-badge {
    top: 6px;
    right: 6px;
    padding: 4px 5px;
    font-size: 0.52rem;
  }

  .tank-selected-preview .tank-symbol-badge {
    left: 6px;
    bottom: 6px;
    padding: 4px 5px;
    font-size: 0.58rem;
  }

  .tank-selected-copy > strong {
    font-size: 1rem;
  }

  .tank-selected-copy > p {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .tank-picker-toggle {
    display: grid;
  }

  .tank-grid {
    grid-template-columns: 1fr;
    max-height: 0;
    min-height: 0;
    overflow: hidden;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
    transition:
      max-height 220ms ease,
      opacity 180ms ease;
  }

  .tank-grid.is-open {
    max-height: min(42dvh, 360px);
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    opacity: 1;
    pointer-events: auto;
  }

  .tank-card {
    min-height: 0;
    grid-template-columns: minmax(94px, 118px) minmax(0, 1fr);
    grid-template-areas:
      "art top"
      "art meta"
      "stats stats"
      "features features";
    align-items: center;
    gap: 8px 10px;
    padding: 10px;
  }

  .tank-card .tank-ship-visual {
    grid-area: art;
    min-height: 92px;
    height: 100%;
  }

  .tank-card .tank-ship {
    width: 98px;
  }

  .tank-card-top {
    grid-area: top;
  }

  .tank-card-meta {
    grid-area: meta;
  }

  .tank-stat-stack {
    grid-area: stats;
  }

  .tank-card-features {
    grid-area: features;
    padding-right: 0;
  }

  .tank-card-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .tank-card-top em {
    justify-self: start;
  }

  .tank-actions {
    position: sticky;
    bottom: -1px;
    padding-top: 6px;
    background:
      linear-gradient(180deg, transparent, rgba(8, 12, 18, 0.92) 28%),
      rgba(8, 12, 18, 0.9);
  }

  .powerup-panel {
    max-height: 90vh;
    gap: 10px;
    padding: 12px;
  }

  .powerup-pack-grid {
    grid-template-columns: 1fr;
  }

  .powerup-pack-preview {
    gap: 5px;
    min-height: 96px;
    padding: 8px;
  }

  .powerup-pack-preview-art {
    min-height: 78px;
  }
}

@media (max-width: 720px) {
  body.run-active .app-shell {
    width: min(100% - 8px, 1540px);
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  body.run-active .topbar {
    gap: 7px;
    padding: 8px;
  }

  body.run-active .brand-mark {
    width: 34px;
    height: 34px;
  }

  body.run-active .brand-mark span {
    width: 16px;
    height: 16px;
  }

  body.run-active .title-block .eyebrow {
    display: none;
  }

  body.run-active #appTitle {
    margin: 0;
    font-size: clamp(0.95rem, 4.8vw, 1.2rem);
  }

  body.run-active .top-actions {
    gap: 5px;
  }

  body.run-active .wallet-button,
  body.run-active .music-button,
  body.run-active .theme-button {
    min-height: 36px;
    padding: 0 7px;
    font-size: 0.72rem;
  }

  body.run-active .game-layout {
    gap: 7px;
    padding: 6px;
  }

  body.run-active .stage-card {
    gap: 7px;
    padding: 6px;
    grid-template-rows: auto auto minmax(360px, 58dvh) auto auto;
  }

  body.run-active .hud-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  body.run-active .hud-strip article {
    min-height: 42px;
    padding: 5px 4px;
  }

  body.run-active .hud-strip span {
    font-size: 0.52rem;
  }

  body.run-active .hud-strip strong {
    font-size: clamp(0.82rem, 4.1vw, 1.08rem);
  }

  body.run-active .race-progress-card {
    gap: 5px;
    padding: 7px 8px;
  }

  body.run-active .race-progress-card p {
    display: none;
  }

  body.run-active .race-progress-track {
    height: 9px;
  }

  body.run-active .canvas-wrap {
    height: min(58dvh, 500px);
    min-height: 360px;
  }

  body.run-active .powerup-bar {
    position: relative;
    bottom: auto;
  }

  body.run-active .touch-controls {
    position: sticky;
    bottom: max(6px, env(safe-area-inset-bottom));
  }

  body.run-active .side-panel,
  body.run-active .coming-soon-strip {
    display: none;
  }
}

@media (max-width: 330px) {
  .intro-content h1 {
    font-size: 3.05rem;
  }

  .intro-kicker,
  .intro-content span {
    font-size: 0.76rem;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .touch-controls {
    grid-template-columns: 1fr 1.08fr 1fr;
  }

  .powerup-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
  }

  .powerup-button {
    min-height: 54px;
  }

  .powerup-button > span:not(.powerup-control-art) {
    font-size: 0.56rem;
  }

  .powerup-button > small {
    font-size: 0.58rem;
  }

  .powerup-control-art {
    width: 23px;
    height: 23px;
  }
}

@keyframes introGridDrift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 0 64px, 64px 0;
  }
}

@keyframes introSweep {
  0% {
    background-position: -72% 0, 0 0;
  }

  58%,
  100% {
    background-position: 172% 0, 0 220px;
  }
}

@keyframes introRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hudLevelPop {
  0% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.12) translateY(-4px);
    box-shadow:
      0 0 28px rgba(139, 92, 246, 0.42),
      0 0 34px rgba(45, 212, 191, 0.24);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes hudLifeHit {
  0% {
    transform: scale(1);
  }

  20% {
    transform: scale(1.12) rotate(-1deg);
    box-shadow:
      0 0 26px rgba(255, 111, 97, 0.48),
      0 0 34px rgba(255, 79, 216, 0.18);
  }

  52% {
    transform: scale(0.96) rotate(1deg);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes hudBestPop {
  0% {
    transform: scale(1);
  }

  34% {
    transform: scale(1.14) translateY(-4px);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes hudFireRise {
  0% {
    transform: translateY(18px) scaleY(0.4);
    opacity: 0;
  }

  28% {
    opacity: 1;
  }

  100% {
    transform: translateY(-12px) scaleY(1.08);
    opacity: 0;
  }
}

@keyframes tankDropdown {
  from {
    opacity: 0;
    transform: translateY(-24px) scaleY(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes tankHangarDrift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 54px 0, 0 54px;
  }
}

@keyframes tankStarSweep {
  from {
    background-position: 0 0, -120px 0;
  }

  to {
    background-position: 28px 28px, 160px 0;
  }
}

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

@keyframes tankShipHover {
  0%,
  100% {
    transform: translateY(1px) scale(var(--ship-scale));
  }

  50% {
    transform: translateY(-4px) scale(var(--ship-scale));
  }
}

@keyframes tankThrusterPulse {
  from {
    opacity: 0.58;
    transform: translateX(-4px) scaleX(0.82);
  }

  to {
    opacity: 1;
    transform: translateX(-10px) scaleX(1.14);
  }
}

@keyframes tankStatPulse {
  from {
    filter: saturate(0.95);
  }

  to {
    filter: saturate(1.35) brightness(1.1);
  }
}

@keyframes powerupDropdown {
  from {
    opacity: 0;
    transform: translateY(-22px) scaleY(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes powerupLabDrift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 34px 34px, 48px 0;
  }
}

@keyframes powerupImageDrift {
  from {
    background-position: 0 0, -92px 0;
  }

  to {
    background-position: 22px 22px, 124px 0;
  }
}

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

@keyframes powerupCorePulse {
  from {
    filter: saturate(0.9) brightness(0.96);
    scale: 0.94;
  }

  to {
    filter: saturate(1.35) brightness(1.12);
    scale: 1.05;
  }
}

@keyframes powerupSparkSweep {
  0% {
    opacity: 0;
    transform: translateX(-42%) rotate(-8deg);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(42%) rotate(-8deg);
  }
}

@keyframes powerupButtonPulse {
  0%,
  100% {
    transform: scale(0.98);
    box-shadow: 0 0 0 color-mix(in srgb, var(--powerup-accent), transparent 100%);
  }

  50% {
    transform: scale(1.04);
    box-shadow: 0 0 14px color-mix(in srgb, var(--powerup-accent), transparent 44%);
  }
}

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

  .intro-grid,
  .intro-splash::after,
  .intro-content,
  .hud-card,
  .tank-panel,
  .tank-panel::before,
  .tank-ship-field,
  .tank-ship-orbit,
  .tank-ship,
  .tank-thruster,
  .tank-stat-fill,
  .powerup-panel,
  .powerup-panel::before,
  .powerup-art-field,
  .powerup-art-ring,
  .powerup-art-core,
  .powerup-art-spark,
  .powerup-button::after {
    animation: none !important;
  }
}
