:root {
  --bg: #0c0e1a;
  --bg-2: #141830;
  --panel: #181d3a;
  --line: #2a3160;
  --fg: #f2f0ff;
  --muted: #9ea3c8;
  --yellow: #ffd23f;
  --red: #ff4d5e;
  --cyan: #3ad6ff;
  --common: #4e5460;
  --uncommon: #0e7a55;
  --rare: #1e4db0;
  --epic: #6a2db0;
  --legendary: #d9a521;
  --display: 'Bungee', system-ui, sans-serif;
  --body: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --kit-bg: #151a35;
  --kit-fg: var(--fg);
  --kit-muted: var(--muted);
  --kit-accent: var(--yellow);
  --kit-accent-fg: #1a1400;
  --kit-line: var(--line);
  --kit-radius: 14px;
  --kit-font: var(--body);
  --kit-mono: var(--mono);
}

* { box-sizing: border-box; }
body {
  margin: 0; color: var(--fg); font: 17px/1.55 var(--body);
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(58, 214, 255, .10), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(255, 77, 94, .08), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
a { color: inherit; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* top */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.logo { font: 400 22px var(--display); text-decoration: none; letter-spacing: .02em; }
.logo span { color: var(--yellow); margin-left: 4px; }
.nav { display: flex; gap: 26px; font-weight: 600; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--fg); }
.top-right { display: flex; align-items: center; gap: 10px; }
.demo { font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); border: 1px solid rgba(58, 214, 255, .4); padding: 3px 8px; border-radius: 999px; }
button { font: inherit; }
.connect, .btn {
  border: 0; cursor: pointer; border-radius: 12px; font: 800 15px var(--body); padding: 11px 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.connect { background: var(--yellow); color: #1a1400; box-shadow: 0 4px 0 #b8900f; }
.connect:active, .btn-main:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8900f; }
.connect.is-connected { background: var(--panel); color: var(--fg); box-shadow: 0 0 0 1px var(--line); font-family: var(--mono); font-size: 14px; }
.connect.is-wrong-net { box-shadow: 0 0 0 1px var(--red); }

/* hero */
.hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; padding: 36px 0 64px; }
.eyebrow { font: 700 13px var(--mono); color: var(--cyan); letter-spacing: .08em; margin: 0 0 14px; }
h1 { font: 400 clamp(34px, 4.6vw, 58px)/1.02 var(--display); margin: 0 0 18px; letter-spacing: -.01em; }
h1 em { font-style: normal; color: var(--yellow); }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 26px; max-width: 52ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-main { background: var(--yellow); color: #1a1400; box-shadow: 0 4px 0 #b8900f; padding: 15px 24px; font-size: 17px; }
.btn-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 2px var(--line); padding: 15px 22px; }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--muted); }
.stats { display: flex; gap: 34px; margin: 34px 0 0; flex-wrap: wrap; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font: 700 24px var(--mono); }

