/* ============ Theme ============ */
:root {
  --bg: #fff8e7;
  --bg-dot: #f3e6c4;
  --card: #ffffff;
  --ink: #1b1b2f;
  --muted: #5d5b6e;
  --red: #ff4757;
  --red-soft: #ffe1e4;
  --blue: #2f7bff;
  --blue-soft: #dde9ff;
  --yellow: #ffd23f;
  --green: #1fb86b;
  --arena-top: #8fd3ff;
  --arena-bottom: #ffe9a8;
  --floor: #e9b96e;
  --shadow: 4px 4px 0 var(--ink);
  --radius: 16px;
  --font-display: "Bangers", "Impact", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14152a;
    --bg-dot: #1d1f3a;
    --card: #23254a;
    --ink: #f6f1e3;
    --muted: #b9b6cf;
    --red-soft: #4a2230;
    --blue-soft: #1f2e57;
    --arena-top: #28337a;
    --arena-bottom: #4b3a6e;
    --floor: #6b4f3a;
    --shadow: 4px 4px 0 #000;
  }
}
:root[data-theme="dark"] {
  --bg: #14152a; --bg-dot: #1d1f3a; --card: #23254a; --ink: #f6f1e3; --muted: #b9b6cf;
  --red-soft: #4a2230; --blue-soft: #1f2e57; --arena-top: #28337a; --arena-bottom: #4b3a6e;
  --floor: #6b4f3a; --shadow: 4px 4px 0 #000;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 2px, transparent 2px);
  background-size: 22px 22px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px 16px 48px; outline: none; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 1px; font-weight: 400; margin: 0; line-height: 1.05; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ============ Header ============ */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--yellow); border-bottom: 3px solid #1b1b2f;
  position: sticky; top: 0; z-index: 20;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #1b1b2f; }
