/* XRP-MEN — Heroes Unite! arcade chrome */
:root {
  --bg-deep: #030712;
  --bg-navy: #070f1c;
  --bg-panel: #0a1528;
  --bg-card: #0a1220;
  --gold: #c9a84c;
  --gold-bright: #e4c56a;
  --cyan: #22d3ee;
  --cyan-dim: #0891b2;
  --cyan-glow: rgba(34, 211, 238, 0.28);
  --crimson: #c43a4e;
  --text: #e8eef8;
  --text-muted: #93a0b8;
  --text-dim: #64728a;
  --border: rgba(34, 211, 238, 0.18);
  --border-gold: rgba(201, 168, 76, 0.4);
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, rgba(34, 211, 238, 0.14), transparent 55%),
    radial-gradient(ellipse 40% 35% at 95% 15%, rgba(59, 130, 246, 0.1), transparent 50%),
    linear-gradient(180deg, #070f1c 0%, #030712 50%, #050a14 100%);
}

body.playing { overflow: hidden; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--gold-bright); }

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: rgba(3, 7, 18, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.game-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.game-brand img {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border-gold);
  object-fit: cover;
}
.game-brand span.sub {
  color: var(--cyan);
  font-weight: 500;
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.wallet-chip, .profile-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
}
.wallet-chip.connected, .profile-chip.signed-in {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, rgba(34,211,238,0.2), rgba(8,145,178,0.15));
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}
.btn-primary:hover { background: rgba(34,211,238,0.3); color: #fff; }
.btn-gold {
  background: linear-gradient(135deg, rgba(201,168,76,0.25), rgba(154,127,46,0.15));
  border-color: var(--border-gold);
  color: var(--gold-bright);
}
.btn-ghost { background: transparent; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.game-shell {
  width: min(100% - 1.5rem, 1100px);
  margin: 1rem auto 2rem;
}

.screen {
  display: none;
  animation: fadeIn 0.35s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel {
  background: rgba(10, 18, 32, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}
h1 .accent { color: var(--cyan); text-shadow: 0 0 24px var(--cyan-glow); }
h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.lede {
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.inspire-note {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.title-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
}
@media (max-width: 720px) {
  .title-hero { grid-template-columns: 1fr; }
}

.logo-glow {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  box-shadow: 0 0 40px var(--cyan-glow);
}
.logo-glow img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Hero select — large portraits like arcade fighter select */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}
.hero-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  font: inherit;
  padding: 0;
  transition: 0.2s;
}
.hero-card:hover, .hero-card.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 28px var(--cyan-glow);
  transform: translateY(-3px);
}
.hero-card.selected {
  border-color: var(--gold-bright);
  box-shadow: 0 0 28px rgba(201,168,76,0.35);
}
.hero-portrait {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #050a14;
}
.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.hero-meta {
  padding: 0.75rem 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.hero-meta strong { font-family: var(--font-display); font-size: 1rem; }
.hero-meta span { font-size: 0.72rem; color: var(--text-dim); }
.hero-blurb {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0.35rem 0 0.15rem;
}
.hero-meta em { font-style: normal; font-size: 0.72rem; color: var(--cyan); margin-top: 0.2rem; font-weight: 600; }

/* Stage map */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}
.mission-card {
  text-align: left;
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: 0.2s;
}
.mission-card:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: 0 0 18px var(--cyan-glow);
}
.mission-card.locked { opacity: 0.45; cursor: not-allowed; }
.mission-card.cleared { border-color: var(--border-gold); }
.m-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
}
.mission-card strong { font-family: var(--font-display); font-size: 1rem; }
.m-sub { font-size: 0.78rem; color: var(--text-dim); }
.m-boss {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}
.m-stars { color: var(--gold-bright); font-size: 0.85rem; margin-top: 0.35rem; }
.m-score { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

/* Play */
#screen-play.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
#canvas-wrap {
  width: 100%;
  max-width: 960px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 0 40px rgba(34,211,238,0.12), 0 20px 50px rgba(0,0,0,0.5);
  background: #000;
  touch-action: none;
}
#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.play-bar {
  display: flex;
  width: 100%;
  max-width: 960px;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.hint-keys {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Mobile controls — D-pad + JUMP / PUNCH / SPECIAL */
.mobile-controls {
  display: none;
  width: 100%;
  max-width: 960px;
  padding: 0.5rem 0.25rem 1rem;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.mobile-controls > * { pointer-events: auto; }

.dpad {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.dpad-btn {
  width: 68px !important;
  height: 68px !important;
  font-size: 1.25rem !important;
}

.fire-cluster {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 240px;
}
.pad-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: rgba(34,211,238,0.15);
  color: var(--cyan);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.68rem;
  touch-action: none;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.pad-btn.jump {
  border-color: #67e8f9;
  color: #67e8f9;
  background: rgba(103,232,249,0.12);
}
.pad-btn.punch {
  width: 76px;
  height: 76px;
  border-color: var(--crimson);
  color: #f87171;
  background: rgba(196,58,78,0.2);
}
.pad-btn.special {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(201,168,76,0.15);
}
.pad-btn.ready {
  box-shadow: 0 0 16px var(--cyan-glow);
}
.pad-btn:active {
  transform: scale(0.94);
  background: rgba(34,211,238,0.35);
}

@media (max-width: 900px), (pointer: coarse) {
  .mobile-controls { display: flex; }
  .hint-keys { display: none; }
}

/* Results / achievements */
.results-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}
@media (max-width: 600px) {
  .results-stats { grid-template-columns: repeat(2, 1fr); }
}
.results-stats div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
}
.results-stats span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}
.results-stats strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--cyan);
}
.results-title { color: var(--text-muted); margin-bottom: 0.5rem; }
.continue-hint {
  font-family: var(--font-mono);
  color: var(--gold-bright);
  margin-bottom: 0.75rem;
}

