:root {
  color-scheme: dark;
  --bg: #050607;
  --panel: rgba(18, 20, 24, 0.88);
  --panel-strong: rgba(22, 24, 29, 0.96);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f4f2ea;
  --muted: #b5bbc6;
  --accent: #9945ff;
  --accent-2: #14f195;
  --accent-hot: #dc1fff;
  --gold: #f0c04d;
  --danger: #d95252;
  --ok: #55b978;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #030405;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  display: grid;
  place-items: center;
}

body.editor-body {
  display: block;
  overflow: hidden;
  background: #0b0d11;
}

body.home-body {
  display: block;
  min-height: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 15% 0%, rgba(153, 69, 255, 0.24), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(20, 241, 149, 0.18), transparent 26rem),
    #050607;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid rgba(20, 241, 149, 0.55);
  background: linear-gradient(135deg, #14f195, #9945ff 70%, #dc1fff);
  color: #050607;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(153, 69, 255, 0.24);
}

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

input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #101216;
  color: var(--text);
  border-radius: 6px;
  padding: 9px 10px;
}

select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #101216;
  color: var(--text);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}

label span,
dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.6rem;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.game-root {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

#arena {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #08090a;
}

.hud-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: scale(var(--hud-scale, 1));
  transform-origin: center;
}

.hud-top,
.hud-bottom {
  position: absolute;
  left: 20px;
  right: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.hud-top {
  top: 18px;
  justify-content: space-between;
}
.hud-bottom {
  bottom: 16px;
  align-items: flex-end;
}

.combat-sol-hud,
.hud-stat-card {
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 241, 149, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(153, 69, 255, 0.32), rgba(20, 241, 149, 0.12)),
    rgba(5, 6, 9, 0.72);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.34), inset 0 0 24px rgba(153, 69, 255, 0.2);
  backdrop-filter: blur(8px);
}

.combat-sol-hud img,
.hud-stat-card img,
.brand-lockup img,
.result-brand img,
.sol-logo-icon {
  width: 34px;
  height: 28px;
  object-fit: contain;
}

.combat-sol-hud div,
.hud-stat-card {
  display: grid;
  gap: 1px;
}

.combat-sol-hud strong,
.hud-stat-card strong {
  font-size: 0.95rem;
}

.combat-sol-hud span,
.hud-stat-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sol-stat-card {
  grid-template-columns: auto auto;
  align-items: center;
}

.sol-stat-card img {
  grid-row: 1 / span 2;
}

.front-screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  background: #050607;
}

.front-screen[hidden],
.front-page[hidden] {
  display: none;
}

.front-page {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.login-page {
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.72)),
    url("/street-fighter/assets/miscellaneous/Arcade - Street Fighter 2 _ Super Street Fighter 2 - Miscellaneous - Title.png") center / cover no-repeat;
}

.front-logo {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 52%);
  max-height: 180px;
  object-fit: contain;
  image-rendering: pixelated;
}

.character-select-page {
  background: #101216;
}

.select-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
  image-rendering: pixelated;
}