.logo-icon { font-size: 28px; }
.logo-text { font-family: var(--font-display); font-size: 30px; letter-spacing: 1.5px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  text-decoration: none; font-weight: 900; color: #1b1b2f; padding: 8px 12px; border-radius: 999px;
}
.nav a.active { background: #1b1b2f; color: var(--yellow); }
.preview-banner {
  background: var(--ink); color: var(--bg); text-align: center; font-size: 14px; padding: 8px 16px;
}
.site-footer { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 16px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 3px solid #1b1b2f; border-radius: 999px; background: var(--card); color: var(--ink);
  font-weight: 900; font-size: 16px; padding: 10px 18px; cursor: pointer; text-decoration: none;
  box-shadow: 3px 3px 0 #1b1b2f; transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #1b1b2f; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #1b1b2f; }
.btn:focus-visible, .chip:focus-visible, .card:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn-small { padding: 6px 12px; font-size: 14px; }
.btn-yellow { background: #fff; color: #1b1b2f; }
.btn-red { background: var(--red); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-dark { background: #1b1b2f; color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ============ Home ============ */
.hero {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: grid; gap: 16px; margin-bottom: 24px;
}
.hero-label { font-weight: 900; text-transform: uppercase; font-size: 13px; letter-spacing: 1.5px; color: var(--red); }
.hero h1 { font-size: clamp(34px, 7vw, 56px); }
.hero-faceoff { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.hero-faceoff .big-emoji { font-size: clamp(56px, 14vw, 96px); line-height: 1; }
.hero-faceoff .fname { font-weight: 900; font-size: clamp(15px, 3.5vw, 20px); margin-top: 6px; }
.vs-badge {
  font-family: var(--font-display); font-size: 28px; background: var(--red); color: #fff; border: 3px solid #1b1b2f;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; transform: rotate(-8deg);
  box-shadow: 3px 3px 0 #1b1b2f;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.section-head h2 { font-size: 34px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 2px solid var(--ink); background: var(--card); border-radius: 999px; padding: 6px 12px;
  font-weight: 700; cursor: pointer; font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s ease;
}
.card:hover { transform: translateY(-3px) rotate(-.5deg); }
.card-emojis { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 48px; line-height: 1; padding: 6px 0; }
.card-emojis .mini-vs { font-family: var(--font-display); font-size: 20px; color: var(--red); }
.card-names { font-weight: 900; text-align: center; font-size: 15px; }
.card-names span { color: var(--muted); font-weight: 700; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-weight: 700; }
.tag { border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--ink); background: var(--bg); }
.voted-pill { color: var(--green); font-weight: 900; }

/* ============ Split bar (results) ============ */
.split { display: flex; height: 28px; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--bg); }
.split > div {
  display: flex; align-items: center; font-weight: 900; font-size: 13px; color: #fff; white-space: nowrap;
  transition: width 1s cubic-bezier(.2,.9,.3,1.2); min-width: 0; overflow: hidden;
}
.split .sa { background: var(--red); justify-content: flex-start; padding-left: 10px; }
.split .sb { background: var(--blue); justify-content: flex-end; padding-right: 10px; }
.split.empty .sa, .split.empty .sb { background: var(--muted); opacity: .35; }

/* ============ Battle page ============ */
.battle-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.back { font-weight: 900; text-decoration: none; }
.battle-title { text-align: center; margin: 4px 0 14px; }
.battle-title h1 { font-size: clamp(32px, 7vw, 54px); }
.battle-title p { margin: 4px 0 0; color: var(--muted); font-weight: 700; }

.arena {
  position: relative; height: clamp(240px, 45vw, 340px); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  background: linear-gradient(var(--arena-top), var(--arena-bottom) 72%, var(--floor) 72%);
}
.arena::after { /* ring ropes */
  content: ""; position: absolute; left: 0; right: 0; top: 58%; height: 4px; background: rgba(0,0,0,.18);
  box-shadow: 0 18px 0 rgba(0,0,0,.12);
}
.arena.shake { animation: shake .35s linear; }
@keyframes shake {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px,-4px); }
  60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px,-2px); }
}
.fighter {
  position: absolute; bottom: 20%; width: 40%; display: flex; flex-direction: column; align-items: center;
  z-index: 3; will-change: transform;
}
.fighter.left { left: 4%; }
.fighter.right { right: 4%; }
.sprite { position: relative; font-size: clamp(72px, 17vw, 128px); line-height: 1; filter: drop-shadow(3px 5px 0 rgba(0,0,0,.25)); user-select: none; }
.sprite.big { font-size: clamp(88px, 21vw, 156px); }
.sprite.small { font-size: clamp(56px, 13vw, 96px); }
.left .sprite .face { display: inline-block; transform: scaleX(-1); } /* face the opponent */
.sprite .crowd { display: grid; grid-template-columns: repeat(3, auto); gap: 0 2px; font-size: .5em; }
.sprite .count-badge {
  position: absolute; top: -6px; right: -10px; background: var(--yellow); color: #1b1b2f; border: 2px solid #1b1b2f;
  border-radius: 999px; font-family: var(--font-display); font-size: 18px; padding: 2px 8px; letter-spacing: .5px;
}
.fighter .crown, .fighter .dizzy { position: absolute; top: -34px; font-size: 40px; opacity: 0; pointer-events: none; }
.nameplate {
  margin-top: 6px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px;
  font-weight: 900; font-size: clamp(12px, 2.6vw, 15px); text-align: center; max-width: 100%;
}
.left .nameplate { border-color: var(--red); box-shadow: 2px 2px 0 var(--red); }
.right .nameplate { border-color: var(--blue); box-shadow: 2px 2px 0 var(--blue); }
.arena-vs { position: absolute; left: 50%; top: 38%; transform: translate(-50%,-50%) rotate(-8deg); z-index: 2; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.pow {
  position: absolute; font-family: var(--font-display); font-size: clamp(30px, 7vw, 52px); color: var(--yellow);
  -webkit-text-stroke: 2px #1b1b2f; paint-order: stroke fill; text-shadow: 3px 3px 0 #1b1b2f; letter-spacing: 1px;
  transform: translate(-50%,-50%); white-space: nowrap;
}
.burst {
  position: absolute; width: 90px; height: 90px; transform: translate(-50%,-50%);
  background: var(--yellow); border: 3px solid #1b1b2f;
  clip-path: polygon(50% 0,61% 32%,98% 22%,70% 50%,98% 78%,61% 68%,50% 100%,39% 68%,2% 78%,30% 50%,2% 22%,39% 32%);
}
.dust {
  position: absolute; left: 50%; top: 58%; width: 60%; height: 70%; transform: translate(-50%,-50%) scale(.2);
  opacity: 0; z-index: 4; pointer-events: none;
}
.dust span {
  position: absolute; border-radius: 50%; background: #fff; border: 3px solid #1b1b2f;
}
.flying { position: absolute; font-size: 28px; transform: translate(-50%,-50%); }
.arena-banner {
  position: absolute; left: 50%; top: 16%; transform: translate(-50%,-50%) scale(0); z-index: 6;
  font-family: var(--font-display); font-size: clamp(28px, 6.5vw, 46px); background: var(--red); color: #fff;
  border: 3px solid #1b1b2f; border-radius: 12px; padding: 4px 16px; box-shadow: 3px 3px 0 #1b1b2f; white-space: nowrap;
}

.vote-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.vote-row .btn { font-size: clamp(15px, 3.6vw, 19px); padding: 14px 10px; border-radius: 14px; }
.vote-row .btn .small { display: block; font-size: 12px; opacity: .9; font-weight: 700; }
.vote-row .btn { flex-direction: column; gap: 0; }

.panel {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-top: 16px;
}
.panel h2 { font-size: 26px; margin-bottom: 10px; }

.stats { display: grid; gap: 8px; }
.stat-row { display: grid; grid-template-columns: 1fr 72px 1fr; align-items: center; gap: 8px; }
.stat-label { text-align: center; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.stat-bar { height: 14px; background: var(--bg); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; display: flex; }
.stat-bar.a { justify-content: flex-end; }
.stat-bar i { display: block; height: 100%; }
.stat-bar.a i { background: var(--red); }
.stat-bar.b i { background: var(--blue); }

.verdict { text-align: center; }
.verdict .verdict-emoji { font-size: 64px; line-height: 1; }
.verdict h2 { font-size: clamp(30px, 6vw, 44px); margin: 6px 0; }
.verdict .you { font-weight: 700; color: var(--muted); margin: 0 0 12px; }
.split-labels { display: flex; justify-content: space-between; font-weight: 900; font-size: 14px; margin-bottom: 6px; gap: 8px; }
.split-labels .la { color: var(--red); }
.split-labels .lb { color: var(--blue); text-align: right; }
.verdict .total { color: var(--muted); font-size: 14px; margin: 8px 0 14px; font-weight: 700; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1b1b2f; color: #fff;
  padding: 10px 16px; border-radius: 999px; font-weight: 700; z-index: 50;
}

/* ============ Results page ============ */
.results-list { display: grid; gap: 12px; }
.result-item {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 12px 14px;
  text-decoration: none; display: grid; gap: 8px; box-shadow: 3px 3px 0 var(--ink);
}
.result-item .ri-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 900; font-size: 15px; flex-wrap: wrap; }
.result-item .ri-head .n { color: var(--muted); font-weight: 700; font-size: 13px; }
select.sort {
  border: 2px solid var(--ink); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-weight: 700;
}

.empty-state { text-align: center; padding: 40px 0; }
.empty-state .big-emoji { font-size: 72px; }

@media (max-width: 520px) {
  .logo-text { font-size: 24px; }
  .nav a { padding: 6px 8px; font-size: 14px; }
  .stat-row { grid-template-columns: 1fr 56px 1fr; }
  .stat-label { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ============ Fighter extras ============ */
.fighter .crown, .fighter .dizzy { left: 50%; transform: translateX(-50%); z-index: 2; }
.fighter .dizzy { top: -20px; font-size: 34px; }
.arena.idle .fighter.left .sprite { animation: bob 1.4s ease-in-out infinite; }
.arena.idle .fighter.right .sprite { animation: bob 1.4s ease-in-out .7s infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.sprite { transition: transform .2s ease; }
.sprite { transform-origin: 50% 100%; }
@media (max-width: 520px) {
  .arena-vs { top: 22%; }
  .arena-vs .vs-badge { width: 44px; height: 44px; font-size: 22px; }
}
.nameplate { position: relative; z-index: 1; }

/* ============ Brawl Arcade ============ */
.btn-big { font-size: 26px; padding: 14px 40px; font-family: var(--font-display); letter-spacing: 1.5px; font-weight: 400; }
.btn-link { background: none; border: 0; cursor: pointer; padding: 0; font-weight: 900; font-size: 16px; }
.arcade-intro { text-align: center; margin: 4px 0 18px; }
.arcade-intro h1 { font-size: clamp(38px, 8vw, 60px); }
.arcade-intro p { margin: 6px auto; max-width: 560px; color: var(--muted); font-weight: 700; }
.arcade-intro .record { color: var(--ink); font-size: 14px; }

.slots { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; max-width: 620px; margin: 0 auto 14px; }
.slot {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 12px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: var(--shadow); min-width: 0;
}
.slot.p1 { border-color: var(--red); } .slot.p2 { border-color: var(--blue); }
.slot.active.p1 { box-shadow: 0 0 0 4px var(--red-soft), 4px 4px 0 var(--red); }
.slot.active.p2 { box-shadow: 0 0 0 4px var(--blue-soft), 4px 4px 0 var(--blue); }
.slot-label { font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; }
.slot.p1 .slot-label { color: var(--red); } .slot.p2 .slot-label { color: var(--blue); }
.slot-emoji { font-size: clamp(52px, 12vw, 76px); line-height: 1.1; }
.slot-name { font-weight: 900; font-size: 15px; text-align: center; }
.slot-stats { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }

.select-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.select-actions { display: flex; gap: 8px; }
.select-hint { font-weight: 900; margin: 12px 0 8px; }
.fighter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.fighter-pick {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .1s ease; min-width: 0;
}
.fighter-pick:hover { transform: translateY(-2px); }
.fighter-pick:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.fp-emoji { font-size: 38px; line-height: 1.1; }
.fp-name { font-size: 11px; font-weight: 800; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.fighter-pick.is-p1 { border-color: var(--red); background: var(--red-soft); box-shadow: 2px 2px 0 var(--red); }
.fighter-pick.is-p2 { border-color: var(--blue); background: var(--blue-soft); box-shadow: 2px 2px 0 var(--blue); }
.fight-cta { position: sticky; bottom: 12px; display: flex; justify-content: center; margin-top: 18px; z-index: 5; }

.arcade-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.arcade-game { max-width: 980px; margin: 0 auto; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; margin-bottom: 8px; }
.hud-side { min-width: 0; }
.hud-side.p2 { text-align: right; }
.hud-name { font-weight: 900; font-size: clamp(13px, 2.6vw, 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-name small { font-size: 11px; color: var(--muted); }
.hp { position: relative; height: 20px; border: 3px solid var(--ink); border-radius: 999px; background: var(--bg); overflow: hidden; margin: 4px 0; }
.hp i, .hp b { position: absolute; top: 0; bottom: 0; left: 0; display: block; }
.hp b { background: #ffb3bb; z-index: 0; }
.hp i { background: var(--green); z-index: 1; transition: width .08s linear; }
.hp.low i { background: var(--red); }
.hud-side.p2 .hp i, .hud-side.p2 .hp b { left: auto; right: 0; }
.hud-row { display: flex; gap: 8px; align-items: center; }
.hud-side.p2 .hud-row { flex-direction: row-reverse; }
.meter { position: relative; flex: 1; max-width: 170px; height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--bg); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--yellow); display: block; }
.hud-side.p2 .meter i { inset: 0 0 0 auto; }
.meter span { position: relative; font-size: 9px; font-weight: 900; display: block; text-align: center; line-height: 10px; letter-spacing: 1px; }
.meter.full { animation: glow .6s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 0 0 var(--yellow); } to { box-shadow: 0 0 10px 3px var(--yellow); } }
.pips { display: flex; gap: 4px; }
.pips span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: var(--bg); }
.pips span.on { background: var(--yellow); }
.hud-mid { text-align: center; }
.timer {
  font-family: var(--font-display); font-size: 34px; line-height: 1; background: var(--card); border: 3px solid var(--ink);
  border-radius: 12px; padding: 4px 10px; min-width: 60px;
}
.timer.low { color: var(--red); }
.round-label { font-weight: 900; font-size: 11px; margin-top: 4px; letter-spacing: 1px; }

.stage { position: relative; border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--arena-top); }
.stage canvas { display: block; width: 100%; aspect-ratio: 2 / 1; height: auto; touch-action: none; }
.arcade-banner {
  position: absolute; left: 50%; top: 32%; transform: translate(-50%,-50%) scale(0); pointer-events: none;
  font-family: var(--font-display); font-size: clamp(34px, 8vw, 72px); color: #fff; background: var(--red);
  border: 4px solid #1b1b2f; border-radius: 14px; padding: 2px 22px; box-shadow: 4px 4px 0 #1b1b2f; white-space: nowrap; letter-spacing: 2px;
}
.arcade-banner.pop { animation: bannerpop 1.1s ease-out forwards; }
@keyframes bannerpop {
  0% { transform: translate(-50%,-50%) scale(0) rotate(-18deg); }
  18% { transform: translate(-50%,-50%) scale(1.15) rotate(-5deg); }
  28%, 78% { transform: translate(-50%,-50%) scale(1) rotate(-5deg); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(.6) rotate(-5deg); opacity: 0; }
}
.overlay { position: absolute; inset: 0; background: rgba(20,21,42,.55); display: grid; place-items: center; padding: 12px; z-index: 5; }
.overlay-card {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; text-align: center; max-width: 440px; width: 100%;
}
.overlay-card h2 { font-size: clamp(32px, 7vw, 48px); margin-bottom: 6px; }
.overlay-card p { margin: 0 0 12px; font-weight: 700; color: var(--muted); }
.result-emoji { font-size: 54px; line-height: 1; }
.pause-btn {
  position: absolute; top: 8px; right: 8px; z-index: 4; width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid #1b1b2f; background: rgba(255,255,255,.85); color: #1b1b2f; cursor: pointer; font-size: 16px;
}
.controls-help { text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; margin: 12px 0 0; line-height: 2; }
kbd {
  display: inline-block; min-width: 24px; padding: 0 6px; border: 2px solid var(--ink); border-bottom-width: 3px; border-radius: 6px;
  background: var(--card); color: var(--ink); font-family: var(--font-body); font-size: 12px; font-weight: 900; line-height: 20px; text-align: center;
}
.touch-controls { display: none; justify-content: space-between; gap: 12px; margin-top: 12px; user-select: none; -webkit-user-select: none; }
.touch-controls .pad { display: flex; gap: 8px; }
.touch-controls button {
  width: 58px; height: 58px; border-radius: 50%; border: 3px solid #1b1b2f; background: var(--card); color: var(--ink);
  font-size: 22px; touch-action: none; box-shadow: 3px 3px 0 #1b1b2f; -webkit-tap-highlight-color: transparent;
}
.touch-controls button.down { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #1b1b2f; background: var(--yellow); color: #1b1b2f; }
.touch-controls .super { opacity: .45; }
.touch-controls .super.ready { opacity: 1; background: var(--yellow); animation: glow .6s ease-in-out infinite alternate; }
@media (hover: none), (pointer: coarse), (max-width: 700px) {
  .touch-controls { display: flex; }
  .controls-help { display: none; }
}
@media (max-width: 420px) {
  .touch-controls button { width: 50px; height: 50px; font-size: 19px; }
  .touch-controls .pad { gap: 5px; }
  .meter span { display: none; }
}
.battle-play { display: flex; justify-content: center; margin-top: 12px; }
.arcade-promo {
  display: flex; align-items: center; gap: 14px; text-decoration: none; margin: -8px 0 24px;
  background: #1b1b2f; color: #fff; border: 3px solid #1b1b2f; border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow);
}
.arcade-promo b { font-family: var(--font-display); font-size: 24px; font-weight: 400; letter-spacing: 1px; color: var(--yellow); }
.arcade-promo span:nth-child(2) { flex: 1; font-weight: 700; font-size: 14px; }
.ap-emoji { font-size: 40px; }
@media (max-width: 420px) {
  .touch-controls { gap: 8px; }
  .touch-controls button { width: 44px; height: 44px; font-size: 18px; }
  .touch-controls .pad { gap: 4px; }
}
.rotate-tip { display: none; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); margin: 10px 0 0; }
@media (orientation: portrait) and (max-width: 700px) { .rotate-tip { display: block; } }

/* Short landscape screens (phones sideways): fit the whole fight on screen */
@media (max-height: 520px) and (orientation: landscape) {
  body.in-game .site-header, body.in-game .site-footer, body.in-game .preview-banner { display: none !important; }
  body.in-game main { padding-top: 6px; padding-bottom: 6px; }
  body.in-game .arcade-top { margin-bottom: 2px; font-size: 13px; }
  body.in-game .arcade-game { position: relative; max-width: none; }
  body.in-game .hud { margin-bottom: 4px; gap: 8px; }
  body.in-game .hp { height: 14px; margin: 2px 0; }
  body.in-game .timer { font-size: 22px; min-width: 44px; padding: 2px 6px; }
  body.in-game .round-label { display: none; }
  body.in-game .stage { width: min(100%, calc((100svh - 96px) * 2)); margin: 0 auto; }
  body.in-game .touch-controls {
    display: flex; position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; padding: 0 8px; pointer-events: none;
  }
  body.in-game .touch-controls .pad { pointer-events: auto; gap: 6px; }
  body.in-game .touch-controls button { width: 50px; height: 50px; font-size: 20px; opacity: .82; }
  body.in-game .touch-controls .super:not(.ready) { opacity: .4; }
  body.in-game .rotate-tip, body.in-game .controls-help { display: none; }
}
.battle-play { flex-direction: column; align-items: center; gap: 8px; }
.arcade-line { margin: 0; font-weight: 700; font-size: 14px; color: var(--muted); text-align: center; }
.arcade-line b.la { color: var(--red); } .arcade-line b.lb { color: var(--blue); }
.arcade-line.small { font-size: 12px; text-align: left; }
.arcade-record { font-size: 14px; color: var(--ink) !important; background: var(--bg); border-radius: 10px; padding: 6px 10px; }
