:root {
  --glass-light: rgba(255, 255, 255, 0.56);
  --glass-list: rgba(255, 255, 255, 0.24);
  --glass-edge: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 12px 40px rgba(16, 21, 42, 0.045);
  --muted: #515969;
  --line: rgba(16, 21, 42, 0.12);
}

body {
  position: relative;
  isolation: isolate;
  background: #e8ecf2;
}

.ambient-backdrop {
  --ambient-image-motion: ambient-image-drift 32s ease-in-out -16s infinite alternate;
  --ambient-light-motion: ambient-light-drift 24s ease-in-out -8s infinite alternate;
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #e9edf3;
}

.ambient-backdrop::before {
  content: '';
  position: absolute;
  inset: -128px;
  background: url('../images/team-background.jpg') center / cover no-repeat;
  filter: blur(64px);
  opacity: 0.24;
  transform: scale(1.12);
  animation: var(--ambient-image-motion);
}

.ambient-backdrop::after {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(255, 255, 255, 0.85) 0%, transparent 52%),
    radial-gradient(ellipse at 83% 38%, rgba(243, 189, 124, 0.27) 0%, transparent 48%),
    linear-gradient(
      160deg,
      rgba(246, 248, 251, 0.38),
      rgba(228, 234, 243, 0.18) 60%,
      rgba(255, 255, 255, 0.68)
    );
  animation: var(--ambient-light-motion);
}
@keyframes ambient-image-drift {
  from {
    transform: translate3d(-3%, -2%, 0) scale(1.12) rotate(-3deg);
  }
  to {
    transform: translate3d(3%, 2%, 0) scale(1.18) rotate(3deg);
  }
}

@keyframes ambient-light-drift {
  from {
    transform: translate3d(-8%, 4%, 0) rotate(-4deg);
  }
  to {
    transform: translate3d(8%, -4%, 0) rotate(4deg);
  }
}

body:not([data-page='home']) .ambient-backdrop {
  --ambient-image-motion: ambient-image-flow 14s ease-in-out -7s infinite alternate;
  --ambient-light-motion: ambient-light-flow 12s ease-in-out -4.5s infinite alternate;
}
body:not([data-page='home']) .ambient-backdrop::after {
  inset: -28%;
}
@keyframes ambient-image-flow {
  0% {
    transform: translate3d(-6%, -4%, 0) scale(1.14) rotate(-4deg);
  }
  48% {
    transform: translate3d(1%, 5%, 0) scale(1.22) rotate(1deg);
  }
  100% {
    transform: translate3d(6%, -2%, 0) scale(1.18) rotate(4deg);
  }
}
@keyframes ambient-light-flow {
  0% {
    transform: translate3d(-12%, 7%, 0) rotate(-5deg);
  }
  56% {
    transform: translate3d(-1%, -8%, 0) rotate(2deg);
  }
  100% {
    transform: translate3d(12%, 1%, 0) rotate(5deg);
  }
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-transparency: reduce), print {
  .ambient-backdrop::before,
  .ambient-backdrop::after {
    animation: none;
  }
}

.site-header {
  background: rgba(255, 255, 255, 0.42);
  border-bottom-color: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.brand strong,
.season-picker,
.section-caption h2 span,
.team small,
.result-label,
.final-label {
  letter-spacing: 0;
  font-kerning: normal;
}

.team small,
.result-label,
.final-label {
  font-family: var(--sans);
}

.page-intro {
  padding-top: 60px;
  gap: 32px;
}

.page-intro > div {
  min-width: 0;
}

.results-title {
  color: var(--navy);
  font-family: var(--sans);
  font-size: clamp(42px, 4.8vw, 64px);
  font-weight: 700;
  font-style: normal;
  line-height: 1.1;
  letter-spacing: 0.005em;
  margin-bottom: 24px;
  text-wrap: balance;
}

.archive-toolbar h2,
.section-caption h2 {
  color: var(--navy);
  font-family: var(--sans);
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 700;
  font-style: normal;
  line-height: 1.15;
  letter-spacing: 0.005em;
  margin-bottom: 16px;
  text-wrap: balance;
}

.section-caption h2 {
  margin-bottom: 0;
}

.section-caption h2 span {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
}

.archive-toolbar {
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 24px;
}

.archive-title {
  min-width: 0;
}

#game-count {
  display: block;
  color: var(--muted);
  font: var(--text-note)/1.7 var(--sans);
}

