:root {
  color-scheme: light;
  --navy: #0b1f3a;
  --navy-2: #17375f;
  --paper: #f8fafc;
  --panel: #ffffff;
  --ink: #111c2f;
  --muted: #607086;
  --line: #c9d3df;
  --line-strong: #8796aa;
  --accent: #2b6fbb;
  --accent-soft: #eaf3fc;
  --success: #1ba67a;
  --danger: #b83d4a;
  --shadow: 0 18px 48px rgba(4, 18, 37, 0.2);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(102, 153, 204, 0.3), transparent 30%),
    linear-gradient(145deg, #07172d 0%, #17375f 46%, #081629 100%);
  background-attachment: fixed;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 9px;
  color: #fff;
  background: #000;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr minmax(230px, 310px);
  gap: 28px;
  align-items: center;
  min-height: 68px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff, #eef2f6);
}

.brand {
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.site-nav a {
  padding: 9px 12px;
  border-radius: 9px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #fff;
  outline: none;
  background: var(--navy);
}

.site-search {
  display: flex;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #abb8c7;
  border-radius: 11px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.site-search input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.site-search button {
  padding: 0 13px;
  border: 0;
  color: var(--navy);
  background: transparent;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy);
  background: #fff;
  cursor: pointer;
}

main {
  padding: 18px;
}

.team-banner {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 26px;
  align-items: center;
  min-height: 190px;
  padding: 24px 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 17px 17px 0 0;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(5, 20, 39, 0.95), rgba(12, 35, 64, 0.78)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0 2px, transparent 2px 32px),
    var(--team-primary, var(--navy));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13);
}

.team-banner::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(115deg, transparent 55%, color-mix(in srgb, var(--team-accent, #c4ced4) 42%, transparent)),
    repeating-linear-gradient(90deg, transparent 0 29px, rgba(255, 255, 255, 0.14) 29px 31px);
}

.team-yankees {
  --team-primary: #0c2340;
  --team-accent: #c4ced4;
  --accent: #1d5d9f;
  --accent-soft: #e8f0f8;
}

.team-mets {
  --team-primary: #002d72;
  --team-accent: #ff5910;
  --accent: #e44b0d;
  --accent-soft: #fff0e8;
}

.team-mets .team-banner {
  background:
    linear-gradient(90deg, rgba(0, 20, 59, 0.97), rgba(0, 45, 114, 0.78)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.24) 0 2px, transparent 2px 32px),
    var(--team-primary);
}

.team-mark {
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  margin: 0;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.team-mark img {
  width: 104px;
  height: 104px;
  object-fit: contain;
}

.team-yankees .team-mark {
  width: 148px;
  height: 148px;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.88);
  background: #0c2340;
}

.team-yankees .team-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.team-heading {
  min-width: 0;
  text-align: center;
}

.league-line {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(42px, 7vw, 78px);
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 0.96;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.record-badge {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 17px;
  padding: 8px 17px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.94);
  font-size: 16px;
  font-weight: 850;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
}

.record-badge .divider {
  opacity: 0.55;
}

.previous-game {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  color: #2d3d51;
  background: linear-gradient(180deg, #f8fafc, #edf2f7);
  font-size: 14px;
}

.previous-game strong {
  color: var(--ink);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(720px, 100%);
  margin: 20px auto 12px;
}

.quick-actions.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(620px, 100%);
}

.action-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(180deg, #fff, #e9eef4);
  box-shadow: 0 4px 0 rgba(80, 96, 116, 0.13);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 7px 18px rgba(20, 45, 76, 0.15);
}

.action-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  background: var(--navy);
  font-size: 20px;
  font-weight: 900;
}

.action-label {
  display: block;
  font-size: 16px;
  font-weight: 850;
}

.action-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.live-status {
  display: flex;
  justify-content: center;
  margin: 4px 0 14px;
}

.status-pill {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #41536a;
  background: #eef3f7;
  font-size: 13px;
  font-weight: 750;
}

.status-dot {
  width: 12px;
  height: 12px;
  border: 1px solid #11825d;
  border-radius: 50%;
  background: #4bd1a3;
  box-shadow: 0 0 0 4px rgba(75, 209, 163, 0.13);
}

.status-pill.is-error .status-dot {
  border-color: #91313b;
  background: #e06976;
  box-shadow: 0 0 0 4px rgba(224, 105, 118, 0.13);
}

.status-pill time {
  color: var(--muted);
  font-weight: 600;
}

.content-stack {
  display: grid;
  gap: 14px;
}

.recap-pair {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  align-items: stretch;
}

.recap-pair .content-card {
  height: 100%;
}

.full-recap-copy {
  color: #44546a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.72;
}

.full-recap-copy p {
  margin: 0 0 12px;
}

.full-recap-copy p:last-child {
  margin-bottom: 0;
}

.full-recap-copy p:first-child::first-letter {
  float: left;
  margin: 4px 7px 0 0;
  color: var(--accent);
  font-size: 38px;
  font-weight: 800;
  line-height: 0.8;
}

.content-card {
  scroll-margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(20, 38, 63, 0.06);
}

.content-card.spotlight {
  animation: card-focus 800ms ease;
}

@keyframes card-focus {
  0%, 100% { box-shadow: 0 8px 20px rgba(20, 38, 63, 0.06); }
  45% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 23%, transparent), 0 12px 28px rgba(20, 38, 63, 0.14); }
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f2f5f8);
}

