/* ============================================================
   TipiStream — shared design system
   ============================================================ */

:root {
  --bg: #060a15;
  --bg-2: #0a1024;
  --panel: rgba(16, 24, 48, 0.72);
  --panel-solid: #0e1730;
  --line: rgba(124, 146, 255, 0.16);
  --line-strong: rgba(124, 146, 255, 0.32);
  --text: #eef2ff;
  --muted: #93a0c4;
  --muted-2: #6b7899;
  --brand: #7c5cff;
  --brand-2: #00d4ff;
  --accent: #ff3b6b;
  --live: #22e08a;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(3, 8, 24, 0.55);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(124, 92, 255, 0.28), transparent 60%),
    radial-gradient(760px 480px at 92% 4%, rgba(0, 212, 255, 0.18), transparent 62%),
    radial-gradient(700px 520px at 50% 108%, rgba(255, 59, 107, 0.12), transparent 65%),
    linear-gradient(180deg, #070c1a 0%, #05080f 100%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: rgba(124, 92, 255, 0.45); }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.65), rgba(0, 212, 255, 0.5));
  border-radius: 99px;
  border: 2px solid var(--bg);
}

/* ---------- layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 clamp(12px, 2.4vw, 28px);
}

.page { padding: 22px 0 72px; }

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

/* ============================================================
   Header
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(7, 12, 26, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(140%);
}

.app-header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 10px clamp(12px, 2.4vw, 28px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__logo {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 6px 16px rgba(124, 92, 255, 0.45));
  transition: transform 0.25s ease;
}
.brand:hover .brand__logo { transform: scale(1.06); }

.brand__name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.brand__name span { color: var(--brand-2); }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #04140c;
  background: linear-gradient(135deg, var(--live), #7cf0bb);
  border-radius: 99px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #04140c;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.app-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 99px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.nav-link:hover { color: var(--text); background: rgba(124, 146, 255, 0.1); }
.nav-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.32), rgba(0, 212, 255, 0.16));
  border-color: var(--line-strong);
}

.clock-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #dfe6ff;
  background: rgba(124, 146, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 99px;
  white-space: nowrap;
}
.clock-chip::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 10px var(--brand-2);
}

.btn-donate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #fff;
  border-radius: 99px;
  background: linear-gradient(135deg, #ff3b6b, #ff7a3d);
  box-shadow: 0 10px 24px rgba(255, 59, 107, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn-donate:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 59, 107, 0.45);
}

/* ============================================================
   Home — hero
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
  margin-bottom: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 88% 0%, rgba(0, 212, 255, 0.2), transparent 62%),
    radial-gradient(520px 300px at 8% 100%, rgba(124, 92, 255, 0.3), transparent 65%),
    linear-gradient(135deg, rgba(20, 28, 58, 0.9), rgba(9, 14, 32, 0.9));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(124, 146, 255, 0.22);
  box-shadow: 0 0 0 46px rgba(124, 146, 255, 0.05), 0 0 0 92px rgba(124, 146, 255, 0.03);
  pointer-events: none;
}

/* Varian ringkas: Home fokus ke papan pertandingan. */
.hero--compact { padding: clamp(18px, 2.6vw, 30px); margin-bottom: 18px; }
.hero--compact .hero__title { font-size: clamp(1.45rem, 3vw, 2.1rem); margin-bottom: 8px; }
.hero--compact .hero__sub { max-width: 560px; font-size: 0.88rem; }
.hero--compact .hero__stats { margin-top: 16px; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 14px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b7c6ff;
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: 99px;
}

.hero__title {
  font-size: clamp(1.7rem, 4vw, 2.9rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.hero__title span {
  background: linear-gradient(100deg, #9c86ff, #00d4ff 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.4vw, 1.02rem);
  line-height: 1.6;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.stat {
  flex: 1 1 110px;
  max-width: 190px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(7, 12, 26, 0.55);
  border: 1px solid var(--line);
}
.stat__num {
  font-size: 1.35rem;
  font-weight: 900;
  background: linear-gradient(120deg, #fff, #9fb3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- toolbar / search ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 26px 0 18px;
}

.toolbar__title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  color: #cbd7ff;
  background: rgba(124, 92, 255, 0.18);
  border: 1px solid rgba(124, 92, 255, 0.3);
}

.search {
  position: relative;
  margin-left: auto;
  width: min(340px, 100%);
}
.search input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(10, 16, 36, 0.8);
  border: 1px solid var(--line);
  border-radius: 99px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}
.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--muted-2);
  fill: none;
  stroke-width: 2;
}

/* ---------- quick chips ---------- */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.chip {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(16, 24, 48, 0.7);
  border: 1px solid var(--line);
  border-radius: 99px;
  transition: all 0.2s ease;
}
.chip:hover, .chip.is-active {
  color: #fff;
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(0, 212, 255, 0.16));
}

/* ============================================================
   Category grid
   ============================================================ */
.section { margin-bottom: 34px; }

.section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section__head h2 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.section__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 12px;
}