.new-achs {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  background: rgba(201,168,76,0.08);
}
.new-achs ul { margin: 0.4rem 0 0 1.1rem; color: var(--gold-bright); }

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.ach-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  opacity: 0.4;
}
.ach-card.unlocked {
  opacity: 1;
  border-color: var(--border-gold);
  box-shadow: 0 0 14px rgba(201,168,76,0.15);
}
.ach-icon {
  font-size: 1.4rem;
  color: var(--cyan);
  width: 2rem;
  text-align: center;
}
.ach-card strong { display: block; font-family: var(--font-display); font-size: 0.95rem; }
.ach-card p { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.15rem; }

.score-banner {
  font-family: var(--font-mono);
  color: var(--gold-bright);
  margin-bottom: 0.5rem;
}

.auth-box { max-width: 440px; }
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.auth-form input {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-glow);
}
.auth-error {
  color: #f87171;
  font-size: 0.85rem;
  margin: 0;
}
.lb-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.lb-table th, .lb-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.lb-table th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.lb-table td { font-variant-numeric: tabular-nums; }
.lb-table tr.me td { color: var(--cyan); }
.lb-empty { color: var(--text-dim); text-align: center !important; }
.pad-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 280px;
  flex-wrap: wrap;
}
.pad-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  min-width: 1.5rem;
}
.profile-chip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10,21,40,0.95);
  border: 1px solid var(--cyan);
  color: var(--text);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 0 24px var(--cyan-glow);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer-mini {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.footer-mini a { margin: 0 0.4rem; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--cyan);
}




.btn-xl {
  font-size: 1.05rem;
  padding: 0.95rem 1.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  min-width: min(100%, 280px);
}
.sticky-play {
  position: sticky;
  bottom: 0.5rem;
  z-index: 5;
  padding: 0.5rem 0;
  background: linear-gradient(180deg, transparent, rgba(4,8,16,0.92) 30%);
}
.mission-card.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 18px var(--cyan-glow);
  background: rgba(34, 211, 238, 0.08);
}


/* —— Arcade cabinet title / select —— */
.arcade-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem 2rem;
  max-width: 720px;
  margin: 0 auto;
}
.arcade-marquee {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(201,168,76,0.08);
}
.arcade-logo {
  width: min(220px, 55vw);
  margin: 0.5rem auto;
}
.arcade-logo img {
  width: 100%;
  border-radius: 16px;
  border: 2px solid var(--border-gold);
  box-shadow: 0 0 40px var(--cyan-glow), 0 0 80px rgba(201,168,76,0.25);
}
.arcade-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  letter-spacing: 0.12em;
  color: var(--cyan);
  text-shadow: 0 0 24px var(--cyan-glow);
  margin-top: 0.25rem;
}
.arcade-title-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 7vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #fff;
  text-transform: uppercase;
}
.arcade-title-text .bang { color: var(--gold-bright); }
.arcade-tag {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 28rem;
  line-height: 1.45;
}
.btn-arcade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 300px);
  padding: 1.05rem 1.8rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #031018;
  background: linear-gradient(180deg, #67e8f9 0%, #22d3ee 45%, #0891b2 100%);
  border: 2px solid #a5f3fc;
  border-radius: 10px;
  box-shadow: 0 0 28px var(--cyan-glow), inset 0 1px 0 rgba(255,255,255,0.45);
  cursor: pointer;
  margin-top: 0.5rem;
}
.btn-arcade:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.btn-arcade:not(:disabled):hover {
  filter: brightness(1.08);
}
.btn-arcade.blink {
  animation: arcadeBlink 1.15s steps(2, end) infinite;
}
@keyframes arcadeBlink {
  50% { opacity: 0.55; }
}
.arcade-subrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-top: 0.35rem;
}
.arcade-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
}
.arcade-eyebrow {
  letter-spacing: 0.22em !important;
  color: var(--gold-bright) !important;
}
.arcade-h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
}
.arcade-hero-grid .hero-card {
  border-width: 2px;
  min-height: 100%;
}
.arcade-hero-grid .hero-card.selected,
.arcade-hero-grid .hero-card.picked-p1 {
  border-color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(228,197,106,0.35);
  transform: translateY(-2px);
}
.hero-confirm-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(201,168,76,0.12), rgba(34,211,238,0.08));
}
.picked-plate {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-transform: uppercase;
}


/* Bigger phone arcade pads */
@media (max-width: 900px), (pointer: coarse) {
  .pad-btn {
    width: 78px;
    height: 78px;
    font-size: 0.72rem;
  }
  .pad-btn.punch {
    width: 92px;
    height: 92px;
    font-size: 0.8rem;
  }
  .pad-btn.shoot {
    width: 86px;
    height: 86px;
    border-color: #f97316;
    color: #fdba74;
    background: rgba(249, 115, 22, 0.22);
  }
  .pad-btn.dpad-btn {
    width: 84px;
    height: 84px;
    font-size: 1.25rem;
  }
  .fire-cluster {
    max-width: 320px;
    gap: 0.65rem;
  }
  .hero-confirm-bar.sticky-play {
    position: sticky;
    bottom: 0.35rem;
    z-index: 8;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.45);
  }
  .btn-arcade {
    min-height: 56px;
    font-size: 1.2rem;
  }
}
.pad-btn.shoot {
  border-color: #f97316;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.18);
}
