/* FOKBAD Live Scoreboard — mobile-first.
   Identitas visual mengikuti fokbad.alqworks.id: retro-sport hangat (krem + "ink" hijau-teal tua),
   aksen lime shuttlecock & oranye gagang raket, border tegas 2px dan bayangan offset tajam.
   Font: Barlow Condensed (display), DM Sans (teks), Space Mono (label). */
:root {
  --paper: #fcfaf2;        /* latar halaman */
  --paper-2: #f3efe1;      /* latar sekunder / baris */
  --surface: #fffdf6;      /* kartu terang */
  --cream: #fdf0c3;        /* header, modal */
  --ink: #0c2827;          /* teks utama & warna gelap brand */
  --ink-2: #174442;
  --lime: #e6e95f;         /* aksen utama */
  --orange: #e6a468;       /* aksen kedua (gagang raket) */
  --orange-d: #a85a1c;     /* oranye gelap untuk teks di latar terang */
  --sage: #dbe2ce;
  --sand: #f1d9b5;
  --mist: #d9e2de;
  --muted: #56645f;
  --line: rgba(12, 40, 39, 0.16);
  --live: #c62f2a;
  --ok: #2b7448;
  --win: #1d6638;
  --lose: #b3261e;
  --star: #c0661f;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 3px 3px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);

  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.4;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
select option { color: var(--ink); background: #fff; }
[hidden] { display: none !important; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 3px solid #c97c38; outline-offset: 2px; }
.muted { color: var(--c-muted, var(--muted)); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--cream);
  border-bottom: 2px solid var(--ink);
}
.top-strip {
  background: var(--ink);
  color: #fef4d4;
  padding-top: env(safe-area-inset-top);
  overflow: hidden;
}
.top-strip-inner {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  white-space: nowrap;
  font: 700 9.5px var(--mono);
  letter-spacing: 1.4px;
}
.top-strip .dot { color: var(--lime); font-size: 7px; }
.top-strip .sparkle { color: var(--lime); font-size: 15px; line-height: 0; }

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand > div { min-width: 0; }
.brand-logo { width: 46px; height: 46px; flex: none; display: block; object-fit: contain; }
.brand-name { font: 900 1.75rem/0.95 var(--display); letter-spacing: 0.02em; }
.brand-sub {
  font: 700 0.62rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 6px; flex: none; }

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font: 700 0.64rem var(--mono);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.conn-live { background: var(--ink); color: var(--lime); }
.conn-live .conn-dot { animation: pulse-lime 1.6s infinite; }
.conn-connecting { background: var(--orange); color: var(--ink); }
.conn-offline { background: var(--live); color: #fff; }

.role-chip,
.wake-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  min-height: 30px;
  transition: background 0.15s, transform 0.15s;
}
.role-chip:hover, .wake-btn:hover { background: rgba(12, 40, 39, 0.07); }
.role-chip.is-admin { background: var(--ink); color: var(--lime); }
.wake-btn { filter: grayscale(1); }
.wake-btn.on { background: var(--lime); filter: none; }
.wake-btn.pending { border-style: dashed; }

.cat-tabs {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 10px;
}
.cat-tab {
  border: 2px solid var(--ink);
  background: transparent;
  border-radius: 999px;
  padding: 7px 8px;
  min-height: 40px;
  font: 800 1.05rem/1 var(--display);
  letter-spacing: 0.08em;
  color: var(--ink);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.cat-tab:hover { background: rgba(12, 40, 39, 0.07); }
.cat-tab.active { background: var(--ink); color: var(--lime); box-shadow: 3px 3px 0 var(--orange); }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 18px 16px 32px; overflow-x: clip; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.section-head h2 {
  margin: 0;
  font: 900 1.75rem/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head > .muted { font: 700 0.68rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase; }
h3 { margin: 0 0 8px; font-size: 0.95rem; }

.live-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--live); flex: none; animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 47, 42, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(198, 47, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 47, 42, 0); }
}
@keyframes pulse-lime {
  0% { box-shadow: 0 0 0 0 rgba(230, 233, 95, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(230, 233, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 233, 95, 0); }
}

.live-section { margin-bottom: 22px; }
.live-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .live-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .live-grid { grid-template-columns: repeat(3, 1fr); } }

.empty {
  border: 2px dashed rgba(12, 40, 39, 0.3);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Champion ---------- */
.champion {
  margin-bottom: 22px;
  border-radius: var(--radius);
  padding: 16px;
  background: var(--lime);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-lg);
}
.champion-title { font: 700 0.72rem var(--mono); letter-spacing: 0.12em; margin-bottom: 12px; }
.podium { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .podium { grid-template-columns: 1fr 1fr; } }
.podium-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-width: 0;
}
.podium-item > div { min-width: 0; }
.podium-medal { font-size: 1.9rem; line-height: 1; }
.podium-rank { font: 700 0.66rem var(--mono); letter-spacing: 0.1em; color: var(--muted); }
.podium-name { font: 900 1.6rem/1.05 var(--display); overflow-wrap: anywhere; }
.podium-item.gold { background: var(--ink); color: var(--cream); }
.podium-item.gold .podium-rank { color: var(--lime); }
.podium-item.silver .podium-rank { color: var(--muted); }

