/* FOLX Main — stylesheet
   Layout: publik = top bar + kolom konten 1200px; admin = ruled T-frame (sidebar 232px + top bar 64px, satu ground).
   Warna dan font dari design system FOLX Padel (forest, clay, cream; Clash Display + Satoshi).
   Gaya app "accent ladder": clay penuh hanya di tanda kecil (data, tombol aksen, ikon aktif); tint clay pucat untuk area. */

@font-face { font-family: "Clash Display"; src: url("../fonts/ClashDisplay-Variable.ttf") format("truetype"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("../fonts/Satoshi-Variable.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }

:root {
  /* brand (tokens.json FOLX Padel) */
  --forest: #0f3725; --forest-soft: #1e4d38; --clay: #d4532f; --clay-deep: #a83d1d; --clay-soft: #b55d45; --cream: #f5f0dc;
  /* terang (tema cream) */
  --ground: #f5f0dc;          /* cream: ground halaman */
  --surface: #fcfaf2;         /* panel di atas cream */
  --raised: #efe8cf;          /* sumur terisi, hover baris */
  --border: #e2d9bb;          /* tepi panel ≈1.2:1 */
  --rule: #ebe4ca;            /* garis antar baris */
  --control: #c9bf9c;         /* tepi input dan tombol outline */
  --text: #0f3725;            /* ink = forest */
  --muted: #4d4d4d;           /* graphite, 7.8:1 di cream */
  --faint: #5c5a52;
  --accent: #d4532f;          /* clay: data, tombol aksen, tanda aktif */
  --accent-mark: #d4532f;     /* garis grafik dan penanda di atas ground */
  --tint-1: #fbeae2;          /* tangga clay: area pucat */
  --tint-2: #f4d2c3;
  --tint-3: #e9ab93;
  --tint-ink: #8a2e13;        /* teks di atas tint clay */
  --primary: #0f3725; --primary-ink: #f5f0dc; --primary-hover: #1e4d38;
  --inverse: #0f3725; --on-inverse: #f5f0dc; --on-inverse-muted: #cfd8cf;
  --positive: #24704a; --negative: #b42318; --warning: #8a4b0c;
  --pill-pos-bg: #ddf1e3; --pill-pos-ink: #0d3b22;
  --pill-neg-bg: #fde4e0; --pill-neg-ink: #7d1a12;
  --pill-warn-bg: #fbedd0; --pill-warn-ink: #6b3a08;
  --pill-bg: #e9e2c8; --pill-ink: #3a3a32;
  --court: #1e4d38; --court-line: #f5f0dc;
  --chart-1: var(--accent-mark); --chart-muted: #b9b29a; --grid: #e4dcc0; --axis-ink: #4d4d4d; --ink: var(--text); --chart-span: .06;

  --font: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Clash Display", "Satoshi", system-ui, sans-serif;
  --fs-title: 24px; --fs-section: 16px; --fs-body: 14px; --fs-small: 12px; --fs-kpi: 26px;
  --pad: 28px; --gap: 16px; --card-pad: 20px;
  --radius-card: 16px; --radius-control: 999px; --radius-input: 10px;
  --control-height: 36px; --sidebar: 232px; --topbar: 64px;
  --ease: cubic-bezier(.22,1,.36,1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0f3725; --surface: #143f2c; --raised: #1e4d38; --border: #275a43; --rule: #20503a; --control: #3f735b;
    --text: #f5f0dc; --muted: #d0d6cc; --faint: #b8c2b6;
    --accent: #d4532f; --accent-mark: #ec7650;
    --tint-1: #3c3a24; --tint-2: #57402a; --tint-3: #8d4a2e; --tint-ink: #f6b79e;
    --primary: #f5f0dc; --primary-ink: #0f3725; --primary-hover: #e3dcc0;
    --inverse: #0a2a1c; --on-inverse: #f5f0dc; --on-inverse-muted: #c6d1c6;
    --positive: #7fd4a2; --negative: #ff9b8a; --warning: #f2c27a;
    --pill-pos-bg: #1d4a33; --pill-pos-ink: #b3ecc8; --pill-neg-bg: #4e2620; --pill-neg-ink: #ffc4b8;
    --pill-warn-bg: #4a3a1a; --pill-warn-ink: #f6d59a; --pill-bg: #234f3b; --pill-ink: #e7e3cf;
    --court: #0a2a1c; --chart-muted: #5d7d6c; --grid: #275a43; --axis-ink: #d0d6cc; --chart-span: .12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0f3725; --surface: #143f2c; --raised: #1e4d38; --border: #275a43; --rule: #20503a; --control: #3f735b;
  --text: #f5f0dc; --muted: #d0d6cc; --faint: #b8c2b6;
  --accent: #d4532f; --accent-mark: #ec7650;
  --tint-1: #3c3a24; --tint-2: #57402a; --tint-3: #8d4a2e; --tint-ink: #f6b79e;
  --primary: #f5f0dc; --primary-ink: #0f3725; --primary-hover: #e3dcc0;
  --inverse: #0a2a1c; --on-inverse: #f5f0dc; --on-inverse-muted: #c6d1c6;
  --positive: #7fd4a2; --negative: #ff9b8a; --warning: #f2c27a;
  --pill-pos-bg: #1d4a33; --pill-pos-ink: #b3ecc8; --pill-neg-bg: #4e2620; --pill-neg-ink: #ffc4b8;
  --pill-warn-bg: #4a3a1a; --pill-warn-ink: #f6d59a; --pill-bg: #234f3b; --pill-ink: #e7e3cf;
  --court: #0a2a1c; --chart-muted: #5d7d6c; --grid: #275a43; --axis-ink: #d0d6cc; --chart-span: .12;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- dasar */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ground); }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num, table { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: var(--fs-small); line-height: 16px; }
.nowrap { white-space: nowrap; }
.display { font-family: var(--display); letter-spacing: -.01em; }

/* ---------------------------------------------------------------- kontrol */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 16px; border-radius: var(--radius-control); border: 1px solid var(--control); background: transparent; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background-color .15s ease, transform .12s var(--ease), border-color .15s ease; }
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.accent { background: var(--clay-deep); color: var(--cream); border-color: transparent; }
.btn.accent:hover { background: #8f3317; }
.btn.ghost { border-color: transparent; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--control); background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--raised); }
.icon-btn svg { width: 18px; height: 18px; }
.link { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--tint-3); text-underline-offset: 3px; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { text-decoration-color: var(--accent); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-input); background: var(--surface); }
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; line-height: 20px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.field { display: grid; gap: 8px; min-width: 0; align-content: start; }
.field > label, .field > .label { font-weight: 600; }
.field .hint { color: var(--muted); font-size: var(--fs-small); line-height: 16px; }
.field .error { color: var(--negative); font-size: 13px; }
.fields { display: grid; gap: 16px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.segmented { display: inline-flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; border-radius: 999px; background: var(--raised); gap: 2px; }
.segmented button { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: var(--gap); overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; padding: 10px 0; color: var(--muted); background: none; border: 0; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.tabs .count { margin-left: 6px; color: var(--tint-ink); background: var(--tint-1); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--control); border-radius: 999px; height: 44px; }
.stepper button { width: 40px; height: 42px; border: 0; background: none; font-size: 20px; cursor: pointer; border-radius: 999px; }
.stepper button:hover { background: var(--raised); }
.stepper output { min-width: 36px; text-align: center; font: 600 22px/1 var(--display); }

/* ---------------------------------------------------------------- pill, badge */
.pill { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--pill-bg); color: var(--pill-ink); }
.pill.pos { background: var(--pill-pos-bg); color: var(--pill-pos-ink); }
.pill.neg { background: var(--pill-neg-bg); color: var(--pill-neg-ink); }
.pill.warn { background: var(--pill-warn-bg); color: var(--pill-warn-ink); }
.pill.tint { background: var(--tint-1); color: var(--tint-ink); }
.pill.live { background: var(--clay-deep); color: var(--cream); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) { .pill.live::before { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .35; } }
.cls { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.cls::before { content: ""; width: 10px; height: 10px; border-radius: 0 50% 50% 50%; flex: none; }
.cls.Bronze::before { background: var(--tint-2); } .cls.Silver::before { background: var(--tint-3); } .cls.Gold::before { background: var(--accent); }

/* lencana level: bentuk drop brand (sudut kiri-atas tajam) */
.drop { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 0 50% 50% 50%; background: var(--tint-1); color: var(--tint-ink); font: 600 15px/1 var(--display); }
.drop.sm { width: 32px; height: 32px; font-size: 13px; }
.drop.lg { width: 92px; height: 92px; font-size: 38px; }
.drop.xl { width: 136px; height: 136px; font-size: 40px; }
.drop.Silver { background: var(--tint-2); } .drop.Gold { background: var(--accent); color: var(--cream); }
.drop .p { font: 600 10px/1 var(--font); margin-left: 1px; vertical-align: super; }

/* ---------------------------------------------------------------- panel dan grid */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.panel > header, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-width: 0; }
.panel h2, .h2 { font-size: var(--fs-section); line-height: 22px; font-weight: 700; }
.panel h3 { font-size: 14px; line-height: 20px; font-weight: 700; }
.panel .meta, .meta { color: var(--muted); font-size: var(--fs-small); line-height: 16px; }
.stack { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.row-flex { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.main-rail { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.title-row h1 { font-size: var(--fs-title); line-height: 30px; font-weight: 700; letter-spacing: -.01em; }
.title-row .sub { margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 22px; max-width: 70ch; }
.title-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { display: grid; place-items: center; min-height: 72px; padding: 16px; border: 1px dashed var(--control); border-radius: 12px; color: var(--muted); text-align: center; grid-column: 1 / -1; }
.notice { padding: 10px 14px; border-radius: 12px; background: var(--pill-warn-bg); color: var(--pill-warn-ink); font-size: 13px; line-height: 18px; }
.notice.tint { background: var(--tint-1); color: var(--tint-ink); }

/* KPI sebagai satu strip terbagi */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.kpi { padding: 16px var(--card-pad); min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi-label { color: var(--muted); }
.kpi-value { margin-top: 4px; font: 600 var(--fs-kpi)/1.15 var(--display); }
.kpi-value small { font: 400 14px var(--font); color: var(--muted); margin-left: 2px; }
.kpi-note { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* tabel */
.table-wrap { overflow-x: auto; min-width: 0; }
table { width: 100%; border-collapse: collapse; }
th { height: 34px; padding: 0 10px; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); white-space: nowrap; }
td { padding: 11px 10px; border-top: 1px solid var(--rule); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; } th:last-child, td:last-child { padding-right: 0; }
th.n, td.n { text-align: right; }
td .sub { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
tr.me td { background: var(--tint-1); }
tr.qual td:first-child { box-shadow: inset 3px 0 var(--accent); padding-left: 10px; }
.rank { font: 600 14px var(--display); color: var(--muted); width: 22px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .name:hover { text-decoration: underline; text-decoration-color: var(--tint-3); text-underline-offset: 3px; }
.rows { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 0; min-width: 0; }
.list-row + .list-row { border-top: 1px solid var(--rule); }
.list-row .grow { flex: 1; min-width: 0; }
.delta { font-weight: 600; font-size: 13px; }
.delta.up { color: var(--positive); } .delta.down { color: var(--muted); }

/* ---------------------------------------------------------------- elemen khas: lapangan */
.courts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.court-card { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-width: 0; padding: 16px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); }
.court-card .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.court-card .court-name { font: 600 18px/1 var(--display); }
.court { position: relative; display: flex; align-items: center; gap: 0; height: 140px; border-radius: 4px; background: var(--court); color: var(--cream); min-height: 132px; padding: 14px; overflow: hidden; }
.court::before { content: ""; position: absolute; inset: 10px; border: 1.5px solid rgba(245, 240, 220, .55); border-radius: 2px; pointer-events: none; }
.court::after { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 0; border-left: 2px dashed rgba(245, 240, 220, .8); pointer-events: none; }
.court .svc { position: absolute; top: 50%; height: 1.5px; background: rgba(245, 240, 220, .45); }
.court .svc.l { left: 10px; width: calc(50% - 40px); } .court .svc.r { right: 10px; width: calc(50% - 40px); }
.court .side { position: relative; z-index: 1; flex: 1 1 0; display: grid; gap: 4px; align-content: center; padding: 4px 10px; min-width: 0; }
.court .side.b { text-align: right; }
.court .side .pl { font-weight: 600; font-size: 14px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.court .side .lv { font-size: 12px; color: var(--on-inverse-muted); }
.court .score { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--forest); font: 600 22px/1 var(--display); }
.court .score .vs { font: 500 12px var(--font); color: var(--on-inverse-muted); }
.court .score b.win { color: #ff9b78; }
.court.idle { justify-content: center; color: var(--on-inverse-muted); }
.court-card .next { display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: 13px; min-width: 0; overflow: hidden; }
.court-card .next b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------------------------------------------------------------- elemen khas: penggaris Folx Level */
.ruler { position: relative; padding-top: 30px; }
.ruler .track { position: relative; display: flex; height: 14px; border-radius: 999px; overflow: hidden; }
.ruler .band { height: 100%; } .ruler .band + .band { border-left: 2px solid var(--surface); }
.ruler .band.Bronze { background: var(--tint-1); } .ruler .band.Silver { background: var(--tint-2); } .ruler .band.Gold { background: var(--tint-3); }
.ruler .marker { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; transition: left .6s var(--ease); }
.ruler .marker .val { font: 600 13px/1 var(--display); }
.ruler .marker .pin { width: 14px; height: 14px; border-radius: 0 50% 50% 50%; background: var(--accent); transform: rotate(45deg); margin-top: 1px; }
.ruler .labels { position: relative; height: 34px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.ruler .labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ruler .labels span.cls-l { top: 16px; transform: none; font-weight: 600; color: var(--text); }

/* ---------------------------------------------------------------- bracket */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 20px; overflow-x: auto; padding-bottom: 4px; }
.bracket .round { display: grid; align-content: space-around; gap: 12px; }
.bracket .round h4 { font-size: 12px; color: var(--muted); font-weight: 500; }
.bm { display: grid; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.bm .t { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; min-height: 38px; }
.bm .t + .t { border-top: 1px solid var(--rule); }
.bm .t .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bm .t.tbd .nm { color: var(--muted); font-weight: 500; }
.bm .t.w { background: var(--tint-1); }
.bm .t .g { font: 600 15px var(--display); }
.bm .when { padding: 4px 12px 6px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); }

/* ---------------------------------------------------------------- publik */
.pub-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--ground); border-bottom: 1px solid var(--border); }
.pub-top .in { max-width: 1240px; margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 28px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 34px; width: auto; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; } :root[data-theme="dark"] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand .logo-light { display: none; } :root:not([data-theme="light"]) .brand .logo-dark { display: block; } }
.brand .app-name { font: 600 15px/1 var(--display); padding-left: 10px; border-left: 1px solid var(--border); }
.pub-nav { display: flex; gap: 4px; }
.pub-nav a { height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.pub-nav a:hover { color: var(--text); background: var(--raised); }
.pub-nav a[aria-current="page"] { color: var(--tint-ink); background: var(--tint-1); }
.pub-main { max-width: 1240px; margin: 0 auto; padding-block: 28px 64px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.pub-foot { border-top: 1px solid var(--border); }
.pub-foot .in { max-width: 1240px; margin: 0 auto; padding-block: 24px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; gap: 16px 32px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.menu-btn { display: none; }
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--ground); padding: calc(16px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px)); display: grid; align-content: start; gap: 6px; }
.sheet a, .sheet button.item { display: flex; align-items: center; height: 48px; font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--rule); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; padding: 0; cursor: pointer; }

/* hero event: blok forest khas poster brand */
.event-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: center; background: var(--inverse); color: var(--on-inverse); border-radius: 0; padding: 28px; margin-bottom: 32px; }
.event-hero h1 { font: 600 44px/1 var(--display); letter-spacing: -.01em; text-transform: uppercase; }
.event-hero h1 .hl { color: #f07a52; }
.event-hero .lead { margin-top: 14px; font-size: 16px; line-height: 24px; color: var(--on-inverse-muted); max-width: 44ch; }
.event-hero .facts { display: flex; gap: 22px; margin-top: 20px; flex-wrap: wrap; }
.event-hero .facts div { display: grid; gap: 2px; } .event-hero .facts b { font: 600 22px/1.1 var(--display); } .event-hero .facts span { font-size: 12px; color: var(--on-inverse-muted); }
.event-hero .cta { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.event-hero .btn { border-color: rgba(245, 240, 220, .45); color: var(--on-inverse); }
.event-hero .btn:hover { background: rgba(245, 240, 220, .1); }
.event-hero .btn.accent { border-color: transparent; color: var(--cream); }
.event-hero .court-card { background: rgba(245, 240, 220, .06); border-color: rgba(245, 240, 220, .14); color: var(--on-inverse); }
.event-hero .court-card .next { color: var(--on-inverse-muted); } .event-hero .court-card .next b { color: var(--on-inverse); }
.event-hero .court-card .pill { background: rgba(245, 240, 220, .14); color: var(--on-inverse); }
.event-hero .court-card .pill.live { background: var(--clay-deep); color: var(--cream); }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font: 600 28px/1.1 var(--display); }
.section-head p { color: var(--muted); margin-top: 6px; max-width: 64ch; }
.promo { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); background: var(--surface); border: 1px solid var(--border); border-radius: 0; overflow: hidden; }
.promo .txt { padding: 32px; display: grid; gap: 14px; align-content: center; }
.promo h2 { font: 600 34px/1.05 var(--display); text-transform: uppercase; }
.promo img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.event-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--gap); }
.event-card > .pill { align-self: flex-start; }
.event-card > div:last-child { margin-top: auto; }
.event-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); transition: border-color .15s ease, transform .15s var(--ease); }
.event-card:hover { border-color: var(--tint-3); }
.event-card h3 { font: 600 22px/1.1 var(--display); }
.event-card .when { color: var(--muted); }

