:root {
  --bg: #07140f; --bg2: #0d2219; --card: #123126; --line: #1e4a3a;
  --text: #e8f6ef; --muted: #8fb5a4; --green: #2ee59d; --green-dim: #1a7a58;
  --gold: #e8c547; --red: #ff6b6b;
  --safe: env(safe-area-inset-bottom, 12px);
  --safet: env(safe-area-inset-top, 12px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; overflow: hidden; }
#app { height: 100%; display: flex; flex-direction: column; padding-top: var(--safet); }
header.appbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 52px; }
header.appbar h1 { font-size: 17px; margin: 0; flex: 1; font-weight: 700; }
.btn { border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; background: var(--card); color: var(--text); }
.btn.primary { background: var(--green); color: #042016; }
.btn.danger { background: #5a1f1f; color: #ffd5d5; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.gold { background: var(--gold); color: #2a2100; }
.screen { flex: 1; overflow-y: auto; padding: 12px 14px calc(20px + var(--safe)); -webkit-overflow-scrolling: touch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
input, select, textarea {
  width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font-size: 16px; margin-top: 6px;
}
label { font-size: 12px; color: var(--muted); font-weight: 600; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg2); border-radius: 12px; margin-bottom: 8px; }
.num { width: 36px; height: 36px; border-radius: 10px; background: var(--green-dim); display: grid; place-items: center; font-weight: 800; }
.live-top { background: linear-gradient(180deg, #0f2e22, #0b1c15); padding: 8px 12px 10px; border-bottom: 1px solid var(--line); }
.scoreline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-box { text-align: center; flex: 1; }
.score-box .name { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.score-box .n { font-size: 36px; font-weight: 800; line-height: 1; }
.clock { text-align: center; min-width: 92px; }
.clock .time { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; }
.clock .per { font-size: 11px; color: var(--gold); }
.live-actions { display: flex; gap: 6px; margin-top: 8px; }
.live-actions .btn { flex: 1; padding: 8px; font-size: 12px; }
.pitch { display: flex; gap: 8px; padding: 8px 10px; overflow-x: auto; }
.chip { flex: 0 0 auto; min-width: 64px; padding: 8px 8px 6px; border-radius: 12px; background: var(--card); border: 2px solid transparent; text-align: center; font-size: 11px; font-weight: 700; color: var(--text); }
.chip.on { border-color: var(--green); background: #134433; }
.chip.sel { border-color: var(--gold); box-shadow: 0 0 0 2px #e8c54744; }
.chip .jn { font-size: 16px; display: block; }
.chip.gk { background: #3a3210; }
.section-label { font-size: 11px; color: var(--muted); padding: 4px 12px 2px; font-weight: 700; text-transform: uppercase; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 10px 4px; }
.stat { min-height: 56px; border: 0; border-radius: 14px; font-weight: 800; font-size: 13px; color: #042016; background: var(--green); }
.stat.def { background: #6ec3ff; color: #042033; }
.stat.gk { background: var(--gold); color: #2a2100; }
.stat:disabled { opacity: .35; }
.log { max-height: 120px; overflow-y: auto; padding: 0 12px 8px; font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe)); transform: translateX(-50%); background: #e8f6ef; color: #042016; padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; z-index: 50; display: none; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-size: 11px; padding: 6px 4px; }
td { padding: 8px 4px; border-top: 1px solid var(--line); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #1a7a58; }
.badge.away { background: #3a3210; color: var(--gold); }
.badge.live { background: #7a1a1a; }
.install-banner { background: #134433; border: 1px solid var(--green-dim); border-radius: 14px; padding: 12px; margin-bottom: 12px; font-size: 13px; }