.cat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(21, 30, 62, 0.92), rgba(10, 15, 34, 0.92));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.cat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 120px at 100% 0%, rgba(0, 212, 255, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 36px rgba(4, 9, 26, 0.6);
}
.cat-card:hover::before { opacity: 1; }

.cat-card__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(0, 212, 255, 0.18));
  border: 1px solid rgba(124, 146, 255, 0.24);
}

.cat-card__body {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.cat-card__name {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-card__meta {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-card__arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: var(--muted-2);
  transition: transform 0.22s ease, color 0.22s ease;
}
.cat-card:hover .cat-card__arrow {
  color: var(--brand-2);
  transform: translateX(3px);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* ---------- kategori ringkas (details) ---------- */
.cat-fold {
  margin-top: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(10, 16, 36, 0.55);
  overflow: hidden;
}

.cat-fold__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease;
}
.cat-fold__head::-webkit-details-marker { display: none; }
.cat-fold__head:hover { background: rgba(124, 146, 255, 0.07); }

.cat-fold__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 800;
}

.cat-fold__hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted-2);
}
.cat-fold__hint::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.22s ease;
}
.cat-fold[open] .cat-fold__hint::after {
  transform: rotate(-135deg) translateY(-2px);
}

.cat-fold > div {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* ============================================================
   Panels / sidebar
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
.layout > * { min-width: 0; }

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 82px;
  min-width: 0;
}

.panel {
  min-width: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 36, 0.4);
}
.panel__head h3 {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.panel__head .count-pill { margin-left: auto; }

.panel__body { padding: 14px 16px; }

/* ticker */
.ticker {
  position: relative;
  overflow: hidden;
  padding: 11px 0;
  border-radius: var(--radius);
  background: rgba(7, 12, 26, 0.65);
  border: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker__track {
  display: inline-flex;
  gap: 42px;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll 34s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cfd8ff;
}
.ticker__item::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 8px var(--brand-2);
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* chat */
.chat-frame {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
  background: #0b1120;
}
.chat-frame--tall { height: 520px; }

/* donate */
.donate-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 59, 107, 0.32);
  background:
    radial-gradient(300px 160px at 100% 0%, rgba(255, 122, 61, 0.28), transparent 70%),
    linear-gradient(150deg, rgba(48, 18, 40, 0.9), rgba(14, 15, 35, 0.92));
}
.donate-card h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.donate-card p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 14px;
}
.donate-card .btn-donate { width: 100%; justify-content: center; }
.donate-top {
  margin-top: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(7, 12, 26, 0.6);
}
.donate-top iframe { display: block; width: 100%; border: 0; }

/* ============================================================
   Watch / category page
   ============================================================ */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted-2);
  margin-bottom: 16px;
}
.crumbs a { color: var(--muted); transition: color 0.2s ease; }
.crumbs a:hover { color: var(--brand-2); }
.crumbs__sep { opacity: 0.5; }
.crumbs strong { color: var(--text); font-weight: 700; }

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-title h1 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.page-title .count-pill { font-size: 0.75rem; }

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