.select-frame {
  position: relative;
  width: min(1660px, calc(100% - 56px));
  height: min(780px, calc(100dvh - 28px));
  min-height: 0;
  padding: 14px 18px;
  border: 1px solid rgba(20, 241, 149, 0.5);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(220, 31, 255, 0.24), transparent 32%),
    radial-gradient(circle at 82% 8%, rgba(20, 241, 149, 0.18), transparent 28%),
    rgba(8, 9, 14, 0.86);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 70px rgba(153, 69, 255, 0.22);
  backdrop-filter: blur(5px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.hud-card,
.login-card,
.select-card,
.menu-shell,
.picker-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.hud-card {
  min-width: 190px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}

.player-card {
  align-content: start;
  text-align: right;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.subtle {
  color: var(--muted);
  font-size: 0.84rem;
}

.sol-line {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

.sol-icon {
  display: inline-grid;
  place-items: center;
  min-width: 31px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  background: linear-gradient(135deg, #7ee7c8, #7a5cff 55%, #f0c04d);
  color: #08090a;
  font-size: 0.62rem;
  font-weight: 1000;
}

.sol-logo-icon {
  filter: drop-shadow(0 0 12px rgba(153, 69, 255, 0.5));
}

.icon-button {
  pointer-events: auto;
  min-width: 70px;
}

.login-card,
.select-card {
  pointer-events: auto;
}

.login-card {
  width: min(820px, calc(100% - 140px));
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.select-card {
  width: min(920px, calc(100% - 500px));
  padding: 12px;
}

.select-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 1.1rem;
}

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

.brand-lockup strong {
  display: block;
  font-size: 1.05rem;
}

.select-title {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.select-title strong {
  font-size: 1.25rem;
  text-shadow: 0 0 18px rgba(20, 241, 149, 0.35);
}

.select-heading #queue-button {
  justify-self: end;
  min-width: 170px;
  min-height: 42px;
  font-size: 1.05rem;
}

.select-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 300px minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: stretch;
}

.fighter-showcase,
.roster-panel,
.leaderboard-panel {
  min-height: 0;
  border: 1px solid rgba(153, 69, 255, 0.42);
  border-radius: 8px;
  background: rgba(10, 12, 20, 0.78);
  box-shadow: inset 0 0 28px rgba(153, 69, 255, 0.14);
  overflow: hidden;
}

.fighter-showcase {
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 8px;
  align-content: start;
}

#selected-fighter-preview {
  width: 100%;
  height: 240px;
  image-rendering: pixelated;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 241, 149, 0.09), rgba(153, 69, 255, 0.12)),
    rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.fighter-showcase h2 {
  margin: 0;
  font-size: 1.55rem;
}

.fighter-showcase p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.select-wallet-stats {
  align-self: end;
  display: grid;
  gap: 6px;
}

.select-wallet-stats div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.select-wallet-stats span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.select-wallet-stats strong {
  overflow-wrap: anywhere;
}

.roster-panel {
  padding: 12px;
}

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

.character-card {
  min-width: 0;
  min-height: 88px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(153, 69, 255, 0.14), transparent 58%),
    rgba(31, 34, 40, 0.92);
  color: var(--text);
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 10px;
  text-align: left;
  box-shadow: none;
}

.character-card.is-selected {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--accent-2), 0 0 28px rgba(20, 241, 149, 0.18);
  background:
    linear-gradient(135deg, rgba(20, 241, 149, 0.18), rgba(153, 69, 255, 0.2)),
    rgba(31, 34, 40, 0.95);
}

.character-card:hover {
  border-color: rgba(220, 31, 255, 0.72);
}

