/* ELS Fit — gaya kelompok layar V5 (Turnamen): daftar, wizard, halaman turnamen (klasemen, ronde, bagan, podium, sheet skor).
   Dimiliki V5. Hanya token (tokens.css / fit.css); tanpa warna mentah. Awalan kelas: tn-. Nilai dinamis tidak ada (tanpa atribut style). */

.tn-stack { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.tn-stack > .page-head { margin: 0; }
.main > .tn-stack { margin-top: 0; }
.tn-sec { margin: 0; }

.tn-back {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: var(--tap); padding-right: var(--space-3);
  font-size: var(--fs-sm); font-weight: 700; color: var(--color-muted); text-decoration: none;
}
.tn-back:hover { color: var(--color-text); }
.tn-back .icon { width: 18px; height: 18px; }

.tn-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.tn-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.tn-prog { display: flex; align-items: center; gap: var(--space-3); }
.tn-prog .bar { flex: 1; }
.tn-prog .cap { white-space: nowrap; }
.tn-champ { display: flex; }
.tn-card-pad { padding: var(--space-4) var(--space-4) var(--space-2); }
.tn-card-pad.sub { padding-bottom: var(--space-4); }

/* ---------------------------------------------------------------- daftar */
.tn-hero-t { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.tn-card .card-t, .tn-card .cap { overflow-wrap: anywhere; min-width: 0; }
.tn-card { min-width: 0; }

/* ---------------------------------------------------------------- kepala halaman turnamen */
.tn-hero h1 { font-size: var(--fs-xl); letter-spacing: -.02em; overflow-wrap: anywhere; }
.tn-hero .eyebrow { min-width: 0; overflow-wrap: anywhere; }
.tn-hero .sub { overflow-wrap: anywhere; }
.tn-sesslink { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); font-size: var(--fs-sm); font-weight: 700; color: var(--color-link); text-decoration: none; }
.tn-sesslink .icon { width: 16px; height: 16px; }
.tn-conn:empty, .tn-hero [hidden] { display: none; }
.tn-conn { display: flex; align-items: center; gap: 6px; }
.tn-conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.tn-conn.off { color: var(--warn); }
.tn-conn.off::before { background: var(--warn); }

/* ---------------------------------------------------------------- "Giliranmu main!" */
.tn-turn { padding: var(--space-4); border-radius: var(--radius-lg); border: 1px solid var(--ok-line); background: var(--ok-soft); display: flex; flex-direction: column; gap: var(--space-3); }
.tn-turn-t { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-md); font-weight: 800; color: var(--ok); }
.tn-turn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.tn-turn-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.tn-turn-vs { font-weight: 700; overflow-wrap: anywhere; min-width: 0; flex: 1 1 160px; }
.tn-turn-vs .vs { color: var(--color-muted); font-weight: 600; }

