/* Arena Champ — painted look-ladder bay */
:root {
  --bg: #0b0d12;
  --bg2: #12151d;
  --panel: #161a24;
  --line: #2a3142;
  --text: #e8ecf4;
  --muted: #8b93a7;
  --accent: #7c5cff;
  --accent2: #3de7c2;
  --danger: #ff5c7a;
  --gold: #f5c542;
  --you: #5b8cff;
  --foe: #ff6b4a;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1430 0%, var(--bg) 55%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 14px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.brand .tag {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; }
.nav a { color: var(--muted); }
.nav a.active { color: var(--text); font-weight: 600; }
.nav a.muted { opacity: 0.65; }

.wallet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.wallet-cell .label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wallet-cell strong { font-size: 1.1rem; }

.screen[hidden] { display: none !important; }

.bay-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 780px) {
  .bay-layout {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

.kicker {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stage-wrap { text-align: center; }
.stage {
  position: relative;
  display: inline-block;
  padding: 10px;
  background: linear-gradient(180deg, #1a2030 0%, #0e1118 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero-stage {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0c12;
}
.hero-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}
.perk-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.perk-badge {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  background: rgba(12, 4, 28, 0.92);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  z-index: 5;
  transition: transform 0.2s ease, border-color 0.2s;
}
.perk-badge.hot {
  transform: scale(1.3) !important;
  border-color: #fff !important;
  background: rgba(80, 40, 10, 0.95);
  z-index: 6;
}

.stage-glow {
  pointer-events: none;
  position: absolute;
  inset: 20% 18% 8%;
  background: radial-gradient(ellipse at 50% 80%, rgba(124, 92, 255, 0.25), transparent 70%);
  border-radius: 50%;
}
.look-label {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.fighter-name {
  margin: 4px 0 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.perk-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 10px auto 0;
  max-width: 360px;
}
.strip-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.strip-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(20, 8, 40, 0.85);
  border-radius: 8px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
}
.strip-chip.hot {
  border-color: var(--gold);
  background: rgba(60, 30, 10, 0.9);
}
.strip-count {
  width: 100%;
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
}

.identity {
  margin: 14px auto 0;
  max-width: 360px;
  text-align: left;
  display: grid;
  gap: 10px;
}
.id-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.id-label {
  width: 56px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.seg-btn {
  padding: 8px 14px;
  border: none;
  background: var(--bg2);
  color: var(--muted);
  font-weight: 600;
}
.seg-btn.active {
  background: linear-gradient(135deg, #6a4fff, #4a7dff);
  color: #fff;
}
.race-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.race-btn {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.race-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: #1c2238;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}
.hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.tracks {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.track-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.track-info {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
  position: relative;
}
.track-icon { font-size: 1.2rem; line-height: 1.4; }
.track-name { font-weight: 600; font-size: 0.92rem; }
.track-lv { color: var(--gold); font-weight: 600; font-size: 0.78rem; }
.track-hint { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.track-dots {
  grid-column: 2;
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.track-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0a0c10;
  border: 1px solid var(--line);
  display: block;
}
.track-dots i.on {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
}
.track-buy {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: rgba(245, 197, 66, 0.08);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}
.track-buy:hover:not(:disabled) { background: rgba(245, 197, 66, 0.18); }

.stats h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.stat-list li {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}
.stat-list .bar {
  height: 8px;
  background: #0a0c10;
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.stat-list .bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  width: 0;
  transition: width 0.25s ease;
}
.stat-list .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.bay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.primary, .ghost {
  border-radius: 10px;
  padding: 11px 16px;
  border: 1px solid transparent;
}
.primary {
  background: linear-gradient(135deg, #6a4fff, #4a7dff);
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: 0 6px 20px rgba(90, 80, 255, 0.35);
}
.primary:hover { filter: brightness(1.08); }
.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.ghost:hover { border-color: var(--muted); }
.linkish {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0;
  text-decoration: underline;
  font-size: inherit;
}
.foot-note {
  margin: 14px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Clash */
.clash-kicker { text-align: center; }
.clash-arena {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
  padding: 16px 8px 20px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #1a1528 0%, #0c0e14 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.clash-side { text-align: center; }
.clash-portrait {
  width: 140px;
  height: 175px;
  object-fit: contain;
  object-position: center bottom;
  display: inline-block;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}
.clash-side.you .clash-portrait { filter: drop-shadow(0 0 12px rgba(91, 140, 255, 0.35)); }
.clash-side.foe .clash-portrait {
  filter: drop-shadow(0 0 12px rgba(255, 107, 74, 0.35));
  transform: scaleX(-1);
}
.hp-bar {
  width: 120px;
  height: 10px;
  margin: 6px auto 4px;
  background: #0a0c10;
  border-radius: 99px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #3d7cff, #5bffc8);
  transition: width 0.2s ease;
}
.hp-fill.foe { background: linear-gradient(90deg, #ff6b4a, #ffb347); }
.clash-label { margin: 0; font-size: 0.85rem; color: var(--muted); }
.clash-vs {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--gold);
  align-self: center;
  letter-spacing: 0.1em;
  padding-bottom: 40px;
}
.clash-arena.hit-you .clash-side.you { animation: shake 0.25s; }
.clash-arena.hit-foe .clash-side.foe { animation: shake 0.25s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.punch-fx {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 40%;
  width: 24px;
  height: 24px;
  margin: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 200, 80, 0.8) 40%, transparent 70%);
  opacity: 0;
  transform: scale(0.4);
}
.punch-fx.pop { animation: popFx 0.35s ease-out; }
@keyframes popFx {
  0% { opacity: 1; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(2.2); }
}

.clash-log {
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #c5cce0;
}
.clash-log .line { margin: 0 0 4px; }
.clash-log .crit { color: var(--gold); }
.clash-log .block { color: var(--accent2); }
.clash-log .win { color: #7dff9a; font-weight: 700; }
.clash-log .lose { color: var(--danger); font-weight: 700; }

.result-card {
  text-align: center;
  padding: 28px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 420px;
  margin: 24px auto;
}
.res-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.result-card h2 {
  margin: 8px 0 10px;
  font-size: 1.8rem;
}
.res-copy { color: var(--muted); margin: 0 0 14px; }
.res-loot {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  color: var(--accent2);
  font-weight: 600;
}
.res-loot li { margin: 4px 0; }
.result-card .bay-actions { justify-content: center; }
.result-card.loss .res-kicker { color: var(--danger); }

.ghost.soon,
button.soon:disabled {
  opacity: 0.55;
  border-style: dashed;
  font-size: 0.85rem;
}
.roadmap-note {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.id-hint {
  margin: 6px 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.75;
  max-width: 28rem;
}
.id-row .race-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
