@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&display=swap');

:root {
  --bg: #05060d;
  --primary: #ffe066;
  --text: #e7ecff;
  --text-dim: #7a86b0;
  --accent: #7fe0ff;
  --sol-purple: #9945ff;
  --sol-green: #14f195;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); overflow: hidden;
  font-family: 'Outfit', system-ui, sans-serif;
}

#scene, #hud {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block;
}
#hud { pointer-events: none; z-index: 1; }

#ui-layer {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 2;
  display: flex; flex-direction: column;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.loading-bar-track {
  position: relative;
  width: 100%; height: 8px;
  background: rgba(255,224,102,0.12); border-radius: 4px;
  overflow: hidden;
}
/* an always-moving shimmer so the bar reads as "working" even while the first
   (heaviest) fighter parses and the fill is still at 0% */
.loading-bar-track::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, transparent, rgba(255,224,102,0.35), transparent);
  width: 40%; border-radius: 4px;
  animation: loadShimmer 1.3s ease-in-out infinite;
}
@keyframes loadShimmer {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.loading-bar-fill {
  position: relative; z-index: 1;
  width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--sol-purple), var(--primary) 55%, var(--sol-green));
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(255,224,102,0.5);
  transition: width 0.45s cubic-bezier(.4,0,.2,1);
}

/* ===================== COVER / LANDING PAGE ===================== */
#cover {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: stretch; justify-content: center;
  background: var(--bg);
  overflow-y: auto;
  transition: opacity 0.6s ease-out;
}
#cover.dismissed { opacity: 0; pointer-events: none; }

.cover-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(900px 600px at 18% 8%, rgba(153,69,255,0.22), transparent 60%),
    radial-gradient(900px 700px at 85% 95%, rgba(20,241,149,0.14), transparent 55%),
    radial-gradient(1100px 800px at 50% 40%, rgba(255,224,102,0.08), transparent 60%);
  animation: coverDrift 16s ease-in-out infinite alternate;
}
.cover-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(127,224,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,224,255,0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 80%);
}
@keyframes coverDrift {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.08) translateY(-14px); }
}
.cover-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 75% 75% at 50% 50%, transparent 55%, rgba(0,0,0,0.65) 100%);
}

.cover-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 1080px;
  margin: auto;
  padding: 22px 28px 28px;
  display: flex; flex-direction: column;
  gap: 18px;
}

