:root {
  --away-color: #555555;
  --home-color: #222222;
  --background: #0b0d10;
  --panel: #15191f;
  --border: #2a3039;
  --text: #f5f7fa;
  --muted: #aab2bf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 5%;
  background: #050607;
  border-bottom: 1px solid var(--border);
}

.back-link {
  color: var(--text);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.pucklab-name {
  font-weight: 800;
  letter-spacing: 1px;
}

.game-container {
  width: min(1100px, 92%);
  margin: 36px auto;
}

.message {
  padding: 30px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.error-message {
  color: #ff8b8b;
}

.game-header {
  position: relative;
  overflow: hidden;
  padding: 32px;
  background:
    linear-gradient(
      110deg,
      var(--away-color) 0%,
      #15191f 45%,
      #15191f 55%,
      var(--home-color) 100%
    );
  border: 1px solid var(--border);
  border-radius: 18px;
}

.game-details,
.game-status,
.shots {
  text-align: center;
}

.game-details {
  margin: 0 0 28px;
  color: #ffffff;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}

.team {
  text-align: center;
}

.team-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.team h1 {
  margin: 10px 0 4px;
  font-size: 1.5rem;
}

.team-record {
  margin: 0;
  color: #e4e8ed;
}

.score {
  min-width: 220px;
  text-align: center;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
}

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

.game-status {
  margin: 8px 0 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.shots {
  margin-top: 26px;
  color: #ffffff;
}

.stats-section {
  margin-top: 34px;
}

.stats-section h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.team-stats {
  margin-bottom: 28px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.team-stats h3 {
  margin-top: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-header {
    padding: 24px 14px;
  }

  .scoreboard {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }

  .team-logo {
    width: 72px;
    height: 72px;
  }

  .team h1 {
    font-size: 1rem;
  }

  .score {
    min-width: auto;
    font-size: 2.3rem;
  }

  .team-stats {
    padding: 14px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 0.85rem;
  }
}
.scoring-section,
.shot-map-section {
  margin-top: 34px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.scoring-section h2,
.shot-map-section h2 {
  margin-top: 0;
}

.scoring-summary {
  display: grid;
  gap: 12px;
}

.scoring-period {
  margin: 12px 0 2px;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.scoring-play {
  display: grid;
  grid-template-columns: 70px 48px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.scoring-time {
  color: var(--muted);
  font-weight: 700;
}

.scoring-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.scoring-player {
  margin: 0 0 4px;
  font-weight: 800;
}

.scoring-assists {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.scoring-score {
  font-size: 1.25rem;
  font-weight: 900;
}

.scoring-label {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  color: #111111;
  background: #f5c542;
  border-radius: 4px;
  font-size: 0.68rem;
  vertical-align: middle;
}

.stats-message {
  color: var(--muted);
  text-align: center;
}

.shot-map-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.shot-map-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

.shot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.shot-legend > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-marker {
  display: inline-block;
  width: 11px;
  height: 11px;
}

.shot-marker {
  background: #2563eb;
  border-radius: 50%;
}

.goal-marker {
  background: #e11d48;
  border: 2px solid #ffd700;
  border-radius: 50%;
}

.miss-marker {
  background: #8b95a5;
  transform: rotate(45deg);
}

.block-marker {
  background: #8b5cf6;
  border-radius: 2px;
}

.rink-wrapper {
  overflow-x: auto;
  padding: 10px;
  background: #cfd8e3;
  border-radius: 14px;
}

.shot-map {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
}

.rink-surface {
  fill: #f7fbff;
  stroke: #d4202f;
  stroke-width: 1.2;
}

.goal-line,
.centre-line {
  stroke: #d4202f;
  stroke-width: 0.7;
}

.centre-line {
  stroke-dasharray: 2 1;
}

.blue-line {
  stroke: #1659a7;
  stroke-width: 1.4;
}

.faceoff-circle {
  fill: none;
  stroke: #d4202f;
  stroke-width: 0.6;
}

.faceoff-dot {
  fill: #d4202f;
}

.goal-crease {
  fill: #b8dff5;
  stroke: #d4202f;
  stroke-width: 0.6;
}

.map-event {
  cursor: pointer;
  stroke: #111111;
  stroke-width: 0.5;
  transition: opacity 0.15s ease;
}

.map-event:hover,
.map-event:focus {
  opacity: 0.65;
  outline: none;
}

.map-shot {
  fill: #2563eb;
}

.map-goal {
  fill: #e11d48;
  stroke: #ffd700;
  stroke-width: 1;
}

.map-miss {
  fill: #8b95a5;
}

.map-block {
  fill: #8b5cf6;
}

.shot-map-details {
  min-height: 48px;
  margin-top: 14px;
  padding: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9px;
}

@media (max-width: 700px) {
  .shot-map-heading {
    flex-direction: column;
  }

  .scoring-play {
    grid-template-columns: 54px 38px 1fr;
  }

  .scoring-logo {
    width: 34px;
    height: 34px;
  }

  .scoring-score {
    grid-column: 3;
    font-size: 1rem;
  }
}
.team-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.team-filter {
  padding: 9px 16px;
  color: var(--text);
  background: #0d1015;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}

.team-filter:hover {
  background: rgba(255, 255, 255, 0.08);
}

.team-filter.active {
  border-color: var(--filter-color, #ffffff);
  box-shadow: 0 0 0 2px var(--filter-color, #ffffff);
}

.team-filter:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.goalie-section {
  margin-top: 34px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.goalie-section h2 {
  margin-top: 0;
}

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

.goalie-card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-top: 5px solid var(--goalie-team-color, #ffffff);
  border-radius: 12px;
}

.goalie-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px;
}

.goalie-headshot {
  width: 82px;
  height: 82px;
  object-fit: cover;
  object-position: top;
  background: #e8edf3;
  border-radius: 50%;
}

.goalie-name {
  margin: 0 0 5px;
  font-size: 1.2rem;
}

.goalie-team {
  margin: 0;
  color: var(--muted);
}

.goalie-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.goalie-badge {
  padding: 3px 7px;
  color: #111111;
  background: #e8edf3;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 800;
}

.goalie-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}

.goalie-stat {
  padding: 14px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.goalie-stat:nth-child(3n) {
  border-right: 0;
}

.goalie-stat-value {
  display: block;
  margin-bottom: 4px;
  font-size: 1.15rem;
  font-weight: 900;
}

.goalie-stat-label {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .goalie-grid {
    grid-template-columns: 1fr;
  }

  .goalie-headshot {
    width: 68px;
    height: 68px;
  }
}
.control-section {
  margin-top: 34px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.control-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.control-heading h2 {
  margin: 4px 0 0;
}

.control-label {
  margin: 0;
  color: #69b3e7;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.control-result {
  margin: 0;
  padding: 7px 12px;
  color: #111111;
  background: #f5c542;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.control-bar {
  position: relative;
  height: 38px;
  background: #747b85;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
}

.control-segments {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 999px;
}

.control-segment {
  height: 100%;
  min-width: 1px;
}

.control-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.control-goal-marker {
  position: absolute;
  top: -7px;
  width: 3px;
  height: 48px;
  background: #ffffff;
  border-radius: 3px;
  transform: translateX(-50%);
}

.control-goal-marker::before {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 9px;
  height: 9px;
  content: "";
  background: #ffffff;
  border-radius: 50%;
  transform: translateX(-50%);
}

.control-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 0.82rem;
}

.control-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.control-swatch {
  width: 14px;
  height: 14px;
  background: #555555;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 3px;
}

.tied-swatch {
  background: #747b85;
}

.control-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.control-metric {
  padding: 14px 8px;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
  text-transform: uppercase;
  border-right: 1px solid var(--border);
}

.control-metric:last-child {
  border-right: 0;
}

.control-value {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: none;
}

@media (max-width: 700px) {
  .control-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .control-metric {
    border-bottom: 1px solid var(--border);
  }

  .control-metric:nth-child(2n) {
    border-right: 0;
  }

  .control-metric:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }
}
.fingerprint-section {
  margin-top: 34px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.fingerprint-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.fingerprint-heading h2 {
  margin: 4px 0 0;
}

.fingerprint-description {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.fingerprint-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.fingerprint-team {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.05rem;
}

.fingerprint-team:last-child {
  justify-content: flex-end;
}

.fingerprint-team img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.fingerprint-versus {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.fingerprint-metrics {
  display: grid;
  gap: 5px;
}

.fingerprint-row {
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}

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

.fingerprint-values {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 0.8fr) 1fr;
  align-items: center;
  gap: 12px;
}

.fingerprint-value {
  font-size: 1.15rem;
  font-weight: 900;
  text-align: center;
}

.fingerprint-value.advantage {
  color: #f5c542;
}

.fingerprint-metric-label {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-align: center;
  text-transform: uppercase;
}

.fingerprint-bar {
  display: flex;
  width: 100%;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  background: #747b85;
  border-radius: 999px;
}

.fingerprint-fill {
  height: 100%;
  transition: width 0.25s ease;
}

.period-control {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.period-control h3 {
  margin: 0 0 16px;
}

#periodControlRows {
  display: grid;
  gap: 12px;
}

.period-control-row {
  display: grid;
  grid-template-columns: 80px 1fr 130px;
  align-items: center;
  gap: 13px;
}

.period-control-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.period-control-bar {
  display: flex;
  height: 13px;
  overflow: hidden;
  background: #747b85;
  border-radius: 999px;
}

.period-control-fill {
  height: 100%;
}

.period-control-result {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.fingerprint-note {
  margin: 24px 0 0;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .fingerprint-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .fingerprint-description {
    text-align: left;
  }

  .fingerprint-team {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }

  .fingerprint-team:last-child {
    justify-content: center;
  }

  .fingerprint-team img {
    width: 44px;
    height: 44px;
  }

  .fingerprint-values {
    grid-template-columns: 1fr 120px 1fr;
    gap: 5px;
  }

  .fingerprint-value {
    font-size: 1rem;
  }

  .period-control-row {
    grid-template-columns: 62px 1fr;
  }

  .period-control-result {
    grid-column: 2;
    text-align: left;
  }
}
.game-picker {
  margin-bottom: 24px;
  padding: 22px;
  color: #f5f7fa;
  background: #15191f;
  border: 1px solid #2a3039;
  border-radius: 14px;
}

.game-picker h2 {
  margin: 0 0 10px;
}

.game-picker p {
  color: #aab2bf;
  line-height: 1.5;
}

.game-picker label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 700;
}

.game-picker select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin-bottom: 12px;
  padding: 10px;
  color: #f5f7fa;
  background: #0b0d10;
  border: 1px solid #566171;
  border-radius: 8px;
  font: inherit;
}

.game-picker button {
  min-height: 44px;
  margin: 0 8px 8px 0;
  padding: 10px 16px;
  color: #111;
  background: #f5c542;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.game-picker button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-picker select:focus-visible,
.game-picker button:focus-visible {
  outline: 3px solid #69b3e7;
  outline-offset: 3px;
}
