:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --header: #0b1d33;
  --accent: #dc2626;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --card: #151e2e;
    --text: #e8edf5;
    --muted: #8b98ad;
    --line: #243044;
    --header: #08121f;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 16px) 12px calc(env(safe-area-inset-left) + 16px);
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  display: block;
  width: 40px;
  height: 40px;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.icon-button.spinning svg { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  border: 2px solid var(--team);
  border-radius: 999px;
  padding: 6px 16px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
}

.chip[aria-pressed="true"] { background: var(--team); }

main {
  padding: 12px calc(env(safe-area-inset-right) + 12px) 0 calc(env(safe-area-inset-left) + 12px);
  max-width: 640px;
  margin: 0 auto;
}

.next {
  margin: 4px 0 16px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #12335c, #0b1d33);
  color: #fff;
  box-shadow: 0 6px 20px rgba(11, 29, 51, 0.25);
}

.next .eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.next .when {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.next .detail {
  margin-top: 6px;
  font-size: 16px;
  opacity: 0.9;
}

.next .countdown {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 14px;
  font-weight: 600;
}

.next.live .countdown { background: var(--accent); }

.day { margin-bottom: 18px; }

.day h2 {
  margin: 0 4px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.day h2 .rel { color: var(--text); }

.session {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--card);
  border-left: 5px solid var(--team, var(--muted));
}

.session.done { opacity: 0.45; }

.session.live { box-shadow: 0 0 0 2px var(--accent); }

.time {
  min-width: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.time .from {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.time .to {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.info {
  flex: 1;
  min-width: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.team {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--team);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.badge.live {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.where {
  margin-top: 6px;
  font-weight: 600;
}

.locker {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}

footer {
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 24px);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

footer p { margin: 6px 0; }

footer a { color: inherit; }

.status.error { color: var(--accent); }