/* profil pemain */
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 380px); gap: 28px; align-items: center; }
.profile-head h1 { font: 600 36px/1.05 var(--display); }
.profile-head .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-top: 24px; }
.stat-row > div { padding: 14px 16px 14px 0; } .stat-row > div + div { padding-left: 16px; border-left: 1px solid var(--border); }
.stat-row b { display: block; font: 600 24px/1.1 var(--display); } .stat-row span { color: var(--muted); font-size: 13px; }
.share-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.share-wrap img { width: 220px; border-radius: 8px; border: 1px solid var(--border); }

/* level guide */
.level-list { display: grid; }
.level-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) 120px; gap: 20px; padding: 18px 0; border-top: 1px solid var(--rule); align-items: start; }
.level-item h3 { font: 600 20px/1.2 var(--display); }
.level-item ul { margin-top: 8px; padding-left: 18px; color: var(--text); line-height: 22px; }
.q { padding: 18px 0; border-top: 1px solid var(--rule); }
.q legend { font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 4px; }
.q .aspect { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.q fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); }
.opt:hover { border-color: var(--control); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--tint-1); color: var(--tint-ink); }
.opt input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }

/* ---------------------------------------------------------------- admin: ruled T-frame */
.admin { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); grid-template-rows: var(--topbar) minmax(0, 1fr); min-height: 100vh; }
.sidenav { grid-row: 1 / -1; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--border); padding: 0 12px 16px; overflow: auto; }
.sidenav .brand { height: var(--topbar); padding: 0 8px; border-bottom: 1px solid var(--border); margin: 0 -12px 8px; padding-left: 20px; }
.sidenav .brand img { height: 30px; }
.sidenav .group { margin: 18px 10px 6px; font-size: 12px; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 10px; color: var(--muted); font-weight: 600; transition: background-color .15s ease, color .15s ease; }
.nav-item + .nav-item { margin-top: 4px; }
.nav-item svg { width: 18px; height: 18px; flex: none; stroke-width: 1.6; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--tint-1); color: var(--tint-ink); }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.nav-item .badge { margin-left: auto; font-size: 12px; color: var(--tint-ink); background: var(--tint-2); padding: 0 7px; border-radius: 999px; line-height: 20px; }
.sidenav .bottom { margin-top: auto; display: grid; gap: 8px; padding-top: 16px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--raised); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 700; font-size: 13px; background: var(--tint-2); color: var(--tint-ink); flex: none; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 var(--pad); border-bottom: 1px solid var(--border); min-width: 0; }
.topbar .crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; }
.topbar .crumb b { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.topbar .search { position: relative; width: min(320px, 32vw); margin-left: auto; }
.topbar .search input { height: 36px; padding-left: 36px; border-radius: 999px; }
.topbar .search svg { position: absolute; left: 12px; top: 9px; width: 18px; height: 18px; color: var(--muted); }
.topbar .who-switch { display: flex; align-items: center; gap: 10px; padding-left: 16px; height: 100%; border-left: 1px solid var(--border); }
.search-results { position: absolute; top: 42px; left: 0; right: 0; z-index: 25; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; box-shadow: 0 10px 28px rgba(15, 55, 37, .16); }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.search-results a:hover, .search-results a:focus { background: var(--raised); }
.canvas { padding: var(--pad); min-width: 0; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px)); }
.login .box { width: min(460px, 100%); display: grid; gap: 18px; }
.acct { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; width: 100%; }
.acct:hover { border-color: var(--tint-3); }

