:root {
  color-scheme: dark;
  --bg:#101116;
  --panel:#1a1b23;
  --line:#343540;
  --text:#f3f1f7;
  --dim:#a09eaf;
  --purple:#b79aff;
  --lime:#ccfa72;
  font-family:"Golos Text",Arial,sans-serif;
}
* { box-sizing:border-box }
body { margin:0; background:radial-gradient(ellipse at 16% 8%,#25203259,transparent 38%),var(--bg); color:var(--text); min-height:100vh }
button,input { font:inherit }
button { color:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent }
button:focus-visible,input:focus-visible,canvas:focus-visible { outline:2px solid var(--lime); outline-offset:3px }
button { transition:background .15s,border-color .15s,transform .15s }
button:active { transform:translateY(1px) }
[hidden] { display:none!important }
.symbols { display:none }
.icon { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; vertical-align:middle }
.topbar { background:#15151d; border-bottom:1px solid #2b2c36 }
.topbar-inner,main { width:min(100% - 80px,1200px); margin:auto }
.topbar-inner { height:64px; display:flex; align-items:center }
.brand { display:flex; align-items:center; gap:7px; white-space:nowrap; font:italic 900 35px/.9 "Barlow Condensed",Impact,sans-serif; letter-spacing:-1px; transform:translateY(-1px) }
.brand-mark { height:41px; width:41px; filter:drop-shadow(0 0 9px #9063e938) }
.brand-second { margin-left:3px; color:var(--purple) }
.topbar nav { display:flex; height:100%; margin-left:46px; gap:27px }
.topbar nav>* { display:inline-flex; align-items:center; gap:8px; background:none; border:none; padding:0 1px; font-size:13px; font-weight:600; white-space:nowrap }
.topbar nav .nav-active { color:var(--purple); position:relative }
.nav-active::after { position:absolute; content:""; height:3px; border-radius:2px 2px 0 0; background:var(--purple); bottom:0; left:0; right:0 }
.nav-help { color:var(--dim) }
.nav-help:hover,.account:hover { color:var(--text) }
.account-tools,.room-actions,.subtitle,.control-title,.network,.desktop-controls,.desktop-controls>span { display:flex; align-items:center }
.account-tools { margin-left:auto; gap:13px }
.icon-button,.expand { width:36px; height:36px; display:grid; place-items:center; border:1px solid var(--line); border-radius:8px; background:#23232e; color:#c6c4d1 }
.icon-button:hover,.expand:hover { background:#363544 }
.divider { background:var(--line); width:1px; height:24px }
.account { display:flex; align-items:center; gap:9px; font-size:13px; color:#d1cfd9; font-weight:600; background:none; padding:0; border:0 }
.account>span:nth-child(2) { max-width:125px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.small-edit { color:#9691a1; width:13px; height:13px }
.avatar { flex:none; width:42px; height:42px; background:radial-gradient(circle at 45% 30%,#7d59bc,#342643 85%); display:grid; place-items:center; border:1px solid #654b88; border-radius:10px; overflow:hidden }
.avatar img { height:96%; width:96%; object-fit:contain }
.avatar.small { width:31px; height:31px; border-radius:50% }
.room-heading { display:flex; justify-content:space-between; align-items:center; gap:24px; margin:22px 0 18px }
.section-label { color:var(--purple); margin:0 0 7px; font-size:10px; letter-spacing:1.8px; font-weight:750; line-height:1.35 }
.slash { font:italic 900 16px/1 "Barlow Condensed",sans-serif; letter-spacing:.4px; margin-right:5px }
h1 { font:italic 800 clamp(44px,4.05vw,62px)/.99 "Roboto Condensed",Arial,sans-serif; letter-spacing:-1.8px; margin:0; text-transform:uppercase }
.subtitle { gap:7px; margin:11px 0 0; color:#b0acbd; font-size:13px }
.subtitle .icon { width:15px; height:15px; color:#aba6ba }
.sep-dot { width:3px; height:3px; border-radius:50%; background:#696675; margin:0 5px }
.room-actions { gap:14px; margin-top:14px }
.room-code { display:flex; align-items:center; gap:8px; padding-right:17px; border-right:1px solid var(--line); white-space:nowrap }
.room-code>.icon { color:#898398; width:17px }
.room-code small,.vitals small:not(.hp-read small) { display:block; font-size:9px; letter-spacing:1.3px; font-weight:650; color:var(--dim) }
.room-code strong { display:block; margin-top:3px; font:700 14px/14px ui-monospace,Menlo,monospace; color:#dcdae5; letter-spacing:1.3px }
.invite { background:var(--lime); color:#1b2512; display:inline-flex; align-items:center; justify-content:center; gap:9px; border:1px solid #cee98b; border-radius:9px; padding:13px 18px; font-weight:750; font-size:14px; line-height:19px; box-shadow:0 2px 0 #879f4c50 }
.invite:hover { background:#deff9e }
.invite .icon { stroke-width:2; width:19px }
.game-grid { display:grid; grid-template-columns:minmax(0,2.96fr) minmax(270px,1fr); gap:22px; align-items:start }
.play-column,aside { min-width:0 }
.play-panel { border:1px solid #44404e; border-radius:13px; overflow:hidden; background:var(--panel); box-shadow:0 6px 26px #0002 }
.canvas-wrap { position:relative; isolation:isolate; width:100%; aspect-ratio:1200/750; background:#10313f url('/assets/arena.webp') center/cover }
#arena { display:block; width:100%; height:100%; touch-action:none; cursor:crosshair; outline-offset:-3px }
.arena-hud { position:absolute; inset:15px 15px auto; display:flex; align-items:flex-start; justify-content:space-between; pointer-events:none }
.phase-chip,.clock-chip,.expand { background:#141421dc; border:1px solid #a89abb47; color:#f3f1f7; box-shadow:0 2px 6px #0509183b }
.phase-chip { display:flex; gap:7px; align-items:center; padding:7px 10px; font-size:9px; font-weight:750; letter-spacing:1.25px; text-transform:uppercase; border-radius:6px }
.phase-chip i,.network i { background:var(--lime); width:6px; height:6px; border-radius:50%; box-shadow:0 0 7px #d1ff7655 }
.clock-chip { position:absolute; left:50%; transform:translateX(-50%); display:flex; align-items:center; justify-content:center; gap:7px; padding:6px 13px; border-radius:8px; font:700 18px/21px ui-monospace,Menlo,monospace; letter-spacing:.1px }
.clock-chip .icon { width:15px; height:15px; color:#ceccdc }
.expand { pointer-events:auto; width:30px; height:30px; border-radius:6px }
.expand .icon { width:14px; height:14px }
.match-overlay { position:absolute; inset:0; display:grid; place-items:center; pointer-events:none; background:#11142248 }
.match-overlay>div { max-width:85%; padding:18px 24px; border:1px solid #a78fd877; border-radius:11px; background:#171724eF; text-align:center; box-shadow:0 10px 48px #0007 }
.match-overlay strong,.match-overlay span { display:block }
.match-overlay strong { font-size:23px }
.match-overlay span { margin-top:6px; color:#c5c1d1; font-size:12px }
.match-overlay button { margin-top:12px; pointer-events:auto }
.vitals { display:flex; align-items:center; gap:21px; padding:14px 20px; border-top:1px solid #414353; background:linear-gradient(100deg,#282534,#1b1c25 65%) }
.player-ident,.kos { display:flex; align-items:center; gap:10px }
.player-ident { min-width:100px; max-width:40% }
.player-ident>span:last-child,.kos>span { min-width:0 }
.player-ident strong { font-size:16px; display:block; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.hp { border-left:1px solid #43404d; padding-left:20px }
.hp-label { display:flex; align-items:center; gap:4px; font-size:10px; color:#bdb9c7 }
.hp-label .icon { width:11px; height:11px; fill:#c0ed76; stroke:#c0ed76 }
.hp-read { display:flex; align-items:center; gap:9px; margin-top:3px; font-size:11px; font-variant-numeric:tabular-nums }
.hp-track { display:block; width:clamp(60px,9vw,148px); height:8px; background:#383842; border-radius:2px; overflow:hidden; position:relative }
.hp-track i { display:block; background:var(--lime); height:100%; width:100%; transition:width .17s }
.hp-track::after { content:""; position:absolute; inset:0; background:repeating-linear-gradient(to right,transparent 0 calc(20% - 2px),#23232d calc(20% - 2px) 20%) }
.hp-read small { color:#a49fae; font-size:10px; font-weight:450 }
.kos { margin-left:auto; gap:9px }
.kos .icon { width:22px; height:22px; color:var(--purple) }
.kos strong { display:block; font-size:18px; font-weight:750; line-height:1.1; margin-top:3px }
aside { display:grid; gap:16px }
.side-card { border-radius:13px; padding:20px 17px 17px; background:linear-gradient(135deg,#20202a,#1b1c24 70%); border:1px solid var(--line) }
.card-title { display:flex; align-items:center; gap:9px; margin-bottom:17px }
h2 { font-size:20px; letter-spacing:-.7px; line-height:1.2; margin:0; font-weight:750 }
.title-icon { width:29px; height:29px; display:grid; place-items:center; border-radius:7px }
.title-icon .icon { width:17px; height:17px; stroke-width:1.9 }
.violet { color:#c5a7ff; background:#393047 }
.amber { color:#f7c66d; background:#38332b }
.spell-list { display:grid; gap:9px }
.spell { width:100%; display:flex; gap:10px; align-items:center; text-align:left; padding:8px; background:#25242f; border:1px solid #3b3947; border-radius:9px; position:relative; overflow:hidden }
.spell:hover { border-color:#75618e; background:#302d3a }
.spell-art { width:47px; height:47px; display:block; flex:none; border-radius:7px; background-image:url('/assets/spells.webp'); background-size:300% 100%; box-shadow:inset 0 0 0 1px #ffffff25 }
.spell-art.bolt { background-position:left }
.spell-art.nova { background-position:center }
.spell-art.blink { background-position:right }
.spell-copy { min-width:0; display:grid; gap:4px }
.spell-copy strong { font-size:14px; line-height:1.15; font-weight:700 }
.spell-copy small { color:#aba7b8; font-size:11px }
kbd { font:600 10px/1 "Golos Text",Arial,sans-serif; display:inline-grid; place-items:center; border:1px solid #454450; border-bottom-width:2px; color:#c4c0cf; background:#2b2b35; border-radius:4px; min-width:22px; min-height:22px; padding:3px 5px }
.spell kbd { margin-left:auto; align-self:center }
.cooldown { position:absolute; bottom:0; left:0; width:0; height:2px; background:#b69aef; transition:width .13s linear }
.count { margin-left:auto; border-radius:5px; border:1px solid #45434e; color:#bfbccb; font:600 11px/1 ui-monospace,Menlo,monospace; padding:4px 6px }
.list-head { display:flex; justify-content:space-between; padding:0 1px 9px; border-bottom:1px solid var(--line); color:#9591a4; font-size:9px; font-weight:650; letter-spacing:1.1px }
#fighters { list-style:none; margin:0; padding:0 }
.fighter { display:flex; align-items:center; gap:9px; border-bottom:1px solid #34333d; padding:10px 1px; min-height:48px }
.fighter:last-child { border:0; padding-bottom:2px }
.fighter .avatar { height:31px; width:31px; border-radius:7px }
.fighter-name { font-size:13px; font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.fighter small { font-size:8px; line-height:1.25; font-weight:700; letter-spacing:.6px; border-radius:3px; padding:2px 4px; background:#2c3328; color:var(--lime) }
.fighter small.bot { color:#aaa5b9; background:#302e39 }
.fighter .score { margin-left:auto; font:700 15px/1 ui-monospace,Menlo,monospace }
.practice-note { color:#a6a1b4; font-size:11px; line-height:1.55; border-top:1px solid var(--line); margin:13px 0 0; padding:12px 0 0 }
.control-strip { border:1px solid #31323c; border-radius:9px; display:flex; align-items:center; gap:22px; padding:12px 15px; margin-top:12px; color:var(--dim); background:#191a21; font-size:11px; min-height:44px }
.control-title { gap:7px; color:#d0cdd8; font-weight:600 }
.control-title .icon { width:17px; height:17px; color:#ada5bb }
.desktop-controls { gap:19px }
.desktop-controls>span { gap:3px; white-space:nowrap }
.desktop-controls>span kbd:last-of-type,.desktop-controls .icon { margin-right:4px }
.desktop-controls kbd { min-width:17px; min-height:18px; padding:2px 4px; font-size:9px }
.desktop-controls .icon { width:12px; height:14px }
.touch-controls { display:none }
footer { display:flex; align-items:center; justify-content:space-between; margin:15px 0 12px; color:#817e8e; border-top:1px solid #2d2c35; padding-top:13px }
.footer-brand { font:italic 900 14px/1 "Barlow Condensed",Impact,sans-serif; letter-spacing:.5px }
.network { gap:7px; font-size:10px }
.network i { width:5px; height:5px }
.network i.offline { background:#f7c66d }
.ping { color:#8a8696; font-size:10px }
.ping:not(:empty)::before { content:'·'; padding-right:6px }
dialog { width:min(440px,calc(100% - 32px)); border:1px solid #51465e; border-radius:15px; padding:28px; color:var(--text); background:#20202b; box-shadow:0 20px 95px #0009 }
dialog::backdrop { background:#090a12c7 }
dialog h2 { margin:12px 0; font:italic 800 34px/1 "Roboto Condensed",sans-serif; text-transform:uppercase; letter-spacing:-.8px }
dialog p:not(.section-label),dialog label { display:block; color:#c6c2d0; font-size:13px; line-height:1.55 }
.dialog-x { display:grid; place-items:center; position:absolute; right:11px; top:11px; border:0; width:28px; height:28px; border-radius:6px; background:#33323e }
.dialog-x svg { width:14px }
.help-list { list-style:none; margin:16px 0; padding:0; display:grid; gap:10px; font-size:12px; line-height:1.4 }
.help-list li { display:flex; align-items:center; gap:10px }
.help-list kbd { min-width:58px }
dialog input { width:100%; border:1px solid #4a4555; background:#171720; border-radius:7px; padding:12px; color:var(--text); margin:10px 0 16px }
.toast { position:fixed; z-index:10; bottom:24px; left:50%; transform:translateX(-50%); background:#2d2c38; border:1px solid #645771; border-radius:8px; box-shadow:0 3px 22px #0006; padding:12px 16px; color:#efedf7; font-size:13px; max-width:90vw; text-align:center }
.play-panel:is(:fullscreen,.expanded) { display:flex; align-items:center; justify-content:center; background:#101116; border:0; border-radius:0; flex-direction:column }
.play-panel:is(:fullscreen,.expanded) .canvas-wrap { width:min(100vw,calc((100dvh - 67px) * 1.6)); flex:none }
.play-panel:is(:fullscreen,.expanded) .vitals { width:min(100vw,calc((100dvh - 67px) * 1.6)); flex:none }
@media(min-width:1500px) { .room-heading { margin-top:40px; margin-bottom:28px } }
@media(max-width:1100px) {
  .topbar-inner,main { width:calc(100% - 48px) }
  .game-grid { grid-template-columns:minmax(0,1fr) 264px; gap:15px }
  .side-card { padding:15px 13px }
  .spell-art { width:40px; height:40px }
  .spell { gap:8px }
  .control-strip { gap:14px }
  .desktop-controls { gap:11px }
}
@media(max-width:800px) {
  .topbar-inner,main { width:calc(100% - 32px) }
  .topbar-inner { height:61px }
  .topbar nav { margin-left:25px; gap:16px }
  .game-grid { grid-template-columns:1fr }
  aside { grid-template-columns:1.1fr 1fr; align-items:start }
  .room-heading { margin:23px 0 18px }
  .room-actions { gap:9px }
  .room-code { padding-right:10px }
}
@media(max-width:600px) {
  .topbar-inner,main { width:calc(100% - 24px) }
  .topbar-inner { height:54px }
  .brand { font-size:27px; gap:2px }
  .brand-mark { width:29px; height:30px }
  .topbar nav { margin-left:14px; gap:0 }
  .topbar nav .nav-active { display:none }
  .topbar nav .nav-help { padding:9px }
  .nav-help span,.small-edit,.account>span:nth-child(2),.divider { display:none }
  .account-tools { gap:8px }
  .icon-button { width:31px; height:31px }
  .room-heading { margin:18px 0 12px; gap:10px; align-items:end; flex-wrap:wrap }
  .section-label { font-size:8px; letter-spacing:1.3px; margin-bottom:4px }
  .slash { font-size:13px }
  h1 { font-size:39px; letter-spacing:-1.3px }
  .subtitle { font-size:11px; margin-top:6px; gap:5px }
  .subtitle .icon { width:12px; height:12px }
  .room-actions { margin:0; width:100%; justify-content:space-between }
  .room-code { padding:0; border:0; gap:6px }
  .room-code>span { display:flex; gap:6px; align-items:baseline }
  .room-code small { font-size:8px }
  .room-code strong { font-size:11px }
  .room-code .icon { width:13px }
  .invite { padding:8px 12px; font-size:12px; gap:6px; border-radius:7px }
  .invite .icon { width:15px; height:15px }
  .play-panel,.side-card { border-radius:9px }
  .arena-hud { inset:7px 7px auto }
  .phase-chip { font-size:7px; padding:4px 6px; gap:4px; letter-spacing:.7px }
  .phase-chip i { width:4px; height:4px }
  .clock-chip { padding:3px 7px; font-size:12px; line-height:15px; border-radius:5px; gap:4px }
  .clock-chip .icon { width:11px; height:11px }
  .expand { width:22px; height:22px; border-radius:4px }
  .expand .icon { width:11px; height:11px }
  .vitals { gap:10px; padding:8px 9px }
  .player-ident { gap:5px; min-width:65px; max-width:34% }
  .player-ident .avatar { height:28px; width:28px; border-radius:6px }
  .player-ident strong { font-size:12px }
  .vitals small:not(.hp-read small) { font-size:7px; letter-spacing:.7px }
  .hp { padding-left:9px }
  .hp-label { font-size:8px }
  .hp-read { font-size:9px; gap:5px }
  .hp-read small { font-size:8px }
  .hp-track { width:44px; height:6px }
  .kos { gap:4px }
  .kos .icon { width:15px; height:15px }
  .kos strong { font-size:13px }
  .control-strip { padding:8px 10px; gap:10px; margin-top:6px; min-height:32px; font-size:10px }
  aside { grid-template-columns:1fr; gap:10px }
  .game-grid { gap:10px }
  .side-card { padding:11px }
  .card-title { margin-bottom:9px; gap:7px }
  .title-icon { width:23px; height:23px }
  .title-icon .icon { width:14px; height:14px }
  h2 { font-size:17px }
  .spell-list { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px }
  .spell { flex-direction:column; text-align:center; gap:5px; padding:7px 1px 8px }
  .spell-art { width:34px; height:34px }
  .spell-copy strong { font-size:10px }
  .spell-copy small,.spell kbd { display:none }
  .desktop-controls { display:none }
  .touch-controls { display:block }
  footer { margin-top:14px }
}
@media(pointer:coarse) { .desktop-controls { display:none } .touch-controls { display:block } }
@media(prefers-reduced-motion:reduce) { *,*::after,*::before { transition:none!important } }

.fullscreen-spells { display:none }
@media(pointer:coarse) {
  .play-panel:is(:fullscreen,.expanded) .fullscreen-spells { position:absolute; right:10px; bottom:10px; display:flex; gap:7px }
  .fullscreen-spells button { border:1px solid #9485a9; border-radius:8px; padding:2px; background:#211f2b }
  .fullscreen-spells .spell-art { width:36px; height:36px }
}
@media(min-width:1101px) and (max-height:950px) {
  .room-heading { margin:16px 0 14px }
  h1 { font-size:49px }
  .vitals { padding:10px 17px }
  .control-strip { margin-top:8px; padding:8px 13px; min-height:36px }
  footer { margin-top:10px; padding-top:8px }
}

body.field-expanded { overflow:hidden }
.play-panel.expanded { position:fixed; inset:0; z-index:8 }
