/* Ithefootball design system — token diselaraskan dengan referensi brand:
   stadium-night dark (#0a0d0b), aksen merah #ff3355, live emerald #00dc64,
   Archivo (display) + Archivo Narrow (condensed), radius 10px.
   ATURAN: tanpa emoji di UI (SVG saja), tanpa scrollbar bawaan browser,
   tanpa kata "otomatis" di copy. Tab/chip row scroll INTERNAL, halaman dikunci. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,700&family=Archivo+Narrow:wght@600;700&display=swap');

:root {
  --bg: #0a0d0b; --bg2: #121613; --card: #121613; --card2: #1a201c; --card3: #232b26;
  --text: #f2f5f2; --muted: #a7b3a9; --faint: #7d8a7f;
  --border: #262e29;
  --emerald: #00dc64; --emerald-dim: rgba(0,220,100,.14);
  --red: #ff3355; --red-dim: rgba(255,51,85,.14);
  --accent-strong: #e8112d; --accent-text: #ff5c74;
  --gold: #f5c518;
  --radius: 10px; --radius-s: 7px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-condensed: 'Archivo Narrow', 'Archivo', system-ui, sans-serif;
  --shadow: 0 8px 28px rgba(0,0,0,.42);
}
[data-theme="light"] {
  --bg: #eef1ee; --bg2: #ffffff; --card: #ffffff; --card2: #f2f4f2; --card3: #e3e8e3;
  --text: #121512; --muted: #48514a; --faint: #5d685f;
  --border: #d3dad3;
  --emerald: #007a35; --emerald-dim: #dcf5e5;
  --red: #d6001c; --red-dim: rgba(214,0,28,.10);
  --accent-strong: #c20019; --accent-text: #c20019;
  --gold: #8a6d00;
  --shadow: 0 8px 24px rgba(20,20,40,.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
[dir="rtl"] { text-align: right; }

/* ——— anti overflow horizontal global ——— */
#app, .page, .container { max-width: 100vw; overflow-x: clip; }
.container { width: min(1200px, 100%); margin: 0 auto; padding: 0 16px; }

/* ——— scroll internal: scrollbar disembunyikan, fade edge ——— */
.hscroll {
  display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(90deg,#000 92%,transparent);
  mask-image: linear-gradient(90deg,#000 92%,transparent);
  padding-bottom: 2px;
}
.hscroll::-webkit-scrollbar { display: none; }
[dir="rtl"] .hscroll { -webkit-mask-image: linear-gradient(-90deg,#000 92%,transparent); mask-image: linear-gradient(-90deg,#000 92%,transparent); }

/* ——— tipografi skor ——— */
.score { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; font-family: var(--font-condensed); }

/* ——— identitas broadcast (dari referensi brand) ——— */
.font-display { font-family: var(--font-display); }
.kicker { font-family: var(--font-condensed); text-transform: uppercase; letter-spacing: .09em; }
.score-num { font-family: var(--font-condensed); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.clip-notch { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%); }

/* ——— logo tim selalu terkurung (anti logo raksasa) ——— */
.stable .tcell img, table img.crest { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }
.league-card img { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.club-head img.crest, .player-head img.crest { width: 76px; height: 76px; object-fit: contain; flex: 0 0 auto; }

/* ——— badge LIVE: titik berdenyut saja ——— */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .45; transform: scale(.8);} }
.live-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--emerald); font-weight: 700; font-size: 11px; letter-spacing: .12em; font-family: var(--font-condensed); background: var(--emerald-dim); border: 1px solid var(--emerald); border-radius: 999px; padding: 3px 8px 2px; white-space: nowrap; }

/* ——— kartu ——— */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip.active { background: var(--emerald-dim); border-color: var(--emerald); color: var(--emerald); }

/* ——— tab bar (scroll internal) ——— */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 12px 16px; font-weight: 700; font-size: 13px; letter-spacing: .04em;
  color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; text-transform: uppercase; }
.tab.active { color: var(--text); border-bottom-color: var(--emerald); }

