:root {
  color-scheme: light;
  --ink: #142033;
  --muted: #667085;
  --line: #e6ebf2;
  --paper: #f7f9fc;
  --surface: #ffffff;
  --brand: #cc2035;
  --brand-dark: #8f1626;
  --gold: #f4b63d;
  --court: #2f7f6b;
  --shadow: 0 18px 55px rgba(20, 32, 51, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(204, 32, 53, 0.18), transparent 34%),
    linear-gradient(135deg, #d7dde7, #f7f9fc 48%, #cfd8e6);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-shell {
  width: min(100vw, 430px);
  min-height: min(100vh, 932px);
  min-height: min(100dvh, 932px);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  min-height: 255px;
  color: white;
  background-image:
    linear-gradient(rgba(12, 18, 28, 0.3), rgba(12, 18, 28, 0.78)),
    url("assets/hero-court.svg");
  background-position: center;
  background-size: cover;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 13, 22, 0.08), rgba(9, 13, 22, 0.58));
}

.status-bar,
.hero__content {
  position: relative;
  z-index: 1;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 22px 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero__content {
  padding: 48px 22px 20px;
}

.kicker,
.event-meta,
.eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 5px 0 4px;
  font-size: 2.55rem;
  line-height: 0.96;
  letter-spacing: 0;
}

.event-meta {
  color: rgba(255, 255, 255, 0.9);
  text-transform: none;
}

.event-button {
  width: 100%;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.17);
  color: white;
  text-align: left;
  backdrop-filter: blur(16px);
}

.event-button span,
.event-button strong {
  display: block;
}

.event-button span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
}

.event-button strong {
  margin-top: 2px;
  font-size: 1rem;
}

.tab-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 252, 0.96);
  backdrop-filter: blur(12px);
}

.tab {
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.tab__icon {
  display: grid;
  width: 24px;
  height: 24px;
  margin: 0 auto 4px;
  place-items: center;
  border-radius: 50%;
  background: #e8eef5;
  color: var(--ink);
  font-size: 0.72rem;
}

.tab.is-active {
  background: var(--brand);
  color: white;
}

.tab.is-active .tab__icon {
  background: white;
  color: var(--brand);
}

.content {
  padding: 18px 16px max(30px, env(safe-area-inset-bottom));
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head--tight {
  margin-top: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.15;
}

.pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f5ef;
  color: #13684e;
  font-size: 0.72rem;
  font-weight: 900;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-link {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.quick-link__icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #fff1cf;
  color: #8b5c00;
}

.spotlight,
.game-card,
.standing-card,
.venue-card,
.bracket-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.spotlight {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
}

.spotlight h3,
.spotlight p {
  margin: 0;
}

.spotlight h3 {
  margin-top: 3px;
  font-size: 1.05rem;
}

.spotlight p:last-child {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
  line-height: 1.35;
}

.score-badge {
  flex: 0 0 auto;
  padding: 9px 10px;
  border-radius: 8px;
  background: white;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 950;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 900;
}

.filter-row,
.segmented {
  display: flex;
  gap: 8px;
}

.filter-row {
  overflow-x: auto;
  padding-bottom: 10px;
}

.chip,
.segment {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.segment {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
}

.chip.is-active,
.segment.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.game-list,
.standings-list,
.venue-list {
  display: grid;
  gap: 10px;
}

.game-card {
  padding: 13px;
}

.game-card__top,
.team-row,
.venue-card__top,
.bracket-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-card__top {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.game-card__status {
  color: var(--brand);
}

.team-row {
  padding: 6px 0;
  font-weight: 900;
}

.team-score {
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.game-card__footer {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.standing-card {
  padding: 13px;
}

.standing-card h3,
.venue-card h3,
.bracket-round h3 {
  margin: 0;
  font-size: 0.95rem;
}

.standing-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.standing-table th,
.standing-table td {
  padding: 8px 4px;
  border-top: 1px solid var(--line);
  text-align: right;
}

.standing-table th:first-child,
.standing-table td:first-child {
  text-align: left;
}

.team-select {
  min-width: 170px;
  max-width: 52%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.venue-card {
  padding: 14px;
}

.venue-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.court-count {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eaf5f2;
  color: var(--court);
  font-size: 0.76rem;
  font-weight: 900;
}

.bracket {
  display: grid;
  gap: 14px;
}

.bracket-round {
  display: grid;
  gap: 8px;
}

.bracket-card {
  padding: 12px;
  font-weight: 900;
}

.bracket-card.muted {
  color: var(--muted);
}

.event-sheet {
  width: min(92vw, 390px);
  margin: auto auto 18px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 32, 51, 0.28);
}

.event-sheet::backdrop {
  background: rgba(13, 20, 32, 0.54);
}

.event-sheet form {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.event-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.event-sheet__head h2 {
  margin: 0;
  font-size: 1rem;
}

.close-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--muted);
  font-weight: 900;
}

.event-option {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.event-option span,
.event-option strong {
  display: block;
}

.event-option span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.event-option strong {
  margin-top: 2px;
}

.event-option.is-active {
  border-color: var(--brand);
  background: #fff5f6;
}

@media (min-width: 431px) {
  body {
    padding: 28px;
  }

  .phone-shell {
    border: 9px solid #111827;
    border-radius: 34px;
  }
}

@media (max-width: 360px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .team-select {
    max-width: none;
    width: 100%;
  }
}
