:root {
  --bg: #171719;
  --card: #252528;
  --card-arc: #1d1d1f;
  --text: #f1f3f4;
  --muted: #9aa0a6;
  --muted-2: #8b8e93;
  --line: rgba(255, 255, 255, 0.09);
  --red: #ff2d4d;
  --pill: #3a2629;
  --pill-hover: #4a3236;
  --tab: #352326;
  --tab-active: #4a2d31;
  --tab-border: #c8a5aa;
  --font: "Inter", "Google Sans", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

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

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid #f4c7cd;
  outline-offset: 2px;
}

.page {
  max-width: 500px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.site-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.45rem, 6.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.loading { text-align: center; color: var(--muted); margin: 48px 0; }

/* Hero */
.hero { text-align: center; padding: 14px 0 34px; }

.verdict {
  margin: 0;
  font-size: clamp(5rem, 28vw, 9rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}
.verdict-yes { color: var(--red); }
.verdict-no { color: #dfe7e2; }
.verdict-tie { color: #d9b44a; }
.verdict-live { color: #ffc247; }
.verdict-wait { color: var(--muted); }

.live-dot {
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-right: 0.12em;
  border-radius: 50%;
  background: #ff3b3b;
  vertical-align: middle;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

.subline {
  margin: 14px 0 0;
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 500;
}

/* Team header */
.team-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}
.team-name {
  margin: 0;
  font-size: clamp(1.4rem, 6vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.team-sub { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

.team-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.icon-btn svg { width: 20px; height: 20px; fill: var(--text); }

.follow {
  background: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
}
.follow:hover { background: var(--pill-hover); }
.follow[aria-pressed="true"] { background: #5a2a32; border-color: rgba(255, 255, 255, 0.28); }

.menu {
  position: absolute;
  right: 0;
  top: 46px;
  z-index: 5;
  min-width: 170px;
  background: #2b2b2e;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
}
.menu button:hover { background: rgba(255, 255, 255, 0.08); }

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin: 18px -16px 0;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1 0 auto;
  white-space: nowrap;
  background: var(--tab);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #ecdcde;
}
.tab:hover { background: #432d31; }
.tab[aria-selected="true"] {
  background: var(--tab-active);
  border-color: var(--tab-border);
  color: #fff;
}

.section-title { margin: 22px 0 12px; font-size: 1.15rem; font-weight: 500; }

/* Scoreboard card */
.card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border-radius: 18px;
  padding: 16px 16px 14px;
  isolation: isolate;
}
.card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -25%;
  bottom: -25%;
  right: -16%;
  width: 62%;
  background: var(--card-arc);
  border-radius: 50% 0 0 50% / 50% 0 0 50%;
}

.card-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  margin: 18px 0 16px;
}
.side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.side img, .side svg.logo { width: 46px; height: 46px; object-fit: contain; display: block; }
.side-name { font-size: 0.95rem; font-weight: 500; }
.side-rec { font-size: 0.8rem; color: var(--muted-2); }

.score {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: clamp(1.7rem, 8vw, 2.5rem);
  font-weight: 300;
  white-space: nowrap;
}
.score .dash { color: var(--muted); }

.divider { height: 1px; background: var(--line); border: 0; margin: 0 0 8px; }

.line-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.line-table th, .line-table td { padding: 6px 4px; text-align: center; font-weight: 400; }
.line-table th { color: var(--muted-2); font-size: 0.78rem; }
.line-table th:first-child, .line-table td:first-child { text-align: left; width: 28%; }
.line-table td:first-child { font-weight: 500; }
.line-table .total { font-weight: 700; }
th.total { color: var(--text); }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}
.refresh {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
}
.refresh:hover { background: rgba(255, 255, 255, 0.08); }
.refresh:disabled { opacity: 0.5; cursor: default; }

/* Extra panels */
.panel { margin: 0 0 14px; padding: 14px 16px; background: var(--card); border-radius: 14px; }
.panel p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.88rem; }
.facts dd { margin: 0; font-weight: 500; text-align: right; }
.link-btn { background: none; border: 0; padding: 0; color: #f4c7cd; text-decoration: underline; }

.recent { list-style: none; margin: 18px 0 0; padding: 0; }
.recent li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.recent img, .recent svg.logo { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.recent .when { color: var(--muted); font-size: 0.8rem; min-width: 74px; }
.recent .opp { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .res { font-weight: 600; }
.res-L { color: var(--red); }
.res-W { color: #7fd69a; }
.recent-title { margin: 22px 0 0; font-size: 0.95rem; color: var(--muted); font-weight: 500; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #333337;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .tabs { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .side img, .side svg.logo { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