/* meja panitia */
.desk-court { display: grid; gap: 14px; }
.score-entry { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--raised); }
.se-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.se-row + .se-row { padding-top: 8px; border-top: 1px solid var(--border); }
.score-entry .team { font-weight: 600; min-width: 0; }
.score-entry .steppers { display: flex; align-items: center; gap: 8px; }
.log-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.timeline-grid { display: grid; grid-template-columns: 64px repeat(var(--courts, 2), minmax(0, 1fr)); gap: 6px; }
.timeline-grid .t { font-size: 12px; color: var(--muted); padding-top: 9px; font-variant-numeric: tabular-nums; }
.slot { padding: 8px 10px; border-radius: 10px; background: var(--raised); font-size: 13px; line-height: 17px; min-width: 0; }
.slot b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.c0 { background: var(--tint-1); color: var(--tint-ink); } .slot.c1 { background: var(--tint-2); color: var(--tint-ink); } .slot.c2 { background: var(--pill-pos-bg); color: var(--pill-pos-ink); } .slot.c3 { background: var(--pill-warn-bg); color: var(--pill-warn-ink); }
.meter { position: relative; height: 10px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }
.meter.over i { background: var(--negative); }
.cat-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 92px 80px 96px; gap: 10px 12px; align-items: end; padding: 14px 0; border-top: 1px solid var(--rule); }
.cat-row .f-name { grid-column: 1 / 5; grid-row: 1; }
.cat-row .del { grid-column: 5; grid-row: 1; justify-self: end; margin-bottom: 2px; }
.cat-row:first-child { border-top: 0; padding-top: 0; }
.sticky-col { position: sticky; top: 16px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--inverse); color: var(--on-inverse); padding: 12px 18px; border-radius: 999px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); }
.dialog-back { position: fixed; inset: 0; z-index: 50; background: rgba(10, 30, 20, .5); display: grid; place-items: center; padding: 16px; }
.dialog { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--ground); border-radius: 20px; padding: 24px; box-shadow: 0 20px 48px rgba(0, 0, 0, .3); }

