:root {
  --bg: #050810;
  --card: #0c1322;
  --card2: #111a2e;
  --border: #1a2436;
  --text: #e8edf5;
  --muted: #8b98ad;
  --primary: #3b82f6;
  --primary-dim: #3b82f626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
}
main { max-width: 720px; margin: 0 auto; padding: 0 14px 60px; }
.dim { color: var(--muted); font-weight: 400; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; max-width: 720px; margin: 0 auto;
}
.brand {
  font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 22px; letter-spacing: 0.5px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .brand { font-size: 16px; letter-spacing: 0; }
  .brand-logo { width: 28px; height: 28px; }
}
.brand span { color: var(--primary); }
.iconbtn {
  background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer;
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:hover { color: var(--text); background: var(--card2); }

/* year + tabs */
.yearrow { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 14px; }
.coffee { font-size: 18px; text-decoration: none; width: 38px; height: 38px; border: 1px solid #4a3b1e; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #1a1503; }
.year {
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 20px;
  border: 1px solid var(--primary); border-radius: 999px; padding: 8px 26px; color: var(--text);
}
.yeararrow { background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; padding: 4px 10px; }
.yeararrow:hover { color: var(--text); }
.tabsrow { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tabs { display: flex; flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.tabs button {
  flex: 1; background: none; border: none; color: var(--muted); font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 13px; padding: 9px 4px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tabs button.active { background: var(--primary); color: #fff; }

/* week strip */
.striprow { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
#weekstrip {
  display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; padding: 2px;
}
#weekstrip::-webkit-scrollbar { display: none; }
.weekbtn {
  background: none; border: none; color: var(--muted); font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 13px; padding: 8px 13px; border-radius: 10px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.weekbtn:hover { color: var(--text); }
.weekbtn.active { background: var(--primary); color: #fff; }

/* ticker */
#ticker {
  display: none; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 14px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
#ticker-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* week meter */
#weekmeter { display: none; margin-bottom: 12px; }
.weekmeter-inner {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 16px;
}
.wm-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.wm-text { flex: 1; min-width: 0; }
.wm-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.wm-label { font-size: 14px; font-weight: 600; margin-top: 2px; }
.wm-score { font-family: 'Orbitron', sans-serif; font-size: 26px; font-weight: 700; }
.wm-score .dim { font-size: 12px; font-family: 'Inter', sans-serif; }

#copyhigh {
  display: none; width: 100%; background: var(--primary-dim); border: 1px solid #3b82f64d; color: var(--primary);
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; border-radius: 12px;
  padding: 12px; cursor: pointer; margin-bottom: 14px;
}
#copyhigh:hover { background: #3b82f63d; }

/* day + cards */
.dayhead {
  text-align: center; font-size: 11px; letter-spacing: 2px; color: var(--muted);
  font-weight: 600; margin: 22px 0 10px;
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; margin-bottom: 14px;
}
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; min-height: 24px; }
.badge {
  font-size: 11px; font-weight: 700; background: var(--card2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px;
}
.badge.live { color: #ef4444; border-color: #ef444455; }
.gdate { font-size: 13px; font-weight: 600; }
.gtime { font-size: 13px; color: var(--primary); font-weight: 600; margin-left: 8px; }
.net { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.notes { margin-bottom: 8px; }
.note-chip {
  display: inline-block; font-size: 11px; color: #f0b429; background: #f0b42914;
  border: 1px solid #f0b42930; border-radius: 6px; padding: 2px 8px; margin: 0 6px 4px 0;
}
.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 8px 0 12px; }
.team { text-align: center; }
.team .logo { width: 62px; height: 62px; object-fit: contain; margin-bottom: 6px; }
.team .abbr { font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 19px; }
.team .tscore { color: var(--primary); margin-left: 6px; }
.team .tname { font-size: 12px; color: var(--muted); margin-top: 2px; }
.team .record { font-size: 11px; color: var(--muted); }
.team.winner .abbr { color: #22c55e; }
.middle { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 92px; }
.vs { font-family: 'Orbitron', sans-serif; color: var(--muted); font-weight: 700; font-size: 14px; }
.chip {
  font-size: 11px; color: var(--muted); background: var(--card2); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px; white-space: nowrap;
}
.revealbtn {
  background: var(--primary); color: #fff; border: none; border-radius: 10px; font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 12.5px; padding: 9px 14px; cursor: pointer; white-space: nowrap;
}
.revealbtn:hover { background: #2f6fd6; }
.hidebtn {
  background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px;
  font-size: 11px; padding: 5px 10px; cursor: pointer;
}
.hidebtn:hover { color: var(--text); }
.venue { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.commentary { font-size: 13px; color: var(--text); line-height: 1.45; margin-bottom: 8px; }
.mvp { font-size: 13px; margin: 6px 0; }
.mvp-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-weight: 700; }
.recap { font-size: 12.5px; color: var(--muted); font-style: italic; margin-bottom: 6px; }
.factsbtn {
  background: none; border: none; color: var(--primary); opacity: 0.75; font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 0; display: block;
}
.factsbtn:hover { opacity: 1; }
.factsbtn:disabled { opacity: 0.5; cursor: default; }
.facts-panel { background: var(--primary-dim); border: 1px solid #3b82f62b; border-radius: 12px; padding: 10px 12px; margin: 6px 0; }
.facts-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.facts-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-weight: 700; }
.facts-nav { font-size: 10px; color: var(--muted); }
.facts-nav button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 5px; }
.facts-nav button:hover { color: var(--primary); }
.facts-body { font-size: 12.5px; line-height: 1.5; }
.src { font-size: 10px; color: var(--primary); border: 1px solid #3b82f633; border-radius: 4px; padding: 1px 5px; text-decoration: none; margin-left: 5px; }
.facts-fail { font-size: 12px; padding: 4px 0; }
.yt { display: block; font-size: 12px; color: #ef4444; text-decoration: none; margin: 4px 0 10px; }
.yt:hover { text-decoration: underline; }

/* meter */
.meter { background: var(--card2); border-radius: 12px; padding: 10px 13px; margin-top: 4px; }
.meter-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.meter-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; flex: 1; }
.meter-label { font-size: 11px; font-weight: 600; white-space: nowrap; }
.meter-score { font-size: 12px; font-weight: 700; font-family: 'Orbitron', sans-serif; white-space: nowrap; }
.meter-score .dim { font-family: 'Inter', sans-serif; font-size: 10px; }
.meter-bar { height: 6px; background: #ffffff12; border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; transition: width 0.7s; }
.hype { margin-top: 9px; }
.hype-line { font-size: 11.5px; color: var(--muted); padding: 1.5px 0; }
.leaders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.leader { background: var(--card2); border-radius: 10px; padding: 8px 10px; }
.leader-cat { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 700; }
.leader-name { font-size: 12.5px; font-weight: 600; margin-top: 3px; }
.leader-val { font-size: 11px; margin-top: 1px; }

.error { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }

/* loading */
#loading {
  position: fixed; inset: 0; background: #050810cc; display: none;
  align-items: center; justify-content: center; z-index: 40;
}
.spinner {
  width: 42px; height: 42px; border: 4px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* dialog */
dialog {
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; max-width: 420px; width: calc(100% - 40px);
}
dialog::backdrop { background: #000000aa; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dlg-head h2 { font-size: 18px; }
.about { background: var(--card2); border-radius: 10px; padding: 12px; font-size: 13px; margin-top: 10px; line-height: 1.5; }

.card-when { display: flex; flex-direction: column; align-items: flex-start; }
.card-when .gtime { margin-left: 0; }

.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
