/* ==========================================================================
   NextPlay — dark green & neon lime sports-tech UI
   --------------------------------------------------------------------------
   Palet: latar hijau sangat gelap (#0B1F17), kartu hijau tua (#183B2D), aksen
   neon lime (#D0FF83). Nama variabel LAMA sengaja dipertahankan (--ink, --ink-2,
   --muted, --line, --line-2, --bg, --surface, --brand, --brand-2, --brand-tint,
   --live, --amber) supaya seluruh komponen yang sudah ada (60+ aturan CSS,
   termasuk papan skor, bagan, tabel, dan lembar A4) ikut berubah tanpa ditulis
   ulang satu per satu. Jangan mengganti nama variabel tanpa menyisir semua
   pemakaiannya.
   ========================================================================== */

:root {
  /* teks */
  --ink: #f7faf7;          /* teks utama */
  --ink-2: #b8c8bd;        /* teks sekunder */
  --muted: #82988a;        /* teks redup / label kecil */
  /* permukaan */
  --bg: #0b1f17;           /* latar aplikasi */
  --bg-2: #10291f;         /* latar kedua (topbar, bilah) */
  --surface: #183b2d;      /* kartu */
  --surface-2: #122b20;    /* permukaan dalam kartu / input */
  --elevated: #204634;     /* kartu menonjol / hover */
  --line: #294638;         /* garis tepi */
  --line-2: #22402f;       /* garis rambut */
  /* aksen */
  --brand: #d0ff83;        /* neon lime (aksen utama) */
  --brand-2: #a9e86c;      /* lime kedua */
  --brand-ink: #0b1f17;    /* teks DI ATAS lime */
  --brand-tint: rgba(208, 255, 131, 0.12);
  --live: #ff7777;
  --amber: #ffd166;
  --gold: #e8cf8a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.38);
  --font: "Inter", "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.95rem; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--line-2);
  padding: 1px 5px;
  border-radius: 5px;
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.sm { font-size: 0.82rem; }
.strong { font-weight: 650; color: var(--ink); }
.num { text-align: center; font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.hidden { display: none; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  background: #0b1f17;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
/* Logo NextPlay (SVG inline): huruf N memakai currentColor supaya otomatis
   putih di header gelap dan gelap di footer terang. */
.brand-logo { height: 26px; width: auto; display: block; flex: none; color: #fff; }
/* Logo unggahan panitia: tinggi tetap seperti logo bawaan, lebar mengikuti
   proporsi gambar aslinya (dan tidak melebar melewati batas header). */
.brand-logo.brand-img { object-fit: contain; max-width: 210px; border-radius: 4px; }
.foot-brand { display: inline-flex; align-items: center; gap: 9px; }
.foot-logo { height: 19px; color: var(--ink); }
.foot-logo.brand-img { max-width: 150px; }
.brand-text { font-size: 0.98rem; }

.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a, .topnav .linklike {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.88rem;
  padding: 7px 11px;
  border-radius: 7px;
}
.topnav a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; text-decoration: none; }
.topnav a.active { background: rgba(255, 255, 255, 0.13); color: #fff; }
.linklike {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

/* ---------------------------------------------------------------- subbar */

.subbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.subbar.admin { border-bottom: 2px solid var(--brand-tint); }
.subbar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 14px;
  flex-wrap: wrap;
}
.subbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.t-title { font-size: 1.4rem; }
.subbar-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.t-logo { height: 56px; width: auto; max-width: 200px; object-fit: contain; flex: none; }
.tcard-logo { height: 38px; width: auto; max-width: 90px; object-fit: contain; flex: none; }
.logorow { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.logo-preview { max-height: 120px; max-width: 320px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: var(--surface); }
.logo-empty { color: var(--muted); font-size: 0.85rem; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 18px 22px; }
/* Pratinjau logo aplikasi (bukan logo turnamen): ditampilkan di atas latar gelap
   seperti header aplikasi, supaya panitia melihat tampilannya yang sebenarnya. */
.applogo-preview { background: #0b1f17; border-color: #294638; padding: 10px 14px; }
.logo-empty.applogo-preview { color: var(--ink-2); border-style: dashed; }
.warn-text { color: var(--amber); }
.meta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.meta-item { color: var(--muted); font-size: 0.85rem; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------------------------------------------------------------- layout */

.page {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 24px;
  padding-bottom: 56px;
}
.narrow { max-width: 460px; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.card-action { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card.danger-card { border-color: rgba(255, 119, 119, 0.35); }

.section { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: baseline; gap: 10px; }
.colh {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 4px 0 10px;
}
.subh {
  margin: 22px 0 10px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.subh:first-child { margin-top: 0; }
.grouph { margin: 16px 0 8px; font-size: 0.95rem; }
.dayh { margin: 18px 0 10px; font-size: 0.98rem; display: flex; gap: 10px; align-items: baseline; }

.hint { color: var(--muted); font-size: 0.82rem; margin: 10px 0 0; }
.prose { white-space: pre-line; }
.legend { color: var(--muted); font-size: 0.78rem; margin: 10px 0 0; }
.legend .dotq {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
  margin-right: 6px;
}
.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }

/* ---------------------------------------------------------------- hero */

.hero {
  background: linear-gradient(160deg, #0b1f17 0%, #17392b 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px 34px;
  box-shadow: var(--shadow-lg);
}
.hero h1 { font-size: 1.9rem; margin-bottom: 10px; }
.hero p { color: rgba(255, 255, 255, 0.72); max-width: 620px; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 550;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #3a5a47; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { background: transparent; }
.btn.danger, .btn.danger-ghost { color: #ff9b9b; border-color: rgba(255, 119, 119, 0.35); background: var(--surface); }
.btn.danger { background: var(--live); border-color: var(--live); color: #2a1010; }
.btn.danger:hover { background: #ff8f8f; border-color: #ff8f8f; }
.btn.sm { padding: 6px 10px; font-size: 0.8rem; }
.btn.block { width: 100%; }
.danger-text { color: #ff9b9b; }
.inline { display: inline-flex; align-items: center; gap: 6px; }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-row input[type="text"], .inline-row input:not([type]) { flex: 1 1 220px; }
.rowactions { display: flex; gap: 6px; }

/* Unduh gambar bagan (PNG/JPG) — tombol admin per kategori, di tab Jadwal & Skor
   dan di kepala kartu bagan halaman publik (hanya terlihat admin). */
.bagimg { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.bagimg-lbl { font-size: 0.78rem; color: var(--muted); }
.bagimg .btn { white-space: nowrap; }
.bagimg .btn:disabled { opacity: 0.65; cursor: default; }
.bagimg-row { align-items: flex-start; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--ink-2);
}
.pill:hover { border-color: #3a5a47; text-decoration: none; }
.pill.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }

/*
 * Filter "Pilih hari" di halaman publik Jadwal & Hasil: satu baris tombol per hari
 * (label singkat + jumlah laga) supaya peserta bisa langsung mengetuk harinya.
 */
.dayfilter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -6px 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.dayfilter-label {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dayfilter .pill { display: inline-flex; align-items: center; gap: 7px; }
.pill .pill-count {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--line-2);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pill.active .pill-count { background: rgba(11, 31, 23, 0.18); color: var(--brand-ink); }
/* Label select yang disembunyikan secara visual (tetap terbaca pembaca layar). */
.sr-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- forms */

input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(208, 255, 131, 0.18);
}
textarea { resize: vertical; }
.input-inline { width: auto; min-width: 130px; }
.input-link { font-size: 0.8rem; color: var(--ink-2); }

.vform { display: flex; flex-direction: column; gap: 14px; }
.vform label { display: flex; flex-direction: column; gap: 6px; font-size: 0.83rem; font-weight: 600; color: var(--ink-2); }
.vform label.check, label.check {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  color: var(--ink-2);
}
.vform label.check input, label.check input { width: auto; }
/* Penjaga hasil: centang persetujuan wajib sebelum menghapus laga grup yang sudah
   dimainkan (lihat playedGroupGuard di routes/admin.js). */
label.check.playwarn { color: var(--amber); font-weight: 600; font-size: 0.78rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .span2 { grid-column: 1 / -1; }
.grid2.tight { gap: 12px; }
.filterbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filterbar select, .filterform select { width: auto; min-width: 160px; }
.filterform { margin-left: auto; }

.copyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copyrow .input-link { flex: 1 1 240px; min-width: 0; }

/* Kartu "Tautan untuk peserta": satu tautan utama + tombol bagikan WhatsApp. */
.sharebox {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  margin: 12px 0 10px;
  border: 1px solid rgba(169, 232, 108, 0.32);
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
}
.sharebox .shareinput { flex: 1 1 280px; min-width: 0; font-size: 0.86rem; font-weight: 600; background: var(--surface); }
.btn.wa { background: #25d366; border-color: #1eb356; color: #08321c; }
.btn.wa:hover { background: #1eb356; }
.sharetable .input-link { width: 100%; }
.sharetable td { vertical-align: middle; }
.sharetable td:first-child { width: 42%; }

/*
 * Di ponsel tabel tautan ditumpuk (judul di atas, tautan + tombol di bawah)
 * supaya kolom tautan tidak sempit — panitia sering membagikan tautan dari HP.
 */
@media (max-width: 720px) {
  .sharetable, .sharetable tbody, .sharetable tr, .sharetable td { display: block; width: 100%; }
  .sharetable tr { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  .sharetable tr:last-child { border-bottom: 0; }
  .sharetable td { padding: 0 0 10px; }
  .sharetable td:first-child { width: 100%; }
  .copyrow .input-link { flex: 1 1 100%; }
  .sharebox .btn { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------- flash */

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid;
}
.flash.ok { background: rgba(169, 232, 108, 0.13); border-color: rgba(169, 232, 108, 0.32); color: #c6f08f; }
.flash.error { background: rgba(255, 119, 119, 0.14); border-color: rgba(255, 119, 119, 0.35); color: #ff9b9b; }
.flash.warn { background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.32); color: var(--amber); }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--line-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.live { background: rgba(255, 119, 119, 0.14); border-color: rgba(255, 119, 119, 0.35); color: #ff9b9b; }
.badge.done { background: rgba(169, 232, 108, 0.13); border-color: rgba(169, 232, 108, 0.32); color: #c6f08f; }
.badge.scheduled { background: var(--line-2); color: var(--muted); }
.badge.bye { background: rgba(168, 155, 255, 0.14); border-color: rgba(195, 184, 255, 0.35); color: #c3b8ff; }
.badge.ko, .badge.group { background: var(--brand-tint); border-color: rgba(169, 232, 108, 0.32); color: var(--brand-2); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--line-2);
  color: var(--ink-2);
  font-size: 0.76rem;
  border: 1px solid var(--line);
}
.chip.sm { font-size: 0.72rem; padding: 1px 6px; }

.livedot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  display: inline-block;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ---------------------------------------------------------------- tables */

.tablewrap { overflow-x: auto; max-width: 100%; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th.num { text-align: center; }
.table th.right { text-align: right; }
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table.narrow th, .table.narrow td { padding: 6px 10px; }
.table .actcell { text-align: right; white-space: nowrap; }
.table .tcell { max-width: 240px; }
.table .scorecell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}
.table .metacell { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.table .won { color: var(--brand-2); font-weight: 650; }
.standings tr.qualified { background: rgba(169, 232, 108, 0.13); }
.standings tr.qualified td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.teamcell { min-width: 180px; }

.team-name { display: block; font-weight: 600; color: var(--ink); }
.team-sub { display: block; font-size: 0.78rem; color: var(--muted); }
.team-players { display: block; font-size: 0.78rem; color: var(--muted); }

/* Kode pertandingan (M001) — dipakai petugas skor untuk mencocokkan lembar skor */
.matchcode {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}
.matchcode.big { font-size: 1rem; padding: 4px 10px; background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24); color: #fff; }
.codecell { white-space: nowrap; }
.codecell .matchcode { font-size: 0.72rem; }
.scoreform .score-code { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tbd, .tbd i { color: var(--muted); font-style: italic; font-weight: 500; }
.formcell { white-space: nowrap; }
.played-mini { display: block; font-size: 0.72rem; color: var(--muted); }
.durmini { display: inline-block; margin-left: 6px; font-size: 0.7rem; color: var(--muted); }
.input-dur { width: 74px; display: inline-block; padding: 4px 6px; font-size: 0.82rem; }
.warn-note {
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.32);
  color: var(--amber);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 10px 0 0;
}
.h2hcell { font-weight: 650; color: var(--brand-2); }
.muted-num { color: var(--muted); }
.standings th { white-space: nowrap; }
.formdot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 700;
  margin-right: 3px;
}
.formdot.w { background: rgba(169, 232, 108, 0.13); color: #c6f08f; }
.formdot.l { background: var(--line-2); color: var(--muted); }

/* ---------------------------------------------------------------- liga
   Klasemen liga setengah kompetisi (lib/views/liga.js): sorotan pemuncak
   sementara/juara, penanda baris pemimpin, dan catatan aturan urutan. */
.liga-leader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: rgba(169, 232, 108, 0.13);
  margin: 0 0 18px;
}
.liga-leader.is-champion { background: rgba(255, 209, 102, 0.12); border-left-color: var(--gold); }
.liga-leader-cup { font-size: 1.7rem; line-height: 1; }
.liga-leader-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.liga-leader-name { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-top: 2px; }
.liga-leader-club { font-weight: 500; font-size: 0.82rem; color: var(--muted); }
.liga-leader-sub { font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.liga-progress { margin: 0 0 18px; }
.liga-note { margin-top: 8px; }
.standings.ligatable tr.is-leader,
.standings.clubtable tr.is-leader { background: rgba(169, 232, 108, 0.13); }
.standings.ligatable tr.is-leader td:first-child,
.standings.clubtable tr.is-leader td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.lead-cup { display: inline-block; margin-right: 4px; }
.standings.ligatable { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- ranking
   NextPlay Ranking (lib/views/ranking.js). Tabelnya TIDAK memakai kelas
   `.standings` karena aturan `.stack.standings` menyembunyikan kolom angka di
   ponsel — di halaman ini kolom Poin justru yang paling penting, jadi dipakai
   `.table.stack` biasa + `data-label` per sel (label muncul otomatis di HP). */
.rankhero .statgrid { margin-bottom: 6px; }
.ranktiers { margin-bottom: 12px; }
.ranktable { font-variant-numeric: tabular-nums; }
.ranktable td.rankcell { white-space: nowrap; font-weight: 700; }
.ranktable .rank-name { display: block; font-weight: 650; }
.medal { margin-right: 4px; }
.rankp { font-size: 1.05rem; color: var(--brand-2); }
.ranktable tr.is-top-1 { background: rgba(255, 209, 102, 0.12); }
.ranktable tr.is-top-2, .ranktable tr.is-top-3 { background: var(--surface-2); }
.ranktable tr.is-me { box-shadow: inset 3px 0 0 var(--brand); }
.rankdetailcell { min-width: 150px; }
.rankdetail summary { cursor: pointer; color: var(--brand-2); font-size: 0.82rem; }
.ranksplit { margin: 8px 0 0; }
.ranksplit li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 6px 0;
  border-top: 1px dashed var(--line-2);
}
.ranksplit li:first-child { border-top: 0; }
.ranksplit .rd-tour { font-weight: 600; }
.ranksplit .rd-meta { grid-column: 1; font-size: 0.75rem; color: var(--muted); }
.ranksplit .rd-points { grid-row: 1 / span 2; align-self: center; font-weight: 700; color: var(--brand-2); }
.ranksplit li.is-title .rd-tour::before { content: '🏆 '; }
.rankpointstable { margin-top: 4px; }
.rankpointstable td.num { font-variant-numeric: tabular-nums; }
.ranknotes { margin: 0; }
.ranknotes li { padding: 8px 0; border-top: 1px dashed var(--line-2); }
.ranknotes li:first-child { border-top: 0; }
.ranknotes li.note-tier, .ranknotes li.note-gender, .ranknotes li.note-single, .ranknotes li.note-dup { color: var(--amber); }
.rankadm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.rankadm-tier { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.rankadm-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rankadm-list { margin: 0; }
.rankadm-list li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 0.86rem; }
.rankcats td { vertical-align: top; }

/* --- foto pemain, level, & penilaian panitia (permintaan panitia Okt 2026) ---
   Foto profil diambil dari data pendaftaran (registration_players.photo_url) dan
   dicocokkan lewat nama; pemain tanpa foto memakai inisial, jadi kolomnya tidak
   pernah kosong. Chip level memakai warna tier + penanda naik level. */
.rankwho { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ranknames { min-width: 0; }
.rankphoto {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
}
.rankphoto.empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-ink);
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  border-color: transparent;
}
.levelchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}
.levelchip .lvfrom { font-size: 0.68rem; font-weight: 500; color: var(--muted); }
.levelchip .lvarrow { color: var(--brand); font-weight: 800; }
.levelchip.lv-beginner { color: var(--ink); }
.levelchip.lv-bronze { color: var(--amber); border-color: rgba(255, 209, 102, 0.45); }
.levelchip.lv-silver { color: #dfe7ea; border-color: rgba(223, 231, 234, 0.5); }
.levelchip.is-up { border-color: var(--brand); box-shadow: 0 0 0 1px rgba(208, 255, 131, 0.25) inset; }
.levelchip.is-panitia { border-style: dashed; }
.lvnote { margin-top: 6px; font-size: 0.75rem; color: var(--muted); }
.levelform { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.levelform select,
.levelform .input-inline { font-size: 0.82rem; padding: 4px 8px; }
.levelform .input-inline { min-width: 170px; flex: 1 1 170px; }
.ranklevels td { vertical-align: top; }
.ranklevels tr.is-manual td { background: rgba(208, 255, 131, 0.04); }
.rankpromo td, .ranklimits td { vertical-align: top; }

@media (max-width: 640px) {
  .rankphoto { width: 30px; height: 30px; }
  .levelform .input-inline { min-width: 0; flex: 1 1 100%; }
  .levelform select { flex: 1 1 100%; }
}

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 18px 0 0; }
.kv dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.kv dd { margin: 4px 0 0; font-weight: 600; }

/* ---------------------------------------------------------------- match cards */

.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "top top top" "a mid b" "foot foot foot";
  align-items: center;
  gap: 8px 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  margin-bottom: 10px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
a.match:hover { border-color: #3a5a47; box-shadow: var(--shadow); text-decoration: none; }
.match:last-child { margin-bottom: 0; }
.match-top { grid-area: top; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.match-top:empty { display: none; }
.match-side { grid-area: a; min-width: 0; }
.match-side.right { grid-area: b; text-align: right; }
.match-side.won .team-name { color: var(--brand-2); }
.match-mid {
  grid-area: mid;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 92px;
}
.match-score { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.match-score.hollow { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.match-foot {
  grid-area: foot;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.match-foot:empty { display: none; }

.matchhead, .courthero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.courthero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.courthero h1 { font-size: 1.6rem; margin-top: 2px; }
.courthero-right { display: flex; gap: 8px; }

.matchdetail {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 8px 0 18px;
}
.md-side { font-size: 1.05rem; }
.md-side.right { text-align: right; }
.md-mid { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.md-score { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.panel { display: flex; flex-direction: column; }
.panel .match:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- live overview */

.livegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 26px; }
.livecol { min-width: 0; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty-action { margin-top: 16px; }

/* ---------------------------------------------------------------- tournament cards */

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.tcard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.tcard:hover { border-color: #3a5a47; box-shadow: var(--shadow-lg); text-decoration: none; }
.tcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tcard-top { flex-wrap: wrap; }
.tcard-top h3 { font-size: 1.02rem; }
.tcard-meta { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.83rem; }
.tcard-foot {
  display: flex;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  font-size: 0.8rem;
  color: var(--muted);
}

.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.catcard {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.catcard:hover { border-color: var(--brand); text-decoration: none; }
.catcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.catcard-top h4 { font-size: 0.98rem; }

.progress {
  position: relative;
  height: 22px;
  margin-top: 12px;
  background: var(--line-2);
  border-radius: 6px;
  overflow: hidden;
}
.progress-bar { height: 100%; background: var(--brand-tint); border-right: 3px solid var(--brand); }
.progress-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: var(--ink-2);
  font-weight: 600;
}

/* ---------------------------------------------------------------- stats */

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------------------------------------------------------------- group blocks */

.groupblock { border-top: 1px solid var(--line-2); padding-top: 6px; margin-bottom: 20px; }
.groupblock:first-child { border-top: 0; }
.mtoggle { margin-top: 12px; }
.mtoggle summary {
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--brand);
  padding: 6px 0;
  font-weight: 600;
}
.mtoggle[open] summary { margin-bottom: 10px; }
.dayblock { border-top: 1px solid var(--line-2); padding-top: 6px; margin-bottom: 12px; }
.dayblock:first-child { border-top: 0; padding-top: 0; }

.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
/* grid/flex children default to min-width:auto, which lets a wide table push
   the whole page wider than the viewport on mobile — allow them to shrink. */
.twocol > *, .livegrid > *, .statgrid > * { min-width: 0; }
.card, .panel, .catblock, .card-body { min-width: 0; }
.twocol.even { align-items: start; }
.catblock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 22px;
}
.catblock:last-child { margin-bottom: 0; }
.catblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 18px;
}
.catblock-head h3 { font-size: 1.15rem; }

/* ---------------------------------------------------------------- bracket */

/* Bagan gaya papan turnamen: kolom per babak, kotak laga dengan kode + jadwal +
   asal tim + skor, dan garis penghubung antar babak.
   Garis dibuat dengan border pada elemen pasangan (.bpair):
     - ::after  = garis vertikal yang menyatukan dua laga sekawanan
     - ::before = garis keluar ke laga babak berikutnya (titik tengah pasangan)
   Karena tiap kotak tingginya sama dan kolom memakai justify-content: space-around,
   titik tengah pasangan otomatis sejajar dengan laga tujuan di babak berikutnya. */
.bracket-hint { margin: 0 0 16px; }
.bracketwrap { overflow-x: auto; padding: 4px 2px 18px; }
.bracket {
  display: flex;
  gap: var(--bracket-gap, 34px);
  align-items: stretch;
  min-width: max-content;
  --bracket-gap: 34px;
  /* Tinggi kotak HARUS seragam: itulah yang membuat titik tengah pasangan
     sejajar dengan laga di babak berikutnya (garis penghubung rapi). */
  --box-h: 172px;
  --pair-gap: 14px;
}
.brnd { display: flex; flex-direction: column; flex: 1 1 0; min-width: 286px; }
.brnd-head {
  padding: 0 2px 8px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 12px;
}
.brnd-title { display: block; font-size: 0.86rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.brnd-sub { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.brnd-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-around; }
.bpair {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  /* dua kotak + jarak napas → kolom pertama menentukan tinggi seluruh bagan */
  min-height: calc(2 * var(--box-h) + 2 * var(--pair-gap));
}
.bpair.single { justify-content: center; min-height: 0; }
.bmatch {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: var(--box-h);
  display: flex;
  flex-direction: column;
}
.bmatch.is-live { border-color: rgba(255, 119, 119, 0.35); box-shadow: 0 0 0 2px rgba(255, 119, 119, 0.15); }
.bmatch.is-done { background: var(--surface-2); }
.bm-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  min-height: 22px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 0.68rem;
  color: var(--ink-2);
}
.bm-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--brand-2);
  white-space: nowrap;
}
.bm-when { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.66rem; color: var(--muted); }
.bm-when .sep { opacity: 0.5; }
.bm-head .livedot { margin-left: auto; }
.bkside {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  flex: 1 1 0;
  min-height: 58px;
  line-height: 1.25;
}
.bkside + .bkside { border-top: 1px solid var(--line-2); }
.bkside.won { background: var(--brand-tint); }
.bkinfo { min-width: 0; flex: 1 1 auto; }
.bkname {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  word-break: break-word;
}
.bkname i { font-style: normal; font-weight: 500; color: var(--muted); }
.bksrc {
  display: block;
  font-size: 0.67rem;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* bagian asal tim (Juara/Runner Up Grup X) dan klub dipisah agar mudah dibaca */
.bksrc .bksrc-org { color: var(--ink-2); font-weight: 600; }
.bksrc .bksrc-club { color: var(--muted); }
.bkscore {
  flex: none;
  min-width: 28px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  line-height: 1.45;
}
.bkside.won .bkscore { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.bm-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-top: 1px dashed var(--line-2);
  min-height: 24px;
}
.bm-score { font-size: 0.88rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-2); }

/* garis penghubung */
.bpair::after {
  content: '';
  position: absolute;
  right: calc(var(--bracket-gap) / -2);
  top: 25%;
  height: 50%;
  border-right: 2px solid #3a5a47;
}
.bpair.single::after,
.brnd:last-child .bpair::after { display: none; }
.bpair::before {
  content: '';
  position: absolute;
  right: calc(var(--bracket-gap) * -1);
  top: 50%;
  width: var(--bracket-gap);
  border-top: 2px solid #3a5a47;
}
.brnd:last-child .bpair::before { display: none; }
.bmatch::after {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(var(--bracket-gap) / -2);
  width: calc(var(--bracket-gap) / 2);
  border-top: 2px solid #3a5a47;
}
.brnd:last-child .bmatch::after { display: none; }

@media (max-width: 900px) {
  .bracket { --bracket-gap: 26px; --box-h: 166px; }
  .brnd { min-width: 266px; }
}

/* ---------------------------------------------------------------- score editor */

.scoreform {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.score-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 18px;
}
.score-team { font-weight: 600; }
.score-team:last-child { text-align: right; }
.vs { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; font-weight: 700; }

.setgrid { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.setblock { border-bottom: 1px dashed var(--line); padding-bottom: 12px; }
.setblock:last-child { border-bottom: 0; padding-bottom: 0; }
.setrow {
  display: grid;
  grid-template-columns: 92px 1fr 18px 1fr;
  align-items: center;
  gap: 12px;
}
.setlabel {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.setlabel select.racesel {
  padding: 4px 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.setrow input.invalid { border-color: var(--live); background: rgba(255, 119, 119, 0.08); }
/* Baris tambahan tiap set: jenis set (biasa / super tiebreak) + poin tiebreak. */
.setextra {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 0 92px;
  font-size: 0.8rem;
  color: var(--muted);
}
.setextra .setkindlabel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.setextra select.kindsell { padding: 4px 6px; font-size: 0.78rem; }
.setextra .dash { color: var(--muted); }
.tbbits { display: inline-flex; align-items: center; gap: 6px; }
.tbbits .tblabel { font-weight: 600; }
.tbinput {
  width: 56px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 5px;
}
.tbinput.invalid { border-color: var(--live); background: rgba(255, 119, 119, 0.08); }
.supernote { display: none; color: var(--muted); }
.setblock.issuper .supernote { display: inline; }
.setblock.issuper .tbbits { display: none; }
.setblock.issuper .setlabel span b.super { color: var(--brand-2); }
.setvalid {
  margin: 8px 0 0 92px;
  font-size: 0.79rem;
  color: #ff9b9b;
}
.setvalid.ok { color: var(--brand-2); }
.racebar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-2);
}
.racebar .racesel-label { font-size: 0.8rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.raceall { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.raceall .btn { padding: 4px 9px; font-size: 0.78rem; }
.card-body.tight { padding: 16px 20px; }
.targetcell { color: var(--ink-2); font-size: 0.82rem; white-space: nowrap; }
.setrow input {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 10px;
}
.dash { text-align: center; color: var(--muted); }

.wo { border-top: 1px dashed var(--line); padding-top: 14px; margin-bottom: 18px; }
.wo summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.wo-body { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.radio { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.radio input { width: auto; }

/* ---------------------------------------------------------------- footer */

.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: auto; }
.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
.page { flex: 1 0 auto; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .livegrid { grid-template-columns: 1fr; gap: 22px; }
  .twocol { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 680px) {
  .wrap { padding: 0 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.5rem; }
  .card-body, .catblock { padding: 16px; }
  .scoreform { padding: 16px; }
  .setrow { grid-template-columns: 76px 1fr 12px 1fr; gap: 8px; }
  .setvalid { margin-left: 0; }
  .setextra { margin-left: 0; }
  .raceall { margin-left: 0; }
  .match { grid-template-columns: 1fr auto 1fr; padding: 12px; }
  .match-mid { min-width: 70px; }
  .table { font-size: 0.82rem; }
  .table th, .table td { padding: 8px 9px; }
  .filterform { margin-left: 0; }
  .tcard-foot { flex-wrap: wrap; gap: 10px; }
}

/* ==========================================================================
   Live point-by-point scoreboard
   ========================================================================== */

.flash-slot { display: none; }
.flash-slot.flash { display: block; margin-bottom: 18px; }

.liveboard {
  background: #0b1f17;
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.15s ease;
}
.liveboard.busy { opacity: 0.72; }
.liveboard .lbrules { font-size: 0.76rem; color: rgba(255, 255, 255, 0.6); line-height: 1.4; }
.liveboard .lbstatus { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.liveboard .lbmeta { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.liveboard .badge { border-color: transparent; }
.liveboard .badge.live { background: rgba(255, 119, 119, 0.18); color: #ffb0b0; }
.liveboard .badge.scheduled { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.8); }
.liveboard .badge.done { background: var(--brand-tint); color: var(--brand-2); }
.liveboard .chip {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.86);
}
.liveboard .chip.warn-chip { background: rgba(255, 209, 102, 0.14); border-color: rgba(255, 209, 102, 0.35); color: var(--amber); }

/* Skor per set — angka skor game dibuat besar (bukan hanya poin berjalan),
   supaya jumlah game tiap set langsung terbaca dari jauh. */
.lbsetsrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 6px; }
.lbsetslbl {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}
.lbsets { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.setchip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
}
.setno { font-weight: 600; white-space: nowrap; }
.setchip i {
  font-style: normal;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.setchip.current { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.3); }
.setchip.current .dot { color: var(--brand); }
.setchip.empty { opacity: 0.55; }
.setchip.empty i { font-size: 1.2rem; }
.setchip .super { color: var(--amber); font-weight: 700; font-size: 0.72rem; }

.lbsidegroup { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 18px; }
.lbside {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}
.lbside.right { flex-direction: row-reverse; text-align: right; }
.lbside .team-name { color: #fff; }
.lbside .team-players { color: rgba(255, 255, 255, 0.55); }
.lbsets-count { color: rgba(255, 255, 255, 0.6); }
.lbsetwon { margin: 5px 0 0; font-size: 0.8rem; color: rgba(255, 255, 255, 0.68); }
.lbsetwon b { color: #fff; font-size: 0.95rem; }
.lbside .lbinfo { min-width: 0; }

/* Dua angka besar berdampingan: GAME (skor set berjalan) dan POIN.
   Keduanya sama besar supaya skor game sejelas poin yang sedang berlangsung. */
.lbnumgroup { display: flex; align-items: stretch; gap: 8px; flex: none; }
.lbnum {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 66px;
  padding: 7px 10px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.lbnum.point { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); }
.lbnum.advantage { border-color: var(--brand); }
.lbnum-lbl {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
}
.lbnum-val {
  font-size: 2.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 2.1ch;
  text-align: center;
}
.lbgame { color: #fff; }
.lbpoint { color: #fff; }
.lbpoint.advantage { color: var(--brand); }

.lbpoints { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lbpt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 16px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.12s ease;
}
.lbpt-btn:hover { background: var(--brand-2); }
.lbpt-btn:active { transform: translateY(1px); }
.lbpt-btn.alt { background: rgba(255, 255, 255, 0.14); }
.lbpt-btn.alt:hover { background: rgba(255, 255, 255, 0.22); }
.lbpt-btn:disabled { opacity: 0.5; cursor: default; }
.lbpt-plus { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.lbpt-name { font-size: 0.84rem; font-weight: 600; }

.lbtools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.lbtool-group { display: flex; gap: 8px; flex-wrap: wrap; }
.liveboard .btn.ghost { color: rgba(255, 255, 255, 0.85); border-color: rgba(255, 255, 255, 0.2); }
.liveboard .btn.ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }
.liveboard .btn.ghost:disabled { opacity: 0.4; cursor: default; }
.liveboard .btn.ghost.danger-text { color: #ffb0b0; }
.lbhist { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.phist {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 700;
}
.phist.s1 { background: rgba(208, 255, 131, 0.22); color: var(--brand); }
.phist.s2 { background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.8); }
.liveboard .hint { color: rgba(255, 255, 255, 0.6); }

/* live indicator on match lists — skor game dibuat lebih besar daripada poin
   supaya jumlah game yang berjalan ikut terbaca jelas, bukan hanya poinnya. */
.match-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.match-live .lbl {
  background: rgba(255, 119, 119, 0.14);
  color: #ff9b9b;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-weight: 700;
}
.match-live.super .lbl { background: rgba(255, 209, 102, 0.12); color: var(--amber); }
.match-live .gp { font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.match-live .pp { font-weight: 700; color: var(--brand-2); }
.match-live .gp-badge {
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-weight: 700;
}
.match-live.sm { font-size: 0.82rem; display: flex; justify-content: center; margin-top: 4px; }
.match-live.sm .gp { font-size: 1rem; }

/* manual entry + rules card */
.manualentry, .rulescard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.manualentry > summary, .rulescard > summary {
  cursor: pointer;
  padding: 16px 20px;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink-2);
}
.manualentry[open] > summary, .rulescard[open] > summary { border-bottom: 1px solid var(--line-2); }
.manualentry > *:not(summary), .rulescard > *:not(summary) { padding: 0 20px; }
.manualentry > .flash, .rulescard > .flash { margin: 16px 20px 0; }
.manualentry > .scoreform {
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 18px 20px 22px;
}
.rulescard > .card-body, .rulescard > .vform { padding: 18px 20px; }
.rulescard > .hint { padding-bottom: 20px; }
.md-live { margin-top: 10px; }
.md-live-nums { display: flex; justify-content: center; gap: 10px; }
.md-num {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 64px;
  padding: 5px 10px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}
.md-num.point { background: var(--brand-tint); border-color: rgba(169, 232, 108, 0.32); }
.md-num i {
  font-style: normal;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.md-num b { font-size: 1.4rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.md-num.point b { color: var(--brand-2); }
.sm2 { font-size: 0.85rem; font-weight: 600; margin: 4px 0 0; }

@media (max-width: 640px) {
  .lbsidegroup { grid-template-columns: 1fr; gap: 10px; }
  .lbside.right { flex-direction: row; text-align: left; }
  .lbnum { min-width: 58px; padding: 6px 8px 7px; }
  .lbnum-val { font-size: 1.95rem; }
  .setchip i { font-size: 1.25rem; }
  .lbpt-btn { padding: 14px 10px; }
  .liveboard { padding: 16px; }
}

/* Jumlah grup & drawing: the count field only takes effect via its own button,
   so the block is visually separated from the category settings form. */
.drawform {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--surface-2);
}
.drawform .actions { margin-top: 2px; }

/* Panel kesiapan di tab Jadwal & Skor: menunjukkan langkah mana yang belum jadi. */
.readygrid { display: flex; flex-direction: column; gap: 14px; }
.readyblock {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface-2);
}
.readyblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.readysteps { display: flex; gap: 8px; flex-wrap: wrap; }
.step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.step.ok { background: var(--brand-tint); border-color: rgba(169, 232, 108, 0.32); color: var(--brand-2); }
.step.todo { border-style: dashed; }

/* Tanggal/jam & lapangan: selalu tampil di daftar pertandingan */
.whencell { display: inline-flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.whencell b { font-weight: 600; color: var(--ink-2); font-size: 0.84rem; }
.whencell i { font-style: normal; font-weight: 700; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.whencell-td { white-space: nowrap; }
.courtcell { font-weight: 600; color: var(--ink-2); }
.vsmini { color: var(--muted); font-size: 0.76rem; padding: 0 3px; }

/* Jadwal per lapangan — tabel berjajar: kolom Jam + satu kolom per lapangan.
   Satu baris = satu jam, sehingga jadwal semua lapangan bisa dibandingkan sejajar. */
.ctsched-hint { margin: 0 0 14px; }
.courtsched { display: flex; flex-direction: column; gap: 22px; }
.courtblock { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; min-width: 0; }
.courtblock.warn { border-color: rgba(255, 209, 102, 0.32); background: rgba(255, 209, 102, 0.12); }
.courtblock-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-2);
}
.courtblock-head h4 { font-size: 1rem; }

.ctimeline { min-width: 100%; }
.ctimeline th.cttime, .ctimeline td.cttime {
  width: 74px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ctimeline td.cttime { font-weight: 700; color: var(--brand-2); font-size: 0.9rem; }
.ctimeline th.ctcourt { min-width: 250px; vertical-align: bottom; }
.ctcourt-name { display: block; font-size: 0.86rem; }
.ctcourt-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-transform: none;
}
.ctimeline td.ctcell {
  vertical-align: top;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
}
.ctimeline tbody tr:nth-child(even) td.ctcell { background: var(--surface-2); }
.ctimeline tbody tr:nth-child(even) td.cttime { background: var(--surface-2); }
.ctimeline td.ctcell.is-clash { background: rgba(255, 119, 119, 0.10); box-shadow: inset 3px 0 0 var(--live); }
.ctentry { padding: 2px 0; }
.ctentry + .ctentry { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.ctentry.is-live { box-shadow: inset 3px 0 0 var(--live); padding-left: 6px; }
.clashmark {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ff9b9b;
  background: rgba(255, 119, 119, 0.14);
  border: 1px solid rgba(255, 119, 119, 0.35);
  border-radius: 5px;
  padding: 2px 6px;
  margin-bottom: 6px;
  display: inline-block;
}
.ctimeline td.ctempty { color: var(--muted); text-align: center; }
.ctimeline td.ctcell { min-width: 250px; }
.cthead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ctteam { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.ctteam.tbd { color: var(--muted); font-style: italic; font-weight: 500; }
.ctclub { font-style: normal; font-weight: 500; color: var(--muted); font-size: 0.76rem; }
.ctvs { display: block; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 2px 0; }
.ctscore { margin-top: 6px; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-2); }
.ctimeline .badge { font-size: 0.68rem; padding: 2px 6px; }

.viewpills { margin-left: auto; }
.baganform { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.baganform label { font-size: 0.82rem; }
.baganform select { margin-top: 4px; }/* Pencarian kode pertandingan (halaman hakim lapangan) */
.codesearch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.codesearch > label { display: block; font-size: 0.83rem; font-weight: 650; color: var(--ink-2); margin-bottom: 8px; }
.codesearch-row { display: flex; gap: 10px; align-items: center; }
.codesearch-row input {
  flex: 1 1 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  max-width: 220px;
}
.codesearch .hint { margin-top: 10px; }
.codesearch + .flash, .flash + .panel { margin-top: 0; }
.flash.ok .btn, .flash.warn .btn { margin-left: 6px; }

/* Daftar tim admin: pemain sebagai baris kedua */
.courtblock .team-sub { font-size: 0.74rem; }

/* Tombol unduh Excel */
.export-actions { margin-bottom: 12px; }
.export-actions.mb { margin: 0 0 14px; }
.export-actions .btn { font-variant-numeric: tabular-nums; }

/* Sesi jadwal: kartu per hari + daftar blok berurutan */
.sessioncard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.sessioncard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 14px;
}
.sessiondate { font-size: 1rem; margin-left: 8px; }
.sessionform { border-top: 1px dashed var(--line); padding-top: 14px; margin-bottom: 14px; }
.sessiontable { font-size: 0.84rem; }
/* Pemilih pola blok (satu grup satu lapangan / paralel). */
.input-pat { width: auto; min-width: 150px; font-size: 0.78rem; padding: 4px 6px; }
.sessiontable th, .sessiontable td { padding: 8px 10px; }
.sessionfoot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.checkrow { display: flex; flex-wrap: wrap; gap: 12px; padding: 6px 0; }
.checkrow label.check { font-weight: 500; }

/* ==========================================================================
   Papan skor TV (layar besar di tiap lapangan)
   ========================================================================== */

.tv-body {
  background: #08170f;
  color: #fff;
  min-height: 100vh;
  margin: 0;
}
.tv-wrap { padding: 18px 20px 26px; }
.tv-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.tv-logo { height: 52px; width: auto; max-width: 220px; object-fit: contain; }
.tv-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tv-tname { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.tv-tloc { font-size: 0.9rem; color: rgba(255, 255, 255, 0.6); }
.tv-head-right { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.tv-livecount { font-size: 0.85rem; color: var(--brand); font-weight: 600; }
.tv-clock { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.tv-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.tv-grid.courts-1 { grid-template-columns: 1fr; }
.tv-grid.courts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* TIGA lapangan = TIGA kolom sejajar. Dulu 3 lapangan tetap dirender 2 kolom,
   sehingga panel COURT 3 terlempar ke baris kedua di bawah — di layar TV terlihat
   seperti "papan skor hanya bisa 2 lapangan". Ukuran huruf dirapatkan sedikit
   supaya panel yang lebih sempit tetap muat tanpa terpotong. */
.tv-grid.courts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tv-grid.courts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tv-grid.courts-3 .tv-panel { padding: 14px 14px 16px; gap: 10px; }
.tv-grid.courts-3 .tv-panel-head h2 { font-size: 1.05rem; }
.tv-grid.courts-3 .tv-name { font-size: 0.95rem; }
.tv-grid.courts-3 .tv-club { font-size: 0.8rem; }
.tv-grid.courts-3 .tv-cell { min-width: 72px; padding: 6px 10px 8px; }
.tv-grid.courts-3 .tv-game { font-size: 2.4rem; }
.tv-grid.courts-3 .tv-point { font-size: 2.8rem; }
.tv-grid.courts-3 .tv-cell-lbl { font-size: 0.66rem; }
.tv-grid.courts-3 .tv-setchip { font-size: 1rem; padding: 4px 10px; }
.tv-grid.courts-3 .tv-idle-teams .tv-name { font-size: 0.98rem; }
.tv-grid.courts-3 .tv-idle-score { font-size: 1.05rem; }
.tv-grid.courts-3 .tv-live { gap: 6px; }
.tv-grid.courts-3 .tv-badge { font-size: 0.62rem; padding: 2px 6px; }
.tv-grid.courts-3 .tv-code { font-size: 0.78rem; }

.tv-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tv-panel.is-live { border-color: rgba(208, 255, 131, 0.45); box-shadow: 0 0 0 1px rgba(208, 255, 131, 0.25); }
.tv-panel-head { display: flex; align-items: center; gap: 10px; }
.tv-panel-head h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.tv-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--live); animation: tvpulse 1.3s infinite; }
@keyframes tvpulse { 0%,100% { opacity: 1 } 50% { opacity: 0.35 } }

.tv-live { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.tv-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tv-side.right { align-items: flex-end; text-align: right; }
.tv-team { min-width: 0; }
/* Foto profil pemain 1 & 2 di atas nama tim (permintaan panitia: supaya penonton
   langsung mengenali pemainnya). Foto sengaja lebih besar dari teks nama dan
   diberi cincin tipis supaya tetap terlihat di latar gelap TV. */
.tv-photos { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.tv-side.right .tv-photos { justify-content: flex-end; }
.tv-photo {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}
.tv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Nama tim boleh terlipat pada garis miring ("A/B") — tanpa `overflow-wrap`, nama
   panjang di panel yang lebih sempit (3 lapangan sejajar) bisa keluar dari kotaknya. */
.tv-name { display: block; font-size: 1.05rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.tv-club { display: block; font-size: 0.85rem; color: rgba(255, 255, 255, 0.55); overflow-wrap: anywhere; }
.tv-tbd { font-style: italic; color: rgba(255, 255, 255, 0.5); font-size: 0.95rem; }

/* Skor game dan poin berdampingan, keduanya besar (skor game bukan lagi
   tulisan kecil) supaya penonton di lapangan bisa membacanya dari jauh. */
.tv-nums { display: flex; align-items: stretch; gap: 10px; }
.tv-side.right .tv-nums { flex-direction: row-reverse; }
.tv-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 84px;
  padding: 6px 12px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.tv-cell.point { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.22); }
.tv-cell-lbl {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
}
.tv-cell-val { font-variant-numeric: tabular-nums; line-height: 1; font-weight: 800; }
.tv-game { font-size: 3rem; }
.tv-point { font-size: 3.4rem; }
.tv-meta { font-size: 0.9rem; font-weight: 600; color: rgba(255, 255, 255, 0.68); }
.tv-vs { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tv-badge { background: var(--live); color: #2a1010; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 6px; }
.tv-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); }
.tv-small { font-size: 0.75rem; color: rgba(255, 255, 255, 0.55); }
.tv-sets { display: flex; gap: 10px; flex-wrap: wrap; }
.tv-setchip {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 5px 13px;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tv-idle { display: flex; flex-direction: column; gap: 8px; }
.tv-idle-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.5); }
.tv-idle-teams { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tv-idle-teams .tv-name { font-size: 1.1rem; }
.tv-vs.small { font-size: 0.8rem; color: rgba(255, 255, 255, 0.5); }
.tv-idle-meta { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); }
.tv-idle-score { font-size: 1.15rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.tv-panel.is-big .tv-idle-score { font-size: 1.5rem; }
/* "Hasil terakhir": sisi pemenang diberi aksen lime supaya TV di lapangan tetap
   terbaca walau semua laganya sudah selesai (sebelumnya panel kosong). */
.tv-idle-teams .tv-team.is-winner .tv-name { color: var(--brand); }

.tv-panel.is-big .tv-point { font-size: 7rem; }
.tv-panel.is-big .tv-game { font-size: 6rem; }
.tv-panel.is-big .tv-cell { min-width: 150px; padding: 10px 22px 14px; }
.tv-panel.is-big .tv-cell-lbl { font-size: 0.95rem; }
.tv-panel.is-big .tv-name { font-size: 1.8rem; }
.tv-panel.is-big .tv-photo { width: 96px; height: 96px; border-width: 3px; }
.tv-panel.is-big .tv-photos { gap: 12px; margin-bottom: 12px; }
.tv-panel.is-big .tv-club { font-size: 1.1rem; }
.tv-panel.is-big .tv-panel-head h2 { font-size: 1.8rem; }
.tv-panel.is-big .tv-meta { font-size: 1.2rem; }
.tv-panel.is-big .tv-setchip { font-size: 1.7rem; padding: 8px 20px; }

.tv-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}
.tv-foot a { color: rgba(255, 255, 255, 0.75); }

@media (max-width: 900px) {
  .tv-grid, .tv-grid.courts-3, .tv-grid.courts-4 { grid-template-columns: 1fr; }
  .tv-point { font-size: 2.5rem; }
  .tv-game { font-size: 2.2rem; }
  .tv-cell { min-width: 68px; padding: 5px 10px 7px; }
  .tv-panel.is-big .tv-point { font-size: 4.4rem; }
  .tv-panel.is-big .tv-game { font-size: 3.8rem; }
  .tv-photo { width: 44px; height: 44px; }
  .tv-panel.is-big .tv-photo { width: 68px; height: 68px; }
}

/* ==========================================================================
   Tanda tangan kapten (lembar skor)
   ========================================================================== */

.badge.signed { background: rgba(169, 232, 108, 0.13); color: #c6f08f; border-color: rgba(169, 232, 108, 0.32); }
.badge.unsigned { background: rgba(255, 209, 102, 0.12); color: var(--amber); border-color: rgba(255, 209, 102, 0.32); }
.badge.stale { background: rgba(255, 119, 119, 0.14); color: #ff9b9b; border-color: rgba(255, 119, 119, 0.35); }
.warn-text { color: var(--amber); }

.signed-chip { background: rgba(169, 232, 108, 0.13); color: #c6f08f; border-color: rgba(169, 232, 108, 0.32); }
.unsigned-chip { background: rgba(255, 209, 102, 0.12); color: var(--amber); border-color: rgba(255, 209, 102, 0.32); }
.stale-chip { background: rgba(255, 119, 119, 0.14); color: #ff9b9b; border-color: rgba(255, 119, 119, 0.35); }
.statuscell-extra { margin-top: 4px; }

.signcard .card-head { align-items: center; }
.signcard .card-action { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.signsummary {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}
.signsummary.ok { background: rgba(169, 232, 108, 0.13); color: #c6f08f; }
.signsummary.warn { background: rgba(255, 209, 102, 0.12); color: var(--amber); }
.signsummary.info { background: var(--surface-2); color: var(--ink-2); }

.signgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.signbox {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.signbox.is-signed { border-color: rgba(169, 232, 108, 0.32); background: rgba(169, 232, 108, 0.13); }
.signbox.is-stale { border-color: rgba(255, 119, 119, 0.35); background: rgba(255, 119, 119, 0.08); }
.signbox-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.signbox-team { font-weight: 650; }
.signbox-status { font-size: 0.82rem; display: flex; flex-direction: column; gap: 2px; }
.signname { font-weight: 650; }
.signname.struck { text-decoration: line-through; color: var(--muted); }
.signform { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
/* Tombol tanda tangan dipakai kapten di ponsel yang dioper petugas → dibuat
   lebar & tinggi supaya mudah disentuh. */
.signform .btn { width: 100%; padding: 12px 14px; font-size: 0.92rem; }
.signfield { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); width: 100%; }
.signfield input { margin-top: 4px; }
.signagree { font-size: 0.82rem; font-weight: 500; line-height: 1.35; align-items: flex-start; }
.signagree input { margin-top: 2px; }

/* ---------------------------------------------------------------- lembar A4 */

.sheetbody { background: var(--surface-2); }
.sheetbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sheetbar .muted { margin-left: auto; }

.sheet {
  width: 210mm;
  max-width: 100%;
  margin: 18px auto 40px;
  padding: 14mm 12mm;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  font-size: 12px;
}
.sheet-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.sheet-logo { height: 52px; width: auto; max-width: 150px; object-fit: contain; }
.sheet-headtext { min-width: 0; }
.sheet-org { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.sheet-sub { font-size: 11px; color: var(--muted); }
.sheet-doc {
  margin-left: auto;
  text-align: right;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.15;
}
.sheet-doc span { font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }

.sheet-title { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; }
.sheet-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  background: var(--brand-tint);
  color: var(--brand-2);
  border-radius: 6px;
  padding: 2px 8px;
}
.sheet-titletext { font-size: 13px; font-weight: 650; }

.sheet-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.sheet-team.right { text-align: right; }
.sheet-teamno { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.sheet-teamname { font-size: 14px; font-weight: 700; line-height: 1.25; }
.sheet-teamsub { font-size: 11px; color: var(--muted); }
.sheet-teamclub { display: block; }
.sheet-vs { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; }

.sheet-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 0 0 12px;
}
.sheet-metaitem dt { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sheet-metaitem dd { margin: 1px 0 0; font-size: 11.5px; font-weight: 600; }

.sheet-h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  margin: 14px 0 6px;
}
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th, .sheet-table td {
  border: 1px solid var(--line);
  padding: 5px 8px;
  font-size: 11.5px;
  text-align: left;
}
.sheet-table th { background: var(--surface-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.sheet-table td.num, .sheet-table th.num { text-align: center; }
.sheet-table td.big { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet-table.narrow { width: auto; min-width: 46%; }
.sheet-empty { font-size: 12px; color: var(--muted); }

.sheet-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.sheet-summary b { font-size: 14px; }

.sheet-signs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sheet-signbox {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px 12px;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sheet-signbox.signed { border-color: rgba(169, 232, 108, 0.32); background: rgba(169, 232, 108, 0.13); }
.sheet-signbox.stale { border-color: rgba(255, 119, 119, 0.35); background: rgba(255, 119, 119, 0.08); }
.sheet-signlabel { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sheet-signteam { font-size: 11.5px; font-weight: 650; color: var(--ink-2); }
.sheet-signname { font-size: 15px; font-weight: 700; }
.sheet-signline { border-bottom: 1px dotted #4a6a56; height: 34px; }
.sheet-signmeta { font-size: 10px; color: var(--muted); margin-top: auto; }
.sheet-signsub { font-size: 10px; color: var(--muted); }

.sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
  font-size: 10px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .signgrid { grid-template-columns: 1fr; }
  .sheet { padding: 16px; }
  .sheet-meta { grid-template-columns: 1fr 1fr; }
  .sheet-signs { grid-template-columns: 1fr; }
}

/* Cetak: hanya lembarnya yang muncul, navigasi & tombol disembunyikan. */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  .noprint, .topbar, .foot, .subbar { display: none !important; }
  body, .sheetbody { background: var(--surface); }
  .sheet {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  .sheet-signbox { break-inside: avoid; }
  .sheet-signs { break-inside: avoid; }
  /* Tata letak kertas A4 tidak boleh ikut mengecil hanya karena halaman dibuka
     di ponsel: kolom tanda tangan & identitas tetap seperti di desktop. */
  .sheet-meta { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .sheet-signs { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .sheet-teams { grid-template-columns: 1fr auto 1fr !important; }
  a { text-decoration: none; color: inherit; }
}

/* ------------------------------------------- tahap turnamen (tab Info admin) */

.stagestable tr.is-current td { background: rgba(169, 232, 108, 0.13); }
.stagestable td, .stagestable th { padding: 7px 10px; }

/* ------------------------------------------- halaman publik ditutup sementara */

.badge.closed { background: rgba(255, 209, 102, 0.12); color: var(--amber); border-color: rgba(255, 209, 102, 0.32); }

/* Halaman yang dilihat peserta saat halaman publik ditutup sementara. */
.closedpage {
  max-width: 620px;
  margin: 40px auto;
  text-align: center;
}
.closedpage-body { padding: 36px 28px 30px; }
.closedpage-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--muted);
}
.closedpage h1 { font-size: 1.45rem; margin-bottom: 10px; }
.closednote {
  margin: 18px auto 0;
  padding: 16px 18px;
  max-width: 480px;
  text-align: left;
  border: 1px solid rgba(255, 209, 102, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(255, 209, 102, 0.12);
}
.closednote p { margin: 0 0 6px; font-size: 0.92rem; color: var(--ink-2); }
.closednote p:last-child { margin-bottom: 0; }

/* --------------------------------------------------- bagan: lengkapi dari grup */

/* Tombol "Lengkapi bagan dari hasil grup" di bawah form buat bagan. */
.ko-fill-row {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  align-items: flex-start;
}
.baganform .muted.sm { margin-bottom: 6px; }

/* --------------------------------------------------- kode pertandingan */

/* Tabel pratinjau rentang kode per hari/sesi di kartu "Kode pertandingan". */
.koderanges { margin-bottom: 14px; }
.koderanges th, .koderanges td { padding: 7px 10px; }

/* --------------------------------------------------- peserta: tandai & ubah tim */

/* Nama tim yang tidak cocok dengan nama pemain (biasanya berkas revisi). */
.matchwarn {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  border: 1px solid rgba(255, 209, 102, 0.32);
  font-size: 0.68rem;
  font-weight: 650;
  cursor: help;
}
/* Form "Ubah" tim: ringkas, muncul saat dibuka saja. */
.teamedit { display: inline-block; }
.teamedit > summary { cursor: pointer; list-style: none; }
.teamedit > summary::-webkit-details-marker { display: none; }
.teamedit[open] > summary { margin-bottom: 8px; }
.teameditform {
  min-width: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: left;
}

/* --------------------------------------------------- bagan: buka/tutup untuk peserta */

/* Pemberitahuan di halaman publik bagan (belum dibuka panitia). */
.bagannote { margin-bottom: 18px; }

/*
 * Label pengganti untuk laga yang namanya belum boleh tampil (babak gugur sebelum
 * dibuka panitia): yang tampil hanya asal tim, jadi ditulis miring & lebih redup
 * supaya jelas ini bukan nama tim sungguhan.
 */
.tbd-name { font-style: italic; color: var(--muted); }
.team-name .tbd-name { font-style: italic; font-weight: 500; color: var(--muted); }
.ctteam.tbd-name { font-style: italic; color: var(--muted); }
.table tr.is-masked td { background: var(--surface-2); }
/* Bilah khusus admin di halaman publik bagan (hanya terlihat oleh admin). */
.adminbanner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 18px;
  border: 1px dashed var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
}
.adminbanner .btn { flex: none; }
/* Status buka/tutup bagan di tab Info admin. */
.baganstate {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin: 0 0 14px;
}
.baganstate.ok { background: rgba(169, 232, 108, 0.13); color: #c6f08f; }
.baganstate.warn { background: rgba(255, 209, 102, 0.12); color: var(--amber); }

/* ---------------------------------------------------------------- diagnostik */

.logbox {
  max-height: 460px;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  background: #0b1f17;
  color: #c9d6cc;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   JUARA (champion & runner up) — kartu, foto, dan animasi trofi
   ========================================================================== */

/* Trofi mengambang halus + kartu juara berkilau. Semua animasi dimatikan bila
   pengguna mengaktifkan "kurangi gerakan" (lihat @media di bawah). */
@keyframes trophy-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}
@keyframes champ-shine {
  0% { transform: translateX(-120%) rotate(8deg); }
  55%, 100% { transform: translateX(220%) rotate(8deg); }
}
@keyframes champ-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes champ-glow {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.08); }
}

.champ-spotlight .card-head h2 { display: flex; align-items: center; gap: 8px; }
.champ-burst {
  width: 22px; height: 22px; display: inline-block; color: var(--gold);
  animation: trophy-bob 2.8s ease-in-out infinite;
}
.champ-burst svg { width: 100%; height: 100%; display: block; }

.champ-minigrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.champ-mini {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(232, 207, 138, 0.45);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--elevated), rgba(232, 207, 138, 0.10));
  color: var(--ink);
  overflow: hidden;
  animation: champ-in 0.5s ease-out both;
  animation-delay: var(--d, 0s);
}
.champ-mini:hover { text-decoration: none; border-color: var(--gold); }
.champ-mini::after {
  content: '';
  position: absolute;
  top: -40%; left: 0;
  width: 40%; height: 180%;
  background: linear-gradient(90deg, rgba(208, 255, 131, 0) 0%, rgba(208, 255, 131, 0.22) 50%, rgba(208, 255, 131, 0) 100%);
  animation: champ-shine 5s ease-in-out infinite;
  pointer-events: none;
}
.champ-mini-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
}
.champ-mini-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.champ-mini-trophy { flex: 0 0 auto; width: 20px; height: 20px; color: var(--gold); }
.champ-mini-trophy svg { width: 100%; height: 100%; display: block; animation: trophy-bob 2.8s ease-in-out infinite; }
.champ-mini-photo {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(232, 207, 138, 0.45); background: var(--surface);
}
.champ-mini-ini {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.78rem;
  background: rgba(255, 209, 102, 0.12); color: var(--gold); border: 2px solid rgba(232, 207, 138, 0.45);
}
.champ-mini-name { font-weight: 700; overflow-wrap: anywhere; }
.champ-mini-sub { font-size: 0.78rem; color: var(--muted); }
.champ-note { margin: 12px 0 0; font-size: 0.82rem; color: var(--muted); }

.champ-list { display: grid; gap: 18px; }
.champ-intro { margin: 0 0 16px; color: var(--ink-2); font-size: 0.9rem; }

.champ-card {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  animation: champ-in 0.5s ease-out both;
  animation-delay: var(--d, 0s);
}
.champ-card.pending { background: var(--surface-2); }
.champ-card::before {
  content: '';
  position: absolute;
  top: -60%; right: -10%;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 207, 138, 0.22), rgba(232, 207, 138, 0) 70%);
  animation: champ-glow 4.2s ease-in-out infinite;
  pointer-events: none;
}
.champ-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.champ-head h3 { font-size: 1.05rem; }
.champ-chip {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--gold); background: rgba(255, 209, 102, 0.12); border: 1px solid rgba(232, 207, 138, 0.45);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.champ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.champ-slot {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--elevated), var(--surface));
  overflow: hidden;
}
.champ-slot.champion { border-color: rgba(232, 207, 138, 0.45); background: linear-gradient(180deg, var(--elevated), rgba(232, 207, 138, 0.10)); }
.champ-slot.runnerup { border-color: #3f5b49; background: linear-gradient(180deg, var(--elevated), var(--surface)); }
.champ-slot.champion::after {
  content: '';
  position: absolute;
  top: -40%; left: 0;
  width: 35%; height: 180%;
  background: linear-gradient(90deg, rgba(232, 207, 138, 0), rgba(232, 207, 138, 0.30), rgba(232, 207, 138, 0));
  animation: champ-shine 6s ease-in-out infinite;
  pointer-events: none;
}
.champ-icon { width: 30px; height: 30px; color: var(--gold); }
.champ-slot.runnerup .champ-icon { color: #a9b6ac; }
.trophy-svg { width: 100%; height: 100%; display: block; animation: trophy-bob 2.8s ease-in-out infinite; }
.champ-slot.runnerup .trophy-svg { animation-duration: 3.4s; }
.champ-photo {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2); border: 3px solid rgba(232, 207, 138, 0.45);
  font-weight: 700; color: var(--gold);
}
.champ-slot.runnerup .champ-photo { border-color: #3f5b49; color: var(--muted); }
.champ-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.champ-slot.champion .champ-photo { box-shadow: 0 0 0 5px rgba(232, 207, 138, 0.13); }
.champ-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.champ-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.champ-team { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.champ-club, .champ-players { font-size: 0.78rem; color: var(--muted); }
.champ-place {
  position: absolute; top: 8px; right: 10px;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); opacity: 0.9;
}
.champ-slot.runnerup .champ-place { color: #a9b6ac; }
.champ-edit {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 0.76rem;
}
.champ-score { margin: 14px 0 0; font-size: 0.86rem; color: var(--ink-2); }
.champ-admin { margin: 10px 0 0; }

/* Kartu kategori di Ringkasan: penanda juara + foto juara. */
.catcard.has-champ { border-color: rgba(232, 207, 138, 0.45); }
.catcard-champ {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 0.82rem;
}
.catcard-photo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(232, 207, 138, 0.45); }
.catcard-cup { font-size: 1.1rem; }
.catcard-champ-name { font-weight: 700; }
.catcard-runner { color: var(--muted); font-size: 0.76rem; }

/* Kartu kelola juara di dashboard admin (tab Peserta & Grup). */
.champadmin {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.champadmin .subh { margin-top: 0; }
.champadmin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.champadmin-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.champadmin-photo {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(232, 207, 138, 0.45); background: var(--surface-2);
}
.champadmin-photo.empty { display: grid; place-items: center; font-size: 1.2rem; }
.champadmin-label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.champadmin-name { display: block; font-size: 0.9rem; }

/* Animasi dimatikan bagi pengguna yang memilih "kurangi gerakan". */
@media (prefers-reduced-motion: reduce) {
  .trophy-svg, .champ-burst, .champ-mini-trophy svg, .champ-card, .champ-card::before,
  .champ-mini, .champ-mini::after, .champ-slot.champion::after {
    animation: none !important;
  }
}

/* ==========================================================================
   REDESIGN UI/UX — "DARK GREEN & NEON LIME"
   --------------------------------------------------------------------------
   Lapisan penyempurnaan di atas komponen yang sudah ada. Sengaja diletakkan
   SEBELUM blok "LAYAR PONSEL PESERTA" di bawah, supaya aturan ponsel tetap
   menang pada layar kecil (urutan cascade: dasar → penyempurnaan → ponsel).

   Prinsip:
   - latar hijau sangat gelap, kartu hijau tua, garis tipis hijau;
   - neon lime HANYA untuk aksi utama, skor pemimpin, status live, elemen
     terpilih, progres, dan angka penting — bukan untuk semua teks;
   - radius 12–18px, bayangan minimal, tanpa efek 3D/glassmorphism.
   Jangan menyalin warna hex di komponen lain: pakai variabel di :root.
   ========================================================================== */

/* ---------------------------------------------------------------- dasar */
html { background: var(--bg); color-scheme: dark; }

body {
  background:
    radial-gradient(1100px 520px at 10% -14%, rgba(52, 118, 83, 0.28), transparent 62%),
    radial-gradient(880px 460px at 96% -6%, rgba(208, 255, 131, 0.07), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

::selection { background: rgba(208, 255, 131, 0.28); color: var(--ink); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4, h5 { letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.06rem; font-weight: 700; }

a { color: var(--brand); }
a:hover { text-decoration: none; }
.strong { color: var(--ink); }

/* batang gulir gelap (desktop) */
* { scrollbar-color: #33543f var(--surface-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: #33543f; border-radius: 999px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  background: rgba(9, 26, 19, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-inner { min-height: 62px; }
.brand { color: var(--ink); gap: 11px; }
.brand-text {
  font-size: 0.99rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
/* tinggi logo TIDAK diubah (26px) supaya konsisten dengan uji ukuran logo */
.brand-logo { color: var(--ink); }
.topnav { gap: 4px; }
.topnav a, .topnav .linklike {
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.topnav a:hover, .topnav .linklike:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.topnav a.active {
  background: var(--brand-tint);
  border-color: rgba(208, 255, 131, 0.4);
  color: var(--brand);
}

/* Sapaan + avatar di topbar (hanya dirender bila admin sedang login). */
.topuser { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topuser-hello {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
}
.topuser-hello b { font-size: 0.82rem; color: var(--ink); font-weight: 700; }
.topavatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  border: 1px solid rgba(208, 255, 131, 0.5);
}
.topavatar:hover { text-decoration: none; filter: brightness(1.06); }

/* ---------------------------------------------------------------- subbar */
.subbar {
  background: linear-gradient(180deg, var(--bg-2), rgba(16, 41, 31, 0.6));
  border-bottom: 1px solid var(--line);
}
.subbar.admin { border-bottom: 1px solid var(--line); }
.subbar-top { padding: 18px 0 12px; }
.t-title { font-size: 1.32rem; font-weight: 800; }
.t-logo { height: 52px; border-radius: 10px; }

/* Tab: bisa digeser di ponsel, penanda aktif neon lime. */
.tabs { gap: 2px; padding-bottom: 1px; }
.tab {
  padding: 11px 13px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
}
.tab:hover { color: var(--ink); background: rgba(208, 255, 131, 0.05); text-decoration: none; }
.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: rgba(208, 255, 131, 0.07);
  font-weight: 700;
}

/* ---------------------------------------------------------------- layout */
.page { gap: 22px; padding-top: 22px; padding-bottom: 64px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(11, 31, 23, 0.28);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-head h2 { font-size: 1rem; font-weight: 700; }
.card-body { padding: 20px; }
.card.danger-card { border-color: rgba(255, 119, 119, 0.4); }

.section { gap: 14px; }
.section-head { gap: 10px; align-items: center; }
.section-head h2 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
/* penanda kecil neon di depan judul bagian */
.section-head h2::before {
  content: '';
  width: 4px; height: 17px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  display: inline-block;
}
.section-head .muted {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.colh, .subh { color: var(--muted); letter-spacing: 0.09em; font-weight: 700; }
.hint, .legend { color: var(--muted); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(620px 320px at 88% -10%, rgba(208, 255, 131, 0.16), transparent 65%),
    linear-gradient(155deg, #14392b 0%, #0d2419 62%, #0b1f17 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 44px 34px 40px;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}
.hero .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(208, 255, 131, 0.35);
  background: rgba(208, 255, 131, 0.1);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.hero .hero-title {
  margin: 0 0 12px;
  font-size: clamp(1.85rem, 4.4vw, 2.75rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 18ch;
}
.hero .hero-title .hero-tagline-end { color: var(--brand); }
.hero .hero-sub {
  color: var(--ink-2);
  font-size: 1rem;
  max-width: 54ch;
  margin: 0;
}
.hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats b { font-size: 1.32rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.hero-stats span { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; }

/* ---------------------------------------------------------------- tombol */
.btn {
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.06s ease,
    box-shadow 0.14s ease;
}
.btn:hover { background: var(--elevated); border-color: #3a5a47; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(208, 255, 131, 0.16);
}
.btn.primary:hover { background: #dcffa4; border-color: #dcffa4; color: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface); border-color: #3a5a47; }
.btn.danger, .btn.danger-ghost { color: #ff9b9b; border-color: rgba(255, 119, 119, 0.4); background: transparent; }
.btn.danger { background: var(--live); border-color: var(--live); color: #2a1010; font-weight: 700; }
.btn.danger:hover { background: #ff8f8f; border-color: #ff8f8f; }
.btn.sm { min-height: 32px; padding: 6px 11px; font-size: 0.79rem; }
/* Tombol di dalam form tanda tangan kapten tetap besar (dipakai sambil berdiri di
   lapangan): aturan ini sengaja ditulis SETELAH `.btn.sm` supaya tidak tertimpa. */
.signform .btn { padding: 12px 14px; font-size: 0.92rem; min-height: 46px; }
.btn.big { min-height: 52px; padding: 14px 22px; font-size: 1rem; border-radius: 14px; }
.danger-text { color: #ff9b9b; }
.hero .btn.ghost { border-color: rgba(208, 255, 131, 0.42); color: var(--brand); background: transparent; }
.hero .btn.ghost:hover { background: rgba(208, 255, 131, 0.12); border-color: var(--brand); }

/* ---------------------------------------------------------------- pil / chip */
.pill {
  padding: 7px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 600;
}
.pill:hover { border-color: #3a5a47; color: var(--ink); text-decoration: none; }
.pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}
.pill .pill-count { background: rgba(11, 31, 23, 0.35); color: var(--ink-2); }
.pill.active .pill-count { background: rgba(11, 31, 23, 0.18); color: var(--brand-ink); }

.dayfilter {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.chip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 8px;
}

/* ---------------------------------------------------------------- flash + badge */
.flash { border-radius: var(--radius-sm); font-weight: 500; }
.flash.ok { background: rgba(169, 232, 108, 0.12); border-color: rgba(169, 232, 108, 0.34); color: #d8fab0; }
.flash.error { background: rgba(255, 119, 119, 0.12); border-color: rgba(255, 119, 119, 0.34); color: #ffb4b4; }
.flash.warn { background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.34); color: #ffe0a0; }

.badge {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* LIVE memakai neon lime (bukan merah): sesuai design system, merah untuk galat. */
.badge.live {
  background: rgba(208, 255, 131, 0.16);
  border-color: rgba(208, 255, 131, 0.5);
  color: var(--brand);
}
.badge.done { background: rgba(169, 232, 108, 0.12); border-color: rgba(169, 232, 108, 0.32); color: #c6f08f; }
.badge.scheduled { background: var(--surface-2); color: var(--muted); }
.badge.bye { background: rgba(168, 155, 255, 0.14); border-color: rgba(168, 155, 255, 0.32); color: #c3b8ff; }
.badge.ko, .badge.group {
  background: var(--brand-tint);
  border-color: rgba(208, 255, 131, 0.3);
  color: var(--brand);
}
.livedot { background: var(--brand); }

/* ---------------------------------------------------------------- formulir */
input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 42px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(208, 255, 131, 0.16);
}
select option { background: var(--surface-2); color: var(--ink); }
.vform label, label.check { color: var(--ink-2); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); min-height: 0; }

/* ---------------------------------------------------------------- tabel */
.table { font-size: 0.87rem; }
.table th {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.09em;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.table td { border-bottom: 1px solid var(--line-2); }
.table tbody tr:hover { background: rgba(208, 255, 131, 0.04); }
/* baris penting (pemimpin klasemen / hasil baru) diberi semburat lime tipis */
.standings tr.qualified, .standings.clubtable tr.is-leader,
.ranktable tr.is-top-1, .stagestable tr.is-current td, .citable tr.row-in {
  background: rgba(208, 255, 131, 0.08);
}
.ranktable tr.is-top-2, .ranktable tr.is-top-3 { background: var(--surface-2); }
.table tr.is-masked td { background: var(--surface-2); }

/* ---------------------------------------------------------------- kartu turnamen */
.tcard {
  background: linear-gradient(180deg, var(--surface), #16362a);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.tcard:hover {
  border-color: rgba(208, 255, 131, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  transform: translateY(-2px);
}
.tcard-top h3 { font-size: 1.03rem; font-weight: 700; }
.tcard-meta { color: var(--muted); font-size: 0.83rem; }
.tcard-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tcard-foot { border-top: 1px solid var(--line-2); color: var(--muted); }
.tcard-foot b { color: var(--ink); font-weight: 700; }
.tcard-flyer {
  border-radius: 12px;
  border: 1px solid var(--line);
}

.catcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.catcard:hover { border-color: rgba(208, 255, 131, 0.45); background: var(--elevated); text-decoration: none; }
.catcard-top h4 { font-weight: 700; }

.progress { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; height: 20px; }
.progress-bar {
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  border-right: 0;
  border-radius: 999px 0 0 999px;
}
.progress-text { color: var(--ink-2); font-weight: 700; font-size: 0.71rem; }

/* ---------------------------------------------------------------- statistik */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}
.stat-num { font-size: 1.6rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat-label { color: var(--muted); letter-spacing: 0.09em; font-weight: 700; font-size: 0.72rem; }

/* ---------------------------------------------------------------- kartu laga */
.match {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
a.match:hover { border-color: rgba(208, 255, 131, 0.42); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32); }
.match-side.won .team-name { color: var(--brand); }
.match-score { font-weight: 800; }
.matchcode {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--brand);
  font-weight: 700;
}
.warn-note { background: rgba(255, 209, 102, 0.12); border: 1px solid rgba(255, 209, 102, 0.32); color: #ffe0a0; }
.courthero { background: var(--surface); border-radius: var(--radius); }

/* ---------------------------------------------------------------- papan skor live */
.liveboard {
  background:
    radial-gradient(560px 260px at 90% -10%, rgba(208, 255, 131, 0.14), transparent 62%),
    linear-gradient(165deg, #10291f, #0b1f17 72%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}
.liveboard .badge.live { background: rgba(208, 255, 131, 0.16); border-color: rgba(208, 255, 131, 0.5); color: var(--brand); }
.liveboard .badge.done { background: var(--brand-tint); color: var(--brand); }
.liveboard .chip { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.lbside {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
/* tim yang sedang memimpin disorot lime; lawan tetap terang & terbaca */
.lbside.is-ahead { border-color: rgba(208, 255, 131, 0.55); background: rgba(208, 255, 131, 0.08); }
.lbside.is-ahead .team-name { color: var(--brand); }
.lbnum { border-radius: 12px; background: var(--surface); border-color: var(--line); }
.lbnum.point { background: var(--elevated); border-color: #3a5a47; }
.lbnum.advantage { border-color: var(--brand); box-shadow: 0 0 0 1px rgba(208, 255, 131, 0.35) inset; }
.lbpoint.advantage { color: var(--brand); }
.setchip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.setchip.current { background: rgba(208, 255, 131, 0.12); border-color: rgba(208, 255, 131, 0.4); }
.setchip.current .dot { color: var(--brand); }
.setchip i { color: var(--ink); }
/* Tombol poin: sasaran sentuh besar, jarak longgar, umpan balik singkat. */
.lbpt-btn {
  background: var(--brand);
  color: var(--brand-ink);
  border: 1px solid var(--brand);
  border-radius: 14px;
  font-weight: 800;
  min-height: 74px;
  transition: transform 0.06s ease, filter 0.12s ease;
}
.lbpt-btn:hover { background: #dcffa4; filter: none; }
.lbpt-btn:active { transform: scale(0.985); filter: brightness(0.95); }
.lbpt-btn.alt { background: var(--surface); color: var(--ink); border-color: #3a5a47; }
.lbpt-btn.alt:hover { background: var(--elevated); }
.liveboard .btn.ghost { color: var(--ink); border-color: #3a5a47; }
.liveboard .btn.ghost:hover { background: var(--surface); border-color: var(--brand); }
.phist.s1 { background: rgba(208, 255, 131, 0.2); color: var(--brand); }

/* ---------------------------------------------------------------- papan TV */
.tv-body { background: #071410; }
.tv-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; }
.tv-panel.is-live { border-color: rgba(208, 255, 131, 0.5); box-shadow: 0 0 0 1px rgba(208, 255, 131, 0.22); }
.tv-panel.is-live .tv-point, .tv-livecount { color: var(--brand); }
.tv-badge { background: var(--brand); color: var(--brand-ink); }

/* ---------------------------------------------------------------- kaki halaman */
.foot {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.foot-inner { padding: 22px 20px; font-size: 0.82rem; }
.foot-logo { color: var(--ink); height: 20px; }
.foot-brand { color: var(--ink-2); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }

/* ---------------------------------------------------------------- lembar A4 tetap TERANG */
/* Kertas skor dicetak di atas kertas putih: variabel tema di dalamnya
   dikembalikan ke nilai terang supaya teks tidak hilang saat dicetak. */
.sheetbody { background: var(--bg); }
.sheetbar { background: var(--bg-2); border-bottom: 1px solid var(--line); color: var(--ink); }
.sheet {
  --ink: #0e1726;
  --ink-2: #33415c;
  --muted: #6b7789;
  --line: #d8dee7;
  --line-2: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --brand: #0d5348;
  --brand-2: #0d5348;
  --brand-tint: #eaf6f1;
  --radius-sm: 8px;
  background: #fff;
  color: var(--ink);
}
@media print {
  .sheetbody, body { background: #fff; }
}

/* ==========================================================================
   LAYAR PONSEL PESERTA (≤ 640px) — tampilan dipadatkan dan tabel lebar
   diubah menjadi KARTU BERTUMPUK supaya peserta tidak perlu menggeser
   halaman ke samping.
   ========================================================================== */

@media (max-width: 640px) {
  /* ---------- pemadatan umum ---------- */
  .wrap { padding: 0 12px; }
  .page { padding: 12px 0 28px; }
  .topbar-inner { padding: 8px 0; }
  /*
   * Tautan topbar (Turnamen / Ranking / Dashboard / Keluar) boleh TURUN KE BARIS
   * berikutnya di layar kecil. Tanpa ini, empat tautan mendorong lebar halaman
   * melewati viewport (terukur 440px di viewport 390px pada halaman publik
   * turnamen saat admin sedang login).
   */
  .topbar-inner { flex-wrap: wrap; row-gap: 2px; }
  .topnav { flex-wrap: wrap; justify-content: flex-end; }
  .topnav a, .topnav .linklike { padding: 5px 8px; font-size: 0.82rem; }
  .brand-text { font-size: 0.95rem; }
  .subbar { padding: 12px 0 0; }
  .subbar-top { gap: 8px; }
  .t-title { font-size: 1.05rem; }
  .t-logo { width: 34px; height: 34px; }
  .meta-row { font-size: 0.74rem; gap: 8px; }
  .tabs { gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { padding: 7px 9px; font-size: 0.8rem; white-space: nowrap; }
  .pills { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .pill { padding: 4px 9px; font-size: 0.78rem; white-space: nowrap; }
  .card { border-radius: 10px; }
  .card-head { padding: 10px 12px; }
  .card-head h2 { font-size: 0.95rem; }
  .card-body { padding: 12px; }
  .card-body.tight { padding: 12px; }
  .section-head h2 { font-size: 1rem; }
  .section { margin-bottom: 18px; }
  .hint, .legend { font-size: 0.74rem; line-height: 1.45; }
  .kv dt, .kv dd { font-size: 0.8rem; }
  .catgrid { gap: 10px; }
  .catcard { padding: 11px; }
  .tgrid { gap: 10px; }
  .tcard { padding: 12px; }
  .tcard h3 { font-size: 0.98rem; }
  .match { padding: 10px; gap: 8px; }
  .match-side { font-size: 0.86rem; }
  .match-foot .chip, .match-top .chip { font-size: 0.68rem; padding: 1px 6px; }
  .baselist { padding-left: 16px; }
  /* Sembunyikan keterangan yang berulang di layar kecil supaya tidak berdesakan:
     teks penjelasan panjang tetap tersedia di desktop. */
  .bracket-hint, .ctsched-hint { font-size: 0.72rem; }
  .champadmin-grid, .champ-grid { grid-template-columns: 1fr; gap: 10px; }
  .champ-minigrid { grid-template-columns: 1fr; gap: 10px; }
  .champ-card { padding: 13px; }
  .champ-slot { padding: 11px; gap: 9px; grid-template-columns: auto auto 1fr; }
  .champ-photo { width: 52px; height: 52px; }
  .champ-team { font-size: 0.92rem; }

  /* ---------- tabel → kartu bertumpuk ---------- */
  .table.stack { font-size: 0.84rem; }
  .table.stack thead { display: none; }
  .table.stack,
  .table.stack tbody,
  .table.stack tr,
  .table.stack td { display: block; width: 100%; }
  .table.stack tr {
    padding: 9px 11px;
    margin: 0 0 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
  }
  .table.stack tr:last-child { margin-bottom: 0; }
  .table.stack tr:hover { background: var(--surface); }
  .table.stack td { border: 0; padding: 1px 0; text-align: left; max-width: none; white-space: normal; }
  .table.stack td:empty { display: none; }

  /* Baris label+angka (klasemen, detail set, laga tanpa lapangan). */
  .table.stack td[data-label]:not([data-label='']) {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-variant-numeric: tabular-nums;
  }
  .table.stack td[data-label]:not([data-label=''])::before {
    content: attr(data-label) ':';
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
  }

  /* Klasemen: dua baris per tim (peringkat + nama, lalu ringkasan angka). */
  .table.stack.standings tr { position: relative; }
  .table.stack.standings td.rankcell {
    display: inline-block;
    width: auto;
    margin-right: 6px;
    font-weight: 700;
    color: var(--brand-2);
  }
  .table.stack.standings td.rankcell::before { content: none; }
  .table.stack.standings td.teamcell { display: inline-block; width: auto; max-width: calc(100% - 30px); vertical-align: top; }
  .table.stack.standings td:not(.rankcell):not(.teamcell) { display: none; }
  .table.stack.standings tr.qualified { box-shadow: inset 3px 0 0 var(--brand); }
  .table.stack.standings .played-mini { display: inline; margin-left: 6px; }
  .mobstat { display: block; margin-top: 3px; font-size: 0.76rem; color: var(--muted); }
  .mobstat .mobform { margin-left: 4px; }

  /* Daftar laga: keterangan (kode/babak/lapangan/jadwal/status) di baris pertama. */
  .table.stack.matches tr,
  .table.stack tr.mrow { padding: 10px 11px; }
  .table.stack.matches td.codecell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .table.stack.matches .mobmeta { display: block; flex: 1 1 100%; font-size: 0.72rem; color: var(--muted); }
  .table.stack.matches td.metacell,
  .table.stack.matches td.whencell-td,
  .table.stack.matches td.statuscell { display: none; }
  .table.stack.matches td.tcell { font-size: 0.88rem; }
  .table.stack.matches td.tcell.right { text-align: left; }
  .table.stack.matches td.scorecell { font-size: 0.95rem; font-weight: 700; color: var(--brand-2); }
  .table.stack.matches td.actcell { margin-top: 6px; text-align: left; }
  .table.stack.matches .formcell-hide { display: none; }

  /* Jadwal per lapangan: satu kartu per jam, nama lapangan jadi label. */
  .table.stack.ctimeline tr { padding: 8px 10px; }
  .table.stack.ctimeline td.cttime {
    display: block;
    font-size: 0.95rem;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--line-2);
    margin-bottom: 6px;
  }
  .table.stack.ctimeline td.cttime::before { content: none; }
  .table.stack.ctimeline td.ctcell {
    display: block;
    min-width: 0;
    padding: 5px 0 5px 9px;
    border-left: 3px solid var(--line-2);
  }
  .table.stack.ctimeline td.ctcell + td.ctcell { margin-top: 4px; }
  .table.stack.ctimeline td.ctcell::before {
    content: attr(data-court);
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-2);
  }
  .table.stack.ctimeline td.ctcell.ctempty { display: none; }
  .table.stack.ctimeline td.ctcell.is-clash { border-left-color: var(--live); }
  .table.stack.ctimeline .ctentry + .ctentry { margin-top: 6px; padding-top: 6px; }
}

/* `.mobstat` (ringkasan angka klasemen) & `.mobmeta` (keterangan laga) hanya
   dipakai pada tampilan bertumpuk layar kecil. Ditulis sebagai media query
   supaya tidak menimpa aturan tampilan di dalam blok ≤640px di atas. */
@media (min-width: 641px) {
  .mobstat, .mobmeta { display: none; }
}

/* ==========================================================================
   PENDAFTARAN PESERTA & SCREENING LEVEL PEMAIN
   ========================================================================== */

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.regfieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 0 0 18px;
  background: var(--surface-2);
}
.regfieldset legend {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 8px;
  color: var(--brand-2);
}
.regform .regfieldset .grid2 { margin-bottom: 0; }

/* Kartu satu pendaftaran (daftar admin). */
.reglist { display: grid; gap: 18px; }
.regcard {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.regcard.status-pending { border-left: 4px solid var(--gold); }
.regcard.status-approved { border-left: 4px solid var(--brand); }
.regcard.status-rejected { border-left: 4px solid var(--live); opacity: 0.86; }
.regcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}
.regcode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  color: var(--brand-2);
}
.regcard-body { padding: 14px 16px; display: grid; gap: 14px; }
.regcard-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}
.regapprove select { max-width: 190px; }

/* Satu pemain di dalam kartu. */
.regplayer { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.regplayer-body { display: grid; gap: 3px; min-width: 0; }
.regplayer-name { font-size: 0.95rem; }
.regplayer-meta { overflow-wrap: anywhere; }
.regplayer-screen { margin-top: 3px; }
.regplayer-exp { margin-top: 2px; }
.reg-photo {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); background: var(--surface-2);
}
.reg-photo.empty {
  display: grid; place-items: center; font-weight: 700; color: var(--muted);
  font-size: 1.1rem;
}

.regcard-suggest {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.85rem;
}
.regreasons { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.82rem; }
.regreasons li { margin-bottom: 2px; }

.regcta .card-head { background: linear-gradient(90deg, var(--brand-tint), var(--surface)); }

@media (max-width: 720px) {
  .regcard-head { flex-direction: column; align-items: flex-start; }
  .regplayer { grid-template-columns: auto 1fr; }
  .regapprove select { max-width: none; width: 100%; }
  .regcard-actions .btn, .regcard-actions form { width: 100%; }
  .regcard-actions form.inline { display: block; }
}

/* Pencocokan otomatis provinsi dari nomor KTP di formulir. */
#provhint1, #provhint2 { display: block; margin-top: 3px; }

/* ==========================================================================
   SCREENING PEMAIN (verifikasi kategori)
   ========================================================================== */

/* --- penanda band (Beginner/Bronze/Silver) --- */
.bandchip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--line-2);
  color: var(--ink-2);
}
.bandchip.band-beginner { background: rgba(169, 232, 108, 0.13); border-color: rgba(169, 232, 108, 0.32); color: #c6f08f; }
.bandchip.band-bronze { background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.32); color: var(--amber); }
.bandchip.band-silver { background: rgba(150, 180, 255, 0.12); border-color: rgba(150, 180, 255, 0.30); color: #b9cdf0; }

.riskchip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 119, 119, 0.14);
  border: 1px solid rgba(255, 119, 119, 0.35);
  color: #ff9b9b;
  margin: 0 3px 3px 0;
  white-space: nowrap;
}

/* --- wizard peserta --- */
.scsteps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 16px 0 20px;
  padding: 0;
}
.scsteps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
}
.scsteps li.active { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-2); font-weight: 650; }
.scsteps li.done { border-color: rgba(169, 232, 108, 0.32); color: var(--brand-2); }
.scstep-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--line-2);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-2);
}
.scsteps li.active .scstep-n { background: var(--brand); color: var(--brand-ink); }

.scqlist { display: grid; gap: 16px; }
.scq { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.scq-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.scq-opts { display: grid; gap: 6px; }
.scq-opt {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 500;
  font-size: 0.84rem;
  cursor: pointer;
}
.scq-opt input { margin-top: 2px; }
.scq-opt.sel, .scq-opt:hover { border-color: var(--brand); background: var(--brand-tint); }
.scq-opt b { color: var(--brand-2); }

.scsum .table { margin-bottom: 12px; }
.rubricbox { margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.rubricbox summary { cursor: pointer; font-weight: 650; color: var(--brand-2); font-size: 0.88rem; }
.rubricbox .table { margin-top: 10px; }
.subcard { margin: 16px 0; border: 1px solid rgba(169, 232, 108, 0.32); box-shadow: none; }
.sclane .card-head { background: linear-gradient(90deg, var(--brand-tint), var(--surface)); }

.schistory { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.schistory-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; }

.scstatus { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 14px 0; }
.scstatus > div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px; }
.scstatus span { display: block; }

/* --- blok screening di kartu pendaftaran admin --- */
.scblock { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.scblock-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.sclink { margin-top: 8px; }
.sclink .copyrow { margin-top: 6px; }

/* --- dashboard panitia --- */
.scstats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.scstat {
  flex: 1 1 120px;
  min-width: 116px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
  color: var(--ink);
  display: block;
}
.scstat:hover { text-decoration: none; border-color: var(--brand); }
.scstat.active { border-color: var(--brand); background: var(--brand-tint); }
.scstat.warn .scstat-n { color: #ff9b9b; }
.scstat.ok .scstat-n { color: var(--brand); }
.scstat-n { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
.scstat-l { display: block; font-size: 0.76rem; color: var(--muted); }

.scfilter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 18px;
}
.scfilter label { display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.scfilter .actions { grid-column: 1 / -1; }
.scpages { margin-top: 14px; align-items: center; }
.scpages .pill.disabled { opacity: 0.45; pointer-events: none; }

.scdash td { vertical-align: top; }

.scrisk { margin: 0 0 10px; padding-left: 18px; font-size: 0.86rem; }
.scrisk li { margin-bottom: 8px; }
.scrisk li > div { color: var(--ink-2); font-size: 0.82rem; }

.scratetable { display: grid; gap: 8px; }
.scraterow {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(90px, 0.6fr) minmax(180px, 2fr);
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-2);
}
.scraterow .scr-l { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.scrateform { margin-top: 10px; }

@media (max-width: 720px) {
  .scsteps { gap: 6px; }
  .scsteps li { font-size: 0.74rem; padding: 5px 10px 5px 6px; }
  .scstat { flex: 1 1 calc(50% - 12px); min-width: 0; }
  .scraterow { grid-template-columns: 1fr; gap: 4px; }
  .scfilter { grid-template-columns: 1fr; }
}

/* Catatan sistem screening (mis. level dinaikkan karena pemain adalah pelatih). */
.scnotice { margin: 0 0 10px; padding-left: 18px; font-size: 0.86rem; }
.scnotice li { margin-bottom: 8px; }
.scnotice li > div { color: var(--ink-2); font-size: 0.82rem; }
.noticechip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(150, 180, 255, 0.12);
  border: 1px solid rgba(150, 180, 255, 0.30);
  color: #b9cdf0;
  margin: 0 3px 3px 0;
  white-space: nowrap;
}


/* ==========================================================================
   JERSEY: acuan desain/size chart + ukuran tiap pemain
   ========================================================================== */

/* Blok acuan di formulir pendaftaran peserta. */
.jerseyref .jerseyref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.jerseyfig { margin: 0; }
.jerseyfig img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.jerseyfig figcaption {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

/* Panel panitia: dua slot unggahan berdampingan. */
.jerseyadmin {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.jerseyslot { min-width: 0; }
.jersey-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 10px;
}
.jersey-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 10px;
  background: var(--surface-2);
}

/* Ukuran jersey pada daftar pendaftar panitia. */
.jerseyline {
  grid-column: 1 / -1;
  margin: 0 0 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.84rem;
  color: var(--ink-2);
}
.jerseychip {
  display: inline-block;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--brand-tint);
  border: 1px solid rgba(169, 232, 108, 0.32);
  color: var(--brand-2);
  font-size: 0.8rem;
}
.jerseymissing { color: #ff9b9b; font-weight: 600; }

/* ==========================================================================
   PANITIA, CHECK-IN, ID CARD & FLYER
   ========================================================================== */

/* --- daftar panitia --- */
.cmrow { display: flex; align-items: center; gap: 10px; }
.cmphoto {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: 0 0 auto;
  background: var(--surface);
}
.cmphoto.empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-tint);
  color: var(--brand-2);
  font-weight: 700;
}
.cmactions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filebtn {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--brand-2);
}
.filebtn input[type='file'] { display: none; }
.filebtn:hover { border-color: var(--brand); background: var(--brand-tint); }

/* --- dashboard check-in --- */
.cistats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.cistat {
  flex: 1 1 130px;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
}
.cistat.ok { border-color: rgba(169, 232, 108, 0.32); background: var(--brand-tint); }
.cistat-n { display: block; font-size: 1.4rem; font-weight: 700; line-height: 1.15; }
.cistat.ok .cistat-n { color: var(--brand); }
.cistat-l { display: block; font-size: 0.76rem; color: var(--muted); }
.bar {
  display: inline-block;
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.bar-fill { display: block; height: 100%; background: var(--brand); }
.citable tr.row-in { background: rgba(169, 232, 108, 0.13); }
.citable .badge { white-space: nowrap; }

/* --- alat cetak ID card --- */
.idcardtool { margin-top: 6px; }
.idcard-status { min-height: 20px; font-size: 0.84rem; color: var(--muted); margin: 10px 0; }
.idcard-status.ok { color: var(--brand-2); font-weight: 600; }
.idcard-status.warn { color: var(--amber); }
.idcard-status.error { color: #ff9b9b; font-weight: 600; }
.idcard-preview { margin-top: 6px; }
.idcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.idcard-box { min-width: 0; }
.idcard-canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--surface);
  display: block;
}
.idcard-caption { font-size: 0.75rem; color: var(--muted); margin-top: 6px; text-align: center; }
.idcard-more { grid-column: 1 / -1; }
.idcard-preview:empty { display: none; }

/* --- flyer --- */
.flyer-preview {
  max-width: 220px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
/*
 * Flyer di halaman publik: ditampilkan UTUH.
 * Jangan memakai `object-fit: cover` atau tinggi tetap di sini — gambar poster
 * jadi terpotong (keluhan panitia). `width: auto` + `max-width/max-height` membuat
 * gambar mengecil mengikuti skalanya sendiri tanpa memotong.
 */
.flyer-full {
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
/* Flyer kecil di kartu beranda: juga UTUH (contain) supaya poster tidak terpotong. */
.tcard-flyer {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: contain;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}
.tcard.has-flyer .tcard-top { padding-top: 12px; }

@media (max-width: 640px) {
  .idcard-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .cistat { flex: 1 1 calc(50% - 12px); min-width: 0; }
  .flyer-full { max-width: 100%; }
}

/* --- halaman pindai QR: tombol besar supaya mudah ditekan di lapangan --- */
.ci-scan .btn.big {
  display: block;
  width: 100%;
  padding: 18px 20px;
  font-size: 1.15rem;
  border-radius: 12px;
}
.ci-actions { margin-top: 14px; }
.ci-scan .kv dt { color: var(--muted); }
.ci-scan .kv dd { font-size: 1rem; }
@media (max-width: 640px) {
  .flyer-full { max-height: none; }
}

/* --- check-in per pemain (dashboard & halaman pindai) --- */
.ciplayers { display: grid; gap: 4px; margin: 6px 0 4px; }
.ciplayer { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ciplayer-name { font-size: 0.82rem; color: var(--muted); }
.ciplayer.in .ciplayer-name { color: var(--brand-2); font-weight: 650; }
.ci-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 12px; }
.ci-playerlist { display: grid; gap: 10px; }
.ciplayer-line {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.ciplayer-line .ciplayer-name { font-size: 0.95rem; color: var(--ink-2); }
.ciplayer-line .ciplayer-name.in { color: var(--brand-2); }
.ciplayer-line .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .ciplayer-line { flex-wrap: wrap; }
  .ciplayer-line .btn { width: 100%; }
}

/* Penjelasan tambahan yang bisa dibuka-tutup (mis. cara pembacaan klasemen). */
.legendmore { margin-top: 6px; }
.legendmore summary { cursor: pointer; font-weight: 600; color: var(--brand); font-size: 0.78rem; }
.legendmore summary:hover { text-decoration: underline; }

/* ==========================================================================
   (permintaan panitia) Hero beranda, footer, & klasemen publik yang lengkap
   ========================================================================== */

/* (4) Keterangan beranda: empat baris, rapi di ponsel & laptop. */
.hero-tagline {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  font-size: 0.98rem;
  color: var(--ink-2);
}
.hero-tagline span { display: block; }
.hero-tagline-end { font-weight: 650; color: var(--brand-2); margin-top: 4px; }

/* (4) Footer: baris keterangan bertumpuk rapi (bukan satu baris memanjang). */
.foot-taglines { display: grid; gap: 1px; line-height: 1.45; }
.foot-taglines b { font-weight: 700; color: var(--ink); }
.foot-taglines span { font-size: 0.82rem; color: var(--muted); }

/*
 * (5) Klasemen halaman PUBLIK: tetap TABEL LENGKAP di ponsel (semua kolom), dapat
 * digeser ke samping di dalam `.tablewrap`. Aturan `.table.stack` (kartu bertumpuk)
 * sengaja di-override HANYA untuk tabel dengan kelas `.fulltable`, karena peserta
 * ingin melihat angka klasemen lengkap tanpa harus membuka apa pun.
 */
.tablewrap-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .table.fulltable,
  .table.fulltable tbody,
  .table.fulltable tr,
  .table.fulltable td,
  .table.fulltable th { display: revert; width: auto; }
  .table.fulltable { display: table; width: 100%; font-size: 0.82rem; }
  .table.fulltable thead { display: table-header-group; }
  .table.fulltable tbody { display: table-row-group; }
  .table.fulltable tr { display: table-row; margin: 0; border: 0; box-shadow: none; background: transparent; }
  .table.fulltable th, .table.fulltable td {
    display: table-cell;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line-2);
    text-align: center;
    white-space: nowrap;
  }
  .table.fulltable th:first-child, .table.fulltable td:first-child { padding-left: 4px; }
  .table.fulltable td.teamcell { text-align: left; white-space: normal; min-width: 132px; }
  /* Judul kolom tetap tampil (mode kartu menyembunyikannya). */
  .table.fulltable th::before, .table.fulltable td::before { content: none !important; }
}

/* ==========================================================================
   (permintaan panitia) Saran memutar ponsel ke posisi MENDATAR di halaman peserta
   ========================================================================== */

/* Bawaan: tidak tampil (desktop, tablet, ponsel mendatar, atau sudah ditutup). */
.rotatehint { display: none; }

/*
 * Hanya muncul di layar ponsel POSISI TEGAK — di posisi mendatar saran ini tidak
 * berguna, dan di desktop tidak relevan. Ditutup → kelas `dismissed` (diingat
 * selama sesi lewat sessionStorage di public/app.js).
 */
@media (max-width: 900px) and (orientation: portrait) {
  .rotatehint:not(.dismissed) {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px auto 0;
    padding: 8px 12px;
    max-width: 640px;
    border: 1px solid rgba(208, 255, 131, 0.32);
    border-radius: var(--radius-sm);
    background: var(--brand-tint);
    color: var(--ink-2);
    font-size: 0.82rem;
    line-height: 1.35;
  }
}
.rotatehint-icon {
  flex: 0 0 auto;
  font-size: 1.1rem;
  color: var(--brand);
  font-weight: 700;
}
.rotatehint-text { flex: 1 1 auto; min-width: 0; }
.rotatehint-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}
.rotatehint-close:hover { color: var(--ink); }

/* Footer ringkas (tanpa empat baris keterangan). */
.foot-inner { justify-content: flex-start; }

/* ==========================================================================
   DRAWING GRUP — RODA UNDIAN (permintaan panitia; acuan: aplikasi picker wheel)

   Roda digambar di <canvas> oleh public/drawing-wheel.js (animasi 60 fps, tanpa
   pustaka tambahan). Di sini hanya tata letaknya: roda + papan pembagian grup.
   Gaya tetap mengikuti aplikasi: putih, border tipis, aksen teal.
   ========================================================================== */

.drawwrap {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.drawwrap > * { min-width: 0; }

.drawside { display: grid; gap: 14px; justify-items: center; }

.drawname {
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-2);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.drawname b { color: var(--ink); }

.wheelbox { position: relative; width: 100%; display: grid; place-items: center; }
#wheel { display: block; max-width: 100%; }

/* Jarum penunjuk di posisi jam 12 */
.drawptr {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid var(--ink);
  filter: drop-shadow(0 2px 3px rgba(16, 24, 40, 0.28));
  z-index: 2;
}

/* Angka di tengah roda: sisa tim yang belum diundi */
.wheelhub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  line-height: 1.05;
  pointer-events: none;
}
.wheelhub span { font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.wheelhub i { font-style: normal; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.drawresult {
  min-height: 34px;
  font-size: 1.05rem;
  color: var(--muted);
  text-align: center;
  opacity: 0;
}
.drawresult.show { opacity: 1; animation: drawpop 0.45s ease; }
.drawresult .drawgot {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-2);
  font-weight: 700;
}
@keyframes drawpop {
  0% { transform: scale(0.86); opacity: 0; }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

.drawctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.drawspeed { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.drawspeed select { padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }

/* Papan hasil: satu kolom per grup, chip tim muncul saat selesai diundi */
.drawboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.drawcol {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.drawcol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--line-2);
  font-weight: 650;
  font-size: 0.85rem;
}
.drawcol-n { color: var(--muted); font-weight: 600; }
.drawcol-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 6px; min-height: 24px; }
.drawchip {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  background: var(--surface);
  animation: chipin 0.42s ease;
  overflow-wrap: anywhere;
}
@keyframes chipin {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.drawsave { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.drawcount { margin-bottom: 12px; }

/* Kartu pratinjau hasil undian di tab Peserta & Grup */
.pendingdraw .pendinglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pendingdraw .pendinglist li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.draftcard {
  margin: 14px 0 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand-tint);
}
.draftcard-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.draftcard-head h4 { margin: 0; }
.draftcard .tablewrap { background: var(--surface); border-radius: var(--radius-sm); }
.draftapply { margin-top: 12px; }

@media (max-width: 860px) {
  .drawwrap { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawchip, .drawresult.show { animation: none !important; }
}

/* ==========================================================================
   PEMBAYARAN PESERTA (instruksi bayar + bukti transfer + verifikasi panitia)
   ========================================================================== */

/* Tabel rekening: label rapat di kiri, nilainya tebal supaya mudah dibaca
   peserta yang sedang menyalin nomor rekening dari ponsel. */
.paytable th { width: 40%; white-space: nowrap; text-align: left; color: var(--ink-2); font-weight: 600; }
.paytable td.payval { font-weight: 700; }
.paytable .btn { margin-left: 6px; }
.paynote {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  background: var(--brand-tint);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.6;
}

/* Kartu lanjutan (di halaman status screening & halaman "pendaftaran terkirim") */
.paylane .card-head h2 { font-size: 1rem; }
.paylane .actions { margin-top: 10px; }

/* --- blok pembayaran pada kartu pendaftar (tab Pendaftaran, panitia) --- */
.payblock {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.payblock.muted-block { border-left-color: var(--line); }
.payblock-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.payblock .actions { margin-top: 10px; }
.payproof { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin: 8px 0 4px; }
.payproof img {
  display: block;
  max-width: 190px;
  max-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.payproof-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
  color: var(--brand-2);
  font-weight: 700;
}

@media (max-width: 720px) {
  /* Di ponsel, label rekening ditumpuk supaya nomor rekening tidak terpotong. */
  .paytable th, .paytable td { display: block; width: auto; }
  .paytable th { padding-bottom: 0; border: 0; }
  .paytable td { padding-top: 2px; }
  .payproof img { max-width: 100%; }
}

/* ==========================================================================
   AKUN PANITIA PER TURNEMEN (tab Panitia)
   ========================================================================== */

/* Baris "Keluar" pada subbar halaman tingkat aplikasi (tanpa turnamen terpilih):
   barisnya tipis dan hanya berisi tombol, jadi tidak boleh mengambil ruang tab. */
.subbar .subbar-only { justify-content: flex-end; padding: 12px 0 0; }
.cmtable td .cmactions { justify-content: flex-start; }
/* Kolom aksi akun panitia memuat beberapa form (input password + 3 tombol);
   di layar sempit ditumpuk supaya tidak mendorong halaman melebar. */
.cmtable td[data-label='Aksi'] { min-width: 0; }
.cmtable td[data-label='Aksi'] form { flex-wrap: wrap; }
@media (max-width: 720px) {
  .cmtable td[data-label='Aksi'] input { width: 100% !important; }
  .cmtable td[data-label='Aksi'] .cmactions { gap: 8px; }
}

/* ==========================================================================
   BERANDA (redesign) — umpan laga berjalan/berikutnya & chip kategori
   --------------------------------------------------------------------------
   Bagian ini diletakkan PALING AKHIR supaya aturan navigasi bawah tidak
   tertimpa blok ponsel yang lebih atas.
   ========================================================================== */

.livefeed { display: flex; flex-direction: column; gap: 14px; }
.feeditem { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.feeditem .match { margin-bottom: 0; }
.feeditem-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-left: 2px; }
.feeditem-t {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
}
.feeditem-t:hover { color: var(--brand); text-decoration: none; }
.feeditem-c {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.catchips { display: flex; flex-wrap: wrap; gap: 10px; }
.catchip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}
.catchip i { font-style: normal; font-size: 0.72rem; font-weight: 600; color: var(--muted); }

/* ---------------------------------------------------------------- navigasi bawah */
.bottomnav { display: none; }

@media (max-width: 640px) {
  .bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(9, 26, 19, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .bnav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 2px;
    border-radius: 10px;
    color: var(--muted);
  }
  .bnav-item:hover { text-decoration: none; }
  .bnav-item.active { color: var(--brand); background: var(--brand-tint); }
  .bnav-ico { display: grid; place-items: center; }
  .bnav-ico svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .bnav-lbl { font-size: 0.62rem; font-weight: 700; white-space: nowrap; }
  /* ruang untuk navigasi bawah supaya kaki halaman tidak tertutup */
  body { padding-bottom: 72px; }
  .page { padding-bottom: 30px; }
  .hero { padding: 30px 20px 26px; border-radius: 18px; }
  .hero .hero-title { font-size: clamp(1.75rem, 7.2vw, 2.2rem); max-width: none; }
  .hero-stats { gap: 18px; margin-top: 22px; padding-top: 16px; }
  .hero-stats b { font-size: 1.14rem; }
  .hero .hero-sub { font-size: 0.94rem; }
  .hero-actions .btn { flex: 1 1 auto; }
  .topbar-inner { min-height: 56px; }
  .topuser-hello { display: none; }
}

/* ==========================================================================
   DASHBOARD ADMIN (redesign) — tindakan cepat & status pendaftaran
   ========================================================================== */

.quickacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.quickact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}
.quickact b { font-size: 0.92rem; font-weight: 700; }
.quickact span { font-size: 0.76rem; color: var(--muted); }
.quickact:hover {
  border-color: rgba(208, 255, 131, 0.45);
  background: var(--elevated);
  text-decoration: none;
  transform: translateY(-1px);
}
.quickact:first-child { border-color: rgba(208, 255, 131, 0.4); background: var(--brand-tint); }
.quickact:first-child b { color: var(--brand); }

/* Badge "Pendaftaran dibuka" di kepala halaman turnamen (juga sebuah tautan). */
.badge.open {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
}
a.badge:hover { text-decoration: none; filter: brightness(1.05); }

/* Lapangan & jadwal di kepala papan skor (papan skor petugas lapangan). */
.lbwhere { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.lbwhere .chip { background: var(--surface); border-color: var(--line); color: var(--ink-2); }

/* Ikon garis kecil (lokasi, tanggal, penyelenggara, jumlah tim). */
.ico {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
}
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
