/* 两两比 — a scoreboard. Neutral ground, one violet accent, and the only
   colour that carries meaning is the one on a head-to-head that was won. */
:root {
  --bg: #101013;
  --panel: #191920;
  --line: #26262f;
  --ink: #e9e9ee;
  --dim: #969aa6;
  --faint: #666a77;
  --accent: #b79ae0;
  --good: #7cc79a;
  --bad: #e0806f;
  --warn: #dfb15a;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
b { font-weight: 600; }
a { color: var(--accent); }

.topbar { padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  border-bottom: 1px solid var(--line); background: #14141a; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.mark { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid;
  place-items: center; font-weight: 700; color: #14141a;
  background: linear-gradient(140deg, #dcc9f2, var(--accent)); }
.titles b { display: block; font-size: 17px; letter-spacing: .06em; }
.titles i { display: block; font-size: 11px; color: var(--faint); font-style: normal; }

main { padding: 14px 12px 24px; max-width: 720px; margin: 0 auto; }
input, button { font: inherit; font-family: inherit; }

.panel { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.panel h2 { margin: 0 0 6px; font-size: 15px; }
h1.q { font-size: 20px; margin: 0 0 4px; line-height: 1.35; }
.sub { color: var(--dim); font-size: 13px; }
.tiny { color: var(--faint); font-size: 12px; line-height: 1.5; }

.field { display: block; margin: 11px 0; }
.field > span { display: block; font-size: 12px; color: var(--dim); margin-bottom: 5px; }
.field input { width: 100%; padding: 11px 12px; background: #0e0e12; color: var(--ink);
  border: 1px solid var(--line); border-radius: 11px; }
.opt { display: flex; gap: 8px; margin-bottom: 8px; }
.opt input { flex: 1 1 auto; min-width: 0; padding: 10px 11px; background: #0e0e12;
  color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.opt .drop { flex: 0 0 auto; background: none; border: none; color: var(--faint);
  font-size: 18px; cursor: pointer; padding: 0 6px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.row > button { flex: 1 1 0; min-width: 110px; }
.primary, .ghost { min-height: 46px; padding: 10px 14px; cursor: pointer; border-radius: 11px;
  border: 1px solid var(--line); background: #20202a; color: var(--ink); }
.primary { background: var(--accent); color: #14141a; font-weight: 700; border-color: transparent; }
.primary.big { width: 100%; margin-top: 8px; min-height: 52px; font-size: 17px; }
.primary:disabled { opacity: .45; cursor: default; }
.primary:active, .ghost:active { filter: brightness(1.15); }

/* Ranking by tapping: no drag, which on a phone is the difference between
   working and nearly working. */
.pick { display: grid; gap: 8px; margin-top: 10px; }
.pick button { display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 13px; background: #0e0e12; color: var(--ink); cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; width: 100%; }
.pick .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid;
  place-items: center; font-family: var(--mono); font-size: 13px;
  background: #24242e; color: var(--faint); }
.pick .ranked .n { background: var(--accent); color: #14141a; font-weight: 700; }
.pick .ranked { border-color: var(--accent); }
.pick .lab { flex: 1 1 auto; }

.copy { display: flex; gap: 8px; margin-top: 8px; }
.copy input { flex: 1 1 auto; min-width: 0; padding: 10px; background: #0e0e12; color: var(--dim);
  border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-family: var(--mono); }

.verdict { padding: 15px; border-radius: 12px; margin-bottom: 14px;
  background: var(--panel); border: 1px solid var(--line); }
.verdict > b { display: block; font-size: 18px; margin-bottom: 5px; }
.verdict.good { border-color: #2d4a37; background: #16211a; }
.verdict.warn { border-color: #4a3d24; background: #211d16; }
.verdict.bad  { border-color: #4a302c; background: #211816; }

.rank { display: grid; gap: 7px; margin-top: 8px; }
.rank .r { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #0e0e12; border: 1px solid var(--line); border-radius: 10px; }
.rank .r .n { font-family: var(--mono); color: var(--faint); width: 22px; }
.rank .r.win { border-color: var(--accent); }
.rank .r .fc { margin-left: auto; font-size: 12px; color: var(--faint);
  font-variant-numeric: tabular-nums; }

.h2h { border-top: 1px solid var(--line); padding: 11px 0; }
.h2h:first-of-type { border-top: none; }
.h2h .names { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.h2h .names .w { color: var(--good); font-weight: 600; }
.h2h .bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden;
  background: #0e0e12; margin-top: 6px; }
.h2h .bar i { display: block; height: 100%; }
.h2h .bar .l { background: var(--accent); }
.h2h .bar .r { background: #3a3a48; }
.h2h .n { font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--faint); margin-top: 4px; }

.foot { text-align: center; padding: 6px 12px max(18px, env(safe-area-inset-bottom));
  color: var(--faint); font-size: 11px; }
