:root {
  --bg: #14101f;
  --panel: #1f1830;
  --panel-2: #2a2140;
  --line: #3a2f57;
  --text: #f4f0ff;
  --muted: #b3a9c9;
  --gold: #ffcc33;
  --gold-2: #ff9f1c;
  --a: #3ec7ff;
  --b: #ff4d6d;
  --ok: #4ade80;
  --radius: 16px;
  --title: "Bangers", "Impact", "Arial Black", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #3b2766 0%, transparent 70%), var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, .logo span, .vs, .ko, .card-name { font-family: var(--title); letter-spacing: .5px; font-weight: 400; }
h2 { font-size: 30px; margin: 24px 0 12px; }
a { color: var(--gold); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.row.center { justify-content: center; }
.fine { color: var(--muted); font-size: 14px; }

/* header / footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; max-width: 1080px; width: 100%; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo span { font-size: 28px; color: var(--gold); text-shadow: 3px 3px 0 #000; }
.top-right { display: flex; align-items: center; gap: 8px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; white-space: nowrap; }
.foot { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 20px 16px 28px; color: var(--muted); font-size: 14px; }

/* buttons */
.big-btn { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #1a1200; border: 0; border-radius: 12px; padding: 12px 22px; font-weight: 800; font-size: 17px; box-shadow: 0 4px 0 #8a5a00; transition: transform .08s; }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a5a00; }
.ghost-btn { background: transparent; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; }
.ghost-btn:hover, .icon-btn:hover { border-color: var(--gold); }
.icon-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 40px; height: 40px; font-size: 18px; }

/* landing */
.hero { text-align: center; padding: 40px 0 16px; }
.hero h1 { font-size: clamp(38px, 7vw, 68px); line-height: 1.02; margin: 0 auto 16px; max-width: 900px; color: var(--gold); text-shadow: 4px 4px 0 #000; }
.lead { font-size: 19px; max-width: 680px; margin: 0 auto 24px; color: #e4dcf7; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.hero .fine { max-width: 560px; margin: 0 auto; }
.hero-art { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 28px auto 0; background: none; border: 0; padding: 0; }
.hero-art img { width: min(34vw, 210px); aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; border: 3px solid var(--a); box-shadow: 0 10px 30px rgba(0,0,0,.5); transform: rotate(-3deg); transition: transform .2s; }
.hero-art img + span + img { border-color: var(--b); transform: rotate(3deg); }
.hero-art:hover img { transform: rotate(0) scale(1.03); }
.hero-art span { font-family: var(--title); font-size: 48px; color: var(--gold); text-shadow: 3px 3px 0 #000; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 32px 0 0; counter-reset: s; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; counter-increment: s; }
.steps li::before { content: counter(s); font-family: var(--title); font-size: 34px; color: var(--gold); display: block; line-height: 1; }
.steps b { display: block; font-size: 18px; margin: 6px 0 4px; }
.steps span { color: var(--muted); }

/* create */
.create-form { display: flex; gap: 10px; align-items: center; }
.create-form input { flex: 1; min-width: 0; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; color: var(--text); padding: 13px 14px; font-size: 17px; }
.create-form input:focus { outline: none; border-color: var(--gold); }
.status { margin: 18px 0; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; align-items: center; }
.status::before { content: ""; width: 22px; height: 22px; flex: none; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
.status.error::before { display: none; }
.status.error { border-color: var(--b); }
@keyframes spin { to { transform: rotate(360deg); } }

/* fighter card */
.card { background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 2px solid var(--gold); border-radius: 20px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.card-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: #000; display: block; }
.card-name { font-size: 32px; color: var(--gold); margin: 10px 0 0; line-height: 1.05; text-shadow: 2px 2px 0 #000; }
.card-title { color: var(--muted); font-style: italic; margin: 2px 0 10px; }
.card-line { font-size: 14px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 8px; margin: 0 0 10px; }
.stats { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; font-size: 13px; margin: 8px 0 12px; }
.stat-bar { height: 8px; background: #000; border-radius: 99px; overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-radius: 99px; }
.moves { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.moves li { background: rgba(0,0,0,.25); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.moves b { display: block; }
.kind { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; background: var(--line); color: var(--text); vertical-align: 2px; }
.trait { font-size: 14px; margin: 4px 0; }
.trait b { color: var(--gold); }
.quote { font-style: italic; color: #fff; margin-top: 8px; }

/* lobby */
.lobby-grid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 28px; margin-top: 18px; }
.ladder { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rung { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.rung .em { font-size: 28px; width: 36px; text-align: center; }
.rung .txt { flex: 1; min-width: 0; }
.rung .txt b { display: block; }
.rung .txt span { color: var(--muted); font-size: 14px; }
.rung.beaten { border-color: var(--ok); }
.rung.locked { opacity: .5; }
.rung.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.rung .big-btn, .rung .ghost-btn { padding: 8px 14px; font-size: 15px; }
.boss { border-color: var(--b); background: linear-gradient(120deg, #3a1530, var(--panel)); }

/* arena */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin-top: 18px; }
.vs { font-size: 54px; color: var(--gold); text-shadow: 3px 3px 0 #000; }
.side { background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; position: relative; }
.side.A { border-color: var(--a); }
.side.B { border-color: var(--b); }
.side img { width: 100%; max-width: 260px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; display: block; margin: 0 auto; background: #000; }
.side .nm { font-family: var(--title); font-size: 26px; margin-top: 6px; line-height: 1.05; }
.hp { height: 14px; background: #000; border-radius: 99px; overflow: hidden; margin-top: 8px; border: 1px solid var(--line); }
.hp i { display: block; height: 100%; width: 100%; transition: width .6s ease; }
.side.A .hp i { background: linear-gradient(90deg, #1b8fd1, var(--a)); }
.side.B .hp i { background: linear-gradient(90deg, #c2203f, var(--b)); }
.hp-num { font-size: 13px; color: var(--muted); }
.side.hit { animation: shake .4s; }
.side.down img { filter: grayscale(1) brightness(.6); }
@keyframes shake { 20% { transform: translateX(-8px) rotate(-1deg); } 40% { transform: translateX(8px) rotate(1deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.dmg { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); font-family: var(--title); font-size: 48px; color: #fff; text-shadow: 3px 3px 0 var(--b), -2px -2px 0 #000; animation: float 1s ease-out forwards; pointer-events: none; }
@keyframes float { to { transform: translate(-50%, -60px); opacity: 0; } }
.feed { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.feed li { background: var(--panel); border-left: 5px solid var(--line); border-radius: 10px; padding: 10px 12px; animation: pop .25s ease-out; }
.feed li.A { border-left-color: var(--a); }
.feed li.B { border-left-color: var(--b); }
.feed .mv { font-weight: 800; }
.feed .pill { float: right; font-size: 13px; background: #000; border-radius: 99px; padding: 1px 8px; margin-left: 8px; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
.arena-controls { display: flex; justify-content: center; margin-top: 10px; }
.result { text-align: center; margin-top: 18px; background: var(--panel); border: 2px solid var(--gold); border-radius: 20px; padding: 18px; }
.ko { font-size: 76px; color: var(--b); text-shadow: 4px 4px 0 #000; line-height: 1; animation: stamp .45s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes stamp { from { transform: scale(2.4) rotate(-8deg); opacity: 0; } }
.finale { font-size: 22px; font-weight: 800; margin: 8px 0 2px; color: var(--gold); }
.callout { font-size: 18px; font-style: italic; margin: 0 0 8px; }
.replay-cta { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #2b1730; border: 1px solid var(--b); color: #fff; padding: 12px 16px; border-radius: 12px; max-width: min(92vw, 560px); z-index: 10; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.toast a { color: var(--gold); }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .lobby-grid { grid-template-columns: 1fr; }
  .create-form { flex-wrap: wrap; }
  .create-form input { flex-basis: 100%; }
  .create-form .big-btn { flex: 1; }
  .vs { font-size: 34px; }
  .side .nm { font-size: 20px; }
  .ko { font-size: 56px; }
  .logo span { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
