:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #5c564c;
  --line: #e4dccf;
  --paper: #f6f1e8;
  --card: #fffdf8;
  --field: #1f6b45;
  --field-soft: #e5f2ea;
  --warn: #8a4b12;
  --cancel: #8d3b32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

a { color: var(--field); }

.wrap { max-width: 42rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

header.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1.5rem;
}

header.top strong { font-size: 1.15rem; letter-spacing: 0.01em; }

nav { display: flex; gap: 0.8rem; font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 0.92rem; }

h1 { font-size: 1.7rem; font-weight: 600; margin: 0 0 0.4rem; }

h2 { font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 0.4rem; }

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 0.55rem 0;
}

.card h3 { margin: 0 0 0.2rem; font-size: 1.15rem; }

.leave {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: var(--field-soft);
  color: var(--field);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  margin-top: 0.55rem;
}

.leave strong { font-size: 1.05rem; }
.leave-row { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: baseline; }
.leave-row + .leave-row { margin-top: 0.35rem; }
.leave .role {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 4.5rem;
}
.leave .reason { margin: 0.35rem 0 0; }
.event-head { display: flex; gap: 0.75rem; align-items: center; }
.event-main { min-width: 0; flex: 1; }
.event-main h1, .event-card h3 { margin: 0; }
.event-card h3 { font-size: 1.15rem; }
.badges { margin: 0 0 0.15rem; }
.when, .address { margin: 0.15rem 0 0; }
.crests { display: flex; align-items: center; gap: 0.3rem; flex: none; }
.vs { font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 0.72rem; color: var(--muted); }
.crest, .crest.fallback {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.crest.fallback {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: white;
  background: hsl(var(--hue) 42% 36%);
}
a.crest-link { text-decoration: none; color: inherit; }
.icon-row { display: flex; gap: 0.45rem; align-items: center; margin: 0.7rem 0 0; }
a.icon-link {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  display: grid;
  place-items: center;
}
a.icon-link.word {
  width: auto;
  padding: 0 0.75rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.85rem;
}
.back { margin: 0 0 0.4rem; }
.team-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.team-profile form.stack { margin-top: 0.9rem; }
.team-profile .crest, .team-profile .crest.fallback { width: 4.2rem; height: 4.2rem; font-size: 1.1rem; }

.badge {
  display: inline-block;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  background: var(--line);
}

.badge.game { background: #f3e0c2; }
.badge.cancelled { background: #f6d7d4; color: var(--cancel); }

form.stack { display: grid; gap: 0.7rem; }
label { display: grid; gap: 0.2rem; font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 0.92rem; }
input, select, button {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
}
button, .button {
  background: var(--field);
  color: white;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.inline { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.map {
  width: 100%;
  height: 16rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0.8rem 0;
}
.map.picker { height: 22rem; }
.place-stage { position: relative; }
.place-stage .map { height: 24rem; margin: 0; }
.place-search {
  position: absolute;
  z-index: 500;
  top: 0.75rem;
  left: 0.75rem;
  right: 3.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--card);
  border-radius: 999px;
  padding: 0.2rem 0.2rem 0.2rem 0.95rem;
  box-shadow: 0 8px 24px rgba(28, 25, 21, 0.14);
}
.place-search input {
  border: 0;
  background: transparent;
  padding: 0.5rem 0;
  flex: 1;
  min-width: 0;
  border-radius: 0;
}
.place-search input:focus { outline: none; }
.place-search button { border-radius: 999px; padding: 0.45rem 0.9rem; }
.place-actions {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.65rem;
}
.place-actions p { margin: 0; }
button.ghost {
  background: transparent;
  color: var(--field);
  padding: 0.2rem 0;
}
button.ghost:hover { text-decoration: underline; }
.card > h2:first-child { margin-top: 0; }
.prefs { display: grid; gap: 0.75rem; }
.errorlist { color: var(--cancel); padding-left: 1rem; margin: 0.45rem 0 0; }
.banner {
  background: #fff4e5;
  border: 1px solid #efd3b0;
  color: var(--warn);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 1rem;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin: 0.35rem 0; }
@media (max-width: 640px) {
  header.top { flex-direction: column; align-items: flex-start; }
}

/* Give games a scoreboard-style focal point while keeping the practical details below. */
.matchup {
  margin: -0.9rem -1rem 0;
  padding: 1.15rem 1.25rem 1.3rem;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(135deg, #152b25, #101b1b 70%);
  color: #f8faf7;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}
.matchup:last-child { margin-bottom: -0.9rem; border-radius: 11px; }
.matchup-topline { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.matchup-label { color: #a8c9b7; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.matchup .matchup-title { margin: 0.35rem 0 1.15rem; font-size: clamp(1.1rem, 3vw, 1.45rem); line-height: 1.25; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.matchup-title a { color: inherit; text-decoration: none; }
.matchup-title a:hover, .matchup-title a:focus-visible { text-decoration: underline; }
.matchup-title span { color: #a8c9b7; font-weight: 400; }
.matchup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 0.6rem; text-align: center; }
.matchup-team { min-width: 0; display: grid; justify-items: center; gap: 0.55rem; font-size: 0.78rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.matchup .crest, .matchup .crest.fallback { width: 4.5rem; height: 4.5rem; font-size: 1.2rem; border: 2px solid rgba(255,255,255,0.3); }
.matchup img.crest { object-fit: contain; padding: 0.25rem; }
.matchup-details { min-width: 0; color: #c3d0c9; font-size: 0.82rem; line-height: 1.35; overflow-wrap: anywhere; }
.matchup-details p { margin: 0.2rem 0; }
.matchup-details .matchup-date { color: white; font-weight: 700; }
.matchup-details .matchup-place { margin-top: 0.55rem; color: white; }
.matchup-details a { color: #c2e7cf; }
.matchup + .leave { margin-top: 0.8rem; }
@media (max-width: 400px) {
  .matchup { padding-left: 0.8rem; padding-right: 0.8rem; }
  .matchup-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 0.35rem; }
  .matchup .crest, .matchup .crest.fallback { width: 3.6rem; height: 3.6rem; }
  .matchup-team, .matchup-details { font-size: 0.72rem; }
}

.matchup-grid { margin-top: 1rem; }
.matchup-event-link { display: block; width: fit-content; margin: 1rem auto 0; color: #c2e7cf; font-size: 0.78rem; font-weight: 600; text-decoration: none; }
.matchup-event-link:hover, .matchup-event-link:focus-visible { text-decoration: underline; }

/* Shared dark palette and event surfaces. */
:root {
  color-scheme: dark;
  --ink: #eef5f0;
  --muted: #a9bbb1;
  --line: #30473c;
  --paper: #0b1714;
  --card: #152820;
  --field: #a9dec0;
  --field-soft: #1b382c;
  --warn: #f2ca91;
  --cancel: #f5c3bc;
}
body { font-family: "Avenir Next", "Segoe UI", sans-serif; }
a { color: var(--field); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #b6e6ca; outline-offset: 3px; }
header.top { align-items: center; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
header.top > a { color: var(--ink); text-decoration: none; }
nav { align-items: center; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); }
nav form { margin: 0; }
nav button { background: transparent; color: var(--muted); padding: 0; }
h1 { font-weight: 700; letter-spacing: -0.03em; }
h2 { color: #a9c9b8; font-size: 0.75rem; letter-spacing: 0.12em; }
.card { background: var(--card); border-color: var(--line); border-radius: 14px; }
input, select, button { background: #20372c; color: var(--ink); border-color: #456052; }
button, .button { background: #a9dec0; color: #102219; font-weight: 700; }
.banner { background: #3c3122; border-color: #6f5938; color: #f2d3a5; }
.place-search { background: var(--card); }
.place-search input { color: var(--ink); }
.team-row:hover { border-color: #8fc6a7; }
.crest, .crest.fallback { border-color: #50675b; }
.event-card { padding: 1.15rem 1.25rem; background: linear-gradient(135deg, #19362b, #101f1b 75%); }
.event-topline { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.event-label { color: #a8c9b7; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.event-top-actions { display: flex; align-items: center; gap: 0.5rem; }
.details-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin: -0.4rem -0.4rem -0.4rem 0; color: #b7d3c3; border-radius: 50%; }
.details-icon:hover { background: #ffffff18; color: white; }
.matchup-grid { margin-top: 1rem; }
.matchup-team { color: #f8faf7; }
.event-surface .crest, .event-surface .crest.fallback { width: 4.5rem; height: 4.5rem; font-size: 1.2rem; border: 2px solid #ffffff4d; }
.event-surface img.crest { background: white; object-fit: contain; padding: 0.25rem; }
.matchup-details, .single-event-details { color: #c3d0c9; font-size: 0.86rem; line-height: 1.4; overflow-wrap: anywhere; }
.matchup-details p, .single-event-details p { margin: 0.2rem 0; }
.event-date, .event-time { color: white; font-weight: 700; }
.event-place { margin-top: 0.55rem !important; color: white; }
.event-address { color: #a9bbb1; font-size: 0.78rem; }
.event-surface a { color: #c2e7cf; }
.directions { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.6rem; }
.event-card .icon-link { width: 2rem; height: 2rem; background: #fff; color: #18221d; border: 0; }
.single-event { display: flex; align-items: center; gap: 1.25rem; margin-top: 1rem; }
.single-event .matchup-team { flex: 0 1 8rem; }
.single-event-details { flex: 1; min-width: 0; }
.single-event-details h1, .single-event-details h3 { margin: 0 0 0.35rem; color: white; font-size: 1.2rem; }
.single-event-details .directions { justify-content: flex-start; }
.event-card .leave { margin: 1rem 0 0; padding: 0.8rem 0.9rem; background: #ffffff0d; border: 1px solid #ffffff18; color: #d4e6da; }
.event-card .leave-row { display: grid; grid-template-columns: 5rem 1fr; gap: 0.15rem 0.6rem; align-items: baseline; }
.event-card .leave-row + .leave-row { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #ffffff18; }
.event-card .leave .role { color: #a8c9b7; }
.event-card .leave strong { color: #fff; }
.event-card .leave-row > span:last-child:not(.role) { grid-column: 2; color: #b8cabe; font-size: 0.82rem; }
.event-extra { margin: 1rem 0 0; }
@media (max-width: 400px) {
  .event-card { padding: 1rem 0.8rem; }
  .event-surface .crest, .event-surface .crest.fallback { width: 3.6rem; height: 3.6rem; }
  .single-event { gap: 0.75rem; }
  .single-event .matchup-team { flex-basis: 6rem; }
  .event-card .leave-row { grid-template-columns: 4.5rem 1fr; }
}

.event-address { white-space: pre-line; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