/* ---------- Admin tools ---------- */
.admin-tools {
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--sage);
  padding: 6px 8px 6px 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-tools-title { font: 700 0.64rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-tools-actions { display: flex; flex: none; gap: 6px; }
.admin-tools .btn-sm { min-height: 30px; padding: 3px 11px; font-size: 0.74rem; }

/* ---------- Buttons ---------- */
.btn {
  border: 2px solid var(--c-fg, var(--ink));
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 0.85rem;
  min-height: 42px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 0 rgba(12, 40, 39, 0.18); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.97); box-shadow: none; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: var(--ink-2); }
.btn-live { background: var(--live); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ghost { background: transparent; color: var(--c-fg, var(--ink)); }
.btn-danger-ghost { background: transparent; border-color: var(--lose); color: var(--lose); }
.btn-sm { padding: 5px 12px; min-height: 36px; font-size: 0.78rem; }

/* ---------- View tabs ---------- */
.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.view-tab {
  border: 0;
  background: transparent;
  padding: 8px 4px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.84rem;
  color: var(--ink);
  min-width: 0;
  transition: background 0.15s;
}
.view-tab:hover { background: rgba(12, 40, 39, 0.07); }
.view-tab.active { background: var(--ink); color: var(--cream); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 2px solid var(--ink);
  background: transparent;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink);
}
.chip.active { background: var(--ink); color: var(--lime); }

