/* Mobile first: base rules target phones; wider layouts are added with
   min-width media queries only. */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--text-md)/1.45 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--header-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--space-4) 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

/* Brand lockup: PS chip + PREDICT IT (bold italic, IT in teal) over SPORTS [AI] with a line fading out to the right. Real text, so it stays sharp. */
@font-face { font-family: "Exo 2 Brand"; font-style: italic; font-weight: 900; font-display: swap; src: url("/brand/fonts/exo2-900-italic.woff2") format("woff2"); }
@font-face { font-family: "Exo 2 Brand"; font-style: italic; font-weight: 700; font-display: swap; src: url("/brand/fonts/exo2-700-italic.woff2") format("woff2"); }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text); text-decoration: none; font-family: var(--font-brand); font-style: italic; }
.brand-mark { display: block; width: 34px; height: 34px; flex: none; }
.brand-text { display: grid; line-height: 1; }
.brand-name { font-size: 21px; font-weight: 900; letter-spacing: -0.01em; white-space: nowrap; }
.brand-it { color: var(--color-brand-teal); }
.brand-sub { display: flex; align-items: center; gap: 0.4em; margin-top: 3px; color: var(--color-text-muted); font-size: 8.5px; font-weight: 700; letter-spacing: 0.32em; white-space: nowrap; }
.brand-ai { color: var(--color-brand-ink); background: var(--color-brand-teal); border-radius: 2px; padding: 0.1em 0.2em 0.05em 0.35em; letter-spacing: 0.12em; }
.brand-sub::after { content: ""; flex: 1; min-width: var(--space-4); height: 2px; background: linear-gradient(90deg, var(--color-brand-teal), transparent); border-radius: 1px; }
.brand-large { flex-direction: column; gap: var(--space-3); margin: 0 auto var(--space-2); }
.brand-large .brand-mark { width: 160px; height: 160px; }
.brand-large .brand-name { font-size: 38px; }
.brand-large .brand-sub { font-size: 13px; margin-top: 6px; }

.header-actions { display: flex; align-items: center; gap: var(--space-3); }

.link-button {
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-sm);
}

.badge {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.app-main {
  padding: var(--space-2) var(--space-4) var(--space-4);
  padding-bottom: calc(var(--tab-bar-height) + var(--space-4) + env(safe-area-inset-bottom));
}

.card {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.card h1 { margin: 0 0 var(--space-2); font-size: var(--text-xl); }

.muted { color: var(--color-text-muted); margin: 0 0 var(--space-4); }

.facts { display: grid; gap: var(--space-2); margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: var(--space-3); }
.facts dt { color: var(--color-text-muted); }
.facts dd { margin: 0; font-weight: 600; }

.tab-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--z-tab-bar);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-bar-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.tab-bar a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-height: 44px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.tab-bar a[hidden] { display: none; }

.tab-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-bar a[aria-current="page"] { color: var(--color-accent); }
.tab-bar a[aria-current="page"] .tab-icon { filter: drop-shadow(0 0 4px var(--color-accent)); }

/* Desktop: side navigation and a centred content column. */
@media (min-width: 1024px) {
  .tab-bar {
    inset: var(--header-height) auto 0 0;
    width: 200px;
    height: auto;
    grid-template-columns: 1fr;
    grid-auto-rows: 48px;
    align-content: start;
    padding: var(--space-4) 0;
    border-top: 0;
    border-right: 1px solid var(--color-border);
  }
  .tab-bar a { grid-auto-flow: column; justify-content: start; gap: var(--space-3); padding-left: var(--space-5); font-size: var(--text-sm); }
  .sport-ribbon { margin-left: 200px; }
  .app-main { margin-left: 200px; max-width: 960px; padding: var(--space-5); }
}