/* ---------------------------------------------------------------- mode TV: layar 16:9 di venue */
.tv { min-height: 100vh; background: var(--forest); color: var(--cream); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 2.2vh; padding: 3vh 3vw; }
.tv .tv-top { display: flex; align-items: center; gap: 2vw; }
.tv .tv-top img { height: 6vh; min-height: 32px; }
.tv .tv-top h1 { font: 600 clamp(22px, 3.4vw, 64px)/1 var(--display); text-transform: uppercase; }
.tv .tv-top .clock { margin-left: auto; font: 600 clamp(20px, 2.6vw, 52px)/1 var(--display); }
.tv .tv-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2vw; min-height: 0; }
.tv .tv-courts { display: grid; grid-template-rows: 1fr 1fr; gap: 2vh; min-height: 0; }
.tv .court-card { background: rgba(245, 240, 220, .06); border-color: rgba(245, 240, 220, .12); color: var(--cream); padding: 2vh 1.4vw; }
.tv .court-card .court-name { font-size: clamp(18px, 1.8vw, 36px); }
.tv .court { height: 100%; min-height: 120px; }
.tv .court-card .stack { height: 100%; grid-template-rows: minmax(0, 1fr) auto; }
.tv .tv-panel h3 { font: 600 clamp(13px, 1vw, 20px)/1 var(--font); color: #cfd8cf; margin: 1.2vh 0 .4vh; }
.tv .court .side .pl { font-size: clamp(14px, 1.5vw, 30px); line-height: 1.2; }
.tv .court .side .lv { font-size: clamp(11px, .9vw, 18px); }
.tv .court .score { font-size: clamp(22px, 2.6vw, 54px); padding: .8vh 1vw; }
.tv .court-card .next { color: #cfd8cf; font-size: clamp(12px, 1vw, 20px); } .tv .court-card .next b { color: var(--cream); }
.tv .court-card .pill { background: rgba(245, 240, 220, .14); color: var(--cream); font-size: clamp(11px, .8vw, 16px); height: auto; padding: .3vh .7vw; }
.tv .court-card .pill.live { background: var(--clay-deep); }
.tv .tv-panel { background: rgba(245, 240, 220, .06); border: 1px solid rgba(245, 240, 220, .12); padding: 2.4vh 1.6vw; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1.6vh; min-height: 0; overflow: hidden; }
.tv .tv-panel h2 { font: 600 clamp(18px, 2vw, 40px)/1 var(--display); text-transform: uppercase; }
.tv .tv-panel table { font-size: clamp(13px, 1.15vw, 24px); }
.tv .tv-panel th { color: #cfd8cf; font-size: clamp(11px, .85vw, 17px); height: auto; padding-bottom: .8vh; }
.tv .tv-panel td { border-top-color: rgba(245, 240, 220, .14); padding-block: 1vh; }
.tv .tv-panel tr.qual td:first-child { box-shadow: inset .35vw 0 var(--clay); }
.tv .dots { display: flex; gap: 8px; } .tv .dots i { width: 10px; height: 10px; border-radius: 0 50% 50% 50%; background: rgba(245, 240, 220, .3); } .tv .dots i.on { background: var(--clay); }
.tv .ticker { display: flex; align-items: center; gap: 1.4vw; background: var(--clay); color: var(--cream); padding: 1.4vh 1.6vw; font: 600 clamp(14px, 1.4vw, 28px)/1.1 var(--display); overflow: hidden; white-space: nowrap; }
.tv .ticker .label { text-transform: uppercase; flex: none; }
.tv .ticker .items { overflow: hidden; text-overflow: ellipsis; font-family: var(--font); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .tv-panel .body { animation: tvIn .5s var(--ease); } }
@keyframes tvIn { from { opacity: 0; transform: translateY(12px); } }
.tv .exit { opacity: .5; }
.tv .exit:hover, .tv .exit:focus-visible { opacity: 1; }
.tv .bm { background: rgba(245, 240, 220, .05); border-color: rgba(245, 240, 220, .14); }
.tv .bm .t + .t, .tv .bm .when { border-color: rgba(245, 240, 220, .12); } .tv .bm .t.w { background: rgba(212, 83, 47, .3); }
.tv .bm .t.tbd .nm, .tv .bm .when { color: #cfd8cf; }

/* ---------------------------------------------------------------- gerak: hanya umpan balik */
@media (prefers-reduced-motion: no-preference) {
  .flash { animation: flash 1.4s var(--ease); }
}
@keyframes flash { 0% { background-color: var(--tint-2); } 100% { background-color: transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; } }

/* ---------------------------------------------------------------- lebar menengah dan HP */
@media (max-width: 1100px) {
  .main-rail { grid-template-columns: minmax(0, 1fr); }
  .profile-head { grid-template-columns: auto minmax(0, 1fr); } .profile-head .ruler-box { grid-column: 1 / -1; }
  .event-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .admin { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); }
  .sidenav { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; background: var(--ground); transform: translateX(-100%); transition: transform .2s var(--ease); padding-top: env(safe-area-inset-top, 0px); }
  .sidenav.open { transform: none; }
  .sidenav .close-side { display: inline-grid; }
  .topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--ground); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 10px; }
  .topbar .search { display: none; }
  .topbar .who-switch { padding-left: 10px; } .topbar .who-switch .who-name { display: none; }
  .menu-btn { display: inline-grid; }
  .canvas { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
  .pub-nav { display: none; }
  .pub-top .in { gap: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .pub-main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 48px; }
  .event-hero { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
  .event-hero h1 { font-size: 34px; }
  .courts { grid-template-columns: minmax(0, 1fr); }
  .court-card .next { flex-wrap: wrap; } .court-card .next b { white-space: normal; }
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .promo { grid-template-columns: minmax(0, 1fr); } .promo .txt { padding: 22px; } .promo h2 { font-size: 26px; } .promo img { min-height: 200px; max-height: 260px; }
  .event-cards { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 0; } .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); } .kpi:nth-child(2n) { border-left: 1px solid var(--border); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .profile-head { grid-template-columns: minmax(0, 1fr); gap: 16px; } .profile-head h1 { font-size: 30px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-row > div:nth-child(3) { padding-left: 0; border-left: 0; } .stat-row > div:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .share-wrap { grid-template-columns: minmax(0, 1fr); } .share-wrap img { width: min(260px, 100%); }
  .level-item { grid-template-columns: 48px minmax(0, 1fr); } .level-item .cls-col { grid-column: 2; }
  .fields.two, .fields.three { grid-template-columns: minmax(0, 1fr); }
  .cat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cat-row .f-name { grid-column: 1; } .cat-row .del { grid-column: 2; }
  .tv .tv-body { grid-template-columns: minmax(0, 1fr); }
  .tv .tv-courts { grid-template-rows: auto auto; }
  .hide-sm { display: none !important; }
  .title-row h1 { font-size: 22px; }
  .section-head h2 { font-size: 24px; }
}
@media (min-width: 901px) { .show-sm { display: none !important; } .sidenav .close-side { display: none; } }
.settings-row h2 { margin: 0; }
@media (max-width: 900px) { .settings-row { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; padding: 20px 0 !important; } }

/* ================================================================ portal FOLX Main */
/* hero beranda: teks besar di kiri, foto lapangan Folx di kanan (bentuk drop) */
.portal-hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 40px; align-items: center; padding-block: 12px 8px; }
.ph-text { display: grid; gap: 18px; align-content: center; }
.ph-text h1 { font: 600 clamp(40px, 5.4vw, 68px)/.98 var(--display); letter-spacing: -.015em; text-transform: uppercase; color: var(--text); max-width: 14ch; }
.ph-text h1 .hl { color: var(--accent-mark); }
.ph-text .lead { font-size: 17px; line-height: 26px; color: var(--muted); max-width: 46ch; }
.ph-text .cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ph-photo { margin: 0; aspect-ratio: 1 / 1; border-radius: 0 50% 50% 50%; overflow: hidden; background: var(--raised); }
.ph-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* pita event: blok forest khas poster brand */
.event-band { background: var(--inverse); color: var(--on-inverse); border-radius: var(--radius-card); padding: 28px; display: grid; gap: 22px; }
.eb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 32px; flex-wrap: wrap; }
.eb-head h2 { font: 600 36px/1.05 var(--display); text-transform: uppercase; margin-top: 10px; }
.eb-head p { color: var(--on-inverse-muted); margin-top: 6px; }
.eb-head .pill.tint { background: rgba(245, 240, 220, .14); color: var(--on-inverse); }
.eb-head .pill.live { background: var(--clay-deep); color: var(--cream); }
.eb-facts { display: flex; gap: 28px; }
.eb-facts div { display: grid; gap: 2px; } .eb-facts b { font: 600 28px/1 var(--display); } .eb-facts span { font-size: 12px; color: var(--on-inverse-muted); }
.cat-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cat-chip { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(245, 240, 220, .18); background: rgba(245, 240, 220, .06); color: var(--on-inverse); font: inherit; cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease); }
.cat-chip b { font: 600 18px/1.1 var(--display); } .cat-chip span { font-size: 13px; color: var(--on-inverse-muted); }
.cat-chip:hover { background: rgba(245, 240, 220, .12); border-color: rgba(245, 240, 220, .32); }
.cat-chip:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.event-band .btn { border-color: rgba(245, 240, 220, .45); color: var(--on-inverse); }
.event-band .btn:hover { background: rgba(245, 240, 220, .1); }
.event-band .btn.primary { background: var(--cream); color: var(--forest); border-color: var(--cream); }
.event-band .btn.primary:hover { background: #e3dcc0; }

/* kartu tutorial */
.learn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.learn-card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); overflow: hidden; color: inherit; text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.learn-card:hover { border-color: var(--control); transform: translateY(-2px); }
.learn-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.learn-card .fig { background: var(--forest); color: var(--cream); padding: 14px 18px; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.learn-card .fig svg { width: 100%; height: 100%; }
.learn-card .txt { padding: 16px 18px 20px; display: grid; gap: 6px; align-content: start; }
.learn-card h3 { font: 600 20px/1.15 var(--display); }
.learn-card p { color: var(--muted); font-size: 14px; line-height: 21px; }

/* kabar + promo */
.news-list { display: grid; border-top: 1px solid var(--border); }
.news-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 18px 4px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; align-items: start; }
.news-row .pill { justify-self: start; }
.news-row h3 { font: 600 20px/1.2 var(--display); }
.news-row p { color: var(--muted); margin-top: 4px; line-height: 21px; }
.news-row:hover h3 { color: var(--tint-ink); }
.news-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.promo-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 18px; border-radius: var(--radius-card); background: var(--tint-1); align-items: start; }
.promo-card .drop { background: var(--accent); }
.promo-card b { font: 600 18px/1.15 var(--display); display: block; }
.promo-card p { color: var(--text); opacity: .85; margin: 4px 0 8px; line-height: 20px; }