/* top bar */
.cover-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.token-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,224,102,0.06);
  border: 1px solid rgba(255,224,102,0.3); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; font-family: inherit;
  transition: all 0.2s ease;
}
.token-chip:hover { background: rgba(255,224,102,0.12); border-color: var(--primary); }
.tk-ticker { color: var(--primary); font-weight: 900; font-size: 16px; letter-spacing: 1px; }
.tk-chain {
  color: var(--sol-green); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px;
  border-left: 1px solid rgba(255,255,255,0.15); padding-left: 10px;
}
.tk-ca { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.token-chip.copied .tk-ca { color: var(--sol-green); }

.cover-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.soc {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; font-weight: 700; font-size: 13px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14); color: var(--text);
  transition: all 0.18s ease;
}
.soc:hover { transform: translateY(-2px); }
.soc-x { background: #111; border-color: rgba(255,255,255,0.5); }
.soc-x:hover { background: #000; border-color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
.soc[data-soon] { color: var(--text-dim); cursor: default; }
.soc[data-soon]::after {
  content: "soon"; font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  color: var(--bg); background: var(--text-dim);
  padding: 1px 5px; border-radius: 4px; margin-left: 2px;
}
.soc[data-soon]:hover { transform: none; }

/* hero */
.cover-hero { text-align: center; margin-top: 4px; }
.cover-kicker {
  color: var(--accent); font-size: 13px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase; margin-bottom: 8px;
  opacity: 0.85;
}
.cover-title {
  font-size: clamp(44px, 8vw, 96px); font-weight: 900; margin: 0;
  line-height: 0.95; letter-spacing: 1px;
  background: linear-gradient(180deg, #fff 0%, var(--primary) 55%, #e0a93a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgba(255,224,102,0.35));
  animation: titlePulse 4s ease-in-out infinite;
}
@keyframes titlePulse {
  0%, 100% { filter: drop-shadow(0 6px 30px rgba(255,224,102,0.3)); }
  50% { filter: drop-shadow(0 6px 44px rgba(255,224,102,0.55)); }
}
.cover-tagline {
  color: #c3ccea; font-size: clamp(14px, 1.8vw, 18px); font-weight: 400;
  max-width: 720px; margin: 14px auto 0; line-height: 1.5;
}
.cover-tagline em { color: var(--accent); font-style: italic; font-weight: 700; }
.cover-tagline strong { color: var(--primary); }

/* rotating panels */
.cover-panels {
  background: rgba(10,14,30,0.55); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
  padding: 0; overflow: hidden;
}
.panel-tabs {
  display: flex; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.panel-tab {
  flex: 1; background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-family: inherit; font-weight: 700; font-size: 14px;
  padding: 14px 8px; letter-spacing: 0.5px; transition: all 0.18s ease;
  border-bottom: 2px solid transparent;
}
.panel-tab:hover { color: var(--text); }
.panel-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(255,224,102,0.05);
}
.panel-stage { position: relative; padding: 22px 26px; min-height: 196px; }
.panel { display: none; animation: panelIn 0.28s ease; }
.panel.active { display: block; }
@keyframes panelIn {
  /* start mostly-opaque so a tab switch never flashes a blank panel */
  from { opacity: 0.45; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel-lede { color: #d4dcf5; font-size: 15px; line-height: 1.6; margin-bottom: 14px; }
.panel-lede strong { color: var(--primary); }
.panel-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.panel-points li { color: #b9c2e4; font-size: 14px; line-height: 1.4; }
.panel-points strong { color: var(--text); }

/* roadmap timeline */
.roadmap { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.roadmap li {
  position: relative; padding-left: 28px;
  display: flex; flex-direction: column; gap: 2px;
}
.roadmap li::before {
  content: ""; position: absolute; left: 4px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--text-dim); background: var(--bg);
}
.roadmap li::after {
  content: ""; position: absolute; left: 9px; top: 18px; bottom: -16px;
  width: 2px; background: rgba(255,255,255,0.1);
}
.roadmap li:last-child::after { display: none; }
.roadmap li.rm-done::before {
  border-color: var(--sol-green); background: var(--sol-green);
  box-shadow: 0 0 10px rgba(20,241,149,0.6);
}
.rm-phase { color: var(--primary); font-weight: 800; font-size: 13px; letter-spacing: 0.5px; }
.roadmap li.rm-done .rm-phase { color: var(--sol-green); }
.rm-text { color: #b9c2e4; font-size: 13.5px; line-height: 1.45; }

/* how to play */
.htp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.htp-key {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 9px; padding: 9px 11px;
}
.htp-key.htp-wide { grid-column: span 2; }
.htp-key span { color: #b9c2e4; font-size: 12.5px; }
kbd {
  display: inline-block; min-width: 20px; text-align: center;
  background: linear-gradient(180deg, #2a3354, #161c30);
  border: 1px solid rgba(255,255,255,0.18); border-bottom-width: 2px;
  border-radius: 6px; padding: 3px 7px;
  color: var(--text); font-family: inherit; font-weight: 700; font-size: 12px;
}
.htp-note { margin-top: 14px; color: #9aa6d0; font-size: 13px; line-height: 1.5; }
.htp-note strong { color: var(--primary); }

/* footer: load + play */
.cover-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.load-row { display: flex; align-items: center; justify-content: space-between; }
.load-label {
  color: var(--accent); font-size: 13px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
}
.load-count { color: var(--primary); font-size: 14px; font-weight: 900; }
.load-dots { display: flex; gap: 6px; }
.load-dots .dot {
  flex: 1; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.1); transition: all 0.4s ease;
}
.load-dots .dot.loading { background: rgba(255,224,102,0.4); animation: dotPulse 1s ease-in-out infinite; }
.load-dots .dot.done {
  background: linear-gradient(90deg, var(--sol-purple), var(--sol-green));
  box-shadow: 0 0 8px rgba(20,241,149,0.5);
}
.load-dots .dot.failed { background: rgba(255,80,80,0.5); }
@keyframes dotPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.play-btn {
  margin-top: 6px; position: relative;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 18px; border: none; border-radius: 14px;
  font-family: inherit; font-weight: 900; font-size: 22px; letter-spacing: 2px;
  cursor: not-allowed; color: #7c8099;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}
.play-btn .play-spinner {
  width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.play-btn.ready {
  cursor: pointer; color: #1a1205;
  background: linear-gradient(180deg, #fff0b0, var(--primary) 45%, #e8b53a);
  border-color: var(--primary);
  box-shadow: 0 10px 36px rgba(255,224,102,0.45);
  animation: playReady 1.6s ease-in-out infinite;
}
.play-btn.ready .play-spinner { display: none; }
.play-btn.ready:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 14px 46px rgba(255,224,102,0.6); }
@keyframes playReady {
  0%, 100% { box-shadow: 0 10px 36px rgba(255,224,102,0.4); }
  50% { box-shadow: 0 10px 50px rgba(255,224,102,0.7); }
}
.cover-fineprint { text-align: center; color: #5a6488; font-size: 11px; margin-top: 2px; }

@media (max-width: 720px) {
  .htp-grid { grid-template-columns: repeat(2, 1fr); }
  .htp-key.htp-wide { grid-column: span 1; }
  .cover-inner { padding: 16px 16px 22px; gap: 14px; }
  .panel-stage { min-height: 230px; }
}

/* Menu UI */
#menu-ui {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center;
}
#menu-ui.active { display: flex; }

.title-container {
  margin-top: 40px; text-align: center;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.game-title {
  color: var(--primary); font-size: 74px; font-weight: 900;
  margin: 0; text-shadow: 0 4px 20px rgba(255,224,102,0.3);
}
.game-subtitle {
  color: #9aa6d0; font-size: 20px; font-weight: 400; margin: 10px 0 0 0;
}

.step-header {
  color: var(--text); font-size: 28px; font-weight: 700;
  margin-top: 20px; text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* Step 0 */
#step-0 {
  position: absolute; bottom: 15%; text-align: center;
  color: var(--text); font-size: 30px; font-weight: 700;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Step 1: Fighter Select — model is in the ring, info overlaid at bottom */
#step-1 {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: 60px;
}

.fighter-select-info {
  text-align: center;
  background: linear-gradient(to top, rgba(5,6,13,0.92) 0%, rgba(5,6,13,0.7) 70%, transparent 100%);
  padding: 30px 50px 20px;
  width: 100%;
}

.fighter-name {
  color: var(--primary); font-size: 52px; font-weight: 900;
  letter-spacing: 3px;
  text-shadow: 0 4px 20px rgba(255,224,102,0.4);
  margin-bottom: 4px;
}
.fighter-tag {
  color: var(--accent); font-size: 18px; font-weight: 700;
  margin-bottom: 10px;
}
.fighter-bio {
  color: #cdd5f5; font-size: 16px; margin-bottom: 12px;
  line-height: 1.4; max-width: 600px; margin-left: auto; margin-right: auto;
}
.fighter-special {
  color: #ffce6b; font-size: 15px; font-weight: 700;
}

.fighter-nav {
  display: flex; align-items: center; gap: 30px;
  margin-top: 10px;
}
.nav-arrow {
  color: var(--primary); font-size: 36px; font-weight: 900;
  opacity: 0.7; transition: opacity 0.2s;
  animation: arrowPulse 1.5s ease-in-out infinite;
}
.nav-arrow:nth-child(1) { animation-delay: 0s; }
.nav-arrow:nth-child(3) { animation-delay: 0.75s; }
@keyframes arrowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}
.nav-hint {
  color: var(--text-dim); font-size: 14px;
}

/* Arena Selection (Step 2) */
#step-2 {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px;
  position: absolute; top: 200px; width: 100%;
}
#step-2 > div:first-child {
  justify-content: center;
}
.arena-card {
  width: 280px; height: 160px;
  background: rgba(10,14,30,0.6); backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.15); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column;
  transition: all 0.2s ease;
}
.arena-card.selected {
  border-color: var(--primary); border-width: 3px;
  transform: scale(1.05); box-shadow: 0 10px 30px rgba(255,224,102,0.2);
}
.arena-canvas-color { height: 80px; border-radius: 6px; margin-bottom: 6px; }
.arena-accent-color { height: 6px; border-radius: 3px; margin-bottom: 16px; }
.arena-card .name { text-align: center; font-size: 21px; font-weight: 700; color: var(--text); }
.arena-card.selected .name { color: var(--primary); }
.arena-hint { text-align: center; color: #9aa6d0; font-size: 16px; margin-top: 10px; }

/* Difficulty Selection (Step 3) */
#step-3 {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px;
  position: absolute; top: 220px; width: 100%;
}
#step-3 > div:first-child {
  justify-content: center;
}
.diff-card {
  width: 250px; height: 150px;
  background: rgba(10,14,30,0.6); backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.15); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; text-align: center; transition: all 0.2s ease;
}
.diff-card.selected {
  border-width: 3px; transform: scale(1.05);
}
.diff-card .label { font-size: 30px; font-weight: 900; margin-bottom: 10px; }
.diff-card .desc { color: #cdd5f5; font-size: 15px; }

.start-hint {
  text-align: center; margin-top: 10px;
  color: var(--primary); font-size: 24px; font-weight: 700;
  animation: pulse 1s infinite;
}

/* Controls */
.controls-legend {
  position: absolute; bottom: 15%; text-align: center;
  color: var(--text-dim); font-size: 14px;
}
.controls-legend p { margin: 6px 0; }
.controls-legend span { color: #cdd5f5; font-weight: 700; }
.menu-controls {
  position: absolute; bottom: 25px; width: 100%; text-align: center;
  color: var(--text-dim); font-size: 15px;
}
.menu-controls span { color: #cdd5f5; font-weight: 700; }

/* ===================== MULTIPLAYER FLOW SCREENS ===================== */
/* Mode / region / searching panels live inside #menu-ui (pointer-events:none),
   so every interactive element re-enables pointer-events explicitly. */
.mp-screen {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px;
}

.online-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--sol-green); margin-right: 7px; vertical-align: middle;
  box-shadow: 0 0 8px var(--sol-green); animation: onlinePulse 2s ease-in-out infinite;
}
@keyframes onlinePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --- mode select --- */
.mode-grid { display: flex; gap: 34px; }
.mode-card {
  pointer-events: auto; cursor: pointer; font-family: inherit;
  width: 320px; min-height: 260px;
  background: rgba(10,14,30,0.62); backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.15); border-radius: 16px;
  padding: 34px 24px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; transition: all 0.18s ease; color: var(--text);
}
.mode-card:hover { border-color: rgba(255,255,255,0.4); transform: translateY(-3px); }
.mode-card.selected {
  border-color: var(--primary); border-width: 3px; transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 40px rgba(255,224,102,0.22);
}
.mode-card--mp.selected { border-color: var(--sol-green); box-shadow: 0 14px 40px rgba(20,241,149,0.22); }
.mode-icon { font-size: 56px; line-height: 1; }
.mode-title { font-size: 30px; font-weight: 900; letter-spacing: 2px; }
.mode-desc { color: #aeb8de; font-size: 15px; text-align: center; }
.mode-online {
  margin-top: 8px; color: var(--sol-green); font-size: 16px; font-weight: 700;
}

/* --- region select --- */
.region-grid { display: flex; gap: 30px; }
.region-card {
  pointer-events: auto; cursor: pointer; font-family: inherit;
  width: 300px; min-height: 210px;
  background: rgba(10,14,30,0.62); backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.15); border-radius: 16px;
  padding: 28px 24px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; transition: all 0.18s ease; color: var(--text);
}
.region-card:hover { border-color: rgba(255,255,255,0.4); transform: translateY(-3px); }
.region-card.selected {
  border-color: var(--primary); border-width: 3px; transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 40px rgba(255,224,102,0.22);
}
.region-flag { font-size: 44px; line-height: 1; }
.region-name { font-size: 28px; font-weight: 900; letter-spacing: 2px; }
.region-sub { color: #9aa6d0; font-size: 14px; }
.region-online { margin-top: 6px; color: var(--sol-green); font-size: 15px; font-weight: 700; }
.region-card.empty .region-online { color: var(--text-dim); }

.mp-status { color: var(--text-dim); font-size: 15px; min-height: 20px; text-align: center; }
.mp-status.warn { color: #ff9d5c; }

/* --- searching / switch prompt --- */
.search-card {
  pointer-events: auto;
  width: 460px; background: rgba(10,14,30,0.7); backdrop-filter: blur(12px);
  border: 2px solid rgba(255,255,255,0.14); border-radius: 18px;
  padding: 40px 36px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.search-spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.12); border-top-color: var(--sol-green);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.search-title { font-size: 24px; font-weight: 900; color: var(--text); letter-spacing: 1px; }
.search-sub { color: #aeb8de; font-size: 15px; }
.search-online { color: var(--sol-green); font-size: 15px; font-weight: 700; }
.search-switch {
  width: 100%; margin-top: 6px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.switch-msg { color: #ff9d5c; font-size: 16px; font-weight: 700; text-align: center; }
.switch-actions { display: flex; gap: 14px; }

.mp-btn {
  pointer-events: auto; cursor: pointer; font-family: inherit;
  padding: 11px 22px; border-radius: 10px; font-size: 15px; font-weight: 800;
  letter-spacing: 0.5px; color: var(--text);
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.2);
  transition: all 0.15s ease;
}
.mp-btn:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.45); }
.mp-btn--go { background: var(--sol-green); color: #062013; border-color: var(--sol-green); }
.mp-btn--go:hover { filter: brightness(1.1); }
.mp-btn--ghost { background: transparent; border-color: rgba(255,255,255,0.18); color: var(--text-dim); margin-top: 6px; }
.mp-btn--ghost:hover { color: var(--text); }

.hidden { display: none !important; }
