:root {
  --bg: #f4efe6;
  --paper: #fffdf8;
  --ink: #172126;
  --muted: #607076;
  --accent: #0d5c63;
  --accent-soft: #d7ebe8;
  --line: #d8d2c6;
  --warm: #b85c38;
  --shadow: 0 18px 50px rgba(23, 33, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(13, 92, 99, 0.16), transparent 32%),
    linear-gradient(180deg, #efe8dc 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 8px 0 18px;
}

.brand-mark {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
}

.brand-copy {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 34rem;
}

.site-nav {
  display: flex;
  gap: 16px;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.notice,
.panel {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  color: var(--warm);
}

.main-content {
  display: grid;
  gap: 16px;
}

.hero {
  padding: 4px 0 0;
}

.hero h1,
.panel h1,
.panel h2,
.game-group h3 {
  margin: 0;
}

.eyebrow {
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
  font-size: 0.82rem;
}

.panel {
  padding: 18px;
}

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

.home-stack {
  display: grid;
  gap: 18px;
}

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

.refresh-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.84rem;
  text-align: right;
}

.chip-list,
.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.link-list {
  flex-direction: column;
  align-items: flex-start;
}

.panel .home-panel-heading {
  margin: 0 0 12px;
}

.home-team-picker {
  max-width: 360px;
}

.home-team-picker .multi-select-menu {
  width: 100%;
  max-height: 320px;
}

.home-team-results {
  gap: 8px;
  max-height: 232px;
  overflow-y: auto;
  padding-right: 2px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  align-items: end;
}

.filters label,
.filter-field {
  display: grid;
  gap: 6px;
  min-width: 180px;
  position: relative;
}

.filter-field-wide {
  min-width: 300px;
}

.filter-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.filter-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.multi-select {
  min-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  position: relative;
}

.multi-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.multi-select summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.85rem;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select-menu {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: var(--shadow);
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: max-content;
  min-width: 100%;
}

.multi-select-teams .multi-select-menu {
  min-width: 300px;
}

.multi-select-divisions .multi-select-menu {
  max-height: 438px;
}

.multi-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 2px 0;
  cursor: pointer;
  font: inherit;
  line-height: 1.1;
  font-size: 0.88rem;
}

.multi-search-wrap {
  min-width: 0;
}

.multi-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  font: inherit;
}

.multi-select-section {
  display: grid;
  gap: 6px;
}

.multi-select-section + .multi-select-section {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.multi-select-section-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-selected-options],
[data-available-options] {
  display: grid;
  gap: 6px;
}

.check-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.check-option input {
  margin: 0;
}

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

.filters select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  font: inherit;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  table-layout: fixed;
}

.data-table .col-team {
  width: auto;
}

.data-table .col-stat {
  width: 3.6rem;
}

.data-table .col-stat-wide {
  width: 4.4rem;
}

.data-table .col-streak {
  width: 6.5rem;
}

.data-table .col-tiebreak {
  width: 12.5rem;
}

.data-table .col-record {
  width: 7.4rem;
}

.data-table .col-gp-mobile {
  width: 3.2rem;
}

.data-table .col-points {
  width: 4rem;
}

.data-table .col-roster-number {
  width: 3.2rem;
}

.data-table .col-roster-name {
  width: auto;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table td:first-child,
.data-table th:first-child {
  min-width: 0;
}

.data-table td:first-child a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table td:not(:first-child),
.data-table th:not(:first-child) {
  white-space: nowrap;
}

.standings-table td:nth-child(2),
.standings-table th:nth-child(2),
.standings-table td:nth-child(3),
.standings-table th:nth-child(3),
.standings-table td:nth-child(4),
.standings-table th:nth-child(4),
.standings-table td:nth-child(5),
.standings-table th:nth-child(5),
.standings-table td:nth-child(6),
.standings-table th:nth-child(6),
.standings-table td:nth-child(7),
.standings-table th:nth-child(7) {
  text-align: center;
}

.standings-table-mobile {
  display: none;
}

.roster-table-mobile {
  display: none;
}

.roster-table td:first-child,
.roster-table th:first-child,
.roster-table td:nth-child(n + 3),
.roster-table th:nth-child(n + 3) {
  text-align: center;
}

.goalie-table .col-stat {
  width: 3.3rem;
}

.goalie-table .col-stat-wide {
  width: 4rem;
}


.standings-section + .standings-section {
  margin-top: 22px;
}

.standings-subhead {
  margin: 0 0 10px;
}

.roster-subhead {
  margin: 14px 0 10px;
}

.roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.roster-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.92rem;
}

.roster-toggle input {
  margin: 0;
}

.panel + .panel {
  margin-top: 18px;
}

.game-group + .game-group {
  margin-top: 18px;
}

.game-table {
  display: grid;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.game-table-inline {
  margin-top: 10px;
}

.game-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.game-row-inline {
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.7fr);
}