/* peringkat kosong */
.lb-empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }

/* artikel */
.article { max-width: 720px; margin: 0 auto; }
.article h1 { font: 600 clamp(32px, 4.2vw, 46px)/1.02 var(--display); margin-top: 14px; letter-spacing: -.01em; }
.article .lead { font-size: 18px; line-height: 28px; color: var(--muted); margin-top: 14px; }
.article > .small.muted { margin-top: 10px; }
.article h2 { font: 600 22px/1.2 var(--display); margin-top: 30px; }
.article p, .article li { font-size: 16px; line-height: 26px; margin-top: 10px; }
.article ul { padding-left: 20px; margin-top: 4px; }
.article li::marker { color: var(--accent-mark); }
.article-fig { margin: 24px 0 0; background: var(--forest); color: var(--cream); border-radius: var(--radius-card); padding: 20px 24px; }
.article-fig svg { width: 100%; height: auto; display: block; max-height: 300px; }
.article + .section { max-width: 1240px; }

/* bracket: label unggulan */
.bm .seed { flex: none; font: 600 11px/1 var(--font); padding: 4px 6px; border-radius: 6px; background: var(--raised); color: var(--muted); }
.bm .t.w .seed { background: var(--tint-2); color: var(--tint-ink); }
.tv .bm .seed { background: rgba(245, 240, 220, .12); color: #cfd8cf; }

/* meja panitia: panel babak gugur */
.ko-row { display: grid; grid-template-columns: minmax(160px, 1fr) auto minmax(0, 1.4fr); gap: 10px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.ko-row:last-child { border-bottom: 0; }
.ko-pairs { grid-column: 1 / -1; }
.ko-pairs:empty { display: none; }
.ko-pairs .small > div { padding: 3px 0; }

/* footer portal */
.pub-foot .in { align-items: flex-start; padding-block: 32px 40px; }
.foot-logo { height: 36px; width: auto; display: block; }
.foot-logo.logo-dark { display: none; }
:root[data-theme="dark"] .foot-logo.logo-light { display: none; } :root[data-theme="dark"] .foot-logo.logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .foot-logo.logo-light { display: none; } :root:not([data-theme="light"]) .foot-logo.logo-dark { display: block; } }
.foot-cols { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 32px; min-width: 0; }
.foot-cols > div { display: grid; gap: 4px; align-content: start; }
.foot-cols b { color: var(--text); font-size: 14px; }

@media (max-width: 1100px) {
  .learn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ko-row { grid-template-columns: minmax(0, 1fr) auto; } .ko-row > .row-flex { grid-column: 1 / -1; justify-content: flex-start !important; }
}
@media (max-width: 900px) {
  .portal-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 4px; }
  .ph-text h1 { font-size: 44px; }
  .ph-photo { aspect-ratio: 4 / 3; border-radius: 0 40% 40% 40%; }
  .event-band { padding: 22px 18px; margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); border-radius: 0; }
  .eb-head h2 { font-size: 28px; }
  .eb-facts b { font-size: 24px; }
  .learn-grid { grid-template-columns: minmax(0, 1fr); }
  .news-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lb-empty { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .foot-cols { grid-template-columns: minmax(0, 1fr); flex-basis: 100%; }
  .ko-row { grid-template-columns: minmax(0, 1fr); } .ko-row > .row-flex { grid-column: 1; }
  .article p, .article li { font-size: 15px; line-height: 24px; }
}
/* teks keterangan di dalam ilustrasi (di atas forest) tetap terbaca */
.learn-card .fig, .article-fig { --muted: #cfd8cf; }
:root[data-theme="dark"] .event-band { border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .event-band { border: 1px solid var(--border); } }
/* klasemen 3 grup berdampingan: tabel ringkas, nama boleh turun baris */
.cols-3 > .panel { padding: 18px 16px; }
.cols-3 th, .cols-3 td { padding-left: 5px; padding-right: 5px; }
.cols-3 td { padding-top: 9px; padding-bottom: 9px; }
.cols-3 .who .name { white-space: normal; overflow: visible; font-size: 13px; line-height: 18px; }
/* bagan: nama rata kiri setelah label unggulan */
.bm .t .nm { flex: 1; min-width: 0; }
.court.idle span { position: relative; z-index: 1; background: var(--court); padding: 4px 10px; border-radius: 6px; }
.learn-card .txt { display: flex; flex-direction: column; }
.learn-card .more { margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 600; color: var(--tint-ink); }
.learn-card:hover .more { text-decoration: underline; text-underline-offset: 3px; }

/* ================================================================ Mode TV (4 layar bergantian) */
.tv.tv-v2 { height: 100vh; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; position: relative; user-select: none; -webkit-user-select: none; }
.tv-v2 .tv-top { gap: 2vw; }
.tv-v2 .tv-title { display: grid; gap: .6vh; min-width: 0; }
.tv-v2 .tv-title .kicker { font: 600 clamp(12px, 1vw, 20px)/1 var(--font); color: #cfd8cf; text-transform: uppercase; letter-spacing: .08em; }
.tv-v2 .tv-title h1 { font: 600 clamp(22px, 3vw, 60px)/1 var(--display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-screen { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 1.6vh; }
@media (prefers-reduced-motion: no-preference) { .tv-screen { animation: tvIn .5s var(--ease); } .tv-screen.flash-in { animation: tvFlash 1.6s var(--ease); } }
@keyframes tvFlash { 0% { opacity: 0; } 15% { opacity: 1; box-shadow: 0 0 0 .4vw var(--clay); } 100% { box-shadow: 0 0 0 0 transparent; } }
.tv-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1.6vw; min-height: 0; }
.tv-cols.one { grid-auto-columns: minmax(0, 900px); justify-content: center; }
.tv-box { background: rgba(245, 240, 220, .06); border: 1px solid rgba(245, 240, 220, .12); padding: 2.2vh 1.4vw; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1.2vh; }
.tv-box > header { display: flex; align-items: baseline; justify-content: space-between; gap: 1vw; }
.tv-box > header h3 { font: 600 clamp(16px, 1.7vw, 34px)/1 var(--display); text-transform: uppercase; }
.tv-box > header span { color: #cfd8cf; font-size: clamp(11px, .9vw, 18px); }
.tv-box table { font-size: clamp(13px, 1.25vw, 26px); }
.tv-box th { color: #cfd8cf; font-size: clamp(11px, .85vw, 17px); height: auto; padding-bottom: .8vh; }
.tv-box td { border-top-color: rgba(245, 240, 220, .14); padding-block: 1.1vh; }
.tv-box tr.qual td:first-child { box-shadow: inset .35vw 0 var(--clay); padding-left: .8vw; }
.tv-note { color: #cfd8cf; font-size: clamp(11px, .95vw, 19px); }
.tv-empty { color: #cfd8cf; font-size: clamp(13px, 1.1vw, 22px); padding: 2vh 0; }
/* hasil */
.tv-result { display: grid; gap: .3vh; padding: 1.1vh 0; border-top: 1px solid rgba(245, 240, 220, .14); }
.tv-result:first-of-type { border-top: 0; }
.tv-result .stg { font-size: clamp(10px, .8vw, 16px); color: #cfd8cf; text-transform: uppercase; letter-spacing: .06em; }
.tv-result .r { display: flex; justify-content: space-between; gap: 1vw; font-size: clamp(13px, 1.2vw, 25px); color: #cfd8cf; }
.tv-result .r .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-result .r b { font: 600 clamp(15px, 1.5vw, 30px)/1 var(--display); }
.tv-result .r.w { color: var(--cream); font-weight: 700; }
.tv-result .r.w b { color: #f07a52; }
/* bagan */
.tv-bracket { display: grid; gap: 1.6vw; overflow: hidden; align-items: stretch; }
.tv-bracket .round { align-content: space-around; }
.tv-bracket .round h4 { font-size: clamp(12px, 1vw, 20px); color: #cfd8cf; text-transform: uppercase; letter-spacing: .06em; }
.tv-bracket .bm .t { min-height: 5vh; font-size: clamp(13px, 1.15vw, 24px); }
.tv-bracket .bm .t .g { font-size: clamp(15px, 1.4vw, 28px); }
.tv-bracket .bm .when { font-size: clamp(11px, .85vw, 17px); }
/* berikutnya */
.tv-next { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.6vw; min-height: 0; }
.tv-next .tv-courts { display: grid; grid-auto-rows: minmax(0, 1fr); gap: 1.6vh; min-height: 0; }
.tv-q { display: flex; align-items: center; gap: 1vw; padding: 1.2vh 0; border-top: 1px solid rgba(245, 240, 220, .14); }
.tv-q:first-of-type { border-top: 0; }
.tv-q .n { flex: none; width: 2.6vw; min-width: 28px; height: 2.6vw; min-height: 28px; display: grid; place-items: center; border-radius: 0 50% 50% 50%; background: rgba(245, 240, 220, .12); font: 600 clamp(13px, 1.1vw, 22px)/1 var(--display); }
.tv-q.first .n { background: var(--clay); }
.tv-q .grow { display: grid; gap: .3vh; min-width: 0; }
.tv-q b { font-size: clamp(14px, 1.3vw, 27px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-q span { color: #cfd8cf; font-size: clamp(11px, .9vw, 18px); }
.tv-q .wait { flex: none; padding: .3vh .6vw; border-radius: 999px; background: rgba(245, 240, 220, .1); }
/* kaki: langkah layar + progres */
.tv-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1vh 2vw; }
.tv-steps { display: flex; gap: 2.2vw; flex-wrap: wrap; }
.tv-step { display: flex; align-items: center; gap: .6vw; color: rgba(245, 240, 220, .55); font-size: clamp(12px, 1.05vw, 21px); }
.tv-step b { font-weight: 600; }
.tv-step.on { color: var(--cream); }
.tv-step.on b { color: #f07a52; }
.tv-step .subs { display: flex; gap: 5px; } .tv-step .subs i { width: 8px; height: 8px; border-radius: 0 50% 50% 50%; background: rgba(245, 240, 220, .3); } .tv-step .subs i.on { background: var(--clay); }
.tv-count { color: #cfd8cf; font-size: clamp(12px, 1vw, 20px); }
.tv-progress { grid-column: 1 / -1; height: 3px; background: rgba(245, 240, 220, .12); overflow: hidden; }
.tv-progress span { display: block; height: 100%; width: 100%; background: var(--clay); transform-origin: left; animation: tvProg linear forwards; }
@keyframes tvProg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .tv-progress span { animation: none; transform: scaleX(1); opacity: .5; } }
/* kontrol manual (klik dua kali) */
.tv-controls { position: absolute; left: 3vw; right: 3vw; bottom: 9vh; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; background: rgba(10, 42, 28, .94); border: 1px solid rgba(245, 240, 220, .2); border-radius: 16px; z-index: 5; }
.tv-controls[hidden] { display: none; }
.tv-controls .btn { color: var(--cream); border-color: rgba(245, 240, 220, .4); }
.tv-controls .btn:hover { background: rgba(245, 240, 220, .1); }
.tv-controls .btn svg { width: 16px; height: 16px; }
.tv-controls .tv-int { display: flex; align-items: center; gap: 8px; color: #cfd8cf; font-size: 14px; }
.tv-controls select { background: transparent; color: var(--cream); border: 1px solid rgba(245, 240, 220, .4); border-radius: 999px; height: 36px; padding: 0 10px; font: inherit; }
.tv-controls select option { color: #0f3725; }
.tv-controls .hint { flex-basis: 100%; color: #cfd8cf; font-size: 12px; }
@media (max-width: 900px) {
  .tv.tv-v2 { height: auto; min-height: 100vh; overflow: visible; }
  .tv-cols { grid-auto-flow: row; }
  .tv-next { grid-template-columns: minmax(0, 1fr); }
  .tv-controls { position: fixed; bottom: 12px; left: 12px; right: 12px; }
}

/* ================================================================ meja panitia: hari main, antrean, nama */
.day-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.day-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.day-card.on { border-color: var(--positive); background: color-mix(in srgb, var(--pill-pos-bg) 45%, transparent); }
.qn { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 0 50% 50% 50%; background: var(--raised); font: 600 13px/1 var(--display); color: var(--text); }
table.queue td { vertical-align: middle; }
.mv { display: inline-flex; gap: 4px; }
.icon-btn.sm { width: 30px; height: 30px; } .icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.q-act { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.shared-name { background: var(--pill-warn-bg); color: var(--pill-warn-ink); border-radius: 6px; padding: 0 4px; }
.rn-scope { border: 0; padding: 8px 0 0; margin: 0; display: grid; gap: 6px; }
.rn-scope legend { color: var(--muted); padding: 0; margin-bottom: 4px; }
.rn-scope label { display: flex; gap: 8px; align-items: center; }
@media (max-width: 900px) { table.queue .mv { display: flex; flex-direction: column; } }
.tv-next .tv-courts { grid-template-rows: none; }
.courts.one { grid-template-columns: minmax(0, 720px); }
.pair-names { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px; } .pair-names .who { display: inline-flex; }
/* Google Drive */
.drive-chip { border: 0; cursor: pointer; font: inherit; }
.drive-chip:disabled { cursor: default; }
.drive-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1.2fr); gap: 16px; }
@media (max-width: 900px) { .drive-grid { grid-template-columns: minmax(0, 1fr); } .topbar .drive-chip { display: none; } }
.tv-top .pill { flex: none; }