.stage-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 26px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}
.stage-title > span:first-child { font: 900 1.4rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.stage-title > .muted { font: 700 0.66rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.stage-title:first-child { margin-top: 0; }
.match-list { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .match-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .match-list { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Kartu: variabel warna lokal (terang default, gelap untuk papan skor live) ---------- */
.match, .card, .bmatch, .fav-card {
  --c-fg: var(--ink);
  --c-muted: var(--muted);
  --c-line: var(--line);
  --c-win: var(--win);
  --c-warn: var(--orange-d);
  --c-tag-bg: var(--ink);
  --c-tag-fg: var(--cream);
  --c-input-bg: #fff;
  --c-dot: var(--orange);
}

/* ---------- Match card ---------- */
.match {
  background: var(--surface);
  color: var(--c-fg);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.match.is-live { box-shadow: 4px 4px 0 var(--live); }
.match.is-finished { background: var(--paper-2); }

/* Papan skor Live Courts — gaya "stat-band" gelap dengan angka lime */
.match.big {
  --c-fg: var(--cream);
  --c-muted: #b4c6bd;
  --c-line: rgba(253, 240, 195, 0.24);
  --c-win: var(--lime);
  --c-warn: var(--orange);
  --c-tag-bg: var(--lime);
  --c-tag-fg: var(--ink);
  --c-input-bg: rgba(253, 240, 195, 0.08);
  --c-dot: var(--lime);
  background: var(--ink);
  padding: 12px 14px 14px;
  box-shadow: 5px 5px 0 var(--live);
}

.match-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.72rem; }
.match-head > .muted { font: 700 0.68rem var(--mono); }
.tag {
  font: 700 0.64rem var(--mono);
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--c-tag-bg, var(--ink));
  color: var(--c-tag-fg, var(--cream));
  white-space: nowrap;
}
.tag-final { background: var(--orange); color: var(--ink); }
.court { color: var(--c-fg, var(--ink)); font-weight: 800; font-size: 0.74rem; }
.court::before { content: "📍 "; }
.match-head .spacer { flex: 1; }
.pill {
  font: 700 0.62rem var(--mono);
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-live { background: var(--live); color: #fff; }
.pill-upcoming { background: transparent; color: var(--c-muted, var(--muted)); box-shadow: inset 0 0 0 1.5px currentColor; }
.pill-finished { background: var(--sage); color: var(--ink); }

.side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}
.side-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-name.tbd { color: var(--c-muted, var(--muted)); font-style: italic; font-weight: 500; }
.side.winner .side-name { color: var(--c-win, var(--win)); font-weight: 800; }
.side.winner .side-name::after { content: " ✓"; }
.side.loser .side-name, .side.loser .score { opacity: 0.55; }
.score {
  font: 800 2rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  min-width: 2.2ch;
  text-align: right;
}
.match.big .score { font-size: 3.2rem; color: var(--lime); }
.match.big .side.loser .score { color: var(--c-fg); }
.match.big .side-name { font-size: 1.12rem; }
.serve-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c-dot, var(--orange)); flex: none; visibility: hidden; }
.side.leading .serve-dot { visibility: visible; }

.score-btn {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--c-fg, var(--ink));
  background: transparent;
  color: var(--c-fg, var(--ink));
  font: 700 1.55rem/1 var(--font);
  padding: 0 0 2px;
  touch-action: manipulation;
  transition: transform 0.08s;
}
.score-btn.plus { background: var(--lime); color: var(--ink); border-color: var(--ink); }
.match.big .score-btn.plus { border-color: var(--lime); }
.score-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.score-btn:active:not(:disabled) { transform: scale(0.92); }

.match-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font: 400 0.64rem var(--mono); color: var(--c-muted, var(--muted)); }
.flag { font: 700 0.62rem var(--mono); letter-spacing: 0.06em; padding: 3px 8px; border-radius: 6px; }
.flag-deuce { background: var(--orange); color: var(--ink); }
.flag-point { background: var(--live); color: #fff; }
.flag-done { background: var(--lime); color: var(--ink); }

.match-admin {
  border-top: 1.5px dashed var(--c-line, var(--line));
  margin-top: 4px;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.court-input {
  flex: 1 1 120px;
  min-width: 0;
  background: var(--c-input-bg, #fff);
  color: var(--c-fg, var(--ink));
  border: 2px solid var(--c-fg, var(--ink));
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 36px;
}
.court-input.needs-court { border-color: var(--c-warn, var(--orange-d)); color: var(--c-warn, var(--orange-d)); border-style: dashed; }
.court-input:disabled { opacity: 0.5; }
.admin-hint { flex-basis: 100%; font: 700 0.66rem var(--mono); color: var(--c-warn, var(--orange-d)); }
.side-name small { font-size: 0.7rem; font-weight: 600; }
.court-input:focus, .team-input:focus, .gate-login input:focus { outline: 3px solid #c97c38; outline-offset: 1px; }

/* ---------- Standings ---------- */
.standings-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .standings-grid { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.card-head h3 { font: 900 1.45rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 4px; }
.card-head .muted { font-family: var(--mono); font-weight: 700; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.table th {
  text-align: right;
  font: 700 0.64rem var(--mono);
  color: var(--muted);
  letter-spacing: 0.05em;
  padding: 6px 4px;
  border-bottom: 2px solid var(--ink);
}
.table td { text-align: right; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: 0; }
.table th:nth-child(2), .table td:nth-child(2) { text-align: left; }
.table th:first-child, .table td:first-child { text-align: center; width: 28px; }
.table td.team-cell { font-weight: 700; max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tr.qualify td.team-cell { font-weight: 800; }
.table tr.qualify .rank-badge { background: var(--lime); color: var(--ink); border-color: var(--ink); }
.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  background: var(--paper-2);
  font: 700 0.74rem var(--mono);
}
.legend { font-size: 0.78rem; color: var(--muted); margin-top: 12px; }
/* Klasemen: Poin (menang = 3) paling menonjol, Selisih Skor berwarna sebagai tie-breaker. */
.rules-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--cream);
  font-size: 0.8rem;
}
.rules-strip b { font-weight: 800; }
.standings-table th.pts-cell, .standings-table td.pts-cell { width: 44px; text-align: center; }
.standings-table td.pts-cell { font: 800 1.15rem/1 var(--display); background: rgba(12, 40, 39, 0.06); }
.standings-table th.pts-cell { color: var(--ink); }
.standings-table tr.qualify td.pts-cell { background: var(--lime); }
.standings-table td.diff-cell { font-weight: 700; }
.standings-table td.diff-cell.pos { color: var(--win); }
.standings-table td.diff-cell.neg { color: var(--lose); }
.legend .rank-badge { width: 14px; height: 14px; border-radius: 4px; background: var(--lime); border-color: var(--ink); vertical-align: middle; }

/* ---------- Bracket ---------- */
.bracket-scroll { overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; }
.bracket { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)) minmax(170px, 0.85fr); gap: 20px; min-width: 600px; }
.bracket-col { display: flex; flex-direction: column; }
.bracket-col-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.bracket-col-title {
  font: 900 1.15rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}
.bmatch {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bmatch.is-live { box-shadow: 4px 4px 0 var(--live); }
.bmatch.final { box-shadow: 5px 5px 0 var(--orange); }
.bmatch-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: 700 0.62rem var(--mono);
  padding: 5px 9px;
  background: var(--ink);
  color: var(--cream);
  letter-spacing: 0.05em;
}
.bmatch.is-live .bmatch-head { background: var(--live); color: #fff; }
.bmatch.final:not(.is-live) .bmatch-head { background: var(--orange); color: var(--ink); }
.bmatch-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 9px; font-size: 0.88rem; }
.bmatch-row + .bmatch-row { border-top: 1px solid var(--line); }
.bmatch-row .slot { display: flex; flex-direction: column; min-width: 0; }
.bmatch-row .src { font: 700 0.58rem var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.bmatch.is-live .bmatch-row .s { font-size: 1.35rem; }
.blive { color: inherit; }
.bmatch-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.bmatch-row .n.tbd { color: var(--muted); font-style: italic; font-weight: 500; }
.bmatch-row .s { font: 800 1.2rem/1 var(--display); font-variant-numeric: tabular-nums; }
.bmatch-row.winner { background: var(--lime); }
.bmatch-row.winner .n { font-weight: 800; }
.bmatch-row.winner .src { color: var(--ink-2); }
.bmatch-row.loser { opacity: 0.55; }

/* ---------- Teams ---------- */
.teams-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .teams-grid { grid-template-columns: 1fr 1fr; } }
.team-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-seed {
  width: 30px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: var(--lime);
  font: 700 0.72rem var(--mono);
}
.team-label { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-input {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 2px solid rgba(12, 40, 39, 0.4);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-weight: 700;
  min-height: 40px;
}
.team-input:hover { border-color: var(--ink); }
.team-record { font: 700 0.68rem var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Follow ---------- */
.star {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--c-muted, var(--muted));
  font-size: 1.1rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  margin: -4px 0;
  padding: 0;
  border-radius: 8px;
  touch-action: manipulation;
}
.star:hover, .star.on { color: var(--star); }
.match.big .star:hover, .match.big .star.on { color: var(--orange); }
.table td.team-cell .star { margin: -6px 4px -6px -4px; vertical-align: middle; }
.side .star { margin-left: -4px; }

.favorites { margin-bottom: 22px; }
.fav-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .fav-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .fav-grid { grid-template-columns: repeat(3, 1fr); } }
.fav-card {
  background: var(--sand);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.fav-card.is-live { box-shadow: 4px 4px 0 var(--live); }
.fav-head { display: flex; align-items: center; gap: 6px; }
.fav-name { flex: 1; min-width: 0; font: 800 1.45rem/1.05 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-badge { display: inline-block; font: 700 0.64rem var(--mono); letter-spacing: 0.04em; padding: 3px 8px; border-radius: 6px; }
.fav-badge.gold { background: var(--ink); color: var(--lime); }
.fav-badge.silver { background: var(--mist); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.fav-badge.in { background: var(--lime); color: var(--ink); }
.fav-badge.out { background: rgba(12, 40, 39, 0.1); color: var(--muted); }
.fav-live {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.fav-live-score { font: 800 2rem/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fav-live-score b { color: var(--lime); font-weight: 800; }
.fav-live-meta { font-size: 0.76rem; color: #c9d6cf; min-width: 0; }
.fav-row { display: flex; gap: 8px; font-size: 0.84rem; }
.fav-k { flex: none; width: 82px; color: var(--ink-2); font: 700 0.62rem var(--mono); letter-spacing: 0.04em; text-transform: uppercase; padding-top: 3px; }
.fav-v { min-width: 0; }
.fav-v .win { color: var(--win); font-weight: 800; }
.fav-v .lose { color: var(--lose); font-weight: 800; }

/* ---------- Install banner ---------- */
.install-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 18px;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.install-icon { font-size: 1.3rem; }
.install-text { flex: 1; min-width: 0; }
.install-close { border: 0; background: transparent; color: var(--ink); font-size: 1.5rem; line-height: 1; padding: 0 4px; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: #fef6d8;
  padding: 14px max(16px, calc((100% - 1200px) / 2 + 16px)) calc(18px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font: 700 0.64rem/1.6 var(--mono);
  letter-spacing: 0.04em;
}

/* ---------- Role gate ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 27, 26, 0.82);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
}
.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 22px 20px 24px;
  box-shadow: 8px 8px 0 var(--lime);
  text-align: center;
}
.gate-logo { width: 104px; height: 104px; display: block; margin: 0 auto; object-fit: contain; }
.gate-kicker { margin: 2px 0 0; font: 700 0.64rem var(--mono); letter-spacing: 0.14em; color: var(--muted); }
.gate-card h1 { font: 900 2.1rem/0.95 var(--display); text-transform: uppercase; letter-spacing: 0; margin: 6px 0 8px; }
.gate-card > p:not(.gate-kicker) { margin: 0 0 18px; font-size: 0.9rem; }
.gate-choices { display: grid; gap: 12px; }
.gate-option {
  text-align: left;
  border: 2px solid var(--ink);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  gap: 3px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.gate-option:hover, .gate-option:focus-visible { background: var(--lime); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); outline: none; }
.gate-option-title { font: 900 1.3rem/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.gate-option-desc { font-size: 0.82rem; color: var(--muted); }
.gate-option:hover .gate-option-desc, .gate-option:focus-visible .gate-option-desc { color: var(--ink-2); }
.gate-option[data-gate="viewer"] .gate-option-title::before { content: "👀  "; }
.gate-option[data-gate="admin"] .gate-option-title::before { content: "🏸  "; }
.gate-login { text-align: left; display: grid; gap: 8px; }
.gate-login label { font: 700 0.7rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.gate-login input {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 1rem;
}
.gate-error { color: var(--lose); font-size: 0.84rem; font-weight: 700; min-height: 1.2em; margin: 0; }
.gate-login-actions { display: flex; justify-content: space-between; gap: 8px; }
.gate-login-actions .btn { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 200;
  max-width: calc(100% - 32px);
  background: var(--ink);
  color: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--lime);
}
.toast.error { background: var(--live); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.toast.success { box-shadow: 4px 4px 0 var(--lime); }

/* ---------- Motion: eskalasi fase gugur (HANYA saat LIVE) ----------
   Kelas .fx / .fx-qf / .fx-sf / .fx-final / .fx-climax ditambahkan app.js hanya untuk laga
   berstatus LIVE di PF/SF/Final. Semua animasi hanya memakai transform & opacity, dan
   durasinya pembagi 12 detik agar sinkron dengan --fx-phase (tidak "loncat" saat re-render). */
:root {
  --heat: #ff7a2f;
  --heat-text: #b4410f;
  --ember: #ffcf70;
  --gold-fx: #f5c542;
}
.match, .bmatch { position: relative; }
.fx { isolation: isolate; }
.fx > :not(.fx-layer) { position: relative; z-index: 1; }

/* Aura di luar kartu: box-shadow statis, yang dianimasikan hanya opacity-nya. */
.fx::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.35;
  will-change: opacity;
  animation: fx-breathe 3s ease-in-out infinite;
  animation-delay: var(--fx-phase, 0s);
}
/* Slot bagan biasanya overflow:hidden; saat ber-efek, aura harus tampil di luar slot
   sementara kliping isi dipindah ke .fx-layer dan sudut header/baris. */
.bmatch.fx { overflow: visible; }
.bmatch.fx .bmatch-head { border-radius: 8px 8px 0 0; }
.bmatch.fx .bmatch-row:last-child { border-radius: 0 0 8px 8px; }
.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}


/* Semifinal LIVE: makin garang — border panas tegas, aura lebih cepat */
.match.fx-sf, .bmatch.fx-sf { border-color: var(--heat); }
.match.big.fx-sf, .match.fx-sf { box-shadow: 5px 5px 0 var(--heat); }
.bmatch.fx-sf { box-shadow: 4px 4px 0 var(--heat); }
.fx-sf::after { box-shadow: 0 0 18px 3px rgba(255, 122, 47, 0.55); animation-duration: 2s; }

/* Final LIVE: puncak — membara (gradien hangat + bara naik) */
.match.fx-final, .bmatch.fx-final { border-color: var(--heat); box-shadow: 5px 5px 0 var(--heat); }
.fx-final::after {
  box-shadow: 0 0 22px 4px rgba(255, 122, 47, 0.6), 0 0 6px 1px rgba(255, 179, 71, 0.7);
  animation-duration: 2s;
}
.fx-final .fx-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 65% at 50% 115%, rgba(255, 122, 47, 0.42), transparent 70%);
  opacity: 0.6;
  animation: fx-breathe 2s ease-in-out infinite;
  animation-delay: var(--fx-phase, 0s);
}
.fx-layer i {
  position: absolute;
  bottom: -6px;
  left: var(--x, 50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 6px 2px rgba(255, 122, 47, 0.8);
  opacity: 0;
  will-change: transform, opacity;
  animation: fx-ember 3s linear infinite;
  animation-delay: calc(var(--fx-phase, 0s) + var(--d, 0s));
}
.fx-layer i:nth-child(1)  { --x: 8%;  --d: -0.2s; --drift: 6px; }
.fx-layer i:nth-child(2)  { --x: 22%; --d: -1.4s; --drift: -8px; }
.fx-layer i:nth-child(3)  { --x: 37%; --d: -2.3s; --drift: 10px; }
.fx-layer i:nth-child(4)  { --x: 55%; --d: -0.8s; --drift: -6px; }
.fx-layer i:nth-child(5)  { --x: 71%; --d: -1.9s; --drift: 8px; }
.fx-layer i:nth-child(6)  { --x: 88%; --d: -2.7s; --drift: -10px; }
.fx-layer i:nth-child(7)  { --x: 15%; --d: -1.1s; --drift: 12px; }
.fx-layer i:nth-child(8)  { --x: 46%; --d: -2.6s; --drift: -12px; }
.fx-layer i:nth-child(9)  { --x: 63%; --d: -0.5s; --drift: 6px; }
.fx-layer i:nth-child(10) { --x: 80%; --d: -1.6s; --drift: -8px; }
.fx-final:not(.fx-climax) .fx-layer i:nth-child(n + 7) { display: none; }
.match .fx-layer i { --rise: -150px; }
.match.big .fx-layer i { --rise: -190px; }
.bmatch .fx-layer i { --rise: -95px; width: 3px; height: 3px; }

/* Klimaks Final (match point / deuce): bara lebih banyak & cepat, aura lebih kuat */
.fx-climax::after {
  box-shadow: 0 0 28px 6px rgba(255, 122, 47, 0.7), 0 0 8px 2px rgba(255, 207, 112, 0.8);
  animation-duration: 1.5s;
}
.fx-climax .fx-layer i { animation-duration: 2s; }
.fx-climax .fx-layer::after { animation-duration: 1.5s; }
.fx-climax .flag { display: inline-block; animation: fx-flag 1.5s ease-in-out infinite; animation-delay: var(--fx-phase, 0s); }

/* Header Final saat Final LIVE */
.fx-final-title { position: relative; color: var(--heat-text); border-bottom-color: var(--heat); }
.fx-final-title::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  box-shadow: 0 0 10px 2px rgba(255, 122, 47, 0.75);
  opacity: 0.4;
  animation: fx-breathe 2s ease-in-out infinite;
  animation-delay: var(--fx-phase, 0s);
}

/* Micro-reaction saat poin masuk (SF & Final LIVE): sapuan kilau + skor membal ~150ms */
.fx-hit .fx-layer::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 55%;
  background: linear-gradient(105deg, transparent, rgba(255, 236, 190, 0.3), transparent);
  transform: translateX(-100%);
  animation: fx-sweep 0.6s ease-out 1 forwards;
}
.score.bump, .bmatch-row .s.bump { display: inline-block; animation: fx-bump 0.15s ease-out 1; }

/* Juara 1 di bagan: trofi + nama, aura keemasan yang elegan (aktif terus setelah Final selesai) */
.row-trophy { display: inline-block; margin-right: 5px; font-style: normal; animation: fx-float 4s ease-in-out infinite; animation-delay: var(--fx-phase, 0s); }
.bmatch-row.champ .n { font-weight: 900; }
/* Kolom "Juara" = ujung bagan di kanan Final. Kartu & card Final sama-sama terpusat vertikal
   di kolomnya, jadi garis penghubung horizontal tepat di tengah keduanya. */
.bchamp-wrap { position: relative; }
.bchamp-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  width: 20px;
  height: 0;
  border-top: 2px solid var(--gold-fx);
  transform: translateY(-1px);
}
.bchamp-wrap.is-empty::before { border-top: 2px dashed rgba(12, 40, 39, 0.35); }
.bchamp {
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 16px 12px 14px;
  background: var(--ink);
  color: var(--cream);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--gold-fx);
}
.bchamp::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  z-index: 0;
  background: linear-gradient(105deg, transparent, rgba(245, 197, 66, 0.28), transparent);
  transform: translateX(-110%);
  pointer-events: none;
  animation: fx-shine 6s ease-in-out infinite;
  animation-delay: var(--fx-phase, 0s);
}
.bchamp > * { position: relative; z-index: 1; }
.bchamp-trophy { font-size: 2.4rem; line-height: 1; margin-bottom: 2px; animation: fx-float 4s ease-in-out infinite; animation-delay: var(--fx-phase, 0s); }
.bchamp-trophy::before {
  content: '';
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 197, 66, 0.55), transparent 65%);
  animation: fx-halo 4s ease-in-out infinite;
  animation-delay: var(--fx-phase, 0s);
}
.bchamp-k { font: 700 0.66rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--lime); }
.bchamp-name { font: 900 1.7rem/1.05 var(--display); color: var(--gold-fx); overflow-wrap: anywhere; max-width: 100%; }