.archive-toolbar .filters {
  flex-shrink: 0;
}

.season-record {
  --line: rgba(16, 21, 42, 0.08);
  padding: 12px 24px 16px;
  background: var(--glass-list);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.scorecard {
  background: rgba(16, 21, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    0 18px 48px rgba(16, 21, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.scorecard::before {
  display: none;
}

.scorecard-meta {
  background: rgba(255, 255, 255, 0.025);
}
.big-score .divider {
  display: block;
  flex: 0 0 0.32em;
  width: 0.32em;
  height: 2px;
  font: inherit;
  background: #7e879e;
  transform: translateY(0.025em);
}

.game-list {
  background: var(--glass-list);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.game-row {
  background: transparent;
}

.game-row:last-child {
  border-bottom: 0;
}

.schedule-item {
  padding: 24px 24px;
}

.schedule-item:first-child {
  border-top: 0;
}

.template-tools {
  background: var(--glass-list);
  border: 1px solid rgba(16, 21, 42, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-footer {
  background: rgba(16, 21, 42, 0.95);
}

dialog {
  background: rgba(249, 250, 252, 0.95);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

dialog::backdrop {
  background: rgba(16, 21, 42, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (max-width: 700px) {
  .archive-toolbar h2,
  .section-caption h2 {
    font-size: clamp(26px, 7.5vw, 32px);
  }

  .archive-toolbar {
    align-items: stretch;
    gap: 20px;
  }

  .page-intro {
    position: relative;
    display: block;
    padding-top: 36px;
    padding-bottom: 28px;
  }

  .results-title {
    max-width: 100%;
    font-size: clamp(38px, 10.5vw, 50px);
    line-height: 1.04;
    margin-bottom: 20px;
  }

  .page-intro .season-picker {
    position: absolute;
    right: 0;
    bottom: 28px;
    width: 85px;
  }

  .ambient-backdrop::before {
    filter: blur(42px);
    opacity: 0.2;
  }

  .ambient-backdrop::after {
    background:
      radial-gradient(ellipse at 100% 35%, rgba(243, 189, 124, 0.2), transparent 65%),
      linear-gradient(
        150deg,
        rgba(255, 255, 255, 0.6),
        rgba(233, 238, 246, 0.1) 65%,
        rgba(255, 255, 255, 0.5)
      );
  }

  .season-record {
    padding: 8px 12px 12px;
  }

  .season-record,
  .game-list {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .scorecard {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .schedule-item {
    grid-template-columns: 56px 44px minmax(0, 1fr);
    gap: 12px;
    padding: 20px 16px;
  }

  .row-detail .score-table th:first-child {
    background: #e3e6ed;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header,
  .season-record,
  .game-list,
  .template-tools {
    background: #f7f8fa;
  }

  .scorecard,
  .site-footer {
    background: var(--navy);
  }

  dialog {
    background: #f9fafc;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .ambient-backdrop {
    display: none;
  }

  body {
    background: var(--paper);
  }

  .site-header,
  .season-record,
  .game-list,
  .template-tools,
  dialog {
    background: #f7f8fa;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .scorecard,
  .site-footer {
    background: var(--navy);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media print {
  .ambient-backdrop {
    display: none;
  }

  body {
    background: #fff;
  }

  .site-header,
  .season-record,
  .game-list {
    background: #fff;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .scorecard {
    background: var(--navy);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
.big-score {
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.035em;
}
.record-item strong,
.row-score,
.game-date,
.schedule-date,
.event-time,
.edit-total {
  font-variant-numeric: lining-nums tabular-nums;
}

@media (max-width: 700px) {
  .season-record {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .season-record .record-item:not(.rate) {
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
  }
  .season-record .record-item:not(.rate) > span {
    text-align: center;
  }
}
