@import url('https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@500;600;700;800;900&family=Archivo:wght@400;500;600;700&display=swap');

/* =========================================================
   Sistem desain: Biru & Gold — gaya grafis siaran olahraga
   ========================================================= */
:root {
  --ink: #030916;
  --bg: #050e22;
  --bg2: #081631;
  --panel: #0b1d42;
  --panel2: #10275a;
  --line: #1b3470;
  --line2: #24438a;
  --text: #f2f5fd;
  --muted: #8b9ac0;
  --dim: #5b6b94;

  --blue: #2a63ff;
  --blue-hi: #5b8cff;
  --blue-deep: #0d2a78;

  --gold: #dfb24a;
  --gold-hi: #f8e3a1;
  --gold-lo: #9a6d1f;
  --gold-ink: #1d1404;
  --gold-grad: linear-gradient(180deg, #fbeab0 0%, #e8bd55 42%, #c08f2c 70%, #f1cf73 100%);
  --gold-line: linear-gradient(90deg, transparent, #dfb24a 20%, #f8e3a1 50%, #dfb24a 80%, transparent);
  --silver-grad: linear-gradient(180deg, #ffffff 0%, #cfd6e4 45%, #8f98ab 75%, #dfe5ef 100%);
  --bronze-grad: linear-gradient(180deg, #ffd9b5 0%, #d08a4e 45%, #8f5126 75%, #e0a26c 100%);

  --live: #ff3b4f;
  --ok: #3ccf91;
  --danger: #ff5a6a;

  --a: #4f86ff;
  --b: #dfb24a;

  --r: 6px;
  --cut: 14px;
  --display: 'Saira Condensed', 'Arial Narrow', system-ui, sans-serif;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22, .9, .24, 1);
  --ease-in: cubic-bezier(.6, 0, .8, .2);
  --spring: cubic-bezier(.3, 1.45, .55, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-hi); }
.muted { color: var(--muted); }
.display { font-family: var(--display); letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
svg.i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* panel bersudut potong — ciri khas */
.cut { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }

/* ---------- komponen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r); border: 1px solid var(--line2);
  background: var(--panel); cursor: pointer; font-weight: 600; font-size: 14px; letter-spacing: .01em;
  transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s;
  user-select: none; -webkit-tap-highlight-color: transparent; text-decoration: none; color: var(--text);
}
.btn:hover { border-color: var(--gold-lo); background: var(--panel2); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: var(--gold-grad); color: var(--gold-ink); border-color: #f3d27a; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.blue { background: var(--blue); border-color: var(--blue-hi); color: #fff; }
.btn.danger { background: transparent; border-color: #5b2232; color: #ff9aa5; }
.btn.danger:hover { background: #2a0f18; border-color: #7a2c3f; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--line); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #dfb24a22; }
label.field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
label.field .input { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; color: var(--text); }

.card { position: relative; background: linear-gradient(180deg, var(--panel), #091839); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card.gold-top::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--gold-line); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 3px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--panel2); border: 1px solid var(--line2); white-space: nowrap; }
.chip.live { background: #ff3b4f1c; color: #ff8d99; border-color: #ff3b4f55; }
.chip.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
.chip.done { background: transparent; color: var(--muted); border-color: var(--line); }
.chip.gold { background: var(--gold-grad); color: var(--gold-ink); border-color: transparent; }
.chip.blue { background: var(--blue); border-color: var(--blue-hi); color: #fff; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 1.4s infinite; flex: none; }
.serve-ball { width: .55em; height: .55em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d0, var(--gold) 55%, var(--gold-lo)); display: inline-block; flex: none; animation: serveIn .45s var(--spring); }
.serve-ball.off { visibility: hidden; }

.conn { position: fixed; right: 12px; bottom: 12px; z-index: 50; font-size: 12px; padding: 6px 10px; border-radius: 4px; background: #2a0f18; color: #ff9aa5; border: 1px solid #5b2232; transition: opacity .3s, transform .3s var(--ease); }
.conn.ok { opacity: 0; transform: translateY(10px); pointer-events: none; }

.toast-wrap { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; pointer-events: none; width: min(92vw, 420px); }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--gold); padding: 12px 16px; border-radius: 4px; animation: toastIn .35s var(--ease); box-shadow: 0 12px 30px #000a; font-size: 14px; }
.toast.err { border-left-color: var(--danger); color: #ffc2c8; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }

/* ---------- bracket ---------- */
.bracket-wrap { position: relative; overflow: auto; padding: 8px 4px 16px; }
.bracket { position: relative; display: flex; gap: 56px; min-width: max-content; align-items: stretch; }
.bracket svg.lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.bracket svg.lines path { fill: none; stroke: var(--line2); stroke-width: 1.5; stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400); animation: draw .9s var(--ease) forwards; }
.bracket svg.lines path.won { stroke: var(--gold); stroke-width: 2; }
.b-round { display: flex; flex-direction: column; min-width: 232px; }
.b-round h4 { margin: 0 0 12px; font-family: var(--display); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .22em; color: var(--gold); text-align: center; }
.b-col { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.b-match { position: relative; background: linear-gradient(180deg, #0d2150, #0a1a3f); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; opacity: 0; animation: wipeIn .55s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 50ms + var(--r, 0) * 140ms); }
.b-match.live { border-color: #ff3b4f88; }
.b-match.live::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--live); }
.b-match.mine { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.b-match .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); padding: 5px 10px; background: #061230; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.b-team { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 14px; min-height: 34px; }
.b-team + .b-team { border-top: 1px solid #16306a; }
.b-team .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-team .seed { font-size: 10px; color: var(--dim); width: 14px; text-align: right; font-weight: 700; }
.b-team .sc { font-family: var(--display); font-weight: 700; font-size: 17px; display: flex; gap: 7px; color: var(--dim); font-variant-numeric: tabular-nums; }
.b-team .sc b { color: var(--text); font-weight: 700; }
.b-team.win { background: linear-gradient(90deg, #dfb24a14, transparent 70%); }
.b-team.win .nm { font-weight: 700; color: var(--gold-hi); }
.b-team.win .sc b { color: var(--gold); }
.b-team.lose { opacity: .5; }
.b-team.tbd .nm { color: var(--dim); }
.champion { display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 210px; text-align: center; gap: 10px; }
.champion .cup { width: 64px; height: 64px; color: var(--gold); }
.champion .cup.off { color: var(--line2); }
.champion .lbl { font-family: var(--display); text-transform: uppercase; letter-spacing: .3em; font-size: 12px; color: var(--muted); font-weight: 700; }
.champion .nm { font-family: var(--display); font-size: 28px; font-weight: 800; text-transform: uppercase; line-height: 1; }

/* ---------- klasemen ---------- */
table.standings { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.standings th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); text-align: center; padding: 8px 6px; border-bottom: 1px solid var(--line2); font-weight: 700; }
table.standings th:nth-child(2) { text-align: left; }
table.standings td { padding: 10px 6px; text-align: center; border-bottom: 1px solid #132a5e; }
table.standings td:nth-child(2) { text-align: left; font-weight: 600; }
table.standings tr.q td:first-child { color: var(--gold); font-weight: 800; box-shadow: inset 3px 0 0 var(--gold); }
table.standings tbody tr { animation: wipeIn .5s var(--ease) both; }
.grp-title { font-family: var(--display); font-size: 22px; font-weight: 800; margin-bottom: 8px; letter-spacing: .06em; text-transform: uppercase; }
.grp-title span { color: var(--gold); }

/* ---------- podium ---------- */
.podium { --h: 280px; position: relative; display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 0; max-width: 980px; margin: 0 auto; width: 100%; }
.podium .rays { position: absolute; left: 50%; bottom: 30%; width: 140%; aspect-ratio: 1; transform: translateX(-50%); background: repeating-conic-gradient(from 0deg, #dfb24a10 0 6deg, transparent 6deg 18deg); mask-image: radial-gradient(circle, #000 0%, transparent 62%); -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%); animation: raysSpin 60s linear infinite, fadeIn 1.6s 1.2s both; pointer-events: none; }
.pd { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pd .who { padding: 0 10px 16px; opacity: 0; animation: dropIn .7s var(--spring) both; display: grid; justify-items: center; gap: 6px; }
.pd .medal { width: 54px; height: 54px; }
.pd .tn { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.pd .pl { font-size: 13px; color: var(--muted); }
.pd .plinth { position: relative; width: 100%; height: var(--ph); transform-origin: bottom; transform: scaleY(0); animation: rise .9s var(--ease) both; display: grid; place-items: start center; padding-top: 14px; overflow: hidden; border-top: 2px solid; }
.pd .plinth .rk { font-family: var(--display); font-weight: 900; font-size: 84px; line-height: 1; opacity: .95; }
.pd .plinth::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, #ffffff30 50%, transparent 65%); transform: translateX(-120%); animation: sheen 3.5s 2.4s ease-in-out infinite; }
.pd.p1 .plinth { --ph: var(--h); background: linear-gradient(180deg, #2b2410, #120e04 80%); border-color: var(--gold-hi); }
.pd.p2 .plinth { --ph: calc(var(--h) * .72); background: linear-gradient(180deg, #1d2a44, #0b1426 80%); border-color: #dfe5ef; }
.pd.p3 .plinth { --ph: calc(var(--h) * .52); background: linear-gradient(180deg, #2c1d12, #120a05 80%); border-color: #e0a26c; }
.pd.p1 .rk { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pd.p2 .rk { background: var(--silver-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pd.p3 .rk { background: var(--bronze-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pd.p1 .tn { font-size: 34px; }
.pd.p3 .plinth { animation-delay: .2s; } .pd.p3 .who { animation-delay: 1.0s; }
.pd.p2 .plinth { animation-delay: .45s; } .pd.p2 .who { animation-delay: 1.25s; }
.pd.p1 .plinth { animation-delay: .7s; } .pd.p1 .who { animation-delay: 1.6s; }
.pd .joint { display: grid; gap: 10px; }
.podium-head { text-align: center; margin-bottom: 26px; display: grid; gap: 6px; justify-items: center; }
.podium-head .k { font-family: var(--display); font-weight: 800; letter-spacing: .35em; text-transform: uppercase; color: var(--gold); font-size: 14px; animation: fadeIn .8s both; }
.podium-head .t { font-family: var(--display); font-weight: 900; font-size: 44px; line-height: 1; text-transform: uppercase; animation: wipeIn .8s .1s var(--ease) both; }
.podium-head .rule { width: 160px; height: 2px; background: var(--gold-line); animation: grow .9s .3s var(--ease) both; }

/* ---------- motion ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wipeIn { from { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-8px); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes serveIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes rollIn { 0% { transform: translateY(70%); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes goldFlash { 0% { color: var(--gold-hi); text-shadow: 0 0 18px #dfb24a99; } 100% { text-shadow: none; } }
@keyframes sweep { 0% { background-position: -150% 0; } 100% { background-position: 250% 0; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes raysSpin { to { transform: translateX(-50%) rotate(360deg); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.roll { display: inline-block; animation: rollIn .42s var(--ease); }
.flip { display: inline-block; animation: rollIn .42s var(--ease), goldFlash 1.2s var(--ease); }
.bump { display: inline-block; animation: goldFlash 1s var(--ease); }
.glow { position: relative; }
.glow::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 30%, #dfb24a33 50%, transparent 70%) no-repeat; background-size: 60% 100%; animation: sweep 1.1s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; animation-delay: 0s !important; }
  .b-match, .pd .who { opacity: 1; }
  .pd .plinth { transform: none; }
}