/* Slot kosong sebelum Final selesai */
.bchamp-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 16px 12px;
  border: 2px dashed rgba(12, 40, 39, 0.35);
  border-radius: var(--radius);
  color: var(--muted);
}
.bchamp-slot-icon { font-size: 1.9rem; line-height: 1; filter: grayscale(1); opacity: 0.45; }
.bchamp-slot .bchamp-k { color: var(--muted); }
.bchamp-slot-text { font-size: 0.8rem; font-style: italic; }

/* Kembang api di sekeliling kartu Juara 1: 4 titik ledakan x 8 percikan, bergantian tiap 3 detik.
   Ditaruh di tepi/sudut kartu supaya tidak menutupi nama juara. */
.fw { position: absolute; inset: -12px; z-index: 2; pointer-events: none; }
.fw b { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.fw b:nth-child(1) { --x: 4%;  --y: 6%;  --c: var(--gold-fx); --d: 0s; }
.fw b:nth-child(2) { --x: 96%; --y: 16%; --c: var(--lime);    --d: -0.75s; }
.fw b:nth-child(3) { --x: 92%; --y: 92%; --c: var(--orange);  --d: -1.5s; }
.fw b:nth-child(4) { --x: 7%;  --y: 80%; --c: #fff3c4;        --d: -2.25s; }
.fw b::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--c) 45%, transparent 70%);
  opacity: 0;
  animation: fw-flash 3s ease-out infinite;
  animation-delay: calc(var(--fx-phase, 0s) + var(--d));
}
.fw i {
  position: absolute;
  left: -1px;
  top: -4px;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: var(--c);
  box-shadow: 0 0 4px var(--c);
  opacity: 0;
  will-change: transform, opacity;
  animation: fw-spark 3s ease-out infinite;
  animation-delay: calc(var(--fx-phase, 0s) + var(--d));
}
.fw i:nth-child(1) { --a: 0deg; }
.fw i:nth-child(2) { --a: 45deg; }
.fw i:nth-child(3) { --a: 90deg; }
.fw i:nth-child(4) { --a: 135deg; }
.fw i:nth-child(5) { --a: 180deg; }
.fw i:nth-child(6) { --a: 225deg; }
.fw i:nth-child(7) { --a: 270deg; }
.fw i:nth-child(8) { --a: 315deg; }

