:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #16181d;
  --muted: #5d6470;
  --line: #dfe2e7;
  --blue: #1f6fe0;
  --blue-soft: #e5efff;
  --orange: #e8730c;
  --orange-soft: #fff0e2;
  --accent: #1f6fe0;
  --ok: #18804a;
  --bad: #c22c2c;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #181b21;
    --surface-2: #20242c;
    --text: #e8eaee;
    --muted: #9aa1ad;
    --line: #2b3039;
    --blue: #5b9bff;
    --blue-soft: #16233a;
    --orange: #ff9a3d;
    --orange-soft: #33220f;
    --accent: #5b9bff;
    --ok: #4fcf88;
    --bad: #ff6b6b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.top { padding: 32px 0 8px; }
.top h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.tag { margin: 4px 0 0; color: var(--muted); }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 20px 0; padding: 48px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .15s, background .15s, padding .2s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--blue-soft); }
.drop.compact { padding: 16px; }
.drop.compact .drop-sub { display: none; }
.drop-title { font-weight: 600; font-size: 17px; }
.drop-sub { color: var(--muted); font-size: 13px; }
.error { color: var(--bad); font-weight: 500; }

.card, .team-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px;
}
h2 { font-size: 15px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* scoreboard */
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 16px;
}
.side { display: flex; align-items: center; gap: 14px; }
.side.orange { justify-content: flex-end; }
.score { font-size: 48px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.side.blue .score, .side.blue .team-label { color: var(--blue); }
.side.orange .score, .side.orange .team-label { color: var(--orange); }
.team-label { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.mid { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.result { font-weight: 700; font-size: 17px; }
.meta { color: var(--muted); font-size: 13px; }

/* teams */
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.team-card { overflow-x: auto; }
.team-card.blue { border-top: 4px solid var(--blue); }
.team-card.orange { border-top: 4px solid var(--orange); }
.team-card.blue h2 { color: var(--blue); }
.team-card.orange h2 { color: var(--orange); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.n { text-align: right; }
.pname { display: block; font-weight: 600; word-break: break-word; }
.plat { display: block; font-size: 12px; color: var(--muted); }
.mvp { color: #d4a514; }
.empty { color: var(--muted); }

/* goals */
.goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.goals li { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; }
.goals li.blue { background: var(--blue-soft); border-left: 4px solid var(--blue); }
.goals li.orange { background: var(--orange-soft); border-left: 4px solid var(--orange); }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.who { font-weight: 600; }
.run { font-variant-numeric: tabular-nums; font-weight: 700; }

/* options */
.options fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 6px; }
.options legend { font-weight: 700; padding-right: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.check small { display: block; color: var(--muted); font-size: 13px; }
.indent { margin-left: 26px; }
.row { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 0; }
.row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=number], select {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; min-width: 220px; max-width: 100%;
}
input:disabled + span, input:disabled { opacity: .5; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--orange-soft); color: var(--orange); padding: 2px 6px; border-radius: 4px; vertical-align: 1px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
button {
  font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 9px;
  padding: 10px 18px; cursor: pointer;
}
button:hover { filter: brightness(1.08); }
.status { font-size: 14px; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }

.mapping { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.mapping-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mapping h3 { margin: 0; font-size: 15px; }
.mapping .hint { margin: 4px 0 8px; }
.mapping td.anon { font-weight: 600; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 6px 12px; }
.team-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.team-dot.blue { background: var(--blue); }
.team-dot.orange { background: var(--orange); }

.tech summary { cursor: pointer; font-weight: 600; }
.tech dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0 0; font-size: 13px; }
.tech dt { color: var(--muted); }
.tech dd { margin: 0; word-break: break-all; }

.foot { color: var(--muted); font-size: 13px; padding-bottom: 32px; }
.foot a { color: inherit; }

@media (max-width: 720px) {
  .teams { grid-template-columns: 1fr; }
  .score { font-size: 36px; }
  .scoreboard { padding: 14px; }
  input[type=text], input[type=number], select { min-width: 0; width: 100%; }
  .row label { flex: 1 1 100%; }
}
