:root {
  --bg: #0d0e12;
  --bg-deep: #08090b;
  --panel: #15171c;
  --panel-2: #1e2128;
  --line: #000000;
  --steel: #b6c0cf;
  --steel-hi: #d8e0ec;
  --fg: #e6ebf2;
  --muted: #8a93a1;
  --hit: #ff5a0a;
  --glow: 0 0 6px rgba(255,90,10,.55), 0 0 18px rgba(255,90,10,.35);
  --heal: #39ff88;
  --warn: #ffd23f;
  --f-pixel: "Pixelify Sans", ui-monospace, monospace;
  --f-pixel2: "Pixelify Sans", ui-monospace, monospace;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 4px 4px 0 var(--line);
  --shadow-sm: 2px 2px 0 var(--line);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--fg); }
body {
  margin: 0; font-family: var(--f-body); font-size: 15px; line-height: 1.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 0%, rgba(255,90,10,.06), transparent 60%);
  overflow-x: hidden;
}
a { color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 16px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px dashed var(--hit); outline-offset: 3px; }
.px-box { background: var(--panel); border: 2px solid var(--line); box-shadow: var(--shadow); }
.btn {
  font-family: var(--f-pixel); font-size: 14px; text-transform: lowercase; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; cursor: pointer;
  background: var(--panel-2); border: 2px solid var(--line); box-shadow: var(--shadow-sm);
  text-decoration: none; white-space: nowrap; transition: transform .06s, box-shadow .06s;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--line); }
.btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--line); }
.btn.hot { background: var(--hit); color: #120700; }
.label { font-family: var(--f-pixel); font-size: 12px; text-transform: lowercase; letter-spacing: .04em; color: var(--muted); }
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg-deep); border-bottom: 2px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 18px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 34px; height: 34px; display: block; }
.brand b { font-family: var(--f-pixel); font-size: 22px; font-weight: 700; }
nav.main { display: flex; gap: 4px; margin-right: auto; }
nav.main a { font-family: var(--f-pixel); font-size: 14px; text-decoration: none; padding: 6px 8px; color: var(--muted); }
nav.main a:hover { color: var(--fg); background: var(--panel); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { padding: 8px 10px; }
.ca-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-block: 12px; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--panel); border: 2px solid var(--line); box-shadow: var(--shadow-sm); font-family: var(--f-pixel); font-size: 13px; }
.chip code { font-family: var(--f-pixel2); font-size: 14px; }
.chip button { background: var(--panel-2); border: 2px solid var(--line); padding: 2px 8px; cursor: pointer; font-family: var(--f-pixel); font-size: 12px; }
.chip .mc { color: var(--heal); font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; }
.status-pill i { width: 10px; height: 10px; background: var(--steel); border: 2px solid var(--line); display: inline-block; }
.status-pill[data-s="live"] i { background: var(--heal); animation: blink 1.2s steps(2) infinite; }
.status-pill[data-s="reconnecting"] i, .status-pill[data-s="syncing"] i { background: var(--warn); animation: blink .6s steps(2) infinite; }
.status-pill[data-s="prelaunch"] i { background: var(--hit); }
@keyframes blink { 50% { opacity: .25; } }
.hero { display: grid; justify-items: center; text-align: center; gap: 14px; padding-block: 34px 26px; }
.hero-logo { width: clamp(96px, 14vw, 132px); height: auto; filter: drop-shadow(0 0 22px rgba(255,90,10,.18)); }
.hero h1 {
  font-family: var(--f-pixel); font-weight: 700; font-size: clamp(64px, 13vw, 150px); line-height: .85; margin: 0;
  letter-spacing: -.01em; color: var(--steel-hi); text-transform: lowercase;
  text-shadow: 4px 4px 0 var(--line), 0 0 30px rgba(182,192,207,.12);
}
.hero p.tag { font-family: var(--f-pixel); font-size: clamp(18px, 3.2vw, 32px); margin: 2px 0 6px; color: var(--hit); text-shadow: var(--glow); letter-spacing: .01em; text-wrap: balance; text-transform: lowercase; }
.round-card { width: min(100%, 720px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 18px; text-align: left; }
.rc-cell { display: grid; gap: 2px; min-width: 0; }
.rc-cell.mid { justify-items: center; text-align: center; }
.rc-cell.end { justify-items: end; text-align: right; }
.rc-v { font-family: var(--f-pixel); font-size: 16px; font-variant-numeric: tabular-nums; }
.round-card .big { font-family: var(--f-pixel); font-size: clamp(40px, 6vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; color: var(--hit); text-shadow: var(--glow); }
.pot { color: var(--warn); }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.arena { position: relative; overflow: hidden; background: var(--bg-deep); }
.arena canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; image-rendering: pixelated; image-rendering: crisp-edges; max-width: 100%; }
.arena-hud { position: absolute; left: 0; right: 0; top: 0; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.boss-name { font-family: var(--f-pixel); font-size: 14px; background: var(--line); padding: 3px 8px; }
.hpbar { width: min(78%, 520px); height: 26px; background: var(--line); border: 2px solid var(--line); box-shadow: var(--shadow-sm); position: relative; }
.hpbar .fill { position: absolute; inset: 2px; right: auto; width: 100%; background: var(--hit);
  background-image: repeating-linear-gradient(90deg, transparent 0 14px, rgba(0,0,0,.28) 14px 16px); transition: width .25s steps(6); box-shadow: 0 0 12px rgba(255,90,10,.5); }
.hpbar .ghost { position: absolute; inset: 2px; right: auto; background: #fff; opacity: .55; transition: width .9s ease-out .2s; }
.hpbar .txt { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-pixel); font-size: 13px; text-shadow: 1px 1px 0 var(--line); font-variant-numeric: tabular-nums; }
.hpbar.healing .fill { background-color: var(--heal); }
.arena-msg { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; display: grid; gap: 6px; justify-items: center; width: 92%; }
.banner { font-family: var(--f-pixel); font-size: clamp(16px, 2.8vw, 26px); padding: 8px 14px; background: var(--hit); color: #120700; border: 2px solid var(--line); box-shadow: var(--shadow), 0 0 28px rgba(255,90,10,.45); text-transform: lowercase; }
.banner.green { background: var(--heal); }
.banner.dim { background: var(--panel-2); color: var(--hit); text-shadow: var(--glow); box-shadow: var(--shadow); }
.banner a { pointer-events: auto; text-transform: none; }
.sub-banner { font-family: var(--f-pixel); font-size: 13px; background: var(--line); padding: 4px 8px; }
.arena-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 2px solid var(--line); background: var(--panel); }
.arena-foot .label b { color: var(--fg); font-weight: 400; font-variant-numeric: tabular-nums; }
.roster { display: grid; gap: 18px; min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 2px solid var(--line); background: var(--panel-2); }
.panel-h h3 { margin: 0; font-family: var(--f-pixel); font-size: 16px; font-weight: 500; text-transform: lowercase; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 7px 12px; border-bottom: 1px solid rgba(0,0,0,.35); font-size: 13px; }
.feed li.new { animation: flashin .6s steps(3); }
@keyframes flashin { 0% { background: rgba(255,90,10,.35); } }
.feed li.heal.new { animation-name: flashg; }
@keyframes flashg { 0% { background: rgba(57,255,136,.25); } }
.feed .w { font-family: var(--f-pixel2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .amt { font-family: var(--f-pixel); font-size: 13px; font-variant-numeric: tabular-nums; }
.feed .hit .amt { color: var(--hit); }
.feed .heal .amt { color: var(--heal); }
.feed .after .amt { color: var(--muted); }
.feed .kill { background: rgba(255,90,10,.14); }
.feed .tx { font-family: var(--f-pixel); font-size: 12px; color: var(--muted); text-decoration: none; }
.feed .tx:hover { color: var(--fg); }
.feed .pend { font-family: var(--f-pixel); font-size: 10px; color: var(--warn); margin-left: 6px; }
.empty { padding: 18px 12px; color: var(--muted); font-size: 13px; }
.top-list { list-style: none; margin: 0; padding: 4px 0; counter-reset: t; }
.top-list li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 6px 12px; font-size: 13px; align-items: center; }
.top-list li.empty::before { content: none; }
.top-list li::before { counter-increment: t; content: counter(t); font-family: var(--f-pixel); font-size: 12px; color: var(--muted); }
.top-list .bar { grid-column: 2 / 4; height: 6px; background: var(--line); overflow: hidden; }
.top-list .bar i { display: block; height: 100%; background: var(--hit); }
.top-list .w { font-family: var(--f-pixel2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.top-list .d { font-family: var(--f-pixel); font-size: 13px; color: var(--hit); font-variant-numeric: tabular-nums; }
section.block { padding-block: 44px 10px; scroll-margin-top: 70px; }
section.block h2 { font-family: var(--f-pixel); font-size: clamp(30px, 4.4vw, 46px); font-weight: 600; margin: 0 0 16px; text-transform: lowercase; text-wrap: balance; color: var(--hit); text-shadow: var(--glow); }
.table-wrap { overflow-x: auto; }
table.halls { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
table.halls th { font-family: var(--f-pixel); font-size: 12px; font-weight: 400; color: var(--muted); text-align: left; padding: 10px 12px; background: var(--panel-2); border-bottom: 2px solid var(--line); text-transform: lowercase; }
table.halls td { padding: 9px 12px; border-bottom: 1px solid rgba(0,0,0,.35); font-variant-numeric: tabular-nums; }
table.halls td.mono { font-family: var(--f-pixel2); }
.tag-s { font-family: var(--f-pixel); font-size: 11px; padding: 2px 6px; border: 2px solid var(--line); text-transform: lowercase; }
.tag-s.killed { background: var(--hit); color: #120700; }
.tag-s.escaped { background: var(--panel-2); }
.tag-s.paid { background: var(--heal); color: #04140b; }
.tag-s.unpaid { background: var(--warn); color: #1a1400; }
.tag-s.rolled { background: transparent; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.step { padding: 18px; display: grid; gap: 10px; align-content: start; }
.step .n { font-family: var(--f-pixel); font-size: 13px; color: var(--muted); }
.step h3 { margin: 0; font-family: var(--f-pixel); font-size: 22px; font-weight: 600; text-transform: lowercase; }
.step p { margin: 0; color: var(--muted); max-width: 40ch; }
.step canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.rules { margin-top: 18px; padding: 14px 16px; font-size: 13px; color: var(--muted); }
.rules b { color: var(--fg); font-weight: 600; }
.rules ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
footer.bot { margin-top: 48px; padding-block: 18px 28px; border-top: 2px solid var(--line); background: var(--bg-deep); }
footer.bot .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
#foot-ca, .chip code { text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
@media (max-width: 980px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  nav.main { display: none; }
  header.top .wrap { gap: 10px; justify-content: space-between; }
  .brand b { font-size: 19px; }
  .top-actions .btn { padding: 8px 10px; font-size: 13px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .arena canvas { aspect-ratio: 4 / 3.4; }
  .hpbar { width: 92%; height: 22px; }
  .arena-msg { top: 60%; }
}
@media (max-width: 520px) { .round-card { grid-template-columns: 1fr 1fr; } .rc-cell.mid { grid-column: 1 / -1; order: -1; } }
@media (max-width: 420px) { .top-actions .x-link { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
