:root {
  --bg: #06080d; --panel: #0e131c; --panel2: #151c28; --line: #26324a; --line2: #34456a; --text: #dbe6f5; --dim: #8394ad;
  --blue: #3d8bff; --cyan: #2fe0d0; --red: #ff3b3b; --orange: #ff9a2e; --gold: #ffcf4a; --accent: #7c5cff; --green: #6cff9a;
  --player: #ffcf4a; --team: #2fe0d0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { background: linear-gradient(#1b2433, #121926); border: 1px solid var(--line2); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
button:hover:not(:disabled) { border-color: #5a78b0; background: linear-gradient(#22304a, #172033); }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: linear-gradient(#8a6bff, #5d3fe0); border-color: #9a82ff; color: #fff; font-weight: 700; letter-spacing: .5px; }
input { background: #0a0f17; border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px; outline: none; }
input:focus { border-color: var(--accent); }
.hidden { display: none !important; }
.blueTxt { color: var(--blue); } .redTxt { color: var(--red); }

/* Menus */
.screen { position: fixed; inset: 0; display: flex; align-items: safe center; justify-content: center; padding: 16px; overflow: auto;
  background: radial-gradient(ellipse at 20% 20%, #13234a 0, transparent 50%), radial-gradient(ellipse at 80% 80%, #3a1020 0, transparent 50%), var(--bg); }
.card { background: linear-gradient(#111827ee, #0b1019ee); border: 1px solid var(--line2); border-radius: 12px; padding: 24px; width: min(440px, 100%); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px #000a, inset 0 1px #ffffff10; }
.card.wide { width: min(660px, 100%); }
h1 { margin: 0; font-size: 42px; letter-spacing: 6px; text-align: center; font-weight: 800; text-shadow: 0 0 24px #4a7cff88; }
h1 span { color: var(--accent); margin-left: 10px; }
h2 { margin: 0; }
.tag, .note { color: var(--dim); margin: 0; text-align: center; }
.note.err { color: #ff8080; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--dim); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; min-width: 0; }
details { color: var(--dim); } details ul { padding-left: 18px; margin: 8px 0 0; } summary { cursor: pointer; }
.code { color: var(--gold); letter-spacing: 3px; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.team h3 { margin: 0 0 8px; } .team.blue h3 { color: var(--blue); } .team.red h3 { color: var(--red); }
.slot { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel2); cursor: pointer; min-height: 56px; position: relative; }
.slot small { display: block; color: var(--dim); }
.slot.me { border-color: var(--gold); } .slot.open { border-style: dashed; color: var(--dim); }
.slot .kick { position: absolute; right: 8px; top: 8px; padding: 2px 8px; font-size: 12px; }
.team.blue .slot.taken { box-shadow: inset 3px 0 var(--blue); } .team.red .slot.taken { box-shadow: inset 3px 0 var(--red); }
.hostctl { justify-content: space-between; flex-wrap: wrap; }

/* Game layout */
#game { flex-direction: column; padding: 0; align-items: stretch; justify-content: stretch; background: #000; }
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#cv.placing, #cv.targeting { cursor: crosshair; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-tag { position: absolute; left: 0; top: 0; font-size: 12px; font-weight: 700; text-shadow: 0 1px 3px #000, 0 0 6px #000; white-space: nowrap; }

/* Top bar */
#topbar { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: 8px 12px; pointer-events: none; background: linear-gradient(#000c, transparent); }
#topbar > * { pointer-events: auto; }
.tb-left { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.nx { display: flex; align-items: center; gap: 8px; } .nx b { color: var(--dim); font-weight: 500; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 70px; height: 6px; background: #000a; border-radius: 3px; overflow: hidden; border: 1px solid #ffffff14; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.bar.hp { width: 150px; height: 9px; } .bar.hp i { background: linear-gradient(90deg, #2b6fe0, #6aa8ff); } .bar.hp.red i { background: linear-gradient(90deg, #d02a2a, #ff7070); }
.tb-right { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
#clock { font-variant-numeric: tabular-nums; color: var(--dim); font-weight: 600; }
#legend { display: flex; gap: 10px; font-size: 12px; color: var(--dim); }
#legend span { display: flex; align-items: center; gap: 4px; } #legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
button.icon { padding: 3px 9px; font-size: 15px; } button.icon.off { opacity: .35; }

/* Credits: the most important number on screen */
#credits { position: relative; text-align: center; padding: 6px 22px 8px; border-radius: 0 0 14px 14px; margin-top: -8px;
  background: linear-gradient(#2a2208, #120f06); border: 1px solid #6a5418; border-top: none; box-shadow: 0 6px 24px #000a, 0 0 30px #ffcf4a22; }
.cr-main { display: flex; align-items: center; justify-content: center; gap: 8px; }
.cr-icon { color: #7fe8ff; font-size: 24px; text-shadow: 0 0 10px #4cd8ff; }
#gold { font-size: 36px; font-weight: 800; color: var(--gold); text-shadow: 0 0 14px #ffb02088; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.cr-sub { font-size: 12px; color: #c8b27a; display: flex; align-items: center; gap: 6px; justify-content: center; } #income { color: #a6ff8a; font-weight: 700; }
.bar.inc { width: 60px; height: 4px; } .bar.inc i { background: #a6ff8a; transition: none; }
#credits.pay #gold { animation: pay .6s; } #credits.broke { animation: shake .35s; } #credits.broke #gold { color: #ff6a6a; }
@keyframes pay { 0% { transform: scale(1); } 30% { transform: scale(1.18); color: #c8ff9a; } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
#crPop { position: absolute; left: 0; right: 0; top: 100%; pointer-events: none; }
#crPop div { color: #a6ff8a; font-weight: 800; font-size: 18px; animation: rise 1.2s forwards; text-shadow: 0 0 8px #000; }
@keyframes rise { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(26px); } }

/* Alerts & calls to action */
#alerts { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 6; }
.alert { display: flex; align-items: center; gap: 10px; background: linear-gradient(#5a0d12ee, #300609ee); border: 1px solid #ff4d4d; color: #ffd9d9; padding: 6px 8px 6px 14px; border-radius: 8px; font-weight: 700; box-shadow: 0 0 24px #ff202060; animation: alertIn .25s; }
.alert button { padding: 3px 10px; font-size: 12px; }
@keyframes alertIn { from { transform: translateY(-10px); opacity: 0; } }
#ctas { position: absolute; right: 12px; top: 76px; width: 280px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.cta { background: linear-gradient(#18233aee, #0e1524ee); border: 1px solid #4f7bd8; border-left: 4px solid var(--gold); border-radius: 8px; padding: 9px 10px; box-shadow: 0 8px 24px #000a; animation: alertIn .3s; position: relative; }
.cta b { display: block; color: var(--gold); font-size: 13px; } .cta p { margin: 2px 0 8px; font-size: 12px; color: var(--dim); }
.cta .go { background: linear-gradient(#e9b93a, #b8861a); border-color: #ffd86a; color: #1a1200; font-weight: 800; padding: 4px 12px; font-size: 12px; }
.cta .x { position: absolute; right: 6px; top: 4px; padding: 0 6px; border: none; background: none; color: var(--dim); }
#toast { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); pointer-events: none; display: flex; flex-direction: column; gap: 4px; align-items: center; z-index: 7; }
#toast div { background: #3a1a1fee; border: 1px solid var(--red); padding: 5px 14px; border-radius: 8px; font-weight: 600; }

/* Hero bar */
#heroBar { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; z-index: 4;
  background: linear-gradient(#141c2cf0, #0b111cf0); border: 1px solid var(--line2); box-shadow: 0 8px 30px #000c; }
#hbPortrait { width: 52px; height: 52px; border-radius: 8px; border: 2px solid var(--gold); background: #0a0f17; cursor: pointer; }
.hb-info { display: flex; flex-direction: column; width: 150px; gap: 2px; } .hb-info small { color: var(--dim); font-size: 11px; }
.bar.hb { width: 150px; height: 8px; } .bar.hb i { background: linear-gradient(90deg, #2fbf55, #6cff9a); }
#hbAbilities { display: flex; gap: 6px; }
.ab { position: relative; width: 50px; height: 50px; padding: 0; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 10px; text-align: center; line-height: 1.1; }
.ab .k { position: absolute; top: 2px; left: 4px; font-weight: 800; color: var(--gold); font-size: 12px; }
.ab .cdv { position: absolute; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; }
.ab.locked { filter: grayscale(1); opacity: .5; } .ab.locked::after { content: '🔒'; position: absolute; bottom: 2px; right: 3px; font-size: 11px; }
.ab.ready { border-color: #ffd86a; box-shadow: inset 0 0 12px #ffcf4a40; }
#hbAuto.on { background: linear-gradient(#2fbf55, #1c7a36); border-color: #6cff9a; color: #fff; }

/* Hero picker */
#heroPick { position: absolute; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; z-index: 10; }
.hp-card { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 18px; width: min(1000px, 96%); max-height: 92%; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
#heroGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hcard { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px; }
.hcard img { width: 100%; aspect-ratio: 1; background: radial-gradient(#1b2740, #0a0f17); border-radius: 8px; }
.hcard b { font-size: 15px; } .hcard i { color: var(--gold); font-style: normal; font-size: 12px; } .hcard small { color: var(--dim); font-size: 11px; }
.hcard ul { margin: 2px 0 0; padding-left: 14px; font-size: 11px; color: #b9c6dc; }

/* Console */
#console { display: grid; grid-template-columns: 250px minmax(280px, 1fr) auto; gap: 8px; padding: 8px; background: linear-gradient(#0f1622, #090d14); border-top: 1px solid var(--line2); height: 228px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-width: 0; overflow: hidden; }
.panel.mm { padding: 4px; } #minimap { width: 100%; height: 100%; display: block; border-radius: 6px; cursor: pointer; }
.panel.info { overflow: auto; }
.sec-h { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--dim); margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.sec-h .hint { font-weight: 500; letter-spacing: 0; text-transform: none; color: #62718a; }
.sec.player .sec-h { color: var(--player); } .sec.team .sec-h { color: var(--team); } .sec.hero .sec-h { color: #ff9ae0; }
.sec.player { border-left: 3px solid var(--player); padding-left: 8px; } .sec.team { border-left: 3px solid var(--team); padding-left: 8px; } .sec.hero { border-left: 3px solid #ff9ae0; padding-left: 8px; }
.sec-row { display: flex; gap: 14px; margin-top: 8px; }
.lanepick { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--dim); font-weight: 600; letter-spacing: 0; }
.lanepick button { padding: 1px 8px; font-size: 11px; } .lanepick button.on { background: linear-gradient(#2fbf55, #1c7a36); border-color: #6cff9a; color: #fff; }
#build { display: grid; grid-template-columns: repeat(7, 78px); gap: 5px; }
.bb { position: relative; height: 92px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; overflow: hidden; }
.bb img { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 70px; height: 70px; }
.bb .nm { position: relative; font-weight: 700; font-size: 11px; background: #000a; width: 100%; text-align: center; }
.bb .cost { position: relative; color: var(--gold); font-size: 11px; font-weight: 700; background: #000a; width: 100%; text-align: center; padding-bottom: 2px; }
.bb .key { position: absolute; top: 3px; left: 5px; font-size: 11px; font-weight: 800; color: var(--gold); }
.bb .cnt { position: absolute; top: 3px; right: 5px; font-size: 11px; font-weight: 800; color: #b8a8ff; }
.bb.sel { border-color: #6cff9a; box-shadow: 0 0 0 2px #6cff9a inset, 0 0 14px #6cff9a55; }
#pUpg, #tUpg, #heroCmd { display: flex; gap: 5px; }
.ub { width: 104px; height: 54px; padding: 4px 6px; text-align: left; display: flex; flex-direction: column; justify-content: center; position: relative; }
.ub .nm { font-size: 11px; font-weight: 700; line-height: 1.15; } .ub .lv { font-size: 10px; color: var(--dim); } .ub .cost { font-size: 11px; color: var(--gold); font-weight: 700; }
.ub .key { position: absolute; top: 2px; right: 5px; font-size: 10px; font-weight: 800; color: var(--gold); }
.sec.player .ub { border-color: #6a5418; } .sec.team .ub { border-color: #19665e; }
.pips { display: flex; gap: 2px; margin-top: 2px; } .pips i { width: 10px; height: 3px; background: #ffffff20; border-radius: 1px; } .pips i.on { background: currentColor; }
.sec.player .pips { color: var(--player); } .sec.team .pips { color: var(--team); }
#heroCmd .ub { width: 130px; }

/* Info panel */
.info-empty { color: var(--dim); font-size: 12px; } .info-empty b { color: var(--text); }
.ip { display: grid; grid-template-columns: 84px 1fr; gap: 10px; }
.ip img { width: 84px; height: 84px; border-radius: 8px; background: radial-gradient(#1b2740, #0a0f17); border: 1px solid var(--line2); }
.ip h3 { margin: 0; font-size: 16px; } .ip .sub { color: var(--dim); font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 1px 10px; font-size: 12px; margin: 4px 0; justify-content: start; }
.stats span { color: var(--dim); } .stats b { font-weight: 600; }
.vs { font-size: 11px; margin: 2px 0; } .vs .g { color: #8dff9a; } .vs .w { color: #ff9a9a; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bigup { background: linear-gradient(#e9b93a, #a8760e); border-color: #ffe08a; color: #1a1200; font-weight: 800; padding: 8px 12px; text-align: left; box-shadow: 0 0 16px #ffcf4a44; }
.bigup small { display: block; font-weight: 600; font-size: 11px; color: #3a2a00; }
.bigup:disabled { filter: grayscale(.6); }
.lanes button.on { background: linear-gradient(#2fbf55, #1c7a36); border-color: #6cff9a; color: #fff; }
.stars { color: var(--gold); letter-spacing: 1px; }
.abl { font-size: 12px; margin: 3px 0; } .abl b { color: var(--gold); }
.tagline { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 10px; background: #ffffff14; margin-left: 6px; color: var(--dim); }

/* Tooltip */
#tip { position: fixed; z-index: 50; max-width: 320px; background: linear-gradient(#141d2ef8, #0b111cf8); border: 1px solid #4f7bd8; border-radius: 8px; padding: 10px 12px; pointer-events: none; box-shadow: 0 10px 30px #000c; font-size: 12px; }
#tip h4 { margin: 0 0 2px; font-size: 14px; } #tip .role { color: var(--gold); font-size: 11px; margin-bottom: 4px; }
#tip p { margin: 4px 0; color: #c2cee3; } #tip .stats { grid-template-columns: repeat(4, auto); }
#tip .next { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; color: #a6ff8a; }
#tip .scope { font-weight: 800; font-size: 11px; letter-spacing: 1px; }

#over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000a; z-index: 20; }
#over h2 { font-size: 42px; text-align: center; } #over p { text-align: center; color: var(--dim); margin: 0; }

/* Chat */
#chat { position: fixed; left: 268px; bottom: 244px; width: min(340px, calc(100% - 24px)); z-index: 10; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
body:not(.ingame) #chat { left: 12px; bottom: 12px; }
#chatLog { max-height: 150px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; text-shadow: 0 1px 2px #000; }
#chatLog div { background: #0009; padding: 2px 8px; border-radius: 6px; margin-top: 2px; }
#chatIn { pointer-events: auto; background: #0a0f17cc; } body.ingame #chatIn:not(:focus) { opacity: .35; }

@media (max-width: 1350px) {
  #console { grid-template-columns: 200px 1fr; height: auto; }
  .panel.cmd { grid-column: 1 / -1; }
  #build { grid-template-columns: repeat(7, 1fr); }
  .sec-row { flex-wrap: wrap; }
  #chat { display: none !important; }
}
