/*
VOICE  guild war room at night: bold headline, calm glass panels, portraits do the talking
IDEA   a siege table — choose a castle like a war-map token, enemy squads laid out as portrait cards
PICTURE hero portraits everywhere: headline collage of the enemy's most-used heroes, big portraits on every team card
COLOUR near-black ground with soft red/violet glows; lime for "our" actions, orange for missing counters, red for the enemy, green for cleared
TYPE   Kanit 700/800 for headlines, IBM Plex Sans Thai for body, Chakra Petch for numbers and the clock
*/
:root {
  --bg: #08080b; --glass: rgba(255,255,255,.035); --glass2: rgba(255,255,255,.06); --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.14);
  --ink: #f2f2f5; --muted: #9a9aa8; --dim: #62626f;
  --lime: #d4ff3a; --lime-soft: rgba(212,255,58,.12);
  --enemy: #ff4d5e; --enemy-soft: rgba(255,77,94,.13);
  --warn: #ff8a3d; --warn-soft: rgba(255,138,61,.13);
  --win: #38e08c; --win-soft: rgba(56,224,140,.13);
  --blue: #6cb8ff; --blue-soft: rgba(108,184,255,.13);
  --ro-attack: #ff6b4a; --ro-magic: #a982ff; --ro-defense: #4f9dff; --ro-support: #3fd28f; --ro-universal: #f5c542;
  --head: 'Kanit', 'IBM Plex Sans Thai', system-ui, sans-serif;
  --body: 'IBM Plex Sans Thai', system-ui, sans-serif;
  --mono: 'Chakra Petch', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 90px; }
body { margin: 0; color: var(--ink); font: 15px/1.55 var(--body); overflow-x: clip; min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(255,77,94,.13), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(140,90,255,.10), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(212,255,58,.05), transparent 60%),
    var(--bg); background-attachment: fixed; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 26px 26px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%); }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: repeating-linear-gradient(115deg, transparent 0 220px, rgba(255,255,255,.018) 220px 222px, transparent 222px 520px); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); margin: 0; line-height: 1.1; font-weight: 600; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