/* ---------------------------------------------------------------- podium */
.tn-podium { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); align-items: end; }
.tn-pod { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.tn-pod .nm { font-size: 12.5px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.tn-pod .vl { font-size: 12px; color: var(--color-muted); }
.tn-stand {
  width: 100%; display: grid; place-items: center; border-radius: 12px 12px 4px 4px; background: var(--color-surface-2);
  border: 1px solid var(--color-border); font-size: 24px; font-weight: 800; color: var(--color-muted);
}
.tn-pod.p1 .tn-stand { height: 74px; background: var(--gradient-primary); color: var(--color-on-primary); border-color: transparent; }
.tn-pod.p2 .tn-stand { height: 54px; }
.tn-pod.p3 .tn-stand { height: 40px; }
.tn-pod.p1 .av-stack { padding: 3px; border-radius: var(--radius-pill); box-shadow: 0 0 0 2px var(--accent); }

/* ---------------------------------------------------------------- klasemen */
.tn-tablewrap { overflow-x: auto; padding: 0 var(--space-3) var(--space-2); }
.tn-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tn-table { table-layout: auto; }
.tn-table th { padding: 6px 4px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--color-border); font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--color-dim); }
.tn-table td { padding: 9px 4px; vertical-align: middle; border-bottom: 1px solid var(--color-border); }
.tn-table th:nth-child(2), .tn-table td:nth-child(2) { width: 100%; max-width: 0; }
.tn-table td.n, .tn-table th.n { white-space: nowrap; padding-left: 8px; }
.tn-table tr:last-child td { border-bottom: 0; }
.tn-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.tn-table tr.me td { background: var(--color-surface-2); }
.tn-table tr.me td:first-child { box-shadow: inset 3px 0 0 var(--color-primary); }
.tn-rank { width: 28px; text-align: center; font-weight: 800; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.tn-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tn-who .nm { font-weight: 700; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }   /* nama lengkap tetap terbaca: membungkus, tidak dipotong */
@media (max-width: 480px) { .tn-who .av-stack { display: none; } }

/* ---------------------------------------------------------------- daftar ronde / laga */
.tn-round.current { border-color: var(--ok-line); }
.tn-mlist { list-style: none; margin: 0; padding: 0; }
.tn-mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--color-border); }
.tn-mrow:first-child { border-top: 0; padding-top: 0; }
.tn-teams { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tn-team { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-weight: 600; }
.tn-team .nm { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.tn-team .sc { margin-left: auto; padding-left: var(--space-2); font-size: var(--fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.tn-team.win { font-weight: 800; }
.tn-team.lose { color: var(--color-muted); }
.tn-team.mine .nm { color: var(--color-link); }
.tn-mact { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.tn-mrow > .sub { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- bagan gugur */
.tn-bracket { position: relative; overflow-x: auto; padding-bottom: var(--space-2); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.tn-bracket-in { position: relative; display: flex; align-items: stretch; gap: 36px; width: max-content; min-width: 100%; padding: 2px; }
.tn-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.tn-line { fill: none; stroke: var(--color-border-strong); stroke-width: 2; stroke-linejoin: round; }
.tn-line.on { stroke: var(--ok); }
.tn-bcol { position: relative; display: flex; flex-direction: column; gap: var(--space-2); width: 232px; flex: none; }
.tn-bcol h3 { margin: 0; }
.tn-bcol-body { flex: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: space-around; gap: var(--space-3); }
.tn-bm { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface-solid); overflow: hidden; }
.tn-bm.ready { border-color: var(--ok-line); }
.tn-bt { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.tn-bt + .tn-bt { border-top: 1px solid var(--color-border); }
.tn-bt .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-bt .sd { font-size: 11px; font-weight: 700; color: var(--color-dim); font-variant-numeric: tabular-nums; }
.tn-bt .sc { margin-left: auto; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tn-bt.win { background: var(--ok-soft); color: var(--ok); }
.tn-bt.tbd { color: var(--color-dim); font-weight: 500; }
.tn-bt.mine .nm { text-decoration: underline; text-decoration-color: var(--color-primary); text-underline-offset: 3px; }
.tn-bm-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--color-border); background: var(--color-surface-2); }
.tn-bm-act { display: flex; gap: 6px; }

/* ---------------------------------------------------------------- sheet skor */
.tn-score-form > * + * { margin-top: var(--space-3); }
.tn-score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.tn-score-grid .field > label { overflow-wrap: anywhere; }
.tn-score-in { min-height: 64px; text-align: center; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tn-verdict { min-height: 1.4em; padding: 0; font-size: var(--fs-sm); font-weight: 600; }
.tn-verdict.good { color: var(--ok); }
.tn-verdict.bad { color: var(--due); }
.tn-elo { padding: var(--space-3); border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface-2); font-size: var(--fs-sm); }
.tn-elo ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tn-elo li { display: flex; justify-content: space-between; gap: var(--space-2); }
.tn-sheet-actions { display: flex; gap: var(--space-2); }
.tn-sheet-actions .btn { flex: 1; }

/* ---------------------------------------------------------------- wizard */
.tn-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.tn-steps li { padding: 8px 4px; text-align: center; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: var(--fs-xs); font-weight: 800; color: var(--color-muted); }
.tn-steps li.done { color: var(--ok); border-color: var(--ok-line); }
.tn-steps li[aria-current="step"] { color: var(--color-link); border-color: var(--color-primary); background: var(--color-primary-soft); }
.tn-form { gap: var(--space-4); }
.tn-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.tn-fs legend { padding: 0; margin-bottom: var(--space-2); font-size: var(--fs-sm); font-weight: 600; }
.tn-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.tn-problem { color: var(--due); font-size: var(--fs-sm); font-weight: 600; }
.tn-problem:empty { display: none; }
.tn-btnrow { display: flex; gap: var(--space-2); }
.tn-btnrow .btn { flex: 1 1 0; white-space: nowrap; }
.tn-btnrow .btn:not(.btn-secondary) { flex-grow: 1.7; }   /* aksi utama lebih lebar: label dengan ikon tidak terpecah dua baris */
.tn-fchips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tn-fchip {
  min-height: var(--tap); padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--color-border-strong);
  background: transparent; color: var(--color-muted); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
}
.tn-fchip:hover { color: var(--color-text); }
.tn-fchip[aria-pressed="true"] { color: var(--color-link); border-color: var(--color-primary); background: var(--color-primary-soft); }
.tn-pickcard { padding: var(--space-2); }
.tn-picks { list-style: none; margin: 0; padding: 0; }
.tn-pick { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 6px var(--space-2); border-radius: var(--radius); cursor: pointer; }
.tn-pick:hover { background: var(--color-surface-2); }
.tn-pick:has(input:checked) { background: var(--color-primary-soft); }
.tn-pick input { width: 22px; height: 22px; flex: none; margin: 0; cursor: pointer; }
.tn-pick:focus-within { outline: 3px solid var(--color-focus); outline-offset: -2px; }
.tn-pick .pk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tn-pick .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-pick .pk-end { display: flex; align-items: center; gap: 6px; flex: none; }
.tn-actionbar {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-2)); z-index: 5;
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); background: var(--color-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow);
}
@media (min-width: 900px) { .tn-actionbar { bottom: var(--space-3); } }

/* pratinjau jadwal */
.tn-pv-teams { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.tn-pv-teams li { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--fs-sm); }
.tn-pv-teams .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tn-pv-rounds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.tn-pv-round ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }

@media (max-width: 380px) {
  .tn-grid2, .tn-score-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tn-bracket { scroll-behavior: auto; }
}