/* stage */
.stage { background: linear-gradient(180deg, var(--bg-2), #0f1226); border: 1px solid var(--line); border-radius: 26px; padding: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.stage-top { display: flex; justify-content: space-between; font: 700 13px var(--mono); color: var(--muted); }
.live { color: var(--red); display: flex; align-items: center; gap: 7px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.fight { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 18px 0 8px; }
.vs { font: 400 30px var(--display); color: var(--yellow); text-shadow: 0 0 24px rgba(255, 210, 63, .5); }
.fighter { text-align: center; position: relative; }
.fighter .pic { width: 100%; max-width: 210px; aspect-ratio: 1; border-radius: 50%; display: block; margin: 0 auto; transition: transform .15s, filter .3s; }
.fighter.right .pic { transform: scaleX(-1); }
.fighter.hit .pic { animation: hit .35s; }
.fighter.right.hit .pic { animation: hit-r .35s; }
.fighter.lost .pic { filter: grayscale(1) brightness(.55); }
.fighter.won .pic { filter: drop-shadow(0 0 22px rgba(255, 210, 63, .55)); }
@keyframes hit { 25% { transform: translateX(-10px) rotate(-5deg); } 60% { transform: translateX(6px); } }
@keyframes hit-r { 25% { transform: scaleX(-1) translateX(-10px) rotate(-5deg); } 60% { transform: scaleX(-1) translateX(6px); } }
.fighter .name { font: 800 18px var(--body); margin: 10px 0 0; }
.fighter .owner { font: 500 12.5px var(--mono); color: var(--muted); }
.hp { height: 10px; border-radius: 99px; background: #2a2f55; margin: 8px auto 0; max-width: 200px; overflow: hidden; }
.hp i { display: block; height: 100%; background: linear-gradient(90deg, #3ee08f, #b6f36a); transition: width .35s; }
.hp i.low { background: linear-gradient(90deg, var(--red), #ff9a5e); }
.dmg { position: absolute; top: 20%; left: 50%; font: 400 26px var(--display); color: var(--red); animation: float .8s forwards; pointer-events: none; }
@keyframes float { to { transform: translate(-50%, -50px); opacity: 0; } }
.tag { display: inline-block; font: 700 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; margin-top: 6px; }
.tag.common { background: var(--common); }
.tag.uncommon { background: var(--uncommon); }
.tag.rare { background: var(--rare); }
.tag.epic { background: var(--epic); }
.tag.legendary { background: var(--legendary); color: #1a1400; }
.log { min-height: 64px; margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(0, 0, 0, .28); font: 500 13.5px/1.55 var(--mono); color: var(--muted); }
.log b { color: var(--yellow); }

/* sections */
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 24px; }
.section-head h2 { font: 400 28px var(--display); margin: 0 0 6px; }
.section-head p { margin: 0; color: var(--muted); }

.challenges { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ch { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; animation: pop .35s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.ch img { width: 76px; height: 76px; border-radius: 50%; }
.ch h3 { margin: 0; font: 800 17px var(--body); }
.ch .who { font: 500 12px var(--mono); color: var(--muted); }
.ch-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ch-bottom .odds { font: 700 13px var(--mono); }
.ch-bottom .odds span { color: var(--muted); font-weight: 500; }
.accept { background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 9px 14px; font: 800 14px var(--body); cursor: pointer; box-shadow: 0 3px 0 #b3303d; }
.accept:active { transform: translateY(2px); box-shadow: 0 1px 0 #b3303d; }

.rarity-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.rarity-row span { font: 700 13px var(--mono); padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); }
.rarity-row i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.card { text-align: center; padding: 12px 8px 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--muted); }
.card img { width: 100%; max-width: 110px; aspect-ratio: 1; border-radius: 50%; }
.card b { display: block; font: 800 14.5px var(--body); margin-top: 6px; }
.card small { font: 500 12px var(--mono); color: var(--muted); }
.card.legendary { border-color: var(--legendary); box-shadow: 0 0 30px rgba(217, 165, 33, .25); }
.card.epic { border-color: rgba(106, 45, 176, .8); }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.board { list-style: none; margin: 0; padding: 0; counter-reset: b; }
.board li { counter-increment: b; display: grid; grid-template-columns: 34px 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.board li::before { content: counter(b); font: 400 20px var(--display); color: var(--muted); }
.board li:nth-child(1)::before { color: var(--yellow); }
.board img { width: 44px; height: 44px; border-radius: 50%; }
.board .w { font: 700 15px var(--mono); }
.board .who { font: 500 12.5px var(--mono); color: var(--muted); }
.steps { margin: 0 0 24px; padding-left: 20px; }
.steps li { margin-bottom: 12px; color: var(--muted); }
.steps b { color: var(--fg); }
.pot-split { display: flex; height: 46px; border-radius: 12px; overflow: hidden; font: 13px var(--mono); margin-bottom: 10px; }
.pot-split div { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.pot-split div:nth-child(1) { background: var(--yellow); color: #1a1400; }
.pot-split div:nth-child(2) { background: var(--cyan); color: #00202a; }
.pot-split div:nth-child(3) { background: var(--red); }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 26px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .split-2 { grid-template-columns: 1fr; gap: 20px; }
  .nav { display: none; }
}
@media (max-width: 520px) {
  .demo { display: none; }
  .logo { font-size: 18px; }
  .stats { gap: 20px; }
  .stats dd { font-size: 20px; }
  .vs { font-size: 20px; }
  .fighter .name { font-size: 15px; }
  .roster { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card { padding: 8px 4px 10px; }
  .card b { font-size: 12.5px; }
}

[data-connect] { white-space: nowrap; }