@keyframes fx-breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.85; } }
@keyframes fx-ember {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  12% { opacity: 0.95; }
  100% { transform: translate(var(--drift, 6px), var(--rise, -150px)) scale(0.35); opacity: 0; }
}
@keyframes fx-flag { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes fx-sweep { from { transform: translateX(-100%); opacity: 1; } to { transform: translateX(200%); opacity: 0; } }
@keyframes fx-bump { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes fx-halo { 0%, 100% { transform: scale(0.9); opacity: 0.55; } 50% { transform: scale(1.12); opacity: 1; } }
/* Banner juara di atas halaman: perayaan hanya saat .celebrate (Final kategori aktif SELESAI).
   - .champion-clip: kilau + petasan DI BELAKANG teks, terpotong rapi di dalam banner.
   - .celeb: trompet, konfeti, petasan samping DI ATAS banner tapi hanya di tepi kiri-kanan,
     boleh keluar sedikit (--spill) tanpa menutupi nama juara. */
.champion { position: relative; }
.champion-clip {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}
.champion-inner { position: relative; z-index: 1; }
.celebrate .champion-clip::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-110%);
  animation: fx-shine 6s ease-in-out infinite;
  animation-delay: var(--fx-phase, 0s);
}
.celebrate .podium-item.gold { position: relative; }
.celebrate .podium-item.gold::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.9), 0 0 18px 4px rgba(245, 197, 66, 0.65);
  opacity: 0.3;
  pointer-events: none;
  animation: fx-breathe 3s ease-in-out infinite;
  animation-delay: var(--fx-phase, 0s);
}
.celebrate .podium-item.gold .podium-medal { display: inline-block; animation: fx-float 4s ease-in-out infinite; animation-delay: var(--fx-phase, 0s); }
.fw.fw-banner { inset: 0; z-index: 0; }
.fw-banner i { animation-duration: 4s; width: 3px; height: 9px; }
.fw-banner b::before { animation-duration: 4s; }
.fw-banner b:nth-child(1) { --x: 80%; --y: 14%; --c: #c62f2a; --d: 0s; }
.fw-banner b:nth-child(2) { --x: 96%; --y: 58%; --c: #fff;    --d: -0.7s; }
.fw-banner b:nth-child(3) { --x: 4%;  --y: 46%; --c: #e0662a; --d: -1.3s; }
.fw-banner b:nth-child(4) { --x: 58%; --y: 8%;  --c: #174442; --d: -2s; }
.fw-banner b:nth-child(5) { --x: 95%; --y: 94%; --c: #e0662a; --d: -2.7s; }
.fw-banner b:nth-child(6) { --x: 30%; --y: 96%; --c: #c62f2a; --d: -3.3s; }

/* ---------- Lapisan perayaan juara: trompet fanfare + konfeti/kok + petasan samping ----------
   --spill = seberapa jauh efek boleh keluar dari sisi kiri-kanan kartu (dibatasi 16–28px).
   Semua elemen berada di jalur tepi, jadi nama & label juara di tengah tetap bersih. */
.celeb { position: absolute; inset: 0; z-index: 2; pointer-events: none; --spill: 28px; }
.celeb-bracket { --spill: 16px; }
.tp {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  font-size: 24px;
  line-height: 30px;
  text-align: center;
}
.tp-l { left: calc(var(--spill) * -1); }
.tp-r { right: calc(var(--spill) * -1); transform: scaleX(-1); }
.celeb-bracket .tp { top: 0; margin-top: -8px; width: 26px; height: 26px; font-size: 20px; line-height: 26px; }
.tp-horn {
  display: inline-block;
  transform-origin: 60% 60%;
  filter: drop-shadow(0 0 4px rgba(245, 197, 66, 0.8));
  animation: tp-swing 2s ease-in-out infinite;
  animation-delay: var(--fx-phase, 0s);
}
.tp i {
  position: absolute;
  left: 40%;
  top: -2px;
  font: 700 13px/1 var(--font);
  font-style: normal;
  color: var(--live);
  opacity: 0;
  animation: tp-note 3s ease-out infinite;
  animation-delay: var(--fx-phase, 0s);
}
.tp i + i { color: var(--ok); animation-delay: calc(var(--fx-phase, 0s) - 1.5s); }

/* Konfeti: tiap <i> = kolom setinggi kartu yang bergeser turun; kepingnya di ::after (berputar).
   Posisi jalur = --spill x (--f - 1): --f <= 1 berarti kolom tak pernah masuk lebih dari tepi kartu. */
.cf { position: absolute; inset: 0; }
.cf i {
  position: absolute;
  top: 0;
  height: 100%;
  width: 6px;
  opacity: 0;
  animation: cf-fall var(--t, 3s) linear infinite;
  animation-delay: calc(var(--fx-phase, 0s) + var(--d, 0s));
}
.cf i:nth-child(odd)  { left: calc(var(--spill) * (var(--f) - 1)); }
.cf i:nth-child(even) { right: calc(var(--spill) * (var(--f) - 1)); }
.cf i::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 6px;
  height: 9px;
  border-radius: 1px;
  background: var(--c);
  animation: cf-spin 1s linear infinite;
}
.cf i:nth-child(1)  { --f: 0.15; --c: var(--gold-fx); --t: 3s; --d: 0s;    --sway: 6px; }
.cf i:nth-child(2)  { --f: 0.3;  --c: var(--live);    --t: 4s; --d: -0.6s; --sway: -6px; }
.cf i:nth-child(3)  { --f: 0.75; --c: var(--orange);  --t: 4s; --d: -1.7s; --sway: -5px; }
.cf i:nth-child(4)  { --f: 0.6;  --c: var(--ok);      --t: 3s; --d: -2.2s; --sway: 5px; }
.cf i:nth-child(5)  { --f: 0.92; --c: var(--ink);     --t: 6s; --d: -3.1s; --sway: 4px; }
.cf i:nth-child(6)  { --f: 0.88; --c: var(--gold-fx); --t: 6s; --d: -4.4s; --sway: -4px; }
.cf i:nth-child(7)  { --f: 0.45; --t: 6s; --d: -1.2s; --sway: 8px; }
.cf i:nth-child(8)  { --f: 0.5;  --t: 6s; --d: -4.1s; --sway: -8px; }
.cf i:nth-child(9)  { --f: 0.05; --c: var(--ok);      --t: 4s; --d: -2.9s; --sway: 5px; }
.cf i:nth-child(10) { --f: 0.1;  --c: var(--orange);  --t: 3s; --d: -1.1s; --sway: -6px; }
.cf i:nth-child(11) { --f: 0.9;  --c: var(--live);    --t: 3s; --d: -0.4s; --sway: -5px; }
.cf i:nth-child(12) { --f: 0.85; --c: var(--gold-fx); --t: 4s; --d: -3.3s; --sway: 6px; }
.cf i:nth-child(13) { --f: 0.95; --c: var(--ink-2);   --t: 3s; --d: -1.9s; --sway: 4px; }
.cf i:nth-child(14) { --f: 0.98; --c: var(--live);    --t: 4s; --d: -2.5s; --sway: -4px; }
/* Dua "konfeti" berupa kok badminton */
.cf i:nth-child(7)::after, .cf i:nth-child(8)::after {
  content: '🏸';
  width: auto;
  height: auto;
  background: none;
  font-size: 13px;
  line-height: 1;
  animation-duration: 2s;
}

/* Petasan samping: sedikit di luar sisi kartu */
.fw.fw-side { inset: 0; z-index: 0; }
.fw-side b:nth-child(1) { --x: calc(var(--spill) * -0.55); --y: 20%; --c: #e0662a; --d: -0.4s; }
.fw-side b:nth-child(2) { --x: calc(100% + var(--spill) * 0.55); --y: 76%; --c: #c62f2a; --d: -1.9s; }
.celeb-bracket .fw-side b:nth-child(1) { --y: -6%; }
/* Kartu Juara 1 di bagan sempit di HP: jalur konfeti kanan digeser keluar agar tak menyentuh nama.
   Jalur kiri tetap (gap ke card Final hanya 20px). */
.celeb-bracket .cf { right: -8px; }

/* Bagan: ruang kanan untuk efek yang keluar dari kartu Juara 1 (kiri cukup oleh gap 20px). */
.bracket-col-champ .bracket-col-body { padding-right: 30px; }

@keyframes tp-swing {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  20% { transform: rotate(6deg) scale(1.08); }
  40% { transform: rotate(-4deg) scale(1); }
  60% { transform: rotate(8deg) scale(1.06); }
}
@keyframes tp-note {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(-12px, -26px) scale(1.1); opacity: 0; }
}
@keyframes cf-fall {
  0% { transform: translate(0, -100%); opacity: 0; }
  8%, 85% { opacity: 1; }
  100% { transform: translate(var(--sway, 6px), 0); opacity: 0; }
}
@keyframes cf-spin {
  0% { transform: rotate(0deg) scaleY(1); }
  50% { transform: rotate(180deg) scaleY(0.35); }
  100% { transform: rotate(360deg) scaleY(1); }
}

@keyframes fw-spark {
  0% { transform: rotate(var(--a)) translateY(-3px) scale(0.3); opacity: 0; }
  5% { opacity: 1; }
  30% { transform: rotate(var(--a)) translateY(-20px) scale(1); opacity: 0.9; }
  42%, 100% { transform: rotate(var(--a)) translateY(-25px) scale(0.6); opacity: 0; }
}
@keyframes fw-flash {
  0% { transform: scale(0.2); opacity: 0; }
  5% { transform: scale(1.3); opacity: 1; }
  22%, 100% { transform: scale(0.6); opacity: 0; }
}
@keyframes fx-shine {
  0% { transform: translateX(-110%); }
  30%, 100% { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
  /* Animasi berulang dimatikan (lihat aturan global di bawah); efek tetap terbaca statis. */
  .fx-layer i, .fx-hit .fx-layer::before, .bchamp::before, .fw, .celebrate .champion-clip::before, .cf, .tp i { display: none; }
  .tp-horn { filter: none; }
  .celebrate .podium-item.gold::after { opacity: 0.8; }
  .fx::after, .fx-final-title::after { opacity: 0.7; }
}

/* ---------- Responsive ---------- */
@media (max-width: 440px) {
  .brand-sub { display: none; }
  .brand-logo { width: 38px; height: 38px; }
  .brand-name { font-size: 1.45rem; }
  .conn { padding: 4px 8px; font-size: 0.6rem; }
  .role-chip { padding: 4px 8px; font-size: 0.7rem; }
  .hide-sm { display: none; }
  .wake-label { display: none; }
  .wake-btn { padding: 4px 8px; }
  .topbar-inner { gap: 8px; padding: 6px 14px; }
  .topbar-right { gap: 5px; }
  .cat-tabs { padding: 0 14px 10px; }
  .container { padding-left: 14px; padding-right: 14px; }
  .bracket-scroll { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .celeb-banner { --spill: 16px; }
  .section-head h2 { font-size: 1.55rem; }
}
@media (max-width: 400px) {
  .hide-xs { display: none; }
  .view-tab { font-size: 0.8rem; }
}
@media (min-width: 700px) {
  .brand-sub { font-size: 0.66rem; }
  .conn { font-size: 0.68rem; }
  .top-strip-inner { gap: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