.player-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(16, 24, 48, 0.9), rgba(8, 12, 26, 0.94));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  background: #000;
}
.player-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 14px;
  align-content: center;
  background: radial-gradient(circle at 50% 45%, #0d1428, #04060d 75%);
  color: var(--muted);
  font-size: 0.85rem;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.player-loader.is-hidden { opacity: 0; visibility: hidden; }
.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(124, 146, 255, 0.18);
  border-top-color: var(--brand-2);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: rgba(10, 16, 36, 0.55);
}

.now-playing { min-width: 0; flex: 1; }
.now-playing__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 3px;
}
.now-playing__name {
  font-size: 0.98rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  border-radius: 99px;
  color: #ffd9e4;
  background: rgba(255, 59, 107, 0.18);
  border: 1px solid rgba(255, 59, 107, 0.4);
}
.live-tag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--muted);
  background: rgba(124, 146, 255, 0.08);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}
.icon-btn:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(124, 92, 255, 0.22);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-hint {
  margin: 14px 0 0;
  font-size: 0.78rem;
  color: var(--muted-2);
  line-height: 1.6;
}

/* channel list */
.ch-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 560px;
  overflow-y: auto;
  padding: 12px;
}

.ch-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(13, 20, 42, 0.75);
  transition: all 0.18s ease;
}
.ch-item:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}
.ch-item:hover {
  border-color: var(--line-strong);
  background: rgba(124, 92, 255, 0.14);
  transform: translateX(3px);
}
.ch-item.is-active {
  border-color: rgba(124, 92, 255, 0.65);
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.38), rgba(0, 212, 255, 0.16));
  box-shadow: 0 10px 22px rgba(60, 40, 160, 0.3);
}

.ch-item__num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #cbd7ff;
  background: rgba(7, 12, 26, 0.6);
  border: 1px solid var(--line);
}
.ch-item.is-active .ch-item__num {
  color: #04121a;
  background: linear-gradient(135deg, #fff, #bfefff);
  border-color: transparent;
}
.ch-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.ch-item__label {
  max-width: 100%;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-item__tag {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: var(--muted-2);
  background: rgba(124, 146, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}
.ch-item.is-active .ch-item__tag {
  color: #dff6ff;
  border-color: rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.12);
}
.ch-item__play {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}
.ch-item.is-active .ch-item__play { color: #eaf6ff; }

.ch-list--empty {
  padding: 26px 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted-2);
}

/* Ringkasan laga aktif di atas daftar stream (mode ?m=). */
.ch-match {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(21, 30, 62, 0.9), rgba(10, 15, 34, 0.9));
}
.ch-match[hidden] { display: none; }
.ch-match__league {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.ch-match__teams {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}
.ch-match__vs {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.ch-match__foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted-2);
}

/* ============================================================
   Live match board (feed oneball)
   ============================================================ */
.feed-status {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px dashed var(--line-strong);
}

.section-match { margin-top: 26px; }

.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 10px;
}
.match-grid > * { min-width: 0; }

.match-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 15px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(21, 30, 62, 0.92), rgba(10, 15, 34, 0.92));
  border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.match-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 32px rgba(4, 9, 26, 0.55);
}
.match-card.is-live {
  border-color: rgba(34, 224, 138, 0.42);
  background:
    radial-gradient(260px 140px at 100% 0%, rgba(34, 224, 138, 0.14), transparent 70%),
    linear-gradient(150deg, rgba(21, 30, 62, 0.94), rgba(10, 15, 34, 0.94));
}
.match-card.is-ended { opacity: 0.62; }

.match-card__top,
.match-card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
/* Tanpa badge liga (sumber tidak menyebut cabangnya) status tetap di kanan. */
.match-card__top .match-status { margin-left: auto; }
.match-card__league {
  min-width: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-card__foot {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted-2);
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.match-card__teams {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}
.match-card__vs {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(124, 146, 255, 0.1);
  border: 1px solid var(--line);
}
.match-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--brand-2);
}
.match-card.is-ended .match-card__cta { color: var(--muted-2); }