a { color: inherit; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--glass2); cursor: pointer; font-weight: 500; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.09); }
.btn.primary { background: var(--lime); border-color: var(--lime); color: #111; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.win { background: var(--win-soft); border-color: rgba(56,224,140,.5); color: var(--win); }
.btn.loss { background: var(--enemy-soft); border-color: rgba(255,77,94,.5); color: #ff8592; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--glass2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: #ff8592; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { background: rgba(0,0,0,.35); border: 1px solid var(--line2); border-radius: 12px; padding: 9px 12px; width: 100%; font-size: 15px; }
input:focus, select:focus, textarea:focus { border-color: rgba(212,255,58,.6); outline: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9aa8' fill='none' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea { resize: vertical; min-height: 76px; }
label.f { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
label.f > span { font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px;
  padding: 14px 32px; background: linear-gradient(180deg, rgba(8,8,11,.92), rgba(8,8,11,.7)); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tl { display: flex; align-items: center; gap: 14px; }
.clock { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: .04em; color: #d9d9e0; white-space: nowrap; }
.phase { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 999px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.phase i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.phase.battle { color: #ffb3ba; border-color: rgba(255,77,94,.35); }
.phase.battle i { background: var(--enemy); box-shadow: 0 0 0 4px var(--enemy-soft); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); }
.tabs a { padding: 8px 18px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: #111; background: var(--ink); }
.tr { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.lang { display: flex; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 13px; }
.lang button.on { background: var(--ink); color: #111; }
.who { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 4px; border: 1px solid var(--line2); border-radius: 999px; font-size: 14px; }
.who .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--lime), #7bd4ff); color: #111; font-weight: 700; font-size: 12px; }
.role { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--lime-soft); color: var(--lime); font-weight: 600; }

/* ---------- page & headline ---------- */
.page { padding: 34px 32px 60px; max-width: 1640px; margin: 0 auto; }
.headline { position: relative; margin-bottom: 30px; }
.eyebrow { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.eyebrow b { color: var(--lime); font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; margin: 0 4px; }
h1.big { font-size: clamp(46px, 6vw, 92px); font-weight: 800; line-height: 1.02; margin: 8px 0 10px; letter-spacing: -.01em;
  background: linear-gradient(100deg, #fff 30%, #8d8d99 85%); -webkit-background-clip: text; background-clip: text; color: transparent; text-wrap: balance; max-width: 62%; }
.lede { color: var(--muted); margin: 0 0 26px; max-width: 60ch; }
.collage { position: absolute; right: 0; top: -10px; width: 46%; height: 196px; pointer-events: none; z-index: -1;
  mask-image: linear-gradient(90deg, transparent 0%, #000 45%); -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%); }
.collage img { position: absolute; top: 0; width: 150px; height: 170px; object-fit: cover; border-radius: 22px; opacity: .55; filter: saturate(1.1);
  transform: skewX(-8deg); border: 1px solid rgba(255,255,255,.12); }
.collage-lbl { position: absolute; right: 0; top: 214px; font-size: 12px; color: var(--muted); }
.headgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); padding: 22px 8px; }
.stat { padding: 2px 22px; border-left: 1px solid var(--line); display: grid; align-content: center; justify-items: center; text-align: center; }
.stat:first-child { border-left: 0; }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font-family: var(--head); font-size: clamp(36px, 3.4vw, 54px); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 13px; }
.stat.hot b { color: var(--warn); }
.side { display: grid; gap: 12px; }
.sidecard { padding: 14px 18px; border-radius: 18px; }
.bigsm { font-family: var(--head); font-size: 30px; font-weight: 700; }
.bigsm small { font-size: 15px; color: var(--muted); font-weight: 400; }
.pips { display: flex; gap: 5px; }
.pips i { width: 12px; height: 28px; border-radius: 4px; background: rgba(255,255,255,.08); border: 1px solid var(--line2); }
.pips i.w { background: var(--win); border-color: var(--win); }
.pips i.l { background: var(--enemy); border-color: var(--enemy); }

/* ---------- castle picker ---------- */
.picker-wrap { margin-bottom: 26px; }
.sechead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sechead h2 { font-size: 26px; font-weight: 700; }
.castles { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; }
.cgroup { display: grid; gap: 8px; align-content: start; }
.cglabel { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; gap: 8px; }
.cglabel span { color: var(--dim); }
.cgrid { display: flex; gap: 8px; }
.arrow { align-self: center; font-size: 28px; color: var(--dim); margin-top: 18px; }
.castle { position: relative; display: grid; justify-items: center; gap: 2px; width: 108px; padding: 12px 8px 10px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--glass); cursor: pointer; transition: .15s; text-align: center; }
.castle:hover { border-color: var(--line2); background: var(--glass2); transform: translateY(-2px); }
.castle svg { width: 46px; height: 38px; margin-bottom: 2px; }
.castle .ck { font-size: 11px; color: var(--muted); white-space: nowrap; }
.castle .cn { font-family: var(--head); font-size: 26px; font-weight: 700; line-height: 1; }
.castle .cc { font-size: 12px; color: var(--muted); }
.castle .cbar { width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 4px; }
.castle .cbar i { display: block; height: 100%; background: var(--win); }
.castle .cmiss { position: absolute; top: 8px; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn); color: #1a0d00; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.castle .lock { position: absolute; top: 9px; left: 10px; width: 11px; height: 13px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Crect x='1' y='5' width='8' height='7' rx='1.5' fill='%239a9aa8'/%3E%3Cpath d='M3 5V3.5a2 2 0 014 0V5' stroke='%239a9aa8' fill='none' stroke-width='1.4'/%3E%3C/svg%3E"); }
.castle.locked { opacity: .6; }
.castle.cleared { border-color: rgba(56,224,140,.45); }
.castle.cleared .cn { color: var(--win); }
.castle.on { border-color: var(--lime); background: linear-gradient(180deg, var(--lime-soft), transparent); box-shadow: 0 10px 30px -10px rgba(212,255,58,.35); }
.castle.on .cn { color: var(--lime); }
.castle.main { width: 150px; background: linear-gradient(180deg, rgba(255,77,94,.12), transparent 70%), var(--glass); }
.castle.main.on { background: linear-gradient(180deg, var(--lime-soft), transparent); }
.castle.all { width: 120px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend i.lk { width: 10px; height: 12px; border-radius: 0; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Crect x='1' y='5' width='8' height='7' rx='1.5' fill='%239a9aa8'/%3E%3Cpath d='M3 5V3.5a2 2 0 014 0V5' stroke='%239a9aa8' fill='none' stroke-width='1.4'/%3E%3C/svg%3E"); }

/* ---------- teams + detail ---------- */
.room { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 500px); gap: 22px; align-items: start; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 360px; border-radius: 999px; padding-left: 38px;
  background: rgba(0,0,0,.35) no-repeat 14px center / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' stroke='%239a9aa8' fill='none' stroke-width='1.6'/%3E%3Cpath d='M11 11l3.5 3.5' stroke='%239a9aa8' stroke-width='1.6'/%3E%3C/svg%3E"); }
.seg { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); }
.seg button { border: 0; background: none; padding: 6px 14px; cursor: pointer; color: var(--muted); font-size: 13px; border-radius: 999px; white-space: nowrap; }
.seg button.on { background: var(--glass2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.grouphead { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.grouphead b { font-family: var(--head); font-size: 19px; font-weight: 600; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.tcard { position: relative; display: grid; gap: 12px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; transition: .15s; overflow: hidden; }
.tcard:hover { border-color: var(--line2); background: var(--glass2); transform: translateY(-2px); }
.tcard.on { border-color: var(--lime); box-shadow: 0 12px 34px -14px rgba(212,255,58,.4); }
.tcard.done { opacity: .62; }
.tcard.done::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 60%, rgba(56,224,140,.12)); pointer-events: none; }
.tch { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tpost { color: var(--muted); }
.tslot { font-weight: 700; color: var(--ink); }
.tspd { color: #c9c9d3; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.05); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.tag.red { color: #ff8592; border-color: rgba(255,77,94,.45); background: var(--enemy-soft); }
.tag.blue { color: var(--blue); border-color: rgba(108,184,255,.45); background: var(--blue-soft); }
.tag.green { color: var(--win); border-color: rgba(56,224,140,.45); background: var(--win-soft); }
.tag.amber { color: var(--warn); border-color: rgba(255,138,61,.5); background: var(--warn-soft); }
.tag.lime { color: var(--lime); border-color: rgba(212,255,58,.45); background: var(--lime-soft); }

/* hero portraits */
.heroes { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.hero { position: relative; display: grid; justify-items: center; gap: 4px; width: 76px; }
.hero .face { position: relative; width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; overflow: hidden;
  font-family: var(--head); font-weight: 700; font-size: 20px; color: #fff; background: #1a1a22; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 8px 20px -10px #000; }
.hero .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .face::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--rc, transparent); pointer-events: none; }
.hero .rd { position: absolute; top: 60px; right: 0; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #111; z-index: 1; }
.heroes.md .hero .rd { top: 49px; right: 0; width: 13px; height: 13px; }
.heroes.sm .hero .rd { top: 36px; right: 0; width: 11px; height: 11px; }
.picker .chosen .hero .rd { display: none; }
.rdi { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.ro-attack { background: var(--ro-attack); } .ro-magic { background: var(--ro-magic); } .ro-defense { background: var(--ro-defense); } .ro-support { background: var(--ro-support); } .ro-universal { background: var(--ro-universal); }
.hero .n { font-size: 12px; color: #cfcfd8; text-align: center; line-height: 1.25; max-width: 80px; overflow-wrap: anywhere; }
.hero .rb { position: absolute; top: -5px; left: -5px; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: var(--rc); color: #111; z-index: 1; letter-spacing: .02em; }
.hero.pet .face { border-radius: 50%; width: 52px; height: 52px; margin-top: 10px; }
.hero.pet { width: 60px; }
.r-o7k { --rc: #ff5d73; } .r-awake { --rc: #b98cff; } .r-gold { --rc: #ffc94a; } .r-gold2 { --rc: #e4a854; } .r-epic { --rc: #6aa8ff; } .r-eawake { --rc: #7fd1ff; }
.heroes.sm .hero { width: 50px; }
.heroes.sm .hero .face { width: 46px; height: 46px; border-radius: 12px; font-size: 14px; }
.heroes.sm .hero .n { display: none; }
.heroes.sm .hero .rb { display: none; }
.heroes.sm .hero.pet { width: 40px; }
.heroes.sm .hero.pet .face { width: 34px; height: 34px; margin-top: 6px; }
.heroes.md .hero { width: 64px; }
.heroes.md .hero .face { width: 60px; height: 60px; border-radius: 14px; }
.heroes.md .hero .n { font-size: 11px; }
.heroes.md .hero.pet { width: 50px; }
.heroes.md .hero.pet .face { width: 44px; height: 44px; margin-top: 8px; }

/* detail panel */
.pane { background: var(--glass); border: 1px solid var(--line); border-radius: 22px; backdrop-filter: blur(14px); }
.pane > header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.pane > header h2 { font-size: 19px; }
.pane .body { padding: 16px 20px; }
.sticky { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; scrollbar-width: thin; }
.enemyCard { position: relative; padding: 20px; border-bottom: 1px solid var(--line); overflow: hidden; border-radius: 22px 22px 0 0;
  background: radial-gradient(500px 200px at 100% 0%, rgba(255,77,94,.20), transparent 70%); }
.enemyCard .lbl { font-size: 13px; color: #ff8592; font-weight: 600; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.kv { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 14px; font-size: 13px; }
.kv b { font-family: var(--mono); font-size: 16px; color: var(--ink); }
.note { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 12px 12px 0; font-size: 14px; white-space: pre-wrap; }
.counter { margin: 14px 16px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: rgba(0,0,0,.2); }
.counter.best { border-color: rgba(212,255,58,.55); box-shadow: 0 12px 30px -18px rgba(212,255,58,.5); }
.counter > .ch { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--line); }
.counter > .ch b { font-family: var(--head); font-weight: 600; }
.counter.best > .ch b { color: var(--lime); }
.counter .cb { padding: 14px 16px; display: grid; gap: 14px; }
.queue { counter-reset: q; display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.queue li { counter-increment: q; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; font-size: 14px; }
.queue li::before { content: counter(q); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700; background: var(--lime-soft); color: var(--lime); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.fact { background: rgba(255,255,255,.04); border-radius: 12px; padding: 8px 12px; }
.fact span { display: block; font-size: 11px; color: var(--muted); }
.fact b { font-weight: 500; font-size: 14px; }
.pre { white-space: pre-wrap; font-size: 14px; }
.warnbox { padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid rgba(255,138,61,.4); color: #ffb27d; font-size: 13px; }
.empty { padding: 40px 22px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--head); font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.log { display: grid; gap: 8px; padding: 16px 20px; font-size: 13px; }
.pane .log { border-top: 1px solid var(--line); }
.log > div { display: flex; gap: 8px; align-items: center; }
.log .sub { margin: 0; }

/* tables (library, roster, wars) */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: rgba(255,255,255,.03); }
.tbl td.r, .tbl th.r { text-align: right; }
.pane .toolbar { padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--line); }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(420px, 1fr); gap: 22px; align-items: start; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; padding: 18px; }
.rcard { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0,0,0,.15); cursor: pointer; text-align: center; }
.rcard:hover { border-color: var(--line2); background: var(--glass2); }
.rcard .hero { width: auto; }
.rcard small { font-size: 11px; color: var(--muted); }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #121218; border: 1px solid var(--line2); border-radius: 24px; box-shadow: 0 40px 80px -20px #000; }
.modal > header { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal > header h2 { font-size: 21px; flex: 1; }
.modal .mb { padding: 20px 22px; display: grid; gap: 16px; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* hero picker (in dialogs) */
.picker { position: relative; }
.picker .chosen { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 8px; border: 1px solid var(--line2); border-radius: 12px; background: rgba(0,0,0,.35); }
.picker .chosen .x { margin-left: auto; }
.picker .chosen .hero { width: auto; grid-auto-flow: column; align-items: center; gap: 10px; }
.picker .chosen .hero .face { width: 38px; height: 38px; font-size: 12px; border-radius: 10px; margin: 0; }
.picker .chosen .hero .n { font-size: 14px; color: var(--ink); max-width: none; text-align: left; }
.picker .chosen .hero .rb { display: none; }
.picker ul { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; min-width: 240px;
  background: #17171f; border: 1px solid var(--line2); border-radius: 14px; max-height: 300px; overflow: auto; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.picker li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.picker li.on, .picker li:hover { background: var(--lime-soft); }
.picker li .face { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 700; overflow: hidden; background: #1a1a22; }
.picker li .face img { width: 100%; height: 100%; object-fit: cover; }
.picker li small { color: var(--muted); margin-left: auto; text-align: right; }

/* login */
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; height: 48px; font-weight: 600; text-decoration: none; font-size: 16px; }
.btn.discord.sm { height: 40px; font-size: 14px; }
.btn.discord:hover { background: #4752c4; border-color: #4752c4; }
.alt { border-top: 1px solid var(--line); padding-top: 12px; }
.alt summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.altbody { display: grid; gap: 12px; margin-top: 12px; }
.who img.av { object-fit: cover; }
.rolepick { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line2); border-radius: 14px; cursor: pointer; }
.rolepick input { width: auto; margin-top: 4px; accent-color: var(--lime); }
.rolepick span { display: grid; gap: 2px; }
.rolepick small { color: var(--muted); font-size: 12px; }
.rolepick:has(input:checked) { border-color: var(--lime); background: var(--lime-soft); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login .wall { position: absolute; inset: -40px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; opacity: .22; transform: rotate(-8deg) scale(1.15);
  mask-image: radial-gradient(circle at 50% 50%, transparent 18%, #000 70%); -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 18%, #000 70%); pointer-events: none; }
.login .wall img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.login .card { position: relative; width: min(440px, 100%); padding: 32px; display: grid; gap: 16px; background: rgba(14,14,19,.82); }
.login h1 { font-size: 40px; font-weight: 800; background: linear-gradient(100deg, #fff 40%, #8d8d99); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login .err { color: #ff8592; font-size: 14px; min-height: 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font-family: var(--head); font-size: 18px; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.credit { font-size: 12px; color: var(--dim); text-align: center; padding: 28px 0 0; }
.credit a { color: var(--muted); }
.demo-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; padding: 8px 16px; border-radius: 999px; font-size: 13px;
  background: rgba(212,255,58,.95); color: #111; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.5); white-space: nowrap; }

#toast { position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #1c1c25; border: 1px solid var(--line2); padding: 10px 18px; border-radius: 999px; z-index: 60; transition: .2s; }
#toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1280px) {
  .room { grid-template-columns: 1fr; }
  .sticky { position: static; max-height: none; }
  .split { grid-template-columns: 1fr; }
  .headgrid { grid-template-columns: 1fr; }
  .collage { display: none; }
  h1.big { max-width: none; }
}
@media (max-width: 860px) {
  .top { grid-template-columns: 1fr; padding: 10px 14px; }
  .tr, .tl { justify-content: space-between; }
  .tabs { overflow-x: auto; }
  .page { padding: 18px 14px 50px; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); row-gap: 16px; }
  .stat:nth-child(3) { border-left: 0; }
  .arrow { display: none; }
  .grid2, .grid3, .facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- sign-in: split hero ---------- */
.login2 { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(400px, 1fr); overflow: hidden; }
.login2 .art { position: relative; overflow: hidden; min-height: 100vh; }
.login2 .art .col { position: absolute; width: 250px; display: grid; gap: 18px; }
.login2 .art img { width: 250px; height: 330px; object-fit: cover; border-radius: 28px; box-shadow: 0 30px 60px -20px #000; animation: drift 16s ease-in-out infinite alternate; }
.login2 .art .col:nth-child(2) img { animation-delay: -6s; }
.login2 .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,8,11,.15), rgba(8,8,11,.35) 55%, #08080b 98%), linear-gradient(0deg, #08080b 2%, transparent 30%); }
.login2 .ltag { position: absolute; left: 56px; bottom: 60px; z-index: 2; }
.login2 .ltag h2 { font-size: clamp(56px, 6vw, 88px); font-weight: 800; text-shadow: 0 8px 40px #000; }
.login2 .ltag p { font-size: 18px; color: #d8d8e0; margin: 8px 0 0; }
@keyframes drift { to { transform: translateY(-40px); } }
.lpanel { position: relative; z-index: 2; padding: 64px clamp(32px, 6vw, 90px); display: flex; flex-direction: column; justify-content: center; gap: 18px;
  background: radial-gradient(600px 400px at 100% 0%, rgba(212,255,58,.08), transparent 60%); }
.lpanel h1 { font-size: 54px; font-weight: 700; }
.lpanel p { margin: 0; }
.btn.discord.big { height: 58px; font-size: 18px; width: 100%; box-shadow: 0 14px 40px -12px rgba(88,101,242,.8); }
.lpanel .err { color: #ff8592; font-size: 14px; min-height: 20px; }
.lfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 12px; color: var(--dim); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line2); font-size: 13px; color: #ddd; background: rgba(255,255,255,.04); white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.live i { background: var(--enemy); box-shadow: 0 0 0 4px var(--enemy-soft); animation: pulse 1.8s infinite; }
@media (max-width: 900px) { .login2 { grid-template-columns: 1fr; } .login2 .art { position: absolute; inset: 0; opacity: .35; } }

/* ---------- headline scoreboard ---------- */
.stats { grid-template-columns: repeat(4, minmax(0,1fr)); padding: 18px 8px 0; }
.stat.ours b { color: var(--lime); }
.stat.enemy b { color: #ff6b78; }
.stat.ours span, .stat.enemy span { font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.scorebar { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- versus intro ---------- */
.vs-intro { position: fixed; inset: 0; z-index: 80; overflow: hidden; cursor: pointer;
  background: linear-gradient(105deg, #0b1a12 0%, #08080b 46%, #08080b 54%, #22080d 100%); animation: vsIn .35s ease-out both; }
.vs-intro.out { animation: vsOut .45s ease-in forwards; }
@keyframes vsIn { from { opacity: 0; } }
@keyframes vsOut { to { opacity: 0; transform: scale(1.04); } }
.vs-slash { position: absolute; left: 50%; top: -80px; bottom: -80px; width: 6px; background: linear-gradient(180deg, transparent, var(--lime), var(--enemy), transparent); transform: rotate(14deg) scaleY(0); animation: slash .5s .25s ease-out forwards; }
@keyframes slash { to { transform: rotate(14deg) scaleY(1); } }
.vs-side { position: absolute; top: 14vh; width: 40vw; }
.vs-side.l { left: 5vw; animation: fromL .55s cubic-bezier(.2,.9,.2,1.1) both; }
.vs-side.r { right: 5vw; text-align: right; animation: fromR .55s cubic-bezier(.2,.9,.2,1.1) both; }
@keyframes fromL { from { transform: translateX(-60vw); } }
@keyframes fromR { from { transform: translateX(60vw); } }
.vs-lbl { font-family: var(--mono); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--lime); }
.vs-side.r .vs-lbl { color: #ff8592; }
.vs-side h2 { font-size: clamp(54px, 6.4vw, 104px); font-weight: 800; margin: 6px 0 18px; overflow-wrap: anywhere; }
.vs-side.l h2 { color: var(--lime); } .vs-side.r h2 { color: #ff6b78; }
.vs-pics { display: flex; gap: 14px; }
.vs-side.r .vs-pics { justify-content: flex-end; }
.vs-pics img { width: clamp(90px, 8.5vw, 136px); aspect-ratio: 132 / 170; object-fit: cover; border-radius: 22px; border: 2px solid rgba(212,255,58,.45); opacity: 0; animation: pop .35s calc(.45s + var(--i) * .08s) ease-out forwards; }
.vs-side.r .vs-pics img { border-color: rgba(255,77,94,.55); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.9); } to { opacity: 1; transform: none; } }
.vs-score { font-family: var(--head); font-weight: 800; font-size: clamp(64px, 8vw, 132px); line-height: 1; margin-top: 22px; font-variant-numeric: tabular-nums; }
.vs-side.l .vs-score { color: #fff; text-shadow: 0 0 40px rgba(212,255,58,.35); }
.vs-side.r .vs-score { color: #fff; text-shadow: 0 0 40px rgba(255,77,94,.35); }
.vs-mid { position: absolute; left: 50%; top: 30vh; transform: translate(-50%, 0); font-family: var(--head); font-weight: 900; font-style: italic; font-size: clamp(110px, 11vw, 180px);
  color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.9); animation: slam .45s .35s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes slam { from { opacity: 0; transform: translate(-50%, 0) scale(3); } }
.vs-foot { position: absolute; left: 0; right: 0; bottom: 7vh; display: flex; gap: 22px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 14px; color: #cfcfd8; animation: vsIn .4s .9s both; }
@media (prefers-reduced-motion: reduce) { .vs-intro *, .vs-intro { animation-duration: .01s !important; animation-delay: 0s !important; } }

.setupnote { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); border: 1px solid rgba(255,138,61,.4); color: #ffb27d; font-size: 13px; }
.setupnote b { color: #ffd0ad; font-size: 14px; }
