:root {
  color-scheme: light;
  --sky: #7ebde8;
  --bg: #7ebde8;
  --ink: #1c1a12;
  --muted: #5c5748;
  --card: #fff8e6;
  --line: #1c1a12;
  --gold: #f5d84a;
  --accent: #1c1a12;
  --accent-ink: #f5d84a;
  --home: #f5d84a;
  --home-ink: #1c1a12;
  --away: #7ebde8;
  --away-ink: #123047;
  --ball: #fff8e6;
  --ball-line: #1c1a12;
  --patch: #1c1a12;
  --field: #3f9a45;
  --poster: #fff8e6;
}

[data-theme="dark"] {
  color-scheme: dark;
  --sky: #14324a;
  --bg: #14324a;
  --ink: #fff4d4;
  --muted: #d4c7a0;
  --card: #1c2a1c;
  --line: #f5d84a;
  --gold: #f5d84a;
  --accent: #f5d84a;
  --accent-ink: #1c1a12;
  --home: #f5d84a;
  --home-ink: #1c1a12;
  --away: #7ebde8;
  --away-ink: #123047;
  --ball: #fff4d4;
  --ball-line: #1c1a12;
  --patch: #1c1a12;
  --field: #1a3d22;
  --poster: #162416;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Nunito", sans-serif;
  background: var(--poster);
  color: var(--ink);
  display: block;
  padding: 0;
  overflow-x: hidden;
}

.poster {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  background: var(--poster);
}

.hero {
  position: relative;
  background: var(--field);
}

.hero img {
  display: block;
  width: 100%;
  height: 38vw;
  min-height: 180px;
  max-height: 240px;
  object-fit: cover;
  object-position: center 58%;
  pointer-events: none;
}

.theme {
  all: unset;
  position: absolute;
  z-index: 10;
  top: 14px;
  right: 14px;
  box-sizing: border-box;
  width: 76px;
  height: 40px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  border-radius: 999px;
  background: #fff8e6;
  cursor: pointer;
  outline: 3px solid #1c1a12;
}

[data-theme="dark"] .theme {
  background: #162416;
  outline-color: #f5d84a;
}

.theme-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5d84a;
  transition: left 0.2s ease;
  pointer-events: none;
}

[data-theme="dark"] .theme-knob {
  left: 40px;
}

.theme-sun,
.theme-moon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.theme svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #1c1a12;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-sun svg {
  fill: #1c1a12;
}

[data-theme="dark"] .theme svg {
  stroke: #f5d84a;
}

[data-theme="dark"] .theme-sun svg {
  fill: none;
}

[data-theme="dark"] .theme-moon svg {
  fill: #f5d84a;
}

.intro,
main {
  padding-left: 16px;
  padding-right: 16px;
}

main {
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.intro {
  text-align: center;
  padding-top: 22px;
  padding-bottom: 8px;
}

.kicker {
  font-family: "Fredoka", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--field);
}

[data-theme="dark"] .kicker {
  color: var(--gold);
}

h1 {
  font-family: "Fredoka", sans-serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 4px;
}

.lede {
  color: var(--muted);
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 6px;
}

.place {
  color: var(--field);
  text-decoration: none;
  font-weight: 800;
}

[data-theme="dark"] .place {
  color: var(--gold);
}

.place:hover {
  text-decoration: underline;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 14px 0 18px;
}

.btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 14px;
  border: 3px solid var(--line);
  background: var(--poster);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.btn.primary {
  background: var(--gold);
  border-color: var(--line);
  color: #1c1a12;
}

.map {
  display: block;
  margin: 0 0 22px;
  border: 3px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  height: 140px;
  background: var(--card);
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.matches-title,
.cta h2 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.55rem;
  text-align: center;
}

.matches-sub,
.cta p {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  line-height: 1.45;
}

.matches-sub {
  margin: 6px 0 18px;
}

.agenda {
  list-style: none;
  display: grid;
  gap: 18px;
}

.game {
  display: grid;
  gap: 18px;
  width: 100%;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 24px;
  padding: 22px 22px 24px;
  color: inherit;
  font: inherit;
  text-align: left;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  scroll-margin-top: 16px;
}

.game::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 12px;
  height: 6px;
  border-radius: 999px;
  background: var(--gold);
  border: 2px solid var(--line);
}

.game:hover {
  outline: 3px solid var(--gold);
}

.game-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.when {
  display: grid;
  text-align: left;
}

.dow,
.mon {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--muted);
}

