:root {
  --bg: #000;
  --card: #161616;
  --line: #2e2e2e;
  --text: #fff;
  --muted: #8e8e93;
  --good: #3dd68c;
  --accent: #f97316;
  --gold: #f4c430;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
main { max-width: 560px; margin: 0 auto; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 48px 0; }
.num { font-variant-numeric: tabular-nums; font-weight: 800; }

/* Üst çubuk */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brand { font-size: 22px; font-weight: 900; background: linear-gradient(90deg, var(--accent), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; padding: 5px 10px; border-radius: 999px; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--accent); background: rgba(249, 115, 22, .12); }
.pill.live .dot { animation: blink 1.6s infinite; }
.pill.ended { color: var(--muted); background: #1e1e1e; }
.pill.wait { color: var(--muted); background: #1e1e1e; }
@keyframes blink { 50% { opacity: .25; } }
.spacer { flex: 1; }
.code { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); background: #1e1e1e; padding: 6px 10px; border-radius: 10px; }
.round-label { font-size: 16px; font-weight: 700; }

/* Tabela */
.board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 0 14px; }
.team { text-align: center; min-width: 0; }
.team .name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .score { font-size: clamp(32px, 11vw, 48px); line-height: 1.1; }
.crown { color: var(--gold); font-size: 11px; margin-right: 3px; }
.mid { text-align: center; min-width: 76px; }
.mid .label { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); }
.mid .tur { font-size: 28px; }
.diff { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.diff.on { color: var(--good); background: rgba(61, 214, 140, .12); }
.diff.off { color: var(--muted); background: #1e1e1e; }

/* Bireysel sıralama */
.standings { display: grid; gap: 4px; padding: 6px 0 14px; }
.standing { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid transparent; }
.standing .rank { width: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.standing .who { flex: 1; font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standing .pts { font-size: 20px; }
.standing .gap { width: 44px; text-align: right; color: var(--muted); font-size: 13px; font-weight: 700; }
.dotc { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Sonuç */
.result { text-align: center; padding: 14px; margin-bottom: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.result .title { font-size: 11px; letter-spacing: 3px; color: var(--muted); font-weight: 700; }
.result .who { font-size: 22px; font-weight: 800; margin-top: 4px; }

/* Geçmiş tablosu */
.section { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); margin: 6px 0 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #0d0d0d; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: center; padding: 9px 4px; white-space: nowrap; }
th { font-size: 12px; font-weight: 700; background: var(--card); position: sticky; top: 0; }
th.tur, td.tur { color: var(--muted); width: 34px; font-weight: 500; }
tbody tr + tr td { border-top: 1px solid #1e1e1e; }
tr.last td { background: rgba(249, 115, 22, .06); }
tr.penalty td { font-size: 12px; color: var(--accent); padding-top: 4px; padding-bottom: 6px; border-top: none !important; }
tfoot td { border-top: 1px solid var(--line); font-weight: 800; }
.neg { color: #ef4444; }
.empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* Kod giriş formu */
.join { max-width: 320px; margin: 48px auto 0; text-align: center; }
.join h1 { font-size: 22px; margin: 16px 0 6px; }
.join input { width: 100%; font: 800 40px ui-monospace, Menlo, monospace; letter-spacing: 6px; text-align: center; color: #fff; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px 0; margin: 18px 0 12px; }
.join input:focus { outline: none; border-color: var(--accent); }
.join button, .btn { width: 100%; font-size: 17px; font-weight: 700; color: #000; background: var(--accent); border: 0; border-radius: 14px; padding: 15px; }
.btn.secondary { display: block; margin-top: 12px; color: var(--text); background: #1e1e1e; text-decoration: none; }
.error { color: var(--accent); font-size: 14px; min-height: 20px; }

.footer { text-align: center; color: #555; font-size: 12px; margin-top: 28px; }
.footer a { color: #888; }
