/* The player's colours (dark, the volt accent, CT blue and T gold), with Chakra
   Petch for headings and numbers. */
:root {
  color-scheme: dark;
  --bg: #0a0c0f; --panel: #12151a; --panel-2: #181c23; --panel-3: #1f242c;
  --line: #232830; --line-strong: #333a45; --well: #07090c;
  --fg: #e8edf2; --muted: #8b95a3;
  --volt: #ccff00; --ct: #5b9bd5; --t: #d9a441; --bad: #ff5d5d; --warn: #ffb020;
  --radius: 4px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.55 var(--font);
}
a { color: var(--volt); }
h1, h2, h3, .brand, .price, .num, .profile-name, .match .pts, .drop-title { font-family: var(--font-display); }
h1 { font-size: clamp(32px, 5.4vw, 52px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 20px; margin: 44px 0 14px; letter-spacing: .01em; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
code { font: 12px Consolas, monospace; background: var(--well); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

button, .button {
  font: inherit; color: var(--fg); background: var(--panel-2); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  height: 36px; padding: 0 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background .15s, border-color .15s, filter .15s;
}
button:hover, .button:hover { background: var(--panel-3); border-color: #475060; }
button:focus-visible, .button:focus-visible, .drop:focus-visible, summary:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
.button.primary, button.primary { background: var(--volt); color: var(--bg); border-color: var(--volt); font-weight: 700; }
.button.primary:hover, button.primary:hover { background: var(--volt); filter: brightness(1.08); }
button.small, .button.small { height: 30px; padding: 0 10px; font-size: 13px; }
.button.big { height: 46px; padding: 0 22px; font-size: 16px; }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }

header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { color: var(--fg); text-decoration: none; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.brand b { color: var(--volt); font-weight: 700; }
.mark { width: 14px; height: 14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--volt); }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--panel-3); border: 1px solid var(--line-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar .initial { font-weight: 800; color: var(--volt); }
.avatar.big { width: 72px; height: 72px; border: 2px solid var(--volt); }
.avatar.big .initial { font-size: 28px; }
.badge { font: 700 11px var(--font); letter-spacing: .06em; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 1px 7px; color: var(--muted); }
.badge.pro { color: var(--volt); border-color: var(--volt); }
.badge.ultra { color: var(--bg); background: var(--volt); border-color: var(--volt); }

main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card p { color: var(--muted); margin: 0; }

/* ---------- landing ---------- */
/* A faint volt glow from the top, behind the hero. */
body.landing { background: radial-gradient(1100px 520px at 50% -120px, rgba(204, 255, 0, .09), transparent 70%) no-repeat, var(--bg); }
.hero { padding: 48px 0 8px; max-width: 760px; }
.eyebrow { color: var(--volt); font: 600 13px var(--font-display); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.hl { color: var(--volt); }
.lead { font-size: 17px; color: #c3cad3; max-width: 640px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 12px; }
/* The product, framed like an app window. */
.shot {
  margin: 34px 0 0; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--panel);
  box-shadow: 0 30px 80px -24px rgba(204, 255, 0, .16), 0 18px 40px -18px rgba(0, 0, 0, .7);
}
.shot-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #0e1115; }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.shot-bar span { margin-left: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-link { display: block; }
.shot-link[href] { cursor: pointer; }
.shot img { display: block; width: 100%; height: auto; transition: filter .2s; }
.shot-link[href]:hover img { filter: brightness(1.06); }
.proof { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px 28px; color: #c3cad3; }
.proof li { display: flex; align-items: center; gap: 9px; }
.proof li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--volt); flex: none; }
.faq { border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 15px 0; font-weight: 600; font-size: 16px; list-style-position: inside; }
.faq summary::marker { color: var(--volt); }
.faq summary:hover { color: var(--volt); }
.faq p { color: var(--muted); margin: 0 0 16px; max-width: 720px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.steps .num {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px;
  border-radius: 50%; background: var(--volt); color: var(--bg); font-size: 17px; font-weight: 700;
}
.steps b { color: var(--fg); font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.feature { transition: border-color .15s; }
.feature:hover { border-color: var(--line-strong); }
.ficon { width: 26px; height: 26px; margin-bottom: 10px; fill: none; stroke: var(--volt); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.plan h3 { color: var(--muted); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.plan .price { font-size: 30px; font-weight: 700; margin: 2px 0 10px; }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); }
.plan li { margin: 3px 0; }
.plan.pro { border-color: var(--volt); position: relative; }
.plan.pro::after {
  content: "Most demos"; position: absolute; top: 14px; right: 14px;
  font: 700 11px var(--font); letter-spacing: .06em; text-transform: uppercase;
  color: var(--bg); background: var(--volt); border-radius: var(--radius); padding: 2px 8px;
}
.closing { margin-top: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px; }
.closing h2 { margin: 0 0 4px; }
.closing p { margin: 0; }

/* ---------- dashboard ---------- */
.profile { display: flex; align-items: center; gap: 18px; margin: 8px 0 22px; }
.profile-text { min-width: 0; flex: 1; display: grid; gap: 4px; }
.profile-name { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 700; line-height: 1.15; min-width: 0; }
.profile-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quota { color: var(--muted); margin: 0; font-size: 14px; }
.meter { height: 6px; max-width: 360px; background: var(--well); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--volt); transition: width .3s; }
.meter-fill.full { background: var(--bad); }

.drop {
  background: var(--panel); border: 2px dashed var(--line-strong); border-radius: 6px;
  padding: 30px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--volt); background: var(--panel-2); }
.drop.over .drop-icon { transform: translateY(-3px); }
.drop.busy { cursor: default; text-align: left; border-style: solid; }
.drop-icon { width: 34px; height: 34px; margin: 0 auto 8px; display: block; fill: none; stroke: var(--volt); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.drop-title { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.link { color: var(--volt); text-decoration: underline; text-underline-offset: 3px; }
.drop-busy .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.upname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: var(--well); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.fill { height: 100%; width: 0; background: var(--volt); transition: width .2s; }
.error-text { color: var(--bad); margin: 10px 0 0; }
.help { margin-top: 10px; color: var(--muted); }
.help summary { cursor: pointer; padding: 6px 0; color: var(--fg); width: fit-content; }
.help summary:hover { color: var(--volt); }
.help summary::marker { color: var(--volt); }
.help ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; max-width: 820px; }
.help b { color: var(--fg); font-weight: 600; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.record { font: 600 15px var(--font-display); color: var(--muted); }
.record .w { color: var(--volt); }
.record .l { color: var(--bad); }
.list { display: grid; gap: 8px; }
.empty { color: var(--muted); background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; }
/* A match: radar thumbnail | result, teams and details | your numbers | actions. */
.item {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 18px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px 12px 14px;
  transition: border-color .15s, background .15s;
}
.item:hover { border-color: var(--line-strong); background: #14181e; }
/* The user's result as a stripe on the left, so a list reads at a glance. */
.item.win { box-shadow: inset 3px 0 0 var(--volt); }
.item.loss { box-shadow: inset 3px 0 0 var(--bad); }
.item.draw { box-shadow: inset 3px 0 0 var(--muted); }
.thumb { position: relative; width: 72px; height: 72px; border-radius: var(--radius); background: var(--well); overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-map {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 4px 4px; text-align: center;
  font: 700 10px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--fg);
  background: linear-gradient(rgba(7, 9, 12, 0), rgba(7, 9, 12, .94) 55%);
}
.meta { min-width: 0; display: grid; gap: 6px; }
/* First row, the match: [result] team  13 : 4  team, the winner lit. */
.match { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.match .team { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34%; }
.match .team.lose { color: var(--muted); font-weight: 600; }
.match .pts { font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.match .pts.win { color: var(--volt); }
.match .pts.lose { color: var(--muted); }
.match .dash { color: var(--muted); font-size: 18px; font-weight: 700; margin: 0 -4px; }
.result {
  flex: none; font: 700 12px var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  border-radius: var(--radius); padding: 2px 8px; background: var(--panel-3); color: var(--muted);
}
.result.win { background: var(--volt); color: var(--bg); }
.result.loss { background: var(--bad); color: var(--bg); }
.sub, .vs { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vs { display: none; color: var(--fg); }
/* Your numbers: one labelled tile each. */
.stats { display: flex; gap: 4px; }
.stat { display: grid; justify-items: center; gap: 1px; min-width: 46px; padding: 5px 6px 4px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); }
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.stat-value { font: 600 16px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat-value.good { color: var(--volt); }
.stat-value.bad { color: var(--bad); }
.actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
button.icon { width: 30px; min-width: 30px; padding: 0; color: var(--muted); }
button.icon:hover { color: var(--fg); }
button.icon.danger:hover, button.icon.armed { color: var(--bad); }
button.icon.armed { width: auto; padding: 0 10px; font-weight: 600; }
button.icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; border-radius: var(--radius); padding: 2px 8px; background: var(--panel-3); color: var(--muted); white-space: nowrap;
}
.status.working { color: var(--warn); }
.status.failed { color: var(--bad); }
.spin { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fail { color: var(--bad); font-size: 13px; }

.foot { padding: 18px 16px; text-align: center; border-top: 1px solid var(--line); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10;
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 10px 16px; font-size: 14px;
}

body.message main { max-width: 560px; padding-top: 80px; }

@media (max-width: 920px) {
  .item { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .thumb { grid-row: 1 / span 2; }
  .stats { grid-column: 2 / -1; grid-row: 2; }
  .actions { grid-column: 3; grid-row: 1; }
  .empty-stats { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-top: 24px; }
  .cta .button { flex: 1 1 100%; }
  .shot { margin-top: 26px; border-radius: 8px; }
  .shot-bar span { display: none; }
  .proof { flex-direction: column; }
  .closing .button { width: 100%; }
  .item { grid-template-columns: 60px minmax(0, 1fr); gap: 10px 12px; }
  .thumb { width: 60px; height: 60px; grid-row: 1; }
  .thumb-map { font-size: 9px; }
  .match .team { font-size: 14px; max-width: 100%; }
  .match .team.side { display: none; }
  .vs { display: block; }
  .match .pts { font-size: 24px; }
  .stats { grid-column: 1 / -1; grid-row: 2; }
  .stat { flex: 1; min-width: 0; }
  .actions { grid-column: 1 / -1; grid-row: 3; }
  .account .uname { display: none; }
  .profile-name { font-size: 22px; }
  .avatar.big { width: 60px; height: 60px; }
}
/* Fingers need bigger targets than a mouse. */
@media (pointer: coarse) {
  button, .button, button.small, .button.small { min-height: 44px; }
  .help summary { padding: 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- admin ---------- */
body.admin main { max-width: 1220px; }
.th-sub { display: block; font-weight: 600; letter-spacing: .04em; text-transform: none; opacity: .75; margin-top: 1px; }
.admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin: 8px 0 18px; }
.admin-head h1 { font-size: 30px; margin: 0; }
.admin-head p { margin: 0; }
.admin-note { margin-top: 12px; max-width: 720px; }
/* Totals at a glance. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { display: grid; gap: 3px; padding: 13px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.tile-label { font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile-value { font: 700 28px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--muted); font-size: 12px; }
.tile .tile-bar { width: 100%; margin: 4px 0 2px; }
main > h2 { margin-top: 36px; }
/* The users. */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th {
  text-align: left; font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #0e1115;
}
table.users td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: middle; }
table.users tr:last-child td { border-bottom: 0; }
table.users tbody tr:hover td { background: #14181e; }
table.users td.num, table.users th.num { text-align: right; }
table.users td.muted { color: var(--muted); }
.u-cell { display: flex; align-items: center; gap: 11px; }
.u-cell .avatar { width: 34px; height: 34px; }
.u-text { display: grid; gap: 1px; }
.u-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.u-id { color: var(--muted); font: 12px Consolas, monospace; text-decoration: none; }
a.u-id:hover { color: var(--volt); text-decoration: underline; }
.badge.you { font-size: 10px; padding: 0 5px; color: var(--volt); border-color: rgba(204, 255, 0, .5); }
/* Plan: a select styled like the site's buttons; a change waits for Apply. */
.plan-cell { display: grid; gap: 6px; }
.plan-select {
  -webkit-appearance: none; appearance: none; font: inherit; font-size: 13px; color: var(--fg);
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); height: 34px; padding: 0 32px 0 11px; min-width: 160px; cursor: pointer;
}
.plan-select:hover { border-color: #475060; }
.plan-select:focus-visible { outline: 2px solid var(--volt); outline-offset: 1px; }
.plan-select.pro { border-color: rgba(204, 255, 0, .6); color: var(--volt); }
.plan-select.ultra { border-color: var(--volt); background-color: rgba(204, 255, 0, .1); color: var(--volt); font-weight: 700; }
.plan-select:disabled { opacity: .5; }
.plan-confirm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; white-space: normal; }
.plan-note { font-size: 12px; color: var(--muted); max-width: 240px; }
.plan-note.warn { color: var(--warn); }
/* Usage: the number, and under it a bar for plans with a limit. */
.use { display: inline-grid; justify-items: end; gap: 5px; }
.use-num { font-weight: 600; }
.use-note { font-size: 11px; color: var(--muted); }
.use-bar { width: 84px; height: 4px; border-radius: 2px; background: var(--well); overflow: hidden; }
.use-fill { height: 100%; background: var(--volt); }
.use-fill.high { background: var(--bad); }
