/* Tourney Manager — gaya tampilan */
/* Warna aksen: tiap pilihan hanya menetapkan warna dasar & warna teks di atasnya.
   Varian hover/lembut diturunkan otomatis untuk mode gelap maupun terang. */
:root { --accent-base: #3b82f6; --ink-dark: #ffffff; --ink-light: #ffffff; }
:root[data-accent="blue"]   { --accent-base: #3b82f6; --ink-dark: #ffffff; --ink-light: #ffffff; }
:root[data-accent="indigo"] { --accent-base: #6366f1; --ink-dark: #ffffff; --ink-light: #ffffff; }
:root[data-accent="violet"] { --accent-base: #a855f7; --ink-dark: #ffffff; --ink-light: #ffffff; }
:root[data-accent="pink"]   { --accent-base: #ec4899; --ink-dark: #ffffff; --ink-light: #ffffff; }
:root[data-accent="red"]    { --accent-base: #f43f5e; --ink-dark: #ffffff; --ink-light: #ffffff; }
:root[data-accent="orange"] { --accent-base: #f97316; --ink-dark: #1a0b00; --ink-light: #ffffff; }
:root[data-accent="amber"]  { --accent-base: #f5b301; --ink-dark: #1a1300; --ink-light: #1a1300; }
:root[data-accent="teal"]   { --accent-base: #14b8a6; --ink-dark: #00201c; --ink-light: #ffffff; }
:root[data-accent="green"]  { --accent-base: #22c55e; --ink-dark: #04130a; --ink-light: #ffffff; }
:root[data-accent="slate"]  { --accent-base: #94a3b8; --ink-dark: #0b0d12; --ink-light: #ffffff; }

:root {
  --bg: #0b0d12;
  --bg-2: #10131a;
  --surface: #151922;
  --surface-2: #1c212c;
  --line: #282e3b;
  --text: #e8ebf2;
  --muted: #8b93a7;
  --accent: var(--accent-base);
  --accent-2: color-mix(in srgb, var(--accent-base) 78%, #fff);
  --accent-ink: var(--ink-dark);
  --accent-soft: color-mix(in srgb, var(--accent-base) 16%, transparent);
  --danger: #ef4444;
  --warn: #f59e0b;
  --gold: #facc15;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --radius-sm: 9px;
  --gap: 36px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fb; --bg-2: #eef0f6; --surface: #ffffff; --surface-2: #f1f3f8; --line: #dde1ea;
    --text: #11141c; --muted: #5c6475;
    --accent: color-mix(in srgb, var(--accent-base) 86%, #000); --accent-2: color-mix(in srgb, var(--accent-base) 70%, #000);
    --accent-ink: var(--ink-light); --accent-soft: color-mix(in srgb, var(--accent-base) 11%, transparent);
    --shadow: 0 10px 30px rgba(20, 28, 48, .08); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f7fb; --bg-2: #eef0f6; --surface: #ffffff; --surface-2: #f1f3f8; --line: #dde1ea;
  --text: #11141c; --muted: #5c6475;
  --accent: color-mix(in srgb, var(--accent-base) 86%, #000); --accent-2: color-mix(in srgb, var(--accent-base) 70%, #000);
  --accent-ink: var(--ink-light); --accent-soft: color-mix(in srgb, var(--accent-base) 11%, transparent);
  --shadow: 0 10px 30px rgba(20, 28, 48, .08); color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.row-gap { display: flex; gap: 10px; align-items: center; }
.row-gap.wrap { flex-wrap: wrap; }
.accent { color: var(--accent); }

/* Tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; cursor: pointer; transition: .15s; white-space: nowrap; background: none;
}
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { border-color: rgba(239, 68, 68, .5); color: var(--danger); }
.btn-danger-ghost:hover { background: rgba(239, 68, 68, .1); color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; display: inline-grid; place-items: center; font-size: 16px;
}
.icon-btn:hover { border-color: var(--accent); }

/* Bar atas */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo b { color: var(--accent); }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 17px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); }
.topbar-actions { display: flex; gap: 8px; }
.menu-btn { display: none; }

/* Landing */
.hero { padding: 72px 0 56px; background: radial-gradient(900px 400px at 15% 0%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 800; letter-spacing: -.03em; }
.lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 14px; }
.pill { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; margin-bottom: 18px; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.hero-card-head { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--accent); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
.mini-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 14px; }
.mini-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px; }
.mini-table td { padding: 8px 6px; border-top: 1px solid var(--line); }
.mini-table td:nth-child(n+3), .mini-table th:nth-child(n+3) { text-align: right; }

.stats { border-block: 1px solid var(--line); background: var(--bg-2); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 26px 20px; text-align: center; }
.stats b { display: block; font-size: 30px; font-weight: 800; color: var(--accent); }
.stats span { color: var(--muted); font-size: 14px; }

.section { padding: 72px 0; }
.section.alt { background: var(--bg-2); }
.section-tight { padding: 36px 20px 64px; }
.section-title { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; text-align: center; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.feature h3 { font-size: 17px; }
.feature p { color: var(--muted); margin: 0; font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; }
.step { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.step p { color: var(--muted); margin: 0; }
.step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 12px; }
.step-num.sm { width: 26px; height: 26px; font-size: 13px; margin: 0 8px 0 0; }
.tool-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 32px; }
.tool-links a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.tool-links a:hover { border-color: var(--accent); }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); }
.cta-band h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
.cta-band .lead { margin: 0 auto 24px; }

/* Kartu turnamen */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.t-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: .15s; }
.t-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.t-card h3 { font-size: 17px; margin: 12px 0 4px; }
.t-card-top { display: flex; align-items: center; gap: 8px; }
.t-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: inline-grid; place-items: center; font-size: 19px; flex: none; }
.t-icon.lg { width: 56px; height: 56px; font-size: 30px; border-radius: 14px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.champ-line { font-weight: 700; color: var(--gold); margin: 10px 0 0; }
.progress { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 12px 0 6px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s; }
.progress.slim { height: 4px; margin: 8px 0 0; max-width: 260px; }

/* Halaman umum */
.page-title { font-size: 30px; font-weight: 800; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .page-title { margin: 0; }
.search { display: flex; gap: 10px; margin: 6px 0 24px; }
.search input { flex: 1; }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.list-title { font-weight: 700; font-size: 16px; }

/* Formulir */
.form { display: flex; flex-direction: column; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0; min-width: 0; }
fieldset.panel { display: flex; flex-direction: column; gap: 14px; }
.panel legend { font-weight: 800; font-size: 16px; padding: 0 6px; display: flex; align-items: center; }
.panel-title { font-size: 16px; margin-bottom: 12px; }
.panel.danger { border-color: rgba(239, 68, 68, .35); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field.inline input { max-width: 110px; }
.field.inline select { width: auto; max-width: 100%; }
.field.inline > span { white-space: nowrap; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2.gap-lg { gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 17px; height: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: 14px; background: var(--bg); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }
.format-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.format-card input { position: absolute; opacity: 0; pointer-events: none; }
.format-body { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; height: 100%; transition: .15s; }
.format-card input:checked + .format-body { border-color: var(--accent); background: var(--accent-soft); }
.format-card input:focus-visible + .format-body { outline: 2px solid var(--accent); }
.format-diagram { color: var(--accent); height: 36px; margin-bottom: 6px; }
.format-diagram svg { height: 36px; width: auto; }
.format-options { display: flex; flex-direction: column; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.form-error { color: var(--danger); font-weight: 600; min-height: 1em; margin: 0; }

/* Turnamen */
.t-hero { padding: 28px 0 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), transparent); }
.t-hero-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.t-hero-id { display: flex; gap: 16px; align-items: center; min-width: 0; }
.t-hero h1 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; margin-bottom: 4px; }
.t-hero p { margin: 0; }
.t-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.t-progress .progress { flex: 1; max-width: 360px; margin: 0; }
.notice { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tabs { position: sticky; top: 64px; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 14px 14px 12px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.t-body { padding-top: 24px; padding-bottom: 64px; }
.h2 { font-size: 19px; font-weight: 800; margin: 28px 0 12px; }
.about { color: var(--muted); max-width: 720px; }

.champion { display: flex; align-items: center; gap: 18px; padding: 20px 24px; border-radius: var(--radius); background: linear-gradient(120deg, rgba(250, 204, 21, .18), rgba(250, 204, 21, .04)); border: 1px solid rgba(250, 204, 21, .4); margin-bottom: 18px; }
.champion .trophy { font-size: 40px; }
.champion span { font-weight: 800; letter-spacing: .1em; color: var(--gold); }
.champion h2 { margin: 0; font-size: 26px; }
.action-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent-soft); margin-bottom: 18px; flex-wrap: wrap; }
.action-card p { margin: 2px 0 0; }

/* Baris pertandingan */
.match-list { display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.match-row {
  display: grid; grid-template-columns: 110px 1fr 92px 1fr 160px; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.match-row.clickable { cursor: pointer; }
.match-row.clickable:hover { border-color: var(--accent); }
.mr-meta { display: flex; flex-direction: column; font-size: 12px; line-height: 1.35; }
.mr-num { color: var(--muted); font-weight: 700; }
.mr-team { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-team.a { text-align: right; }
.mr-team.winner { font-weight: 800; color: var(--accent); }
.mr-team a:hover { text-decoration: underline; }
.is-tbd { color: var(--muted); font-style: italic; font-weight: 500; }
.is-bye { color: var(--muted); }
.mr-score { display: flex; justify-content: center; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.mr-score b { font-size: 18px; min-width: 22px; text-align: center; background: var(--surface-2); border-radius: 6px; padding: 2px 4px; }
.mr-score .vs { color: var(--muted); font-size: 13px; }
.mr-score .enter { font-size: 12px; font-weight: 700; color: var(--accent); border: 1px dashed var(--accent); border-radius: 6px; padding: 4px 6px; white-space: nowrap; }
.mr-score .tb { color: var(--warn); font-style: normal; }
.mr-score { flex-wrap: wrap; row-gap: 2px; }
.sets-detail { flex-basis: 100%; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.mr-tag { font-size: 12px; color: var(--muted); text-align: right; }
.st-ready { border-left: 3px solid var(--accent); }
/* baris laga menyesuaikan lebar kolomnya, bukan lebar layar */
@container (max-width: 640px) {
  .match-row { grid-template-columns: 1fr 80px 1fr; row-gap: 6px; padding: 10px 12px; }
  .mr-meta { grid-column: 1 / -1; flex-direction: row; gap: 10px; }
  .mr-tag { grid-column: 1 / -1; text-align: left; }
}
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.seg-btn { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg-btn.active { background: var(--accent-soft); color: var(--accent); }
.bucket-title { font-size: 15px; margin: 22px 0 10px; }

/* Bagan */
.b-title { font-size: 15px; margin: 22px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.bracket-scroll { overflow-x: auto; padding-bottom: 12px; }
.bracket { display: flex; gap: var(--gap); min-width: min-content; }
.b-col { display: flex; flex-direction: column; width: 230px; flex: none; }
.b-col-head { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 0 10px; text-align: center; }
.b-col-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.b-pair { flex: 1; display: flex; flex-direction: column; position: relative; }
.b-pair::after { content: ''; position: absolute; right: calc(var(--gap) / -2); top: 25%; bottom: 25%; width: calc(var(--gap) / 2); border: 2px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; }
.b-slot { flex: 1; display: flex; align-items: center; position: relative; padding: 6px 0; }
.b-slot > .bm { width: 100%; }
.b-slot.has-in::before { content: ''; position: absolute; left: calc(var(--gap) / -2); width: calc(var(--gap) / 2); top: 50%; border-top: 2px solid var(--line); }
.b-slot.has-out::after { content: ''; position: absolute; right: calc(var(--gap) * -1); width: var(--gap); top: 50%; border-top: 2px solid var(--line); }
.bm { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; z-index: 1; }
.bm.clickable { cursor: pointer; }
.bm.clickable:hover { border-color: var(--accent); }
.bm.st-ready { border-left: 3px solid var(--accent); }
.bm.st-bye, .bm.st-void { opacity: .45; }
.bm-meta { font-size: 11px; color: var(--muted); padding: 5px 10px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 14px; }
.bm-row.winner { font-weight: 800; background: var(--accent-soft); }
.bm-row.winner .bm-score { color: var(--accent); }
.bm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.bm-sets { display: inline-flex; gap: 2px; flex: none; }
.bm-sets i { font-style: normal; min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.bm-sets i.won { color: var(--text); font-weight: 800; }
.bm-row.winner .bm-sets i.won { color: var(--accent); }
.p3 { width: 230px; }

/* Klasemen */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.table-wrap { overflow-x: auto; }
.standings { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.standings th { font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.standings td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.standings .left { text-align: left; width: 100%; }
.standings td.left a { font-weight: 700; }
.standings tr:last-child td { border-bottom: 0; }
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); font-weight: 800; font-size: 12px; }
.standings tr.qualify .rank { background: var(--accent); color: var(--accent-ink); }
.formg { display: inline-flex; gap: 3px; }
.formg i { font-style: normal; width: 20px; height: 20px; border-radius: 5px; font-size: 11px; font-weight: 800; display: grid; place-items: center; color: #fff; }
.f-W { background: var(--accent); }
.f-D { background: #6b7280; }
.f-L { background: var(--danger); }
.legend { margin-top: 14px; }

/* Peserta */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.team-card { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.team-card:hover { border-color: var(--accent); color: var(--text); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.team-head { display: flex; gap: 16px; align-items: center; margin: 14px 0 6px; }
.team-head h2 { margin: 0 0 6px; }
.stat-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-pills span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; }
.rename-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.rename-grid .form-actions { grid-column: 1 / -1; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.modal-head h3 { margin: 2px 0 0; font-size: 20px; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.score-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.score-team { display: flex; flex-direction: column; gap: 8px; font-weight: 700; text-align: center; }
.score-team input { font-size: 32px; font-weight: 800; text-align: center; padding: 12px; }
.score-sep { font-size: 28px; color: var(--muted); }
.sets-grid { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px 10px; align-items: center; }
.sets-grid > b { text-align: center; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sets-grid input { text-align: center; font-size: 20px; font-weight: 800; padding: 8px; }
.set-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.sets-summary { text-align: center; font-weight: 700; margin: 12px 0 0; min-height: 1.4em; color: var(--accent); }
.mode-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-choice input { position: absolute; opacity: 0; pointer-events: none; }
.mode-choice > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.mode-choice > span b { font-size: 14px; color: var(--text); }
.mode-choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.mode-choice input:focus-visible + span { outline: 2px solid var(--accent); }
#scoreOptions:not(:empty) { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 520px) { .mode-choices { grid-template-columns: 1fr; } }
.quick-scores { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.chip-btn { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 700; }
.chip-btn:hover { border-color: var(--accent); }
.tiebreak { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tiebreak p { width: 100%; margin: 0; }
.sched { margin-top: 16px; }
.sched summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.share-body { display: grid; grid-template-columns: 190px 1fr; gap: 18px; align-items: start; }
.qr { width: 190px; min-height: 190px; padding: 5px; background: #fff; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.qr .muted { color: #555; }
.share-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 12px; }

/* Halaman legal (privasi & ketentuan) */
.static-nav { display: flex; }
.legal { padding-top: 36px; padding-bottom: 72px; }
.legal h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; margin-bottom: 4px; }
.legal h2 { font-size: 20px; margin: 32px 0 10px; }
.legal h3 { font-size: 16px; margin: 18px 0 6px; }
.legal p, .legal li { line-height: 1.7; }
.legal ul { padding-left: 22px; margin: 0 0 1em; }
.legal li { margin-bottom: 6px; }
.legal a:not(.btn) { color: var(--accent); text-decoration: underline; }
.legal-back { margin-top: 36px; }
.auth-legal { font-size: 12px; color: var(--muted); text-align: center; margin: 14px 0 0; }
.auth-legal a { color: var(--accent); }
@media (max-width: 760px) { .static-nav { display: none; } }

/* Akun */
.account { position: relative; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: var(--accent-soft); color: var(--accent); font-weight: 800; cursor: pointer; padding: 0; overflow: hidden; display: grid; place-items: center; }
.avatar-btn:hover { border-color: var(--accent); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); color: var(--text); }
.account-id { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; min-width: 0; }
.account-id span { overflow: hidden; text-overflow: ellipsis; }
.auth-wrap { display: grid; place-items: center; padding: 48px 16px 72px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; font-weight: 800; }
.auth-card .form { gap: 14px; margin-top: 4px; }
.btn-block { width: 100%; }
.btn-google { width: 100%; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; gap: 10px; margin-top: 8px; }
.btn-google:hover { background: #f7f8f8; color: #1f1f1f; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-links a { color: var(--accent); font-weight: 700; }
.auth-sent { text-align: center; }
.auth-sent-icon { font-size: 44px; margin-bottom: 8px; }
.btn.is-busy { opacity: .7; cursor: progress; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* Panitia */
.role-badge { align-self: center; }
.staff-list { display: flex; flex-direction: column; }
.staff-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.staff-row:first-child { border-top: 0; }
.staff-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.staff-id b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-row select { width: auto; padding: 7px 10px; }
.staff-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.staff-form input { flex: 1 1 220px; }
.staff-form select { width: auto; }
.role-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.role-legend div { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 640px) { .role-legend { grid-template-columns: 1fr; } }

/* Pengaturan tampilan */
.theme-section { margin-bottom: 20px; }
.theme-section h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-opt { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 700; font-size: 13px; text-align: center; }
.mode-opt.active { border-color: var(--accent); }
.mode-preview { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 8px; height: 56px; }
.mode-preview i { display: block; height: 8px; border-radius: 3px; }
.mode-preview i:first-child { width: 60%; background: var(--accent-base); }
.mode-dark { background: #10131a; } .mode-dark i:not(:first-child) { background: #282e3b; }
.mode-light { background: #eef0f6; } .mode-light i:not(:first-child) { background: #d3d8e3; }
.mode-system { background: linear-gradient(135deg, #10131a 50%, #eef0f6 50%); }
.mode-system i:not(:first-child) { background: #8b93a7; }
.swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; border: 2px solid transparent; background: var(--bg); cursor: pointer; font-size: 12px; font-weight: 600; }
.swatch:hover { border-color: var(--line); }
.swatch.active { border-color: var(--accent); }
.swatch-dot { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.swatch.active .swatch-dot { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.theme-preview { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.theme-preview .progress { flex-basis: 100%; margin: 0; }
@media (max-width: 480px) { .swatch-grid { grid-template-columns: repeat(4, 1fr); } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 200; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 700; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.footer a:not(.logo) { display: block; font-size: 14px; padding: 3px 0; }
.footer-bottom { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }

/* Mode TV */
body.tv-mode { overflow: hidden; }
.tv { height: 100vh; display: flex; flex-direction: column; padding: 22px 32px; gap: 14px; }
.tv-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.tv-head h1 { margin: 0; font-size: 30px; text-align: center; }
.tv-clock { text-align: right; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tv-sub { display: flex; align-items: center; gap: 16px; }
.tv-sub h2 { margin: 0; font-size: 22px; color: var(--accent); }
.tv-dots { display: flex; gap: 6px; flex: 1; }
.tv-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tv-dots i.on { background: var(--accent); }
.tv-body { flex: 1; overflow: auto; font-size: 17px; }
.tv-body .standings { font-size: 18px; }
.tv-champ { margin: 0; }
.tv-exit { position: fixed; right: 16px; bottom: 14px; font-size: 13px; color: var(--muted); padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); opacity: .5; }
.tv-exit:hover { opacity: 1; }

/* Responsif */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .group-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .container { padding: 0 16px; }
  .section-tight { padding: 28px 16px 56px; }
  .menu-btn { display: inline-grid; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .nav.open { display: flex; }
  .topbar-actions { margin-left: auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .feature-grid, .steps, .grid-2, .footer-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hero { padding: 44px 0 36px; }
  .section { padding: 52px 0; }
  .list-row { flex-direction: column; align-items: stretch; }
  .share-body { grid-template-columns: 1fr; justify-items: center; }
  .share-fields { width: 100%; }
  .hide-sm { display: none; }
  .tv { padding: 14px; }
  .tv-head { grid-template-columns: 1fr auto; }
  .tv-head > div:first-child { display: none; }
  .tv-head h1 { font-size: 20px; text-align: left; }
  .score-team input { font-size: 26px; }
  .t-hero-id { align-items: flex-start; }
  .t-icon.lg { width: 44px; height: 44px; font-size: 24px; }
}