.match-status {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-radius: 99px;
  color: #cbd7ff;
  background: rgba(124, 146, 255, 0.14);
  border: 1px solid var(--line);
}
.match-status.is-live {
  color: #04140c;
  background: linear-gradient(135deg, var(--live), #7cf0bb);
  border-color: transparent;
  animation: pulse 1.8s ease-in-out infinite;
}
.match-status.is-soon {
  color: #ffe8c2;
  background: rgba(255, 176, 59, 0.16);
  border-color: rgba(255, 176, 59, 0.4);
}
.match-status.is-ended { color: var(--muted-2); }

.empty-state--sm {
  padding: 22px 16px;
  font-size: 0.84rem;
}
.empty-state a { color: var(--brand-2); font-weight: 700; }

/* Papan pertandingan di Home */
#matchBoard .match-grid { margin-top: 4px; }
#matchFilters { margin-bottom: 10px; }

/* Filter liga — satu baris yang bisa digeser ke samping */
.league-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.league-bar::-webkit-scrollbar { display: none; }
.league-bar .chip { flex: 0 0 auto; white-space: nowrap; }
.league-bar .chip--all {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #0b1226;
  box-shadow: 10px 0 14px -10px rgba(0, 0, 0, 0.95);
}
.league-bar .chip--all:hover { background: #131c38; }
.league-bar .chip--all.is-active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, #332a63, #16324a);
  box-shadow: 10px 0 14px -10px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(124, 92, 255, 0.25);
}
.chip__count {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(124, 146, 255, 0.14);
  border-radius: 99px;
}
.chip.is-active .chip__count { color: var(--text); background: rgba(255, 255, 255, 0.16); }
.chip__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(34, 224, 138, 0.16);
  vertical-align: 1px;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 500;
  transform: translate(-50%, 16px);
  padding: 11px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #04121a;
  background: linear-gradient(135deg, #ffffff, #bdf0ff);
  border-radius: 99px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: 40px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.78rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand-2); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .watch-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 900px) {
  .layout, .watch-grid { grid-template-columns: minmax(0, 1fr); }
  .side-stack { position: static; }
  .chat-frame { height: 360px; }
  .ch-list { max-height: none; }
}

@media (max-width: 760px) {
  .app-header__inner { min-height: 60px; gap: 10px; }
  .brand__logo { height: 34px; }
  .brand__name { font-size: 0.95rem; }
  .live-pill { display: none; }
  .clock-chip { display: none; }
  .app-nav .nav-link span { display: none; }
  .nav-link { padding: 9px 11px; }
  .btn-donate { padding: 9px 13px; font-size: 0.8rem; }
  .hero { padding: 22px 18px; }
  .hero::after { display: none; }
  .hero__stats { gap: 8px; }
  .stat { flex: 1 1 100px; padding: 10px 12px; }
  .stat__num { font-size: 1.1rem; }
  .toolbar { gap: 10px; }
  .search { margin-left: 0; width: 100%; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 9px; }
  .cat-card { padding: 12px; gap: 10px; }
  .cat-card__icon { width: 36px; height: 36px; font-size: 1rem; }
  .cat-card__name { font-size: 0.84rem; }
  .page { padding: 16px 0 48px; }
  .player-shell { min-height: 200px; }
  .player-bar { padding: 11px 12px; gap: 8px; }
  .chat-frame { height: 300px; }
  .match-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
  .match-card { padding: 11px 12px; }
  .match-card__teams { font-size: 0.84rem; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 10px; }
  .app-header__inner { padding: 8px 10px; }
  .brand__name { display: none; }
  .hero__title { font-size: 1.5rem; }
  .hero__sub { font-size: 0.85rem; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-card__meta { font-size: 0.66rem; }
  .section__head h2 { font-size: 0.9rem; }
  .panel__head { padding: 11px 12px; }
  .panel__body { padding: 11px 12px; }
  .ch-list { padding: 9px; }
  .ch-item { padding: 9px 10px; }
  .ch-item__label { font-size: 0.8rem; }
  .ch-item__tag { display: none; }
  .ch-item.is-active .ch-item__play { display: none; }
  .match-grid { grid-template-columns: minmax(0, 1fr); }
  .match-card__foot { font-size: 0.66rem; }
  .toast { bottom: 16px; font-size: 0.78rem; padding: 9px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .ticker__track { animation: none; }
}
