:root { --ink: #eef2f6; --muted: #93a1b0; --gold: #e2b347; --panel: rgba(10, 15, 22, .86); --line: rgba(255, 255, 255, .12); --accent: #d93a49; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b1016; color: var(--ink); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#score { position: absolute; top: 18px; left: 22px; display: flex; align-items: stretch; font-weight: 800; letter-spacing: .04em; filter: drop-shadow(0 3px 8px rgba(0,0,0,.5)); }
#score .tm { display: flex; align-items: center; gap: 8px; background: rgba(12, 16, 22, .92); padding: 6px 12px; }
#score .sw { width: 6px; align-self: stretch; }
#score .gl { background: #f4f6f8; color: #0b1016; padding: 6px 12px; font-size: 18px; min-width: 64px; text-align: center; }
#score .clk { background: var(--accent); padding: 6px 12px; font-variant-numeric: tabular-nums; min-width: 66px; text-align: center; }
#toast { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font: 900 64px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.6); opacity: 0; transform: scale(.9); transition: opacity .25s, transform .25s; }
#toast.on { opacity: 1; transform: scale(1); }
#toast small { display: block; font-size: 20px; font-weight: 700; letter-spacing: .1em; margin-top: 10px; color: var(--gold); }
#replayTag { position: absolute; top: 18px; right: 22px; background: var(--accent); padding: 6px 14px; font-weight: 900; letter-spacing: .2em; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .55; } }
#bottom { position: absolute; left: 22px; bottom: 22px; display: grid; gap: 6px; min-width: 220px; }
#who { background: rgba(12, 16, 22, .88); padding: 6px 12px; font-weight: 700; border-left: 5px solid var(--gold); }
#who small { color: var(--muted); font-weight: 600; margin-left: 6px; }
#power { height: 10px; background: rgba(12, 16, 22, .88); border: 1px solid var(--line); opacity: 0; transition: opacity .15s; }
#power.on { opacity: 1; }
#power i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4cc36b, #e2b347 70%, #d93a49); }
#radar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: 210px; height: 136px; border-radius: 6px; background: rgba(12, 30, 18, .55); border: 1px solid rgba(255,255,255,.25); }
#keys { position: absolute; right: 22px; bottom: 22px; font-size: 12px; color: var(--muted); text-align: right; background: rgba(12, 16, 22, .7); padding: 6px 10px; border-radius: 6px; }
#keys b { color: var(--ink); background: rgba(255,255,255,.12); padding: 1px 6px; border-radius: 4px; margin-right: 4px; }
#keys span { display: inline-block; margin-left: 12px; }
#keys { top: 18px; bottom: auto; max-width: min(520px, 48vw); line-height: 2; }
#toast.small { font-size: 34px; top: 20%; }
#toast.small small { font-size: 15px; }
@media (max-width: 900px) { #keys { display: none; } #radar { width: 168px; height: 109px; } }
#score .clk small { font-size: 12px; color: #ffe08a; }
#score { flex-wrap: wrap; max-width: 520px; }
#score .pens { flex-basis: 100%; display: flex; align-items: center; gap: 12px; background: rgba(12,16,22,.92); padding: 4px 12px; font-size: 12px; }
#score .pens div { display: flex; gap: 4px; min-width: 70px; }
#score .pens i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
#score .pens i.y { background: #4cc36b; } #score .pens i.n { background: #d93a49; }
#score .pens span { margin-left: auto; color: var(--gold); }
#fps { position: absolute; top: 60px; left: 22px; font: 600 12px/1.3 ui-monospace, Consolas, monospace; color: #b8f5c8; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 4px; }
.tabsel { display: flex; gap: 8px; margin: 0 0 16px; }
.tabsel button { border: 1px solid var(--line); background: #111923; color: var(--muted); border-radius: 999px; padding: 7px 16px; font-weight: 700; }
.tabsel button.on { background: var(--gold); color: #0b1016; border-color: var(--gold); }
.bracket { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 14px 0; align-items: center; }
.bracket h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.tie { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; overflow: hidden; font-size: 13px; }
.tie div { display: flex; justify-content: space-between; padding: 5px 10px; gap: 8px; }
.tie div + div { border-top: 1px solid var(--line); }
.tie .w { font-weight: 800; color: var(--ink); } .tie .l { color: var(--muted); }
.tie.me { border-color: var(--gold); }
.tie .tbd { color: var(--muted); font-style: italic; }
.champ { text-align: center; font: 900 34px/1.1 system-ui, sans-serif; color: var(--gold); margin: 6px 0 10px; }
.sect { margin-top: 18px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 800; }
#hint { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); background: rgba(12, 16, 22, .85); padding: 8px 16px; border-radius: 8px; font-weight: 600; opacity: 0; transition: opacity .2s; }
#hint.on { opacity: 1; }
#hint b { color: var(--gold); }
#who b { color: var(--gold); margin-right: 4px; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; }
#fade.go { animation: fade .6s ease-out; }
@keyframes fade { 0% { opacity: .85; } 100% { opacity: 0; } }
.panel .tabs { display: flex; gap: 8px; }
.loading { position: fixed; inset: 0; display: grid; place-items: center; font-weight: 800; letter-spacing: .1em; color: var(--muted); }

/* ---------- in-match controls panel ---------- */
#ctlBtn { position: absolute; right: 22px; top: 18px; pointer-events: auto; border: 1px solid var(--line); background: rgba(12, 16, 22, .88); color: var(--ink); border-radius: 8px; padding: 7px 12px; font-weight: 800; }
#ctlBtn small { color: var(--muted); margin-left: 4px; font-weight: 700; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
#ctlBtn.on { background: var(--gold); color: #0b1016; border-color: var(--gold); }
#ctlBtn.on small { color: #0b1016; border-color: rgba(0,0,0,.3); }
#keys { top: 62px; }
#replayTag { top: 62px; }
#ctlPanel { position: absolute; right: 22px; top: 62px; width: 330px; max-height: calc(100% - 210px); overflow: auto; pointer-events: auto; background: rgba(10, 15, 22, .9); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
#ctlPanel h3 { margin: 0; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
#ctlPanel h3 small { color: var(--muted); font-size: 11px; margin-left: 6px; letter-spacing: .04em; }
#ctlPanel .ctl { grid-template-columns: 1fr; margin-top: 4px; font-size: 12px; }
#ctlPanel .note { margin-top: 10px; }

/* ---------- menus ---------- */
#menu { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 0%, rgba(30, 60, 40, .55), rgba(6, 9, 13, .92) 70%); overflow: auto; padding: 24px; }
#menu.clear { background: rgba(6, 9, 13, .55); }
.panel { width: min(920px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.brand { font: 900 44px/1 system-ui, sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.brand span { color: var(--gold); }
.sub { color: var(--muted); margin: 8px 0 20px; }
.row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: start; }
.side h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.vs { align-self: center; font-weight: 900; font-size: 22px; color: var(--muted); padding-top: 24px; }
select { width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #111923; color: var(--ink); }
.card { margin-top: 10px; display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.kit { width: 38px; height: 44px; border-radius: 8px 8px 12px 12px; border: 2px solid rgba(255,255,255,.25); position: relative; }
.kit::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: var(--k2); border-radius: 0 0 10px 10px; }
.card b { display: block; }
.card small { color: var(--muted); }
.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
.opts label { display: grid; gap: 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.go { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; align-items: center; }
.btn { border: 0; border-radius: 10px; padding: 12px 22px; font-weight: 800; letter-spacing: .04em; background: #1b2633; color: var(--ink); }
.btn.primary { background: var(--accent); color: #fff; font-size: 17px; padding: 14px 30px; }
.btn:hover { filter: brightness(1.15); }
.ctl { margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 26px; font-size: 13px; color: var(--muted); }
.ctl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.ctl b { color: var(--ink); }
.ctl h4 { grid-column: 1 / -1; margin: 10px 0 2px; color: var(--ink); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.note { font-size: 12px; color: var(--muted); margin-top: 16px; }
.stats { width: 100%; border-collapse: collapse; margin: 12px 0; }
.stats td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.stats td:first-child, .stats td:last-child { width: 30%; font-weight: 800; font-size: 18px; }
.final { font: 900 56px/1 system-ui, sans-serif; text-align: center; margin: 6px 0 4px; }
.scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; color: var(--muted); }
.scorers div:last-child { text-align: right; }
.credit { margin-top: 6px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.panel.wide { width: min(1100px, 100%); }
.crtop { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); margin-bottom: 12px; }
.crtop b { display: block; font-size: 18px; } .crtop small { color: var(--muted); }
.crtop .cash { margin-left: auto; text-align: right; font: 900 24px/1 system-ui, sans-serif; color: #7ee29a; }
.crtop .cash small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.ctabs button { padding: 6px 14px; font-size: 13px; }
.crmsg { background: rgba(226, 179, 71, .14); border: 1px solid rgba(226, 179, 71, .5); color: #ffe7a8; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-weight: 600; }
.nextfx { text-align: center; padding: 14px; border: 1px solid var(--gold); border-radius: 10px; background: rgba(226, 179, 71, .06); }
.nextfx small { color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.nextfx div { font: 900 26px/1.2 system-ui, sans-serif; margin-top: 4px; }
.nextfx span { color: var(--gold); font-size: 15px; vertical-align: middle; } .nextfx i { color: var(--muted); font-size: 16px; font-style: normal; margin: 0 6px; }
.crcols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.tbl th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; text-align: center; padding: 4px 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #0e141c; }
.tbl td { text-align: center; padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.06); }
.tbl .l { text-align: left; }
.tbl tr.me td { background: rgba(226, 179, 71, .14); font-weight: 700; }
.tbl tr.xi td:nth-child(3) { color: var(--gold); font-weight: 700; }
.scroll { max-height: 48vh; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.dim { opacity: .45; }
.star { background: none; border: 0; color: var(--muted); font-size: 17px; padding: 0 4px; }
.star.on { color: var(--gold); }
.xinfo { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 13px; padding: 10px 0; }
.res div, .news div { font-size: 13px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.res div.me { color: var(--gold); }
.news small { display: block; color: var(--muted); font-size: 11px; }
.news { max-height: 300px; overflow: auto; }
.fin { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; }
.fin .big { font: 900 40px/1.1 system-ui, sans-serif; color: #7ee29a; margin-top: 6px; }
.cheat { display: flex; gap: 8px; margin: 10px 0; }
.cheat input, .opts input:not([type]) { flex: 1; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #111923; color: var(--ink); }
.chk { display: block; margin: 12px auto; max-width: 640px; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .crcols, .fin { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; } .vs { padding: 0; text-align: center; } .opts, .ctl { grid-template-columns: 1fr 1fr; } .brand { font-size: 32px; } }