.day {
  font-family: "Fredoka", sans-serif;
  font-size: 3.2rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.badge {
  font-family: "Fredoka", sans-serif;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid var(--line);
}

.badge.home {
  background: var(--gold);
  color: var(--home-ink);
}

.badge.away {
  background: var(--away);
  color: var(--away-ink);
}

.badge.played {
  background: var(--ink);
  color: var(--gold);
}

.badge.this-week {
  background: var(--gold);
  color: #1c1a12;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.game-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  background: var(--gold);
  color: #1c1a12;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
}

.bang {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #1c1a12;
  color: #f5d84a;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.jersey {
  font-family: "Fredoka", sans-serif;
  font-size: 3.4rem;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.03em;
}

.versus {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font-family: "Fredoka", sans-serif;
  font-size: 0.95rem;
}

.mini-ball {
  width: 28px;
  height: 28px;
  stroke: var(--ball-line);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-ball circle {
  fill: var(--ball);
}

.mini-ball polygon {
  fill: var(--patch);
  stroke: none;
}

.mini-ball path {
  fill: none;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.98rem;
}

.kickoff {
  display: grid;
  width: 100%;
}

.kick-time {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(3.4rem, 16vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.meta strong {
  color: var(--ink);
}

.tap-hint {
  color: var(--field);
  font-weight: 800;
  font-size: 0.88rem;
  text-align: center;
  padding-bottom: 8px;
}

.match-body {
  position: relative;
  overflow: hidden;
}

.game-x {
  position: absolute;
  inset: 6px 0;
  z-index: 2;
  pointer-events: none;
}

.game-x span {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 50%;
  height: 10px;
  margin-top: -5px;
  background: #e24b3b;
  border: 2px solid var(--line);
  border-radius: 999px;
}

.game-x span:first-child {
  transform: rotate(28deg);
}

.game-x span:last-child {
  transform: rotate(-28deg);
}

.game.played .scoreboard,
.game.played .kick-time,
.game.played .jersey {
  opacity: 0.45;
}

.highlights {
  list-style: none;
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 3;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}

.highlights li {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--muted);
  padding-left: 1.1em;
  position: relative;
}

.highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--line);
}

.highlight-last {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
}

.highlights .highlight-last::before {
  background: var(--gold);
  outline: 2px solid var(--line);
}

[data-theme="dark"] .tap-hint {
  color: var(--gold);
}

.cta {
  margin: 28px 0 32px;
  padding: 22px 18px 8px;
  text-align: center;
  border-top: 4px dashed var(--gold);
}

.cta h2 {
  margin-bottom: 8px;
}

.cta p {
  margin-bottom: 16px;
}

.cta .actions {
  margin: 0 0 12px;
}

.joke-pop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 26, 18, 0.5);
}

.joke-pop[hidden] {
  display: none;
}

.joke-card {
  width: min(420px, 100%);
  background: var(--poster);
  border: 5px solid var(--gold);
  outline: 3px solid var(--line);
  border-radius: 28px;
  padding: 24px 22px 20px;
  text-align: center;
}

.joke-who {
  font-family: "Fredoka", sans-serif;
  color: var(--field);
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.joke-text {
  font-family: "Fredoka", sans-serif;
  font-size: 1.45rem;
  line-height: 1.35;
  margin-bottom: 18px;
  display: grid;
  gap: 10px;
}

.joke-text .highlight-last {
  color: var(--ink);
}

@media (max-width: 520px) {
  .theme {
    top: 10px;
    right: 10px;
    width: 68px;
    height: 36px;
  }

  [data-theme="dark"] .theme-knob,
  .theme-knob {
    width: 28px;
    height: 28px;
  }

  [data-theme="dark"] .theme-knob {
    left: 36px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .day,
  .jersey {
    font-size: 2.4rem;
  }

  .game {
    padding: 16px 12px 20px;
    gap: 14px;
    border-radius: 18px;
  }

  .badge {
    font-size: 0.78rem;
    padding: 6px 9px;
  }

  .game-alert {
    font-size: 0.95rem;
    padding: 7px 12px 7px 7px;
  }

  .bang {
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }

  .meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .cta {
    margin: 22px 0 24px;
    padding-top: 18px;
  }

  .joke-card {
    border-width: 4px;
    padding: 20px 16px 16px;
  }

  .joke-text {
    font-size: 1.25rem;
  }
}

@media (min-width: 700px) {
  body {
    padding: 24px 16px 48px;
  }

  .poster {
    border: 5px solid var(--gold);
    outline: 4px solid var(--line);
    border-radius: 36px;
    overflow: hidden;
  }

  .hero img {
    height: 280px;
    max-height: none;
  }

  .intro,
  main {
    padding-left: 28px;
    padding-right: 28px;
  }

  .map {
    height: 180px;
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .btn {
    flex: 0 1 auto;
    min-width: 140px;
  }
}
