/* Stream Battles: dark, OmniStream-like. Shared by the game (index.html) and the admin panel. */
:root {
  --bg: #0e0e10;
  --panel: #18181b;
  --panel2: #1f1f23;
  --line: #2a2a2e;
  --text: #efeff1;
  --muted: #9a9aa3;
  --accent: #9146ff;
  --accent2: #772ce8;
  --ok: #00c853;
  --bad: #ff4d4f;
  --warn: #ffb300;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* Header */
header#top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: rgba(14, 14, 16, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; white-space: nowrap; }
.logo-icon { font-size: 20px; }
#nav { display: flex; gap: 4px; margin-left: 12px; }
.nav-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 0; color: var(--muted);
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600;
}
.nav-btn:hover { background: var(--panel2); color: var(--text); }
.nav-btn.on { background: rgba(145, 70, 255, .16); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-icon { font-size: 16px; }
.spacer { flex: 1; }
.langs { display: flex; gap: 6px; }
.lang-flag { width: 28px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: none; cursor: pointer; opacity: .5; }
.lang-flag svg { display: block; width: 100%; height: 100%; }
.lang-flag[aria-pressed='true'] { opacity: 1; border-color: var(--accent); }
.user { display: flex; align-items: center; gap: 8px; }
.user-name { color: var(--muted); font-weight: 600; }

/* Controls */
button, .btn { font: inherit; }
.btn, button.primary, .chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn { background: var(--panel2); border: 1px solid var(--line); color: var(--text); padding: 8px 14px; }
.btn:hover { border-color: #3a3a40; background: #26262b; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); padding: 6px 10px; }
.btn.ghost:hover { color: var(--text); background: var(--panel2); }
.btn.danger { color: var(--bad); }
button.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border: 0; color: #fff; padding: 10px 18px;
  box-shadow: 0 4px 16px rgba(145, 70, 255, .3);
  transition: transform .1s, box-shadow .15s;
}
button.primary:hover { box-shadow: 0 6px 22px rgba(145, 70, 255, .45); }
button.primary:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }
.wide { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { background: var(--panel2); border: 1px solid var(--line); color: var(--muted); padding: 5px 10px; font-size: 12px; }
.chip:hover { color: var(--text); }
.chip.on { color: var(--text); border-color: var(--accent); background: rgba(145, 70, 255, .16); }
.chip.static { cursor: default; color: var(--text); }
input, select, textarea {
  width: 100%;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(145, 70, 255, .2); }
label.field { display: block; margin: 12px 0 6px; font-weight: 600; font-size: 13px; }
.form-error { color: var(--bad); margin: 10px 0 0; font-weight: 600; }

/* Layout */
main { padding: 20px 18px 60px; max-width: 1180px; margin: 0 auto; }
.loading { text-align: center; font-size: 32px; padding: 80px; opacity: .6; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page { display: grid; gap: 16px; }
.page-head p { margin: 0; }
.center-page { display: grid; place-items: center; min-height: calc(100vh - 140px); }
.auth-card { width: min(400px, 100%); }
.auth-card button.primary { margin-top: 16px; }
.auth-logo { font-size: 40px; text-align: center; margin-bottom: 6px; }
.auth-card h1, .auth-card > p.muted:first-of-type { text-align: center; }
.count { margin-left: 6px; background: var(--panel2); color: var(--text); border-radius: 999px; padding: 1px 8px; font-size: 12px; letter-spacing: 0; }
.empty { color: var(--muted); text-align: center; padding: 24px; margin: 0; }

/* Character creation */
.create-card { width: min(520px, 100%); }
.body-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.body-option {
  background: var(--panel2); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 10px; cursor: pointer; color: var(--text); font-weight: 600;
  display: grid; gap: 6px; justify-items: center;
}
.body-option.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(145, 70, 255, .2); }
.body-preview { height: 220px; width: 100%; }
.body-preview svg { height: 100%; width: 100%; }
.create-card button.primary { margin-top: 16px; }

/* Character page */
.hero { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; }
.hero-card { text-align: center; }
.stage {
  height: 340px; border-radius: 10px; margin-bottom: 12px;
  background: radial-gradient(circle at 50% 85%, rgba(145, 70, 255, .28), transparent 62%), var(--panel2);
}
.stage svg { height: 100%; width: 100%; }
.hero-name { font-size: 22px; }
.level-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.level-badge { background: rgba(145, 70, 255, .2); color: #c9a8ff; border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 12px; }
.xp-bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 8px 0 12px; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #c084fc); border-radius: 99px; transition: width .6s; }
.record { display: flex; justify-content: center; gap: 18px; font-weight: 700; margin-bottom: 10px; }
.body-switch { display: flex; justify-content: center; gap: 6px; }
.hero-side { display: grid; gap: 16px; align-content: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.stat { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 10px 12px; }
.stat-icon { font-size: 18px; }
.stat-name { color: var(--muted); flex: 1; }
.stat-value { font-size: 18px; }
.stat-bonus { color: var(--ok); font-weight: 700; font-size: 12px; }
.stat-bonus.neg { color: var(--bad); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.slot { background: var(--panel2); border: 1px dashed var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; align-content: start; }
.slot.filled { border-style: solid; border-color: color-mix(in srgb, var(--rarity) 50%, var(--line)); }
.slot-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.slot-empty { color: #55555c; text-align: center; padding: 30px 0; font-size: 12px; }
.slot .item-tile { background: var(--panel); }

/* Items */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.item-tile {
  --rarity: #9e9e9e;
  position: relative;
  display: grid; gap: 4px; text-align: left;
  background: var(--panel2); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--rarity) 45%, var(--line));
  border-radius: 10px; padding: 8px; cursor: pointer; font: inherit;
  transition: transform .12s, box-shadow .15s;
}
.item-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px color-mix(in srgb, var(--rarity) 30%, transparent); }
.item-art {
  height: 84px; border-radius: 8px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rarity) 28%, transparent), transparent 70%), #26262c;
}
.item-art svg { height: 100%; width: 100%; }
.sb-icon { font-size: 34px; }
.item-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; }
.rarity { color: var(--rarity); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.item-bonus { color: var(--muted); }
.tile-action {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px; opacity: 0; transition: opacity .15s;
}
.item-tile:hover .tile-action { opacity: 1; }
.new-badge { position: absolute; top: 6px; right: 6px; background: var(--ok); color: #000; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; text-transform: uppercase; }

/* Hunt */
.monster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.monster-card { display: grid; gap: 10px; }
.monster-card h2 { text-align: center; margin: 0; }
.monster-art {
  height: 200px; border-radius: 10px;
  background: radial-gradient(circle at 50% 80%, rgba(0, 200, 83, .22), transparent 60%), var(--panel2);
}
.monster-art svg { height: 100%; width: 100%; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) scaleY(1.03); } }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.drops-title { margin: 4px 0 0; }
.drops { display: grid; gap: 6px; }
.drop {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel2); border-radius: 8px; padding: 4px 10px 4px 4px;
  border-left: 3px solid var(--rarity);
}
.drop-art { width: 40px; height: 40px; background: #26262c; border-radius: 6px; display: grid; place-items: center; flex: none; }
.drop-art svg { width: 100%; height: 100%; }
.drop-art .sb-icon { font-size: 20px; }
.drop-name { flex: 1; font-weight: 600; }
.drop-chance { color: var(--rarity); }
.fight-btn { font-size: 16px; padding: 12px; }

/* Battle */
.battle-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .78); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.battle { width: min(860px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; max-height: 100%; overflow: auto; }
.battle-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.vs { font-weight: 900; font-size: 20px; color: var(--accent); }
.hp-name { font-weight: 800; margin-bottom: 4px; }
.hp.b { text-align: right; }
.hp-bar { position: relative; height: 18px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.hp.b .hp-bar { transform: scaleX(-1); }
.hp.b .hp-num { transform: scaleX(-1); }
.hp-fill { height: 100%; background: linear-gradient(90deg, #00c853, #69f0ae); transition: width .3s; }
.hp-fill.y { background: linear-gradient(90deg, #ffb300, #ffd54f); }
.hp-fill.r { background: linear-gradient(90deg, #ff1744, #ff616f); }
.hp-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.arena {
  position: relative; height: 340px; border-radius: 12px; overflow: hidden;
  background:
    linear-gradient(180deg, transparent 70%, rgba(145, 70, 255, .18) 70%, rgba(145, 70, 255, .05)),
    radial-gradient(circle at 50% 100%, rgba(145, 70, 255, .25), transparent 60%),
    var(--panel2);
}
.arena-fighter { position: absolute; bottom: 14px; width: 36%; height: 88%; transition: transform .2s, opacity .6s, filter .6s; }
.arena-fighter svg { width: 100%; height: 100%; }
.arena-fighter.a { left: 6%; }
.arena-fighter.b { right: 6%; height: 62%; }
.arena-fighter.a.lunge { animation: lungeR .38s ease-out; }
.arena-fighter.b.lunge { animation: lungeL .38s ease-out; }
@keyframes lungeR { 40% { transform: translateX(14%); } }
@keyframes lungeL { 40% { transform: translateX(-14%) scaleY(.92); } }
.arena-fighter.hit { animation: hit .32s; }
@keyframes hit { 25% { transform: translateX(-4%); filter: brightness(2) saturate(.3); } 60% { transform: translateX(3%); } }
.arena-fighter.b.hit { animation-name: hitB; }
@keyframes hitB { 25% { transform: translateX(4%); filter: brightness(2) saturate(.3); } 60% { transform: translateX(-3%); } }
.sb-fighter .f-hurt, .sb-fighter .f-ko, .sb-fighter .f-win { display: none; }
.arena-fighter.hurt .f-normal { display: none; }
.arena-fighter.hurt .f-hurt { display: inline; }
.arena-fighter.ko .f-normal, .arena-fighter.ko .f-hurt { display: none; }
.arena-fighter.ko .f-ko { display: inline; }
.arena-fighter.win .f-normal { display: none; }
.arena-fighter.win .f-win { display: inline; }
.arena-fighter.ko { transform: rotate(-80deg) translate(-30%, 10%); transform-origin: 50% 100%; opacity: .7; transition: transform .8s ease-in, opacity .8s; }
.arena-fighter.win { animation: cheer .6s ease-in-out 2; }
@keyframes cheer { 50% { transform: translateY(-6%); } }
.arena-fighter.defeated { opacity: .15; filter: grayscale(1); transform: scaleY(.4); transform-origin: 50% 100%; transition: transform .6s, opacity .8s, filter .6s; }
.floats { position: absolute; inset: 0; pointer-events: none; }
.float {
  position: absolute; top: 30%; font-weight: 900; font-size: 24px; color: #fff;
  text-shadow: 0 2px 0 #000, 0 0 10px rgba(255, 77, 79, .8);
  animation: rise 1.1s ease-out forwards;
}
.float.a { left: 20%; }
.float.b { right: 20%; }
.float.crit { color: var(--warn); font-size: 32px; text-shadow: 0 2px 0 #000, 0 0 14px rgba(255, 179, 0, .9); }
.float.miss { color: var(--muted); font-size: 18px; text-shadow: 0 2px 0 #000; }
@keyframes rise { 0% { transform: translateY(10px) scale(.7); opacity: 0; } 15% { transform: translateY(0) scale(1.15); opacity: 1; } 100% { transform: translateY(-70px) scale(1); opacity: 0; } }
.battle-banner {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.5);
  font-size: 44px; font-weight: 900; opacity: 0; pointer-events: none; white-space: nowrap;
  text-shadow: 0 4px 0 #000;
}
.battle-banner.show { animation: banner .5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.battle-banner.win { color: var(--warn); }
.battle-banner.loss { color: var(--bad); }
.battle-banner.draw { color: var(--muted); }
@keyframes banner { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.battle-foot { display: flex; justify-content: flex-end; }
.battle-result { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; animation: fade .3s; }
.result-line { font-size: 18px; font-weight: 800; }
.result-line.levelup { color: var(--warn); }
.result-actions { display: flex; gap: 8px; justify-content: flex-end; }
.drops-won .item-tile { cursor: default; animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* Arena placeholder */
.soon { text-align: center; padding: 60px 16px; }
.soon-icon { font-size: 56px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  max-width: calc(100vw - 32px);
}
.toast.ok { border-color: var(--ok); }
.toast.bad { border-color: var(--bad); }

/* Admin */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: rgba(255, 255, 255, .02); }
.table-wrap { overflow-x: auto; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > button { flex: 0 0 auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; background: var(--panel2); margin: 1px 2px; }
.pill.active { color: var(--ok); }
.pill.suspended, .pill.banned { color: var(--bad); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 18px; background: var(--bg); border: 1px dashed var(--warn); border-radius: 8px; padding: 10px; user-select: all; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; min-height: 120px; }
.mini-art { width: 56px; height: 56px; background: #26262c; border-radius: 8px; display: grid; place-items: center; }
.mini-art svg { width: 100%; height: 100%; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hide-sm, .nav-label { display: none; }
  #nav { margin-left: 0; }
  header#top { padding: 8px 12px; gap: 8px; }
  .logo b { display: none; }
  .arena { height: 260px; }
  .battle-banner { font-size: 32px; }
  .grid2 { grid-template-columns: 1fr; }
  main { padding: 16px 16px 60px; }
}

/* Arena (public/arena.js) */
.arena-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.arena-main { display: grid; gap: 16px; min-width: 0; }
.stage-card { display: grid; gap: 10px; }
.stage-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; }
.plate .pl-name { margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate.b { text-align: right; }
.plate.b .hp-bar, .plate.b .hp-num { transform: scaleX(-1); }
.stage-clock { font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 56px; text-align: center; padding-bottom: 2px; }
.streak { color: var(--warn); font-weight: 700; }
.stage-arena {
  position: relative; height: 380px; border-radius: 12px; overflow: hidden;
  background:
    linear-gradient(180deg, transparent 74%, rgba(145, 70, 255, .2) 74%, rgba(145, 70, 255, .05)),
    radial-gradient(circle at 20% 100%, rgba(145, 70, 255, .28), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(255, 145, 0, .2), transparent 45%),
    var(--panel2);
}
.st-fighter { position: absolute; bottom: 16px; height: 82%; aspect-ratio: 340 / 500; transition: opacity .6s, filter .6s; }
.st-fighter svg { width: 100%; height: 100%; display: block; }
.st-fighter.a { left: 4%; }
.st-fighter.b { right: 4%; }
.st-fighter.b svg { transform: scaleX(-1); }
.st-fighter.recoil { animation: recoil .16s; }
.st-fighter.a.recoil { --kick: -3%; }
.st-fighter.b.recoil { --kick: 3%; }
@keyframes recoil { 40% { transform: translateX(var(--kick, -3%)); } }
.st-fighter.hit { animation: hit .32s; }
.st-fighter.b.hit { animation-name: hitB; }
.st-fighter.ko { opacity: .55; filter: grayscale(.7); transform-origin: 50% 100%; transition: transform .8s ease-in, opacity .8s, filter .8s; }
/* A knocked-out fighter falls forward, towards the middle (falling back would leave the stage). */
.st-fighter.a.ko { transform: rotate(84deg); }
.st-fighter.b.ko { transform: rotate(-84deg); }
.st-fighter.win { animation: cheer .6s ease-in-out 3; }
.hurt .sb-fighter .f-normal, .ko .sb-fighter .f-normal, .ko .sb-fighter .f-hurt, .win .sb-fighter .f-normal { display: none; }
.hurt .sb-fighter .f-hurt, .ko .sb-fighter .f-ko, .win .sb-fighter .f-win { display: inline; }
.st-shots { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.shot {
  position: absolute; left: 0; top: 0; width: var(--size, 12px); height: var(--size, 12px);
  margin: calc(var(--size, 12px) / -2) 0 0 calc(var(--size, 12px) / -2);
  border-radius: 50%; will-change: transform;
}
.shot.a { background: radial-gradient(circle at 35% 35%, #fff, #b388ff 45%, #7c4dff); box-shadow: 0 0 12px #b388ff, -14px 0 10px -4px rgba(179, 136, 255, .6); }
.shot.b { background: radial-gradient(circle at 65% 35%, #fff, #ffab40 45%, #ff6d00); box-shadow: 0 0 12px #ffab40, 14px 0 10px -4px rgba(255, 171, 64, .6); }
.burst { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: radial-gradient(circle, #fff, #ffd54f 40%, transparent 70%); animation: burst .5s ease-out forwards; }
@keyframes burst { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.stage-arena .float { top: auto; }
.stage-banner {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 4;
  font-size: 40px; font-weight: 900; text-align: center; pointer-events: none; opacity: 0;
  text-shadow: 0 4px 0 #000; transition: opacity .2s; max-width: 90%;
}
.stage-banner.show { opacity: 1; }
.stage-banner.idle { font-size: 20px; color: var(--muted); text-shadow: none; }
.stage-banner.count { font-size: 80px; color: #fff; }
.stage-banner.go { color: var(--warn); animation: banner .4s cubic-bezier(.2, 1.6, .4, 1); }
.stage-banner.ko { color: var(--warn); }
.stage-banner.draw { color: var(--muted); }
.stage-hint { margin: 0; text-align: center; }
.king { margin-bottom: 10px; }
.king-row { font-size: 15px; }
.queue-list { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.queue-list li.mine b { color: var(--accent); }
.queue-list .empty-q { list-style: none; margin-left: -22px; }
.queue-me { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.chat-card { display: grid; grid-template-rows: auto 1fr auto auto; height: calc(100vh - 120px); min-height: 420px; position: sticky; top: 76px; }
.chat-log { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; min-height: 0; }
.msg { position: relative; padding: 3px 6px; border-radius: 6px; overflow-wrap: anywhere; line-height: 1.4; }
.msg:hover { background: rgba(255, 255, 255, .04); }
.msg-name { margin-right: 6px; }
.msg.fired.a { background: rgba(179, 136, 255, .1); }
.msg.fired.b { background: rgba(255, 171, 64, .1); }
.msg-fired { margin-right: 4px; }
.msg-mod { position: absolute; right: 4px; top: 1px; display: none; gap: 2px; background: var(--panel); border-radius: 6px; }
.msg:hover .msg-mod { display: flex; }
.msg-mod button { background: none; border: 0; cursor: pointer; padding: 2px 4px; font-size: 13px; border-radius: 4px; }
.msg-mod button:hover { background: var(--panel2); }
.chat-status { min-height: 18px; padding: 4px 2px 0; }
.chat-form { display: flex; gap: 6px; margin-top: 4px; }
.chat-form button.primary { padding: 10px 14px; }
.chat-input.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.arena .shot { z-index: 3; }

@media (max-width: 960px) {
  .arena-page { grid-template-columns: 1fr; }
  .chat-card { position: static; height: 420px; }
}
@media (max-width: 760px) {
  .stage-arena { height: 260px; }
  .fw { font-size: 17px; }
  .stage-banner.count { font-size: 56px; }
}
.arena-fighter.recoil { animation: recoil .16s; }

/* Floating words (neutral, single-use) and the side picker */
.st-words { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fw {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 24px; font-weight: 800; letter-spacing: .06em; color: rgba(255, 255, 255, .42);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6); white-space: nowrap; user-select: none;
  animation: fwIn .5s ease-out, fwDrift 6s ease-in-out .5s infinite alternate, fwOut 1.5s ease-in var(--fade-at, 9999s) forwards;
}
.fw.partial { color: rgba(255, 213, 79, .5); }
.fw i { font-style: normal; display: inline-block; min-width: .6em; text-align: center; color: rgba(255, 213, 79, .8); }
.fw sup { font-size: 11px; margin-left: 4px; color: rgba(255, 213, 79, .8); }
.fw.taken { animation: fwTaken .7s ease-out forwards; z-index: 2; }
.fw.taken.a { color: #d1b3ff; text-shadow: 0 0 16px #b388ff; }
.fw.taken.b { color: #ffd59e; text-shadow: 0 0 16px #ffab40; }
.fw.gone { animation: fwGone .4s ease-in forwards; }
@keyframes fwIn { from { opacity: 0; transform: translate(-50%, -30%) scale(.8); } }
@keyframes fwDrift { to { transform: translate(-50%, calc(-50% - 8px)); } }
@keyframes fwOut { to { opacity: .08; } }
@keyframes fwTaken { 30% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; } to { transform: translate(-50%, -90%) scale(1.2); opacity: 0; } }
@keyframes fwGone { to { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }
.side-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; min-height: 40px; }
.side-label { color: var(--muted); font-weight: 600; }
.side-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--panel2); color: var(--text); border: 2px solid var(--side); font: inherit;
}
.side-btn.a { --side: #7c4dff; }
.side-btn.b { --side: #ff9100; }
.side-btn:hover { box-shadow: 0 0 14px color-mix(in srgb, var(--side) 50%, transparent); }
.side-btn.on { background: color-mix(in srgb, var(--side) 30%, var(--panel2)); box-shadow: 0 0 18px color-mix(in srgb, var(--side) 60%, transparent); }
.side-count { color: var(--muted); font-size: 12px; }
.side-me { font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.side-me.a { color: #d1b3ff; background: rgba(124, 77, 255, .15); }
.side-me.b { color: #ffd59e; background: rgba(255, 145, 0, .15); }

/* Power-up words and effects */
.fw.pu { color: rgba(255, 255, 255, .62); }
.fw-icon { margin-right: 6px; font-size: .85em; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .5)); display: inline-block; animation: puIcon 1.2s ease-in-out infinite; }
@keyframes puIcon { 50% { transform: scale(1.2); } }
.fw.pu-heal { text-shadow: 0 0 14px rgba(255, 82, 82, .7); }
.fw.pu-shield { text-shadow: 0 0 14px rgba(66, 165, 245, .7); }
.fw.pu-blast { text-shadow: 0 0 14px rgba(255, 145, 0, .8); }
.fw.pu-speed { text-shadow: 0 0 14px rgba(255, 235, 59, .7); }
.float.pu { color: #fff; font-size: 20px; text-shadow: 0 2px 0 #000, 0 0 12px rgba(255, 255, 255, .7); white-space: nowrap; }
.float.blocked { color: #90caf9; font-size: 18px; text-shadow: 0 2px 0 #000, 0 0 10px #42a5f5; }
.st-fighter.shielded::after {
  content: ''; position: absolute; inset: 6% -6% 0; border-radius: 48% 48% 40% 40%;
  border: 3px solid rgba(100, 181, 246, .75); background: radial-gradient(ellipse, rgba(66, 165, 245, .12), rgba(66, 165, 245, .28));
  box-shadow: 0 0 22px rgba(66, 165, 245, .55); pointer-events: none; animation: shieldPulse 1.6s ease-in-out infinite;
}
@keyframes shieldPulse { 50% { opacity: .65; } }
.st-fighter.fast { filter: drop-shadow(0 0 10px rgba(255, 235, 59, .8)); }
.st-fighter.powered { animation: powered .6s; }
@keyframes powered { 30% { filter: brightness(1.8) drop-shadow(0 0 16px #fff); } }

/* The king's crown and the challenger bonus */
.sb-crown { animation: crownFloat 2.4s ease-in-out infinite; transform-box: fill-box; }
@keyframes crownFloat { 50% { transform: translateY(-6px); } }
.handicap { color: #69f0ae; font-weight: 700; }

/* Lasting power-ups */
.pl-status { display: flex; gap: 4px; min-height: 20px; margin-top: 4px; flex-wrap: wrap; }
.plate.b .pl-status { justify-content: flex-end; }
.st-pu { display: inline-flex; align-items: center; gap: 2px; background: var(--panel2); border-radius: 999px; padding: 0 6px; font-size: 13px; }
.st-pu small { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.st-fighter.invuln { filter: drop-shadow(0 0 8px #ffd54f) drop-shadow(0 0 18px rgba(255, 213, 79, .7)); }
.st-fighter.poisoned svg { filter: sepia(.25) hue-rotate(40deg) saturate(1.2) drop-shadow(0 0 6px rgba(171, 71, 188, .7)); }
.shot.pierce { box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 0 16px #fff; }
.fw.pu-regen { text-shadow: 0 0 14px rgba(105, 240, 174, .8); }
.fw.pu-poison { text-shadow: 0 0 14px rgba(171, 71, 188, .9); }
.fw.pu-pierce { text-shadow: 0 0 14px rgba(255, 255, 255, .8); }
.fw.pu-invuln { text-shadow: 0 0 14px rgba(255, 213, 79, .9); }
.float.regen { color: #69f0ae; text-shadow: 0 2px 0 #000, 0 0 10px #00c853; }
.float.poison { color: #ce93d8; text-shadow: 0 2px 0 #000, 0 0 10px #8e24aa; }

/* Weapons: preview mode, proficiency, the hunt's approach and melee swing */
.mode-switch { display: flex; justify-content: center; gap: 6px; margin: -4px 0 10px; }
.sub-h3 { margin-top: 14px; }
.weapon-rows { display: grid; gap: 8px; }
.weapon-row { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 10px 12px; }
.weapon-info { flex: 1; display: grid; gap: 4px; min-width: 0; }
.prof-bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.prof-fill { height: 100%; background: linear-gradient(90deg, #ffb300, #ffe082); border-radius: 99px; }
.arena-fighter.b { transition: transform .9s ease-in-out, opacity .6s, filter .6s; }
.arena-fighter.b.far { transform: translateX(28%) scale(.82); transform-origin: 50% 100%; }
.arena-fighter.swing { animation: swing .38s ease-out; }
@keyframes swing { 35% { transform: translateX(22%) rotate(6deg); } }
.small-line { font-size: 15px; }

/* Admin: streaming arenas */
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bg-option { background: var(--panel2); border: 2px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; color: var(--text); font: inherit; font-weight: 600; display: grid; gap: 4px; }
.bg-option.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(145, 70, 255, .2); }
.bg-thumb { aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; }
.bg-thumb svg, .bg-mini svg { width: 100%; height: 100%; display: block; }
.bg-mini { width: 96px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; }
.links { display: grid; gap: 6px; margin-top: 12px; word-break: break-all; }
.pu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.part-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.part { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 8px; }
.part-art { width: 54px; height: 64px; flex: none; }
.part-art svg { width: 100%; height: 100%; }
.part-info { flex: 1; min-width: 0; display: grid; gap: 4px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.set { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.set.chk { display: flex; align-items: center; gap: 8px; }
.chan-cell { display: grid; gap: 4px; min-width: 220px; }
.chan-add { display: flex; gap: 4px; }
.chan-add select, .chan-add input { padding: 4px 6px; font-size: 12px; }
.pill-x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; }
.pill-x:hover { color: var(--bad); }
@media (max-width: 760px) { .pu-row { grid-template-columns: 1fr; } }

/* Tournaments (public/bracket.js) */
.tour { display: grid; gap: 10px; margin-top: 12px; }
.tour-winner { color: var(--warn); font-weight: 800; }
.bracket { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 4px; }
.b-round { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; min-width: 170px; }
.b-title { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; text-align: center; }
.b-match { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.b-match.running { border-color: var(--bad); box-shadow: 0 0 12px rgba(255, 77, 79, .35); }
.b-side { padding: 5px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-side + .b-side { border-top: 1px solid var(--line); }
.b-side.won { color: var(--ok); }
.b-side.tbd { color: var(--muted); font-weight: 400; }
.b-live { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--bad); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; }
.tour-table td, .tour-table th { padding: 5px 8px; }
.tour-table tr.win td { color: var(--warn); }
.tour-matches { display: grid; gap: 4px; }
.tm { font-size: 13px; }
.tm.running { color: var(--bad); font-weight: 700; }
