:root {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #10b981;
  --accent2: #3b82f6;
  --err: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; }
.who { font-size: .85rem; color: var(--muted); }
.who a { color: var(--accent2); }
.container { max-width: 680px; margin: 0 auto; padding: 16px; }
.muted { color: var(--muted); }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.05rem; margin: 22px 0 10px; color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.login-card { max-width: 420px; margin: 40px auto; }
.login-form { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.login-form label { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.login-form select, .login-form input, button {
  padding: 11px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 1rem;
}
button {
  margin-top: 16px; background: var(--accent); color: #06281c;
  font-weight: 700; border: none; cursor: pointer;
}
.error-banner { background: rgba(239,68,68,.15); color: #fca5a5; padding: 10px; border-radius: 8px; }
.identity-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.identity {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); text-decoration: none;
}
.identity:hover, .identity.active { border-color: var(--accent); }
.identity-name { font-weight: 600; }
.identity-go { font-size: .8rem; color: var(--accent); }
.or-sep { margin-top: 16px; }
.hint { font-size: .8rem; margin-top: 14px; }
.hint a { color: var(--accent2); }

.intro { margin-bottom: 8px; }
.matches { display: flex; flex-direction: column; gap: 10px; }

/* Two-line match block (one row per team), mirroring the admin score editor. */
.match-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin: 0;
}
.match-card.locked { opacity: .6; }
.match-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .72rem; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,.05); padding-bottom: 6px;
}
.match-board { display: flex; flex-direction: column; gap: 9px; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-info { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.team-flag { font-size: 1.7rem; line-height: 1; flex-shrink: 0; }
.team-name { font-size: .95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-input {
  width: 46px; height: 40px; text-align: center; font-size: 1.25rem; font-weight: 800;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  outline: none; flex-shrink: 0; -moz-appearance: textfield; appearance: none;
}
.score-input::-webkit-outer-spin-button, .score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(16,185,129,.2); }

.match-foot { display: flex; justify-content: space-between; align-items: center; min-height: 16px; }
.deadline { font-size: .72rem; color: var(--muted); }
.save-status { font-size: .78rem; }
.save-status .ok, .save-status.ok { color: var(--accent); }
.save-status .err, .save-status.err { color: var(--err); }
.badge { font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.badge.closed { color: #fca5a5; border-color: rgba(239,68,68,.4); }