.character-thumb {
  width: 88px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.character-thumb canvas,
.sprite-cell canvas,
.candidate-card canvas {
  image-rendering: pixelated;
}

.character-name {
  max-width: 100%;
  font-size: 0.9rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-card .character-details {
  display: grid;
  gap: 5px;
}

.character-card .character-tag {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-panel {
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.leaderboard-panel header,
.leaderboard-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.leaderboard-tabs button {
  min-height: 30px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
  box-shadow: none;
}

.leaderboard-tabs button.is-active {
  border-color: var(--accent-2);
  background: linear-gradient(135deg, rgba(20, 241, 149, 0.9), rgba(153, 69, 255, 0.8));
  color: #050607;
}

.leaderboard-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.leaderboard-rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(153, 69, 255, 0.28);
  color: var(--accent-2);
  font-weight: 1000;
}

.leaderboard-name {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.leaderboard-name strong,
.leaderboard-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-name span,
.leaderboard-metric span {
  color: var(--muted);
  font-size: 0.72rem;
}

.leaderboard-metric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.leaderboard-list-wide {
  max-width: 920px;
}

.sf-home {
  min-height: 100%;
  color: var(--text);
}

.sf-hero {
  position: relative;
  min-height: 96vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-bottom: 1px solid rgba(20, 241, 149, 0.34);
}

.sf-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: 0.52;
  transform: scale(1.03);
}

.sf-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, #050607 84%);
  pointer-events: none;
}

.sf-hero-scanline {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(153, 69, 255, 0.18), transparent 42%, rgba(20, 241, 149, 0.12)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.sf-home-nav,
.sf-hero-content,
.sf-home-band {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.sf-home-nav {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sf-home-brand,
.home-ca,
.sf-primary-action,
.sf-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sf-home-brand {
  color: #fff;
  font-weight: 1000;
  font-size: 1.02rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sf-home-brand img {
  width: 42px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(153, 69, 255, 0.58));
}

.home-ca {
  max-width: min(640px, 52vw);
  padding: 8px 10px;
  border: 1px solid rgba(20, 241, 149, 0.42);
  border-radius: 8px;
  background: rgba(7, 8, 12, 0.74);
  box-shadow: 0 0 34px rgba(153, 69, 255, 0.22);
  backdrop-filter: blur(8px);
}

.home-ca[hidden] {
  display: none;
}

.home-ca small {
  color: var(--accent-2);
  font-weight: 1000;
}

.home-ca span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.home-ca button {
  min-width: 38px;
  min-height: 32px;
  padding: 0 8px;
}

.sf-hero-content {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  padding: 32px 0 86px;
}

.sf-hero-fighters {
  min-height: 500px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.sf-hero-fighter {
  position: relative;
  min-height: 236px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(20, 241, 149, 0.35);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 76%, rgba(20, 241, 149, 0.16), transparent 42%),
    linear-gradient(135deg, rgba(153, 69, 255, 0.26), rgba(5, 6, 9, 0.64));
  box-shadow: inset 0 0 28px rgba(153, 69, 255, 0.15), 0 16px 40px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.sf-hero-fighter canvas,
.sf-hero-fighter img {
  width: 100%;
  height: 100%;
  min-height: 185px;
  object-fit: contain;
  image-rendering: pixelated;
}

.sf-hero-fighter span {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.sf-hero-copy {
  max-width: 680px;
}

.sf-hero-copy h1 {
  margin: 10px 0 16px;
  font-size: clamp(3.2rem, 7.2vw, 7.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(220, 31, 255, 0.34), 0 0 44px rgba(20, 241, 149, 0.24);
}

.sf-hero-copy p {
  max-width: 650px;
  color: #d9dde6;
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  line-height: 1.5;
}

.sf-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.sf-primary-action,
.sf-secondary-action {
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 7px;
  font-weight: 1000;
}

.sf-primary-action {
  color: #050607;
  background: linear-gradient(135deg, #14f195, #9945ff 65%, #dc1fff);
  box-shadow: 0 0 40px rgba(153, 69, 255, 0.36);
}

.sf-secondary-action {
  color: var(--text);
  border: 1px solid rgba(20, 241, 149, 0.46);
  background: rgba(8, 10, 16, 0.74);
}

.sf-home-band {
  padding: 54px 0;
}

.sf-reward-band {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 26px;
  align-items: stretch;
}

.sf-reward-band h2,
.sf-fighters-section h2 {
  margin: 6px 0 12px;
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.sf-reward-band p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.sf-reward-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sf-reward-cards div,
.sf-fighter-card {
  border: 1px solid rgba(153, 69, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(153, 69, 255, 0.2), rgba(20, 241, 149, 0.08)),
    rgba(14, 16, 22, 0.9);
  box-shadow: inset 0 0 28px rgba(153, 69, 255, 0.12);
}

.sf-reward-cards div {
  min-height: 150px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.sf-reward-cards strong {
  color: var(--accent-2);
  font-size: 1.04rem;
}

.sf-reward-cards span {
  color: #d8dce5;
}

.sf-fighters-section header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.sf-fighter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.sf-fighter-card {
  min-height: 300px;
  padding: 14px;
  display: grid;
  grid-template-rows: minmax(180px, 1fr) auto auto;
  gap: 8px;
}

.sf-fighter-card canvas,
.sf-fighter-card img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  image-rendering: pixelated;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 80%, rgba(20, 241, 149, 0.16), transparent 42%),
    rgba(0, 0, 0, 0.32);
}

.sf-fighter-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.sf-fighter-card span,
.sf-home-empty {
  color: var(--accent-2);
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-height: 820px) {
  .select-frame {
    width: min(1660px, calc(100% - 36px));
    height: calc(100dvh - 18px);
    padding: 10px 14px;
  }

  #selected-fighter-preview {
    height: 205px;
  }

  .character-card {
    min-height: 78px;
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .character-thumb {
    width: 82px;
    height: 64px;
  }

  .leaderboard-row {
    padding: 7px;
  }
}

@media (max-width: 980px) {
  .sf-home-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .home-ca {
    max-width: 100%;
  }

  .sf-hero-content,
  .sf-reward-band {
    grid-template-columns: 1fr;
  }

  .sf-hero-fighters {
    min-height: 280px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .sf-hero-fighter {
    min-height: 170px;
  }

  .sf-hero-fighter canvas {
    min-height: 130px;
  }

  .sf-hero-fighter img {
    min-height: 130px;
  }

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

  .sf-fighters-section header {
    align-items: start;
    flex-direction: column;
  }
}

.menu-overlay,
.sprite-picker {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
}

.menu-overlay[hidden],
.sprite-picker[hidden] {
  display: none;
}

.menu-shell {
  width: min(1500px, calc(100% - 56px));
  height: min(910px, calc(100% - 56px));
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  pointer-events: auto;
}

.menu-header,
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.menu-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-tabs button {
  min-width: 118px;
  background: #22262d;
  border-color: var(--line);
  color: var(--text);
}

.menu-tabs button.is-active {
  border-color: var(--accent-2);
  color: #050607;
  background: linear-gradient(135deg, #14f195, #9945ff 70%, #dc1fff);
}

.menu-pages {
  min-height: 0;
  overflow: hidden;
}

.menu-page {
  display: none;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.menu-page.is-active {
  display: block;
}

.settings-grid,
.controls-list,
.stats-list {
  display: grid;
  gap: 10px;
}

.settings-grid {
  max-width: 520px;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-line input {
  width: auto;
}

.control-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 10px;
  align-items: center;
  max-width: 680px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid #666d78;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #242831;
  color: #fff;
  font-size: 0.75rem;
}

.stats-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
  margin: 0;
}

.stats-list div,
.reward-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.stats-list dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.reward-card {
  max-width: 460px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 12px;
}

.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 34px;
  background: radial-gradient(circle at center, rgba(153, 69, 255, 0.22), rgba(0, 0, 0, 0.76));
}

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

.result-shell {
  width: min(920px, calc(100% - 80px));
  padding: 28px;
  border: 1px solid rgba(20, 241, 149, 0.56);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(153, 69, 255, 0.22), rgba(20, 241, 149, 0.08)),
    rgba(8, 9, 14, 0.94);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 70px rgba(153, 69, 255, 0.3);
  text-align: center;
}

.result-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.result-shell h1 {
  margin: 14px 0 8px;
  font-size: 3.2rem;
  line-height: 1;
  text-shadow: 0 0 28px rgba(220, 31, 255, 0.38);
}

.result-shell p {
  color: var(--muted);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.result-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

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

.result-grid strong {
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.result-grid .result-sol {
  grid-column: span 2;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

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

.token-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 8px;
}

.sprite-editor {
  min-height: 0;
}

.sprite-table {
  display: grid;
  grid-template-columns: 130px repeat(15, 104px);
  gap: 6px;
  min-width: max-content;
}

.sprite-header,
.sprite-name,
.sprite-cell {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.sprite-header,
.sprite-name {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 6px;
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
}

.sprite-cell {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 4px;
}

.sprite-cell button {
  width: 100%;
  height: 100%;
  min-height: 80px;
  padding: 0;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  border-color: transparent;
  display: grid;
  place-items: center;
  position: relative;
}

.sprite-scale-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 34px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(20, 241, 149, 0.86);
  color: #050607;
  font-size: 0.62rem;
  font-weight: 1000;
}

.picker-shell {
  width: min(1180px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  pointer-events: auto;
  overflow: hidden;
}

.manual-crop {
  display: grid;
  grid-template-columns: repeat(5, minmax(70px, 100px)) minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 8px;
  align-items: end;
}

.candidate-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  align-content: start;
}

.candidate-card {
  min-height: 104px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
}

.candidate-card.is-selected {
  border-color: var(--accent);
}

.sprite-editor-app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 8px 16px;
  background: #0b0d11;
}

.sprite-editor-app .sprite-picker {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 16px;
  place-items: center;
}

.sprite-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 560px);
  gap: 18px;
  align-items: end;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.sprite-editor-toolbar h1 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

.sprite-toolbar-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sprite-editor-help {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.88rem;
}

.sprite-editor-help a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.sprite-editor.workspace {
  min-height: 0;
  overflow: auto;
  padding: 0 2px 12px 0;
}

.sprite-editor-grid {
  grid-template-columns: 130px 474px repeat(15, 104px);
}

.sprite-calibration-cell {
  min-height: 338px;
  display: grid;
  grid-template-columns: repeat(2, 220px);
  grid-auto-rows: min-content;
  gap: 8px;
  align-content: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.sprite-calibration-cell canvas {
  width: 220px;
  height: 126px;
  image-rendering: pixelated;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: #111820;
}

.calibration-toggle {
  min-height: 34px;
  align-items: center;
  color: var(--text);
  font-size: 0.78rem;
}

.calibration-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.scale-line {
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.scale-line input {
  padding: 6px 7px;
}

.sprite-test {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.sprite-test[hidden] {
  display: none;
}

.sprite-test-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.sprite-test-toolbar h2 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

#sprite-test-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(20, 241, 149, 0.42);
  border-radius: 8px;
  background: #101216;
  image-rendering: pixelated;
}

.sprite-test-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sprite-test-controls button.is-active {
  border-color: var(--accent-2);
  background: linear-gradient(135deg, #14f195, #9945ff 70%, #dc1fff);
  color: #050607;
}

.sprite-editor-workbench {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
}

.sprite-workbench-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 336px 390px;
  gap: 8px;
}

.sprite-stage-panel,
.sprite-inspector,
.candidate-dock,
.sprite-overview {
  min-height: 0;
  border: 1px solid rgba(20, 241, 149, 0.34);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 0%, rgba(153, 69, 255, 0.2), transparent 34%),
    rgba(13, 15, 20, 0.94);
  box-shadow: inset 0 0 28px rgba(153, 69, 255, 0.12);
}

.sprite-stage-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

#sprite-test-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  image-rendering: pixelated;
  background: #101216;
}

.sprite-stage-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) auto auto;
  gap: 10px;
  align-items: end;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.sprite-inspector {
  overflow: auto;
  padding: 8px 12px 12px;
}

.sprite-inspector-title h2 {
  margin: 4px 0 8px;
  font-size: 1.2rem;
}

.move-key-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid rgba(20, 241, 149, 0.55);
  border-radius: 6px;
  background: rgba(153, 69, 255, 0.18);
  color: #14f195;
  font-size: 0.78rem;
  font-weight: 900;
  vertical-align: middle;
}

.sprite-inspector-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.editor-field {
  display: grid;
  gap: 4px;
}

.editor-field span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sprite-toggle-grid {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.animation-strip {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.animation-frame-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
}

.animation-frame {
  min-height: 104px;
  padding: 6px;
  display: grid;
  gap: 4px;
  place-items: center;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.animation-frame canvas,
.candidate-card canvas {
  image-rendering: pixelated;
}

.animation-frame span,
.candidate-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.animation-frame.is-active,
.sprite-cell button.is-selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(20, 241, 149, 0.45), 0 0 22px rgba(153, 69, 255, 0.35);
}

.frame-button-row,
.sprite-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.sprite-action-grid {
  position: sticky;
  top: -8px;
  z-index: 5;
  margin: 0 0 10px;
  padding: 8px 0;
  background:
    linear-gradient(180deg, rgba(13, 15, 20, 1), rgba(13, 15, 20, 0.92));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sprite-action-grid button {
  min-height: 38px;
}

.candidate-dock {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.candidate-dock-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.candidate-dock-header > button {
  flex: 0 0 auto;
}

.candidate-dock-header h2 {
  margin: 2px 0 0;
  font-size: 0.82rem;
  line-height: 1.2;
}

.candidate-dock .candidate-grid {
  padding: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 8px;
  row-gap: 18px;
}

.candidate-dock .candidate-card {
  min-height: 142px;
  grid-template-rows: 68px auto auto;
  align-items: center;
  gap: 8px;
  color: var(--text);
  padding: 8px 6px;
}

.candidate-dock .candidate-card canvas {
  width: 76px;
  height: 66px;
}

.candidate-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.candidate-actions button {
  min-height: 22px;
  padding: 0 6px;
  font-size: 0.62rem;
}

.sprite-overview {
  max-height: 56px;
  overflow: auto;
  padding: 8px;
}

.sprite-overview[open] {
  max-height: 210px;
}

.sprite-overview summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 900;
  margin-bottom: 8px;
}

.sprite-overview .sprite-editor-grid {
  grid-template-columns: 130px repeat(22, 104px);
}