/* ——— tombol ——— */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: var(--card2); color: var(--text); font-weight: 700; font-size: 14px; }
.btn.primary { background: var(--emerald); border-color: var(--emerald); color: #06110c; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.icon-btn svg, .btn svg { width: 20px; height: 20px; flex: 0 0 auto; }

/* ——— form ——— */
.input, select.input, textarea.input { width: 100%; padding: 12px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: var(--card2); color: var(--text); font-family: var(--font); font-size: 15px; }
.input:focus { outline: 2px solid var(--emerald); border-color: var(--emerald); }
label.f-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }

/* ——— header ——— */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 20px; letter-spacing: -.4px; white-space: nowrap; line-height: 1; flex: 0 0 auto; min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 8px; display: block; flex: 0 0 auto; }
.brand .wordmark { white-space: nowrap; font-family: var(--font-display); }
.brand .wordmark .wm-red { color: var(--accent-text); }
.brand .live-badge { margin-inline-start: 4px; }
@media(max-width:560px){.brand{font-size:17.5px}.brand img{width:30px;height:30px}}
.header-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }

/* ——— bottom nav (mobile) ——— */
.bottom-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 50; display: none;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav .row { display: flex; }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; color: var(--muted); font-size: 10.5px; font-weight: 600; min-width: 0; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--emerald); }
.bottom-nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 760px) { .bottom-nav { display: block; } .page { padding-bottom: 76px; } .top-nav { display: none; } }
@media (min-width: 761px) { .top-nav { display: flex; gap: 4px; } }

/* ——— baris pertandingan (selaras referensi: kolom waktu kiri, tim bertumpuk, skor besar) ——— */
.match-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); min-width: 0; }
.match-row .mwhen { width: 64px; flex: 0 0 auto; padding-top: 3px; min-width: 0; }
.match-row .mday { display: block; font-size: 10.5px; font-weight: 700; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.match-row .mtime { display: block; font-size: 12.5px; margin-top: 1px; font-weight: 700;
  color: var(--muted); font-variant-numeric: tabular-nums; }
.match-row .mtime-live { color: var(--emerald); font-weight: 800; display: inline-flex; align-items: center; }
.match-row .mtime-live .live-dot { margin-inline-end: 5px; width: 7px; height: 7px; }
.match-row .mtime-ft { color: var(--faint); font-weight: 700; }
.match-row .mteams { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.match-row .mteam { display: flex; align-items: center; gap: 10px; min-height: 30px; min-width: 0; }
.match-row .mteam img { width: 24px; height: 24px; object-fit: contain; flex: 0 0 auto; }
.match-row .mname { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.match-row .mscore { font-family: var(--font-condensed); width: 28px; text-align: center; font-size: 22px;
  font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.league-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px; font-weight: 800; font-size: 13px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.delayed-tag { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--card2); color: var(--faint); border: 1px solid var(--border); letter-spacing: .06em; }

/* ——— tabel klasemen ——— */
.stable { width: 100%; border-collapse: collapse; font-size: 14px; }
.stable th { text-align: left; padding: 10px 8px; color: var(--faint); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.stable td { padding: 9px 8px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.stable .pos { width: 34px; font-weight: 800; }
.form-w,.form-d,.form-l { display: inline-flex; width: 20px; height: 20px; border-radius: 6px; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; margin-inline-end: 3px; }
.form-w { background: var(--emerald-dim); color: var(--emerald); } .form-d { background: var(--card2); color: var(--muted); }
.form-l { background: var(--red-dim); color: var(--red); }
.zone-ucl { border-inline-start: 3px solid var(--emerald); } .zone-rel { border-inline-start: 3px solid var(--red); }
.zone-po { border-inline-start: 3px solid var(--gold); }

/* ——— skeleton ——— */
.skel { position: relative; overflow: hidden; background: var(--card2); border-radius: var(--radius-s); min-height: 18px; }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%);} to { transform: translateX(100%);} }

/* ——— misc ——— */
.section-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.card-icon-y { color: #f5c542; } .card-icon-r { color: var(--red); }
.page { padding: 18px 0 40px; }
dialog.itf { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; max-width: min(440px, 92vw); }
dialog.itf::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--card2);
  border: 1px solid var(--border); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 99; }
