:root{--navy:#1d2433;--bg:#f4f6fa;--line:#dde2ea;--neon:#00e676;--muted:#6b7385}
*{box-sizing:border-box}
body{font-family:system-ui,Segoe UI,Helvetica,Arial,sans-serif;margin:0;background:var(--bg);color:#1d2433;font-size:15px}
a{color:#1a56c4}
.muted{color:var(--muted)}.small{font-size:13px}
.err{color:#c62828;font-weight:600;min-height:1em;margin:4px 0}.ok{color:#1b8a3a;font-weight:600;margin:4px 0}
.err:empty,.ok:empty{display:none}
button{font:inherit;border:0;border-radius:7px;padding:8px 14px;background:var(--navy);color:#fff;cursor:pointer;font-weight:600}
button:hover{opacity:.9}button.ghost{background:#e3e7ef;color:var(--navy)}button.danger{background:#c62828}
input,select{font:inherit;padding:8px 10px;border:1px solid #c9cfdb;border-radius:7px;width:100%;margin-top:4px;background:#fff}

/* header */
.top{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:var(--navy);color:#fff;padding:10px 18px;position:sticky;top:0;z-index:10}
.brand{font-size:20px;font-weight:800;letter-spacing:.3px}.brand span{color:var(--neon)}
.brand.big{font-size:26px;text-align:center}
.menu{margin-left:auto;display:flex;gap:12px;align-items:center;font-size:14px}
.menu a{color:#cfd6e4;text-decoration:none}.menu a:hover{color:#fff}
.menu button{padding:6px 12px;background:#2f3a52}
.clock{font-size:13px;opacity:.8}
.pill{display:inline-flex;align-items:center;gap:7px;padding:4px 12px;border-radius:20px;font-size:13px;font-weight:700;background:#3a4256}
.pill::before{content:"";width:9px;height:9px;border-radius:50%;background:#9aa3b5}
.pill.LIVE{background:#0f3d24;color:#7dffb5}.pill.LIVE::before{background:var(--neon);animation:pulse 1.6s infinite}
.pill.DELAYED{background:#4a3a10;color:#ffd54f}.pill.DELAYED::before{background:#ffb300}
.pill.STARTING{background:#123150;color:#90caf9}.pill.STARTING::before{background:#42a5f5}
.pill.OFFLINE{background:#4a1616;color:#ff8a80}.pill.OFFLINE::before{background:#ff5252}
@keyframes pulse{0%{opacity:1}50%{opacity:.25}100%{opacity:1}}
.warn{background:#fff3cd;border-bottom:1px solid #ffe08a;padding:8px 18px;font-weight:600;color:#6d4c00}

main{padding:14px 18px;max-width:1500px;margin:0 auto}
.cards{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.card{background:#fff;border-radius:10px;padding:8px 14px;box-shadow:0 1px 3px #0002;min-width:120px}
.card .k{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}.card .v{font-size:21px;font-weight:700;white-space:nowrap}
.card .v small{font-size:13px;font-weight:600;color:var(--muted)}
.up{color:#1b8a3a}.dn{color:#c62828}
.panel{background:#fff;border-radius:10px;padding:14px 16px;box-shadow:0 1px 3px #0002;margin-bottom:14px}
.panel h2{margin:0 0 8px;font-size:18px}
.tabs{display:flex;gap:6px;margin-bottom:10px;flex-wrap:wrap}
.tabs button{background:#fff;color:var(--navy);border:1px solid #ccd3e0}
.tabs button.on{background:var(--navy);color:#fff;border-color:var(--navy)}
.chip{display:inline-block;padding:3px 10px;border-radius:10px;font-size:13px;font-weight:700;border:1px solid #ccd;margin:0 6px 6px 0;background:#fff}
.c-win{background:#00c853}.c-lose{background:#ff1744;color:#fff}.c-fight{background:#ffeb3b}.c-meet{background:#fce4ec}
.c-gwin{background:#9c27b0;color:#fff}.c-glose{background:#e1bee7}.c-atm{background:#7e3ff2;color:#fff}
.legend{margin-top:10px}

/* chain - same colours as the EOD dashboard */
.chain{background:#0d0d0d;padding:10px 12px;border-radius:10px}
.chead{display:grid;grid-template-columns:1fr auto 1fr;gap:3px 40px;color:var(--neon);font-size:14px;margin-bottom:8px}
.chead .mid{color:#fff;text-align:center;font-weight:700}.chead div:nth-child(3n){text-align:right}
.scroll{overflow:auto;max-height:calc(100vh - 230px);border-radius:6px}
.ct{border-collapse:collapse;font-size:14px;width:100%;font-variant-numeric:tabular-nums}
.ct thead{position:sticky;top:0;z-index:3}
.ct th{background:#1e1e1e;color:#fff;border:1px solid #333;padding:6px 9px;white-space:nowrap}
.ct tr.side th{color:var(--neon);letter-spacing:2px}
.ct td{background:#fff;color:#000;border:1px solid #999;padding:4px 9px;text-align:right;white-space:nowrap}
.ct td.cl{font-weight:700}
.ct td.WIN{background:#00c853;color:#000}.ct td.LOSE{background:#ff1744;color:#fff}
.ct td.FIGHTING{background:#ffeb3b;color:#000}.ct td.MEETING{background:#ff80ab;color:#000}
.ct td.GWIN{background:#9c27b0;color:#fff}.ct td.GLOSE{background:#e1bee7;color:#000}
.ct td.sk{background:#29b6f6;color:#000;font-weight:700;text-align:center;position:sticky;left:0;z-index:1}
.ct td.sk.atm{background:#7e3ff2;color:#fff}
.ct td.av{background:#e3e7ef;font-weight:700}
.ct td.pos{color:#1b8a3a;font-weight:600}.ct td.neg{color:#c62828;font-weight:600}
.ct tr.met td:not(.cl):not(.sk):not(.av){background:#fce4ec}
.ct td.f-up{animation:fup 1.2s}.ct td.f-dn{animation:fdn 1.2s}
@keyframes fup{0%{box-shadow:inset 0 0 0 3px #00e676}100%{box-shadow:inset 0 0 0 3px transparent}}
@keyframes fdn{0%{box-shadow:inset 0 0 0 3px #ff1744}100%{box-shadow:inset 0 0 0 3px transparent}}

/* login / account / admin */
body.auth{display:flex;min-height:100vh;align-items:center;justify-content:center;background:linear-gradient(160deg,#1d2433,#2c3a57)}
.authbox{background:#fff;border-radius:14px;padding:26px 28px;width:min(380px,92vw);box-shadow:0 10px 30px #0005;display:flex;flex-direction:column;gap:10px}
.authbox .muted{text-align:center;margin:0}
.authbox label{font-size:14px;font-weight:600}
.authbox button{margin-top:6px;padding:10px}
table.users{border-collapse:collapse;width:100%}
table.users th,table.users td{border-bottom:1px solid var(--line);padding:8px;text-align:left}
table.users td button{padding:5px 10px;font-size:13px;margin-right:4px}
form.row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
form.row label{font-size:14px;font-weight:600;min-width:180px}

@media (max-width:700px){
  body{font-size:14px}.top{padding:8px 10px;gap:6px 10px;position:static}.brand{font-size:18px}
  .menu{gap:10px;font-size:13px;margin-left:0;width:100%}.menu button{margin-left:auto}
  main{padding:10px 8px}.cards{gap:6px}.card{flex:1 1 45%;min-width:0;padding:6px 10px}.card .v{font-size:17px}
  .ct{font-size:12px}.ct td,.ct th{padding:3px 5px}.chead{gap:2px 10px;font-size:12px}
  .scroll{max-height:calc(100vh - 120px)}
}