.card-title {
  display: flex;
  gap: 11px;
  align-items: center;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-style: italic;
  line-height: 1;
}

.card-title-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-style: normal;
}

.expand-button {
  flex: none;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.expand-button:hover,
.expand-button:focus-visible {
  color: #fff;
  outline: none;
  background: var(--accent);
}

.card-body {
  padding: 16px 20px 18px;
}

.recap-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recap-list li {
  position: relative;
  padding-left: 22px;
  color: #526176;
  line-height: 1.5;
}

.recap-list li::before {
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.content-card:not(.expanded) .recap-list li:nth-child(n + 4),
.content-card:not(.expanded) tbody tr:nth-child(n + 6) {
  display: none;
}

.recap-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat-panel {
  min-width: 0;
}

.stat-panel h3 {
  margin: 0 0 9px;
  font-size: 15px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #e1e6ec;
  text-align: center;
  white-space: nowrap;
}

th {
  color: #2f3f53;
  background: #eaf0f5;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

td {
  color: #39495d;
  font-size: 13px;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 124px;
  text-align: left;
  background: #fff;
}

th:first-child {
  z-index: 2;
  background: #eaf0f5;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.boxscore-table th:first-child,
.boxscore-table td:first-child {
  min-width: 126px;
  font-weight: 850;
}

.boxscore-table td.total,
.boxscore-table th.total {
  color: var(--ink);
  background: #eef2f6;
  font-weight: 900;
}

.pitching-decisions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.empty-state,
.loading-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  background: #f7f9fb;
}

.skeleton-line {
  height: 11px;
  margin: 9px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #e6ebf0 20%, #f5f7f9 50%, #e6ebf0 80%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}

.skeleton-line:nth-child(2) { width: 84%; }
.skeleton-line:nth-child(3) { width: 70%; }

@keyframes shimmer {
  to { background-position: -220% 0; }
}

.utility-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.utility-links a {
  padding: 11px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #42536a;
  text-align: center;
  text-decoration: none;
  background: #edf2f6;
  font-size: 12px;
  font-weight: 800;
}

.utility-links a:hover,
.utility-links a:focus-visible {
  color: #fff;
  outline: none;
  border-color: var(--navy);
  background: var(--navy);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #edf1f5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
}

.site-footer a {
  color: var(--accent);
  font-family: Inter, sans-serif;
  font-style: normal;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 930px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .site-search {
    grid-column: 1 / -1;
  }

  .team-banner {
    grid-template-columns: 120px 1fr;
    padding: 24px 30px;
  }

  .team-mark {
    width: 112px;
    height: 112px;
  }

  .team-mark img {
    width: 84px;
    height: 84px;
  }

  .team-yankees .team-mark {
    width: 124px;
    height: 124px;
  }

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

@media (max-width: 680px) {
  body {
    background: var(--paper);
  }

  .site-shell {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .site-header {
    position: relative;
    grid-template-columns: 1fr auto;
    gap: 12px;
    min-height: 60px;
    padding: 9px 13px;
  }

  .brand {
    font-size: 21px;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .site-nav {
    position: absolute;
    z-index: 20;
    top: 59px;
    right: 10px;
    display: none;
    width: 190px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 35px rgba(7, 23, 45, 0.25);
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-search {
    display: none;
  }

  main {
    padding: 7px;
  }

  .team-banner {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
    padding: 16px 10px 18px;
    text-align: center;
  }

  .team-mark {
    width: 90px;
    height: 90px;
    margin: auto;
  }

  .team-mark img {
    width: 66px;
    height: 66px;
  }

  .team-yankees .team-mark {
    width: 108px;
    height: 108px;
  }

  h1 {
    font-size: clamp(30px, 10vw, 43px);
  }

  .league-line {
    margin-bottom: 6px;
  }

  .record-badge {
    margin-top: 11px;
    padding: 6px 12px;
    font-size: 12px;
  }

  .previous-game {
    padding: 9px 8px;
    font-size: 11px;
  }

  .quick-actions {
    gap: 7px;
    margin: 12px auto 10px;
  }

  .quick-actions.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recap-pair {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .full-recap-copy {
    font-size: 13px;
    line-height: 1.62;
  }

  .action-button {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    min-height: 83px;
    padding: 8px 4px;
    text-align: center;
  }

  .action-icon {
    width: 29px;
    height: 29px;
    font-size: 16px;
  }

  .action-label {
    font-size: 12px;
  }

  .action-meta {
    display: none;
  }

  .status-pill {
    min-height: 31px;
    padding: 5px 10px;
    font-size: 11px;
  }

  .status-pill time {
    display: none;
  }

  .content-stack {
    gap: 10px;
  }

  .content-card {
    border-radius: 12px;
  }

  .card-heading {
    min-height: 48px;
    padding: 8px 11px;
  }

  .card-title {
    gap: 7px;
    font-size: 18px;
  }

  .card-title-icon {
    width: 27px;
    height: 27px;
    font-size: 14px;
  }

  .expand-button {
    padding: 6px;
    font-size: 11px;
  }

  .card-body {
    padding: 12px;
  }

  .recap-list {
    gap: 8px;
  }

  .recap-list li {
    padding-left: 18px;
    font-size: 12px;
  }

  th,
  td {
    padding: 8px;
    font-size: 11px;
  }

  th:first-child,
  td:first-child {
    min-width: 105px;
  }

  .utility-links {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
  }

  .site-footer {
    justify-content: center;
    padding: 13px;
    text-align: center;
  }

  .site-footer a {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