.game-row-main,
.roster-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.game-row-main {
  display: grid;
  grid-template-columns: 76px minmax(108px, 1fr) 24px 14px minmax(108px, 1fr) 24px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.game-row-main-inline {
  grid-template-columns: 184px minmax(82px, 1fr) 24px 14px minmax(82px, 1fr) 24px;
}

.game-row-side {
  display: grid;
  grid-template-columns: minmax(84px, 0.8fr) minmax(96px, 1fr) 72px 28px 28px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.game-row-side-inline {
  grid-template-columns: minmax(0, 1fr) 72px 28px 28px;
}

.empty-state,
.roster-row span {
  color: var(--muted);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.game-time {
  min-width: 76px;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--muted);
  white-space: nowrap;
}

.game-mobile-meta {
  display: none;
}

.game-datetime-inline {
  min-width: 184px;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--muted);
  white-space: nowrap;
}

.game-team {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-team-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.game-score {
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.game-winner {
  font-weight: 700;
}

.game-sep,
.game-division,
.game-venue {
  color: var(--muted);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.game-sep {
  text-align: center;
}

.game-division,
.game-venue {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-cell,
.game-link-cell {
  text-align: center;
  min-width: 0;
}

.game-link-cell {
  color: var(--accent);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.game-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0 auto;
}

.game-icon-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.status-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.84rem;
}

.roster-list {
  display: grid;
  gap: 10px;
}

.roster-row {
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  padding: 8px 0;
}

@media (max-width: 820px) {
  .site-header,
  .section-head,
  .panel-grid,
  .game-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .site-header {
    align-items: start;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding: 16px;
  }

  .panel {
    padding: 16px;
  }

  .game-row {
    gap: 8px;
  }

  .game-row-side {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px 8px;
    align-items: start;
  }

  .game-row-main {
    grid-template-columns: 68px minmax(0, 1fr) 24px;
    grid-template-areas:
      "time meta ."
      "time away-team away-score"
      "time home-team home-score";
    gap: 4px 8px;
  }

  .game-row-main-inline {
    grid-template-columns: minmax(0, 1fr) 24px;
    grid-template-areas:
      "time ."
      "meta ."
      "away-team away-score"
      "home-team home-score";
  }

  .game-row-side-inline {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .game-time {
    min-width: 68px;
    font-size: 0.92rem;
  }

  .game-datetime-inline {
    font-size: 0.92rem;
    min-width: 0;
  }

  .game-datetime-mobile-anchor {
    grid-area: time;
    align-self: start;
  }

  .game-team-away {
    grid-area: away-team;
  }

  .game-score-away {
    grid-area: away-score;
  }

  .game-team-home {
    grid-area: home-team;
  }

  .game-score-home {
    grid-area: home-score;
  }

  .game-sep-mobile {
    display: none;
  }

  .game-mobile-meta {
    display: flex;
    grid-area: meta;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .game-mobile-meta-sep {
    flex: 0 0 auto;
  }

  .game-division,
  .game-venue {
    grid-column: 1 / -1;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }

  .status-cell {
    text-align: left;
  }

  .game-row:not(.game-row-inline) .game-division,
  .game-row:not(.game-row-inline) .game-venue {
    display: none;
  }

  .game-row-inline .game-venue {
    display: none;
  }

  .game-row-inline .game-datetime-mobile-anchor {
    align-self: auto;
  }

  .game-row-inline .game-mobile-meta {
    white-space: nowrap;
  }

  .game-link-cell {
    text-align: right;
  }

  .status-pill {
    font-size: 0.78rem;
  }

  .multi-select-menu {
    width: 100%;
  }

  .standings-table-desktop {
    display: none;
  }

  .standings-table-mobile {
    display: table;
    font-size: 0.92rem;
  }

  .standings-table-mobile th,
  .standings-table-mobile td {
    padding: 8px 6px;
  }

  .standings-table-mobile .col-record {
    width: 5.4rem;
  }

  .standings-table-mobile .col-gp-mobile {
    width: 2.4rem;
  }

  .standings-table-mobile .col-points {
    width: 2.5rem;
  }

  .standings-table-mobile td:nth-child(2),
  .standings-table-mobile th:nth-child(2),
  .standings-table-mobile td:nth-child(3),
  .standings-table-mobile th:nth-child(3),
  .standings-table-mobile td:nth-child(4),
  .standings-table-mobile th:nth-child(4) {
    text-align: center;
  }

  .standings-table-desktop {
    font-size: 0.92rem;
  }

  .standings-table-desktop th,
  .standings-table-desktop td {
    padding: 8px 6px;
  }

  .refresh-meta {
    justify-items: start;
    text-align: left;
  }

  .roster-table-desktop {
    display: none;
  }

  .roster-table-mobile {
    display: table;
  }

  .roster-table-mobile th,
  .roster-table-mobile td {
    padding: 8px 5px;
  }

  .roster-table-mobile .col-roster-number {
    width: 2.5rem;
  }

  .roster-table-mobile .col-gp-mobile {
    width: 2.4rem;
  }

  .roster-table-mobile .col-stat,
  .roster-table-mobile .col-stat-wide,
  .roster-table-mobile .col-points {
    width: 2.9rem;
  }

  .roster-table-mobile .col-record {
    width: 5.6rem;
  }

  .roster-table-mobile td:nth-child(3),
  .roster-table-mobile th:nth-child(3),
  .roster-table-mobile td:nth-child(4),
  .roster-table-mobile th:nth-child(4),
  .roster-table-mobile td:nth-child(5),
  .roster-table-mobile th:nth-child(5) {
    text-align: center;
  }
}
