:root {
  --font-display: "Teko", "Barlow Condensed", Impact, sans-serif;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg: #F2F2F4;
  --card-bg: #ffffff;
  --text: #0D0D0F;
  --muted: #5E5E68;
  --accent: #A87400;
  --on-accent: #ffffff;
  --border: rgba(13,13,15,0.14);
  /* Team-tinted hero backgrounds (teamHeroBackgroundStyle() + .hero-tinted
     below) are built from a black vignette/scrim over the team's jersey
     texture. In light mode that full-strength black reads as a jarring dark
     patch next to otherwise-light cards, so it's weaker here; dark mode
     keeps the original full-strength values since the card is already dark
     there. */
  --hero-shade-strong: rgba(0, 0, 0, 0.35);
  --hero-shade-fade: rgba(0, 0, 0, 0.65);
  --hero-scrim: rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  /* Only when no explicit choice overrides the OS/browser preference --
     the Cloudflare-migration theme toggle (phase 7) sets data-theme="light"
     on html to opt back out of dark mode even when the OS prefers it. */
  :root:not([data-theme="light"]) {
    --bg: #0D0D0F;
    --card-bg: #19191D;
    --text: #F5F5F7;
    --muted: #A3A3AB;
    --accent: #F5C84C;
    --on-accent: #0D0D0F;
  --border: rgba(255,255,255,0.14);
    --hero-shade-strong: rgba(0, 0, 0, 0.65);
    --hero-shade-fade: rgb(0, 0, 0);
    --hero-scrim: rgba(0, 0, 0, 0.45);
  }
}

/* Explicit choice wins over prefers-color-scheme either direction. */
:root[data-theme="dark"] {
  --bg: #0D0D0F;
  --card-bg: #19191D;
  --text: #F5F5F7;
  --muted: #A3A3AB;
  --accent: #F5C84C;
  --on-accent: #0D0D0F;
  --border: rgba(255,255,255,0.14);
  --hero-shade-strong: rgba(0, 0, 0, 0.65);
  --hero-shade-fade: rgb(0, 0, 0);
  --hero-scrim: rgba(0, 0, 0, 0.45);
}

:root[data-theme="light"] {
  --bg: #F2F2F4;
  --card-bg: #ffffff;
  --text: #0D0D0F;
  --muted: #5E5E68;
  --accent: #A87400;
  --on-accent: #ffffff;
  --border: rgba(13,13,15,0.14);
  --hero-shade-strong: rgba(0, 0, 0, 0.35);
  --hero-shade-fade: rgba(0, 0, 0, 0.65);
  --hero-scrim: rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

a {
  color: inherit;
}

/* ---------- App shell: sidebar + main column ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.backdrop.open {
  display: block;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  max-width: 80vw;
  height: 100vh;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-list a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.1;
}

.nav-list a.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.1;
  cursor: pointer;
}

.nav-group-toggle.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.nav-group-chevron {
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
  transform: rotate(180deg);
}

.nav-sublist {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.nav-sublist.open {
  display: flex;
  margin-bottom: 6px;
}

.nav-sublist a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 30px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.3;
}

.nav-sublist a.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.nav-team-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.main-column {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 8px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 600;
}

.topbar-title.is-hidden {
  display: none;
}

/* !important: the :root[data-theme=...] .brand-banner-light/dark rules
   further down are equally specific (3 class-level selectors each) and
   come later in the cascade, so without it the active theme's rule would
   win and the banner would stay visible while searching. */
.sidebar-banner.is-hidden {
  display: none !important;
}

/* Home-page player search, rendered once in .topbar (mobile) and once in
   .sidebar-header (desktop, hidden below). Sits flush right via
   margin-left:auto rather than a flex sibling, so it doesn't need
   .topbar-title or the sidebar banners to carry a matching flex rule. */
.player-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.sidebar-header .player-search {
  display: none;
}

.player-search.active {
  flex: 1;
  margin-left: 0;
}

.player-search-field {
  display: none;
  min-width: 0;
}

.player-search.active .player-search-field {
  display: flex;
  flex: 1;
  min-width: 0;
}

.player-search-input {
  width: 100%;
  min-width: 0;
  padding: 7px 14px;
  margin-right: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.player-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.player-search-toggle .close-icon {
  display: none;
}

.player-search.active .player-search-toggle .search-icon {
  display: none;
}

.player-search.active .player-search-toggle .close-icon {
  display: block;
}

.player-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 25;
  padding: 6px;
}

.player-search.active .player-search-results:not(:empty) {
  display: block;
}

.search-result-item {
  padding: 8px;
  border-radius: 10px;
}

.search-result-item:hover,
.search-result-item:focus {
  background: var(--bg);
}

@media (min-width: 860px) {
  .backdrop {
    display: none !important;
  }

  .sidebar {
    position: static;
    transform: none;
    width: 240px;
    min-width: 240px;
    max-width: none;
    height: auto;
    border-right: 1px solid var(--border);
  }

  #sidebar-open,
  #sidebar-close {
    display: none;
  }

  .topbar {
    display: none;
  }

  .sidebar-header .player-search {
    display: flex;
  }
}

/* ---------- Page content ---------- */

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-header {
  padding: 8px 0 4px;
  text-align: center;
}

.page-header h1 {
  margin: 0;
  font-size: 1.3rem;
}

.page-header .brand-heading {
  font-size: 1.7rem;
}

.brand-banner {
  max-width: 100%;
  width: 360px;
  height: auto;
  border-radius: 12px;
}

.sidebar-banner {
  width: 170px;
  border-radius: 8px;
}

.brand-banner-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-banner-light {
    display: none;
  }
  :root:not([data-theme="light"]) .brand-banner-dark {
    display: inline-block;
  }
}

:root[data-theme="dark"] .brand-banner-light {
  display: none;
}

:root[data-theme="dark"] .brand-banner-dark {
  display: inline-block;
}

:root[data-theme="light"] .brand-banner-light {
  display: inline-block;
}

:root[data-theme="light"] .brand-banner-dark {
  display: none;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Empty state: a quiet dashed card with a puck, instead of loose grey text. */
.empty-note {
  padding: 22px 16px;
  margin: 16px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.empty-note::before {
  content: "";
  display: block;
  margin: 0 auto 14px;
  width: 30px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0.55;
  box-shadow: 0 5px 0 -1px currentColor;
}

.game-card,
.section-tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.game-list,
.team-teaser-schedule {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-teaser-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.team-teaser-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-teaser-title {
  margin: 0;
}

.fav-team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fav-team-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.fav-team-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fav-team-card-top > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fav-team-card-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.fav-team-card-name {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
  /* wrap long names ("Chicago Blackhawks") onto a second line instead of cutting them off */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.fav-team-card-schedule {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fav-team-card-game {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.fav-team-card-game-logo {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.fav-team-card-scorer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
}

.fav-team-card-photo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.fav-team-card-scorer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.upcoming-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.upcoming-teams {
  display: flex;
  align-items: center;
  gap: 6px;
}

.upcoming-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.upcoming-abbrevs {
  font-weight: 600;
  font-size: 0.85rem;
}

.upcoming-time {
  color: var(--muted);
  font-size: 0.78rem;
}

.game-card-trigger {
  cursor: pointer;
}

.game-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.archive-game-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.game-card-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.game-card-youtube {
  display: block;
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 40%;
}

.team.home {
  justify-content: flex-end;
}

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

.abbrev {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-time {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.dash {
  color: var(--muted);
  font-weight: 400;
}

.ot-tag {
  text-align: center;
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}

.live-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #e5484d;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e5484d;
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.finn-stats {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.95rem;
}

.stat-line .team-tag {
  color: var(--muted);
  font-size: 0.75rem;
}

.stat-line .value {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Footer / archive quick-list (per night page) ---------- */

.page-footer {
  margin-top: 20px;
}

.page-footer h2 {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.archive-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Full archive page ---------- */

.archive-full-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-full-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  font-size: 0.95rem;
}

/* ---------- Sidebar team icon ---------- */

.nav-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -4px;
  margin-right: 6px;
}

/* ---------- Team page ---------- */

.team-page-header {
  text-align: center;
}

.team-hero-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  margin-bottom: 6px;
}

/* ---------- Player card ---------- */

.player-card-header {
  text-align: left;
}

.player-card-header h1 {
  padding-right: 44px;
}

.player-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 4px 0 14px;
  font-size: 0.95rem;
}

.player-hero-meta span + span::before {
  content: "·";
  margin-right: 10px;
  opacity: 0.6;
}

.player-hero-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.player-hero-photo {
  width: 40vw;
  max-width: 140px;
  height: 40vw;
  max-height: 140px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.player-hero-team-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Flip card: .player-hero-flip is the fixed-position frame (holds the
   fav-star so it stays put and clickable either side) and never itself
   rotates; .player-hero-flip-inner is what actually flips via rotateY,
   with front/back faces stacked via position: absolute + backface-
   visibility: hidden so only one is ever visible/clickable at a time. Both
   faces carry the same .hero-banner/.page-header/.player-card-header
   classes as the old single header did, since both need the same
   team-tinted background and white text. min-height is sized for the back
   face's bio grid (the taller of the two); the front face centers its
   (shorter) content inside that same height via flex, rather than the
   card visibly resizing when it flips. */
.player-hero-flip {
  position: relative;
}

.player-hero-flip-inner {
  position: relative;
  min-height: 240px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

/* .hero-banner.player-hero-face (not just .player-hero-face): .hero-banner
   itself sets position: relative further down, and since both are single-
   class selectors of equal specificity, source order alone would decide
   the winner -- the compound selector's higher specificity makes this
   override unconditional regardless of where .hero-banner's rule sits. */
.hero-banner.player-hero-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 44px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hero-banner.player-hero-back,
.hero-banner.player-hero-room {
  transform: rotateY(180deg);
}

.player-hero-flip-hint {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Front face keeps only #number/position after the rest moved to the
   back -- shown bigger/bolder since it's no longer sharing the line with
   five other fields. */
.player-hero-meta-front span {
  font-size: 1.25rem;
  font-weight: 700;
}

.player-hero-back-title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}

.player-hero-bio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}

.player-hero-bio-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player-hero-bio-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.65);
}

.player-hero-bio-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.player-hero-draft {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  color: #fff;
}

.player-hero-draft-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ---------- Team-colored hero background (player card + team page) ----------
   The background-image/size/position/repeat declarations themselves come
   from an inline style="" attribute (teamHeroBackgroundStyle() in
   _shared/format.ts), since they're keyed by team abbreviation -- this
   class only carries the fixed layout, which is the same regardless of
   team. The composite background is always dark by construction (it ends
   in a fade to black), so headings/subtitles inside it are pinned to
   white rather than the theme's --text/--muted, in both light and dark
   mode. */
.hero-banner {
  position: relative;
  border-radius: 16px;
  padding: 18px 12px 14px;
}

.hero-banner h1,
.hero-banner .subtitle,
.hero-banner .player-hero-meta {
  color: #fff;
}

.hero-fav-form {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.hero-fav-star {
  background: none;
  border: none;
  padding: 4px;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: color 0.15s ease, transform 0.1s ease;
}

.hero-fav-star:hover {
  color: rgba(255, 255, 255, 0.8);
}

.hero-fav-star:active {
  transform: scale(0.88);
}

.hero-fav-star.is-fav {
  color: #ffd43b;
}

.hero-fav-star.is-fav:hover {
  color: #ffe066;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--text);
  margin: 4px 0 8px;
}

/* Only the current-round game list on the dashboard needs a manual
   refresh -- it's the one section whose live box scores someone might
   watch update over several minutes, where a plain reload is faster than
   relying on the next cron tick or re-opening the tab. */
.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.section-title-row .section-title {
  margin: 4px 0 8px 0;
}

.refresh-btn {
  flex-shrink: 0;
}

/* Dashboard day browser (?pv=-1/0/1): prev/next arrows flank the title. */
.section-title-row .section-title {
  flex: 1;
  min-width: 0;
}

.day-nav-btn {
  flex-shrink: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.day-nav-btn.is-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ---------- Stat cards (team Kausitilastot, player Kausi/Uran tilastot) ----------
   A boxed card per stat period, its own header bar + a dense, centered,
   abbreviated-column table -- closer to the separate "2026-27 Season" /
   "Career" boxes on a player's own stats page on nhl.com than this
   project's other tables (leaderboards, game logs), which are long lists
   sharing one wide .stats-table. Each period here is exactly one row, so
   there's no row striping/sorting to design for -- just one card that
   reads at a glance. */
.stat-card-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.stat-card-headshot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

.stat-card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card-team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: auto;
}

.stat-card-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stat-card-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 100%;
}

.stat-card-table th,
.stat-card-table td {
  padding: 10px 8px;
  text-align: center;
  white-space: nowrap;
}

.stat-card-table thead th {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
}

.stat-card-table tbody td {
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-card-highlight {
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
}

/* League top-10 rank next to a stat value (player page's current season). */
.rank-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: middle;
}

@media (min-width: 640px) {
  .stat-card-grid {
    flex-direction: row;
  }

  .stat-card-grid .stat-card {
    flex: 1;
    min-width: 0;
  }
}

.division-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.division-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}

.division-header {
  background: transparent;
  border: none;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.division-row.is-team {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.division-row.qualified {
  border-color: #0a7d32;
  box-shadow: inset 2px 0 0 #0a7d32;
}

.division-row.qualified.is-team {
  box-shadow:
    inset 2px 0 0 #0a7d32,
    inset 0 0 0 1px var(--accent);
}

.division-rank {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

.division-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-align: left;
}

.division-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.division-name {
  min-width: 0;
  line-height: 1.2;
}

.division-stats {
  display: grid;
  grid-template-columns: repeat(5, 22px);
  gap: 4px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.division-stats.cols-6 {
  grid-template-columns: repeat(6, 20px);
}

.division-points {
  font-weight: 700;
  color: var(--accent);
}

/* ---------- League standings ---------- */

.standings-legend {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.playoff-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0a7d32;
  margin-left: 6px;
  vertical-align: middle;
}

.wc-cutoff-line {
  border-top: 2px dashed var(--muted);
  margin: 2px 4px 6px;
  opacity: 0.6;
}

/* ---------- Kuntopuntari (form guide) ---------- */

.sarjataulukko-view-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.sarjataulukko-view-section.is-hidden {
  display: none;
}

.form-row-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-chips {
  display: flex;
  gap: 3px;
}

.form-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
}

.form-record {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}

.schedule-row-link {
  text-decoration: none;
  cursor: pointer;
}

.schedule-date {
  color: var(--muted);
  font-size: 0.8rem;
}

.schedule-opponent {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.schedule-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.schedule-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.schedule-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.85rem;
}

.schedule-result {
  font-weight: 700;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.result-w {
  color: #0a7d32;
  background: rgba(10, 125, 50, 0.14);
}

.result-l {
  color: #b3261e;
  background: rgba(179, 38, 30, 0.14);
}

.result-otl {
  color: #b3690f;
  background: rgba(179, 105, 15, 0.14);
}

.schedule-ot {
  margin-left: 4px;
  font-size: 0.65rem;
  opacity: 0.8;
}

/* Asetukset favorites rows -- flexbox, not a grid, on purpose: the old
   /omat page reused .schedule-row's positionally-sized 4-column grid for a
   3-child layout, and the mismatch caused the team/player name to overflow
   into the next column. These rows have varying child counts (team row:
   info + remove button; player row: info + stat line + remove button), so
   flex-with-space-between fits whatever's actually there instead of
   assuming fixed column roles. */
.fav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}

.fav-row-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.fav-row-info img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.fav-row-meta {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
}

.roster-group-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 12px 0 6px;
}

.archive-date {
  font-weight: 600;
}

.archive-count {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Playoff bracket ---------- */

.bracket-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 860px) {
  .bracket-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.bracket-pair {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 18px;
}

.bracket-pair .matchup-card {
  margin-bottom: 0;
}

.bracket-connector {
  position: absolute;
  top: 22%;
  bottom: 22%;
  right: 0;
  width: 12px;
  border: 2px solid var(--muted);
  border-left: none;
  border-radius: 0 8px 8px 0;
  opacity: 0.6;
}

.matchup-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 14px;
  margin-bottom: 8px;
}

.matchup-team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.matchup-team + .matchup-vs {
  border-top: 1px dashed var(--border);
}

.matchup-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.matchup-abbrev {
  font-weight: 700;
}

.matchup-seed {
  color: var(--muted);
  font-size: 0.7rem;
}

.matchup-points {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.matchup-vs {
  text-align: center;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  padding: 2px 0;
}

/* ---------- Sortable league stats tables ---------- */

.stats-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 0 16px;
}

.stats-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.78rem;
  white-space: nowrap;
}

.stats-table th,
.stats-table td {
  padding: 6px 5px;
  text-align: right;
}

.expand-toggle {
  display: block;
  margin: 10px auto 0;
  padding: 6px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.table-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* Segmented pill control (Asetukset: Teema, Tulospiilo) -- several forms,
   each posting a different value to the same endpoint, laid out so they
   read as one wide rounded bar with a divider between choices rather than
   separate buttons floating next to each other. */
.toggle-group {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
}

.toggle-group form {
  flex: 1;
  display: flex;
}

.toggle-group form + form,
.toggle-group button + button {
  border-left: 1px solid var(--border);
}

.toggle-segment {
  flex: 1;
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.toggle-segment.active {
  background: var(--accent);
  color: var(--on-accent);
}

/* Custom-styled select/search/text inputs, used in the table-filters forms
   (team picker, player search) and the login form -- plain native controls
   otherwise look out of place next to the pill-shaped filter buttons. */
.table-filters select,
.table-filters input[type="search"],
.table-filters input[type="text"],
.login-form select,
.login-form input[type="text"] {
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
}

.table-filters select,
.login-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.table-filters select:focus,
.table-filters input:focus,
.login-form select:focus,
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}

/* Multi-select checkbox dropdown (team/nationality filters) -- a <select>
   can't do multi-choice in a way that works well on a phone, so this is a
   <details>/<summary> styled to look like the other filter pills, with a
   checkbox list underneath instead of a native options popup. */
.multi-filter {
  position: relative;
  display: inline-block;
}

.multi-filter summary {
  list-style: none;
  padding: 6px 30px 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

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

.multi-filter[open] summary {
  border-color: var(--accent);
}

.multi-filter-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 170px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.multi-filter-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.multi-filter-panel label:hover {
  background: var(--bg);
}

.multi-filter-panel input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.multi-filter-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Bigger breathing room on Asetukset than the rest of the site's default
   (tighter) spacing -- this page is mostly forms/lists, not dense tables. */
.settings-page {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.settings-page .section-title {
  margin-bottom: 12px;
}

.settings-page .standings-legend {
  margin-bottom: 14px;
}

.fav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.stats-table th:nth-child(2),
.stats-table td:nth-child(2) {
  text-align: left;
  white-space: normal;
  min-width: 108px;
}

/* Player card game logs reuse .stats-table but their 2nd column is the
   opponent, not a player name -- revert the wide-left-aligned override. */
.game-log-table th:nth-child(2),
.game-log-table td:nth-child(2) {
  text-align: right;
  white-space: nowrap;
  min-width: 0;
}

/* Player card's per-game table rows: each played game links to its report
   page (app.js). No visible hint text here -- that affordance (ported from
   the old static site's .game-card-trigger/.game-card-hint) belongs on the
   dashboard/Arkisto game cards (gameCard.ts) instead, not here. */
.game-row-link {
  cursor: pointer;
}

.stats-table th:first-child,
.stats-table td:first-child {
  text-align: center;
}

.total-row {
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--bg-alt, rgba(128, 128, 128, 0.08));
  border-bottom: 2px solid var(--border);
}

.total-row td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.stats-table thead th {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.stats-table thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.stats-table thead th.sort-asc::after {
  content: " \25B2";
}

.stats-table thead th.sort-desc::after {
  content: " \25BC";
}

.stats-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.player-cell img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

.player-name {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-weight: 600;
}

.player-meta {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
}

.pos-tag {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15em;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* On the dark team-tinted tiles (front page pörssit, Yön suomalaiset, bingo)
   the position must follow the light text colour, not the page's dark one. */
.section-tile.hero-tinted .pos-tag {
  color: #fff;
}

.table-team-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -4px;
  margin-right: 4px;
}

.stat-strong {
  font-weight: 700;
  color: var(--accent);
}

.col-rank {
  color: var(--muted);
  font-weight: 600;
}

/* Highlight dots after a pörssi player's name: blue = Finnish, team color =
   favorite team (see leaderboard.ts's highlightDots). The thin gray ring
   keeps dark team colors (navy on dark bg) and light ones (yellow on white)
   visible in both themes. */
.player-name-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hl-dots {
  display: inline-flex;
  gap: 3px;
  flex-shrink: 0;
}

.hl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(128, 128, 128, 0.55);
}

.hl-dot-fin {
  --dot-color: #1d6fe0;
  background: var(--dot-color);
}

.hl-dot-team {
  background: var(--dot-color, var(--accent));
}

:root[data-theme="dark"] .hl-dot-fin {
  --dot-color: #6aa8ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hl-dot-fin {
    --dot-color: #6aa8ff;
  }
}

/* Pörssi tables (Pistepörssi, Maalivahtipörssi, Suomipörssi, Suosikkipelaajat)
   scale the headshot/name/stat text up to match the team logo's visual size
   (logo size itself is unchanged). Scoped to .porssi-table so roster tables
   on team/game pages stay compact. */
.porssi-table {
  font-size: 0.88rem;
}

.porssi-table th,
.porssi-table td {
  padding: 8px 4px;
}

.porssi-table thead th {
  font-size: 0.72rem;
}

.porssi-table .player-cell {
  gap: 8px;
}

.porssi-table .player-cell img {
  width: 36px;
  height: 36px;
}

.porssi-table td:nth-child(2) {
  min-width: 0;
}

/* Edistyneet tilastot: nimi kahdella rivillä + pienempi kuva kapeuttaa jäädytettyä saraketta. */
.porssi-table .player-cell.two-line {
  gap: 6px;
}

.porssi-table .player-cell.two-line > img:first-child {
  width: 28px;
  height: 28px;
}

.porssi-table .player-cell.two-line .player-name {
  font-size: 0.85rem;
  line-height: 1.2;
}

.porssi-table .player-cell.two-line .player-meta {
  font-size: 0.72rem;
}

.porssi-table .player-name {
  font-size: 0.92rem;
}

.porssi-table .player-meta {
  font-size: 0.82rem;
}

.porssi-table .table-team-logo,
.porssi-table .player-cell img.table-team-logo {
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: none;
  vertical-align: middle;
  margin-right: 0;
}

/* ---------- Standings team info panel ---------- */

.team-trigger {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.team-detail {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
}

.team-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-detail-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.team-detail-link:hover .team-detail-name {
  text-decoration: underline;
}

.team-detail-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-detail-name {
  font-weight: 700;
  font-size: 1rem;
}

.team-detail-vs {
  color: var(--muted);
  font-weight: 400;
}

.team-detail-close {
  flex-shrink: 0;
  margin-left: auto;
}

.team-detail-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-section {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.tp-section:first-child {
  padding-top: 0;
  border-top: none;
}

.tp-section-title {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 5px;
}

.tp-results {
  display: flex;
  gap: 6px;
}

.tp-result-chip {
  font-weight: 700;
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.tp-next {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.tp-next-date {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.tp-next-opponent {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tp-scorer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tp-scorer-line {
  color: var(--muted);
  white-space: nowrap;
}

.tp-player {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tp-player-photo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

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

/* Generic tinted-background treatment for any element carrying an inline
   per-team/per-entity hero background (team page header excluded -- that
   one's text only ever sits along the top/bottom edges, where the
   background's own gradients already give it enough contrast; this is for
   elements whose text runs the full height/width instead): sarjataulukko's
   click-a-team panel, the dashboard's favorite-team cards and stat teasers.
   Since the crest/texture colors vary per entity, a flat dark scrim behind
   every child guarantees contrast regardless of color, rather than relying
   on the background's own gradients alone. */
.hero-tinted {
  position: relative;
  border: none;
  color: #fff;
}

.hero-tinted::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--hero-scrim);
  border-radius: inherit;
  pointer-events: none;
}

.hero-tinted > * {
  position: relative;
  z-index: 1;
}

.hero-tinted .section-title {
  color: #fff;
}

.team-detail.hero-tinted .icon-btn {
  color: #fff;
}

.team-detail.hero-tinted .tp-section {
  border-top-color: rgba(255, 255, 255, 0.25);
}

.team-detail.hero-tinted .tp-section-title,
.team-detail.hero-tinted .tp-next-date,
.team-detail.hero-tinted .tp-scorer-line,
.team-detail.hero-tinted .tp-empty {
  color: rgba(255, 255, 255, 0.8);
}

.team-detail.hero-tinted .tp-result-chip {
  background: rgba(255, 255, 255, 0.2);
}

.team-detail.hero-tinted .result-w {
  color: #86efac;
}

.team-detail.hero-tinted .result-l {
  color: #fca5a5;
}

.team-detail.hero-tinted .result-otl {
  color: #fde68a;
}

.fav-team-card.hero-tinted .fav-row-meta {
  color: rgba(255, 255, 255, 0.8);
}

.fav-team-card.hero-tinted .fav-team-card-scorer {
  border-top-color: rgba(255, 255, 255, 0.25);
}

.section-tile.hero-tinted .stats-table thead th,
.section-tile.hero-tinted .player-meta,
.section-tile.hero-tinted .col-rank,
.section-tile.hero-tinted .empty-note {
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.3);
}

.section-tile.hero-tinted .stats-table tbody tr {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.section-tile.hero-tinted .stat-strong,
.section-tile.hero-tinted .archive-link {
  color: #8ab4ff;
}

.gd-period {
  display: inline-block;
  margin: 10px 0 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gd-period:first-child {
  margin-top: 0;
}

.gd-goal-row {
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
}

.gd-goal-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gd-goal-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  flex-shrink: 0;
  width: 34px;
}

.gd-goal-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.gd-goal-who {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.gd-goal-strength {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.gd-goal-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  flex-shrink: 0;
}

.gd-goal-assists {
  margin: 2px 0 0 60px;
  color: var(--muted);
  font-size: 0.78rem;
}

.gd-stat-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  padding-bottom: 4px;
}

.gd-stat-header .gd-stat-team:first-child {
  grid-column: 1;
  text-align: left;
}

.gd-stat-header .gd-stat-team:last-child {
  grid-column: 3;
  text-align: right;
}

.gd-stat-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  padding: 3px 0;
  align-items: center;
}

.gd-stat-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gd-stat-value.gd-stat-better {
  color: #0a7d32;
}

.gd-stat-row .gd-stat-value:first-child {
  text-align: left;
}

.gd-stat-row .gd-stat-value:last-child {
  text-align: right;
}

.gd-stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  white-space: nowrap;
}

.gd-stat-block {
  margin-bottom: 8px;
}

/* Game preview's "Joukkuetilastot" bar: one continuous team-colored bar,
   matching NHL.com's own Team Stats section (its bars are confirmed
   proportional to the share of each stat, not a fixed 50/50 split --
   away_pct + home_pct always sum to ~100 here). The `gap` below is a fixed
   white seam between the two halves -- several real team colors are
   identical or near-identical (e.g. BUF/CBJ, DET/NJD both share a hex), and
   two adjacent same-colored halves would otherwise merge into one
   indistinguishable block. A flex gap shrinks both halves by their
   proportional share to make room (no explicit width math needed), so
   each bar now ends a little short of the container's own edge; the
   diagonal clip-path on each half's inner edge keeps the original slanted
   look, just no longer overlapping into the gap the way the old
   -8px-margin version did -- that overlap was also a standing bug, quietly
   eating 8px off the bar's right end as a stray sliver of the container's
   own (gray) background showing through inside the home half. The shared
   app.js copy of this rendering (dashboard/tulospiilo's click-to-expand
   info box) reuses these same class names with no JS-side clip-path/margin
   of its own, so this CSS change alone covers all three places this bar
   appears. */
.pts-bar {
  display: flex;
  height: 10px;
  margin-top: 4px;
  border-radius: 2px;
  overflow: hidden;
  gap: 3px;
  background: var(--card-bg);
}

.pts-bar-away,
.pts-bar-home {
  height: 100%;
}

.pts-bar-away {
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.pts-bar-home {
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);
}

.pts-ranks {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.form-chips-end {
  justify-content: flex-end;
}

/* ---------- Players to watch (game preview) ----------
   Same 1fr-auto-1fr grid as .gd-stat-row, but a photo-forward comparison
   instead of a bare number -- the one section with no existing component
   to reuse, since every other table in the app is list-shaped, not a
   single head-to-head pairing. */
.pw-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.pw-row:first-child {
  border-top: none;
}

.pw-player {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.pw-row .pw-player:last-child {
  flex-direction: row-reverse;
  text-align: right;
}

.pw-headshot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

.pw-player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pw-row .pw-player:last-child .pw-player-info {
  align-items: flex-end;
}

.pw-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.2;
}

.pw-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
  overflow: hidden;
  white-space: normal;
}

.pw-player-empty {
  color: var(--muted);
}

/* ---------- Prime time ---------- */

.primetime-day {
  margin: 18px 0 8px;
}

.primetime-day-group:first-child .primetime-day {
  margin-top: 0;
}

.primetime-day-group.is-hidden {
  display: none;
}

.primetime-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 6px;
  text-decoration: none;
  cursor: pointer;
}

.primetime-row.is-finished {
  opacity: 0.6;
}

.primetime-time {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.primetime-matchup {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  flex-wrap: wrap;
}

.primetime-at {
  color: var(--muted);
  font-weight: 400;
  margin: 0 2px;
}

.primetime-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.primetime-score-pending {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- Otteluohjelma ---------- */

.day-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 0 16px 4px;
}

.day-pill {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.day-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.schedule-day-section.is-hidden {
  display: none;
}

/* ---------- Player card: season-by-season history toggle ---------- */

.season-type-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.season-history-section.is-hidden {
  display: none;
}

/* ---------- Team page: full-season schedule button + toggle ---------- */

.team-schedule-link {
  display: inline-block;
  text-decoration: none;
  margin: 4px 0 16px;
  padding: 10px 18px;
  font-size: 0.95rem;
}

.team-games-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.team-games-section.is-hidden {
  display: none;
}

/* ---------- Pistepörssi: kaikki pelaajat/rookiet toggle ---------- */

.player-filter-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.player-filter-section.is-hidden {
  display: none;
}

/* ---------- Analytiikka: division + Pistepörssi points-race charts ---------- */

.live-now { margin-bottom: 16px; }
.live-now-title { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: #d93025; text-transform: uppercase; letter-spacing: .04em; }

.division-picker,
.streak-picker,
.analytiikka-view-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.division-chart-section.is-hidden,
.streak-section.is-hidden,
.analytiikka-view-section.is-hidden {
  display: none;
}

.roster-team-section.is-hidden {
  display: none;
}

.division-chart,
.skater-chart {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.division-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-axis path,
.chart-axis line {
  stroke: var(--border);
}

.chart-axis text {
  fill: var(--muted);
  font-size: 0.65rem;
}

.division-chart-endpoint-logo {
  pointer-events: none;
}

.skater-chart-endpoint {
  pointer-events: none;
}

.skater-chart-endpoint-photo {
  stroke: var(--card-bg);
  stroke-width: 2px;
}

.skater-chart-endpoint-badge {
  stroke: var(--card-bg);
  stroke-width: 1px;
}

.skater-chart-endpoint-name {
  fill: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
}

/* ---------- Tulospiilo (spoiler-free mode) ---------- */

.spoiler-placeholder {
  color: var(--muted);
  letter-spacing: 0.1em;
}

.spoiler-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
}

.spoiler-reveal-toggle {
  width: 24px;
  height: 24px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.spoiler-check-text {
  font-size: 0.82rem;
  color: var(--muted);
}

.spoiler-score-row {
  display: block;
  pointer-events: none;
  opacity: 0.6;
  padding: 8px 6px;
  margin: 0 -6px;
  border-radius: 10px;
}

.spoiler-reveal-toggle:checked ~ .spoiler-score-row {
  pointer-events: auto;
  opacity: 1;
}

.spoiler-reveal-toggle:checked ~ .spoiler-score-row:hover,
.spoiler-reveal-toggle:checked ~ .spoiler-score-row:focus-visible {
  background: var(--bg);
}

.spoiler-reveal-hint {
  display: none;
}

.spoiler-score-row .spoiler-reveal-hint {
  margin: 10px 0 10px;
  padding: 6px 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.spoiler-reveal-toggle:checked ~ .spoiler-score-row .spoiler-reveal-hint {
  display: block;
}

.tp-exit-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tp-exit-modal[hidden] {
  display: none;
}

.tp-exit-modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 20px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tp-exit-modal-text {
  margin: 0;
  font-size: 0.9rem;
}

.tp-exit-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.spoiler-bulk {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.spoiler-exit {
  display: block;
  margin: 20px auto 0;
  width: fit-content;
  padding: 10px 24px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  text-align: center;
}

/* ===== Sarjataulukko tabs + NHL-style tables (standings restyle) ===== */

.standings-tab-picker {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 12px 0 14px;
}

.standings-tab {
  flex: 1;
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 4px;
  cursor: pointer;
  margin-bottom: -1px;
  white-space: nowrap;
}

.standings-tab.active {
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--text);
}

.standings-tab-section.is-hidden {
  display: none;
}

.stand-scroll {
  overflow-x: auto;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  -webkit-overflow-scrolling: touch;
}

.stand-table {
  --st-stripe: color-mix(in srgb, var(--card-bg) 94%, var(--text));
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.stand-table th,
.stand-table td {
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
  min-width: 36px;
}

.stand-table thead th {
  font-weight: 700;
  background: var(--card-bg);
}

.stand-table th.st-active {
  color: var(--accent);
}

.st-arrow {
  display: block;
  margin: 3px auto 0;
  border: 4px solid transparent;
  border-top-color: var(--accent);
  border-bottom-width: 0;
}

.stand-table .st-first {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  min-width: 128px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
}

.stand-table tbody tr:nth-child(odd) td {
  background: var(--st-stripe);
}

.stand-table td.st-pts {
  font-weight: 700;
}

.stand-row.qualified td.st-first {
  box-shadow: inset 3px 0 0 #0a7d32;
}

.stand-table .st-rank {
  display: inline-block;
  width: 36px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.stand-table .st-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.st-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.stand-table tr.stand-cutoff td,
.stand-table tr.stand-detail-row td {
  padding: 0;
  background: var(--card-bg);
}

.stand-detail-row .team-detail {
  position: sticky;
  left: 0;
  width: calc(100vw - 70px);
  max-width: 560px;
  box-sizing: border-box;
  margin: 8px 0;
  text-align: left;
  white-space: normal;
}

/* Let the tab views shrink to the column so only the table scrolls. */
.sarjataulukko-view-section,
.standings-tab-section {
  min-width: 0;
  max-width: 100%;
}

.stand-table .st-first .st-rank {
  vertical-align: middle;
}

.stand-table .st-first .st-team {
  vertical-align: middle;
}

.stand-table .st-first .st-rank {
  line-height: 26px;
}

/* ===== Match timeline "Ottelun kulku" (mt-*) -- _shared/matchTimeline.ts + app.js renderTimeline ===== */
.mt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mt-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mt-band:first-child {
  margin-top: 0;
}

.mt-band-score {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.mt-event {
  display: flex;
  flex-direction: column;
  padding: 5px 4px;
}

.mt-away {
  align-items: flex-start;
  text-align: left;
}

.mt-home {
  align-items: flex-end;
  text-align: right;
}

.mt-main {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

/* Home events mirror the away layout: time ends up at the right edge. */
.mt-home .mt-main,
.mt-home .mt-who,
.mt-home .mt-pill {
  flex-direction: row-reverse;
}

.mt-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.mt-who {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  font-size: 0.9rem;
}

.mt-penalty .mt-who strong {
  font-weight: 400;
}

.mt-reason,
.mt-strength {
  color: var(--muted);
  font-size: 0.85rem;
}

.mt-badge {
  flex-shrink: 0;
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f5c542;
  color: #14171a;
  font-weight: 800;
  font-size: 0.8rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.mt-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.mt-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.mt-assists {
  margin: 1px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.mt-final-label {
  margin: 2px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Shootout attempts (mt-so) */
.mt-so-miss {
  flex-shrink: 0;
  display: inline-flex;
  color: #d93025;
}

.mt-so-save strong,
.mt-so-miss strong {
  font-weight: 500;
  color: var(--muted);
}

/* Dashboard day arrows + refresh: boxed so they read as buttons */
.day-nav-btn,
.refresh-btn {
  background: var(--card-bg);
  border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent);
  border-radius: 8px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 1.2rem;
}

.day-nav-btn:hover,
.refresh-btn:hover {
  border-color: var(--muted);
}

/* Dashboard day row: title centered between the arrows, both axes */
.section-title-row {
  align-items: center;
  margin: 4px 0 10px;
}

.section-title-row .section-title {
  margin: 0;
  text-align: center;
}

/* Penalties: slightly quieter than goals */
.mt-goalie .mt-time,
.mt-penalty .mt-time {
  font-weight: 400;
  font-size: 0.8rem;
}

.mt-penalty .mt-who {
  font-size: 0.82rem;
}

.mt-goalie .mt-reason,
.mt-penalty .mt-reason {
  font-size: 0.78rem;
}

.mt-goalie .mt-badge,
.mt-penalty .mt-badge {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 0.72rem;
}

/* Goalie change: plain red swap icon instead of the yellow penalty badge */
.mt-goalie .mt-badge.mt-swap {
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: none;
  color: #d62828;
}

/* ===== Yön suomalaiset (finnishNight.ts) ===== */
.yf-section .yf-scroll {
  margin-bottom: 12px;
}

.yf-section .yf-scroll:last-child {
  margin-bottom: 0;
}

.yf-table .yf-first {
  min-width: 150px;
}

.yf-table .player-cell {
  gap: 10px;
}

.yf-table .player-cell img:not(.table-team-logo) {
  width: 36px;
  height: 36px;
}

.yf-table .player-name {
  font-size: 0.95rem;
}

.yf-table .player-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

.yf-table .player-meta .table-team-logo {
  width: 18px;
  height: 18px;
  margin: 0;
  background: none;
  border-radius: 0;
}

.yf-table .yf-game {
  font-weight: 600;
}

/* "[logo] 4–1 [logo]" result (also reused by other sections). */
.yf-result {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.yf-game-logo {
  width: 26px;
  height: 18px;
  object-fit: contain;
  flex: none;
}

.yf-game-logo.yf-opp {
  opacity: 0.75;
}

.yf-own-score {
  font-weight: 800;
}

.yf-opp-score {
  font-weight: 500;
  color: var(--muted);
}

.yf-live {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.yf-section .yf-scroll {
  color: var(--text);
}

.yf-live .live-dot {
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}

/* Same translucent look as the front-page teaser porssi-tables: the
   hero-tinted tile shows through, no card box / sticky opaque cells. */
.section-tile.hero-tinted .yf-section .yf-scroll,
.section-tile.hero-tinted .yf-scroll {
  border: 0;
  border-radius: 0;
  background: none;
  color: #fff;
}

.yf-section .yf-table th,
.yf-section .yf-table td {
  background: transparent;
  position: static;
  border-right: 0;
}

.yf-section .yf-table thead th {
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.yf-section .yf-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.08);
}

.yf-section .yf-table .player-name,
.yf-section .yf-table td.st-pts,
.yf-section .yf-table .yf-own-score {
  color: #fff;
}

.yf-section .yf-table .player-meta,
.yf-section .yf-table .yf-opp-score {
  color: rgba(255, 255, 255, 0.75);
}

.yf-section .yf-table .st-first {
  min-width: 0;
}

.yf-section .yf-live {
  color: #ffd0d0;
}

/* ===== Pörssit restyle (.porssi-table: NHL-app style, shares look with .stand-table) =====
   Markup unchanged. The rank (#) cell and the player cell are both sticky,
   so "sija + kuva + nimi" stays pinned while the stat columns scroll. */
.stats-table-wrap:has(> .porssi-table) {
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}

.porssi-table {
  --st-stripe: color-mix(in srgb, var(--card-bg) 94%, var(--text));
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.porssi-table th,
.porssi-table td {
  padding: 9px 6px;
  text-align: center;
  background: var(--card-bg);
}

.porssi-table thead th {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--border);
  min-width: 34px;
}

.porssi-table tbody tr:nth-child(odd) td {
  background: var(--st-stripe);
}

.porssi-table tbody tr {
  border-bottom: 0;
}

.porssi-table .col-rank {
  box-sizing: border-box;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 2;
}

.porssi-table th:nth-child(2),
.porssi-table td:nth-child(2) {
  position: sticky;
  left: 40px;
  z-index: 1;
  box-sizing: border-box;
  text-align: left;
  min-width: 150px;
  max-width: 200px;
  padding-left: 4px;
  border-right: 1px solid var(--border);
}

.porssi-table th:nth-child(2) {
  z-index: 2;
}

/* Kaksirivinen nimisolu: sarake mitoitetaan sisällön mukaan (ei 150 px:n vähimmäisleveyttä). */
.porssi-table:has(.player-cell.two-line) :is(th, td):nth-child(2) {
  min-width: 0;
  max-width: none;
  padding-right: 6px;
}

.porssi-table td.stat-strong {
  color: var(--text);
  font-weight: 700;
}

/* Active/sorted column: accent label with the same triangle as .st-arrow */
.porssi-table thead th.sort-asc,
.porssi-table thead th.sort-desc {
  color: var(--accent);
}

.porssi-table thead th.sort-asc::after,
.porssi-table thead th.sort-desc::after {
  content: "";
  display: block;
  margin: 3px auto 0;
  border: 4px solid transparent;
}

.porssi-table thead th.sort-desc::after {
  border-top-color: var(--accent);
  border-bottom-width: 0;
}

.porssi-table thead th.sort-asc::after {
  border-bottom-color: var(--accent);
  border-top-width: 0;
}

/* The default "rank ascending" state means best-first, i.e. a descending stat */
.porssi-table thead th[data-sort="rank"].sort-asc::after {
  border-top-color: var(--accent);
  border-bottom-color: transparent;
  border-top-width: 4px;
  border-bottom-width: 0;
}

.porssi-table thead th[data-sort="rank"].sort-desc::after {
  border-top-color: transparent;
  border-bottom-color: var(--accent);
  border-top-width: 0;
  border-bottom-width: 4px;
}

.porssi-table thead th[data-sort="name"].sort-asc::after,
.porssi-table thead th[data-sort="name"].sort-desc::after {
  margin-left: 0;
}

/* Front-page teasers sit on a hero-tinted tile: keep that background, no
   card box or sticky columns (6 narrow columns fit without scrolling). */
.section-tile.hero-tinted .stats-table-wrap:has(> .porssi-table) {
  border: 0;
  border-radius: 0;
  background: none;
}

.section-tile.hero-tinted .porssi-table th,
.section-tile.hero-tinted .porssi-table td {
  background: transparent;
  position: static;
  border-right: 0;
  min-width: 0;
  max-width: none;
}

.section-tile.hero-tinted .porssi-table thead th {
  color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.section-tile.hero-tinted .porssi-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.08);
}

.section-tile.hero-tinted .porssi-table td.stat-strong {
  color: #fff;
}

.section-tile.hero-tinted .porssi-table th:nth-child(2),
.section-tile.hero-tinted .porssi-table td:nth-child(2) {
  min-width: 0;
}


/* ---------- Player card restyle ----------
   Hero front bio line + flag, Kausi/Uran stat cards as a centered title bar
   over a label-above-value grid (NHL.com mobile style), and the team column
   of the season-history table. Uses theme tokens only. */
.player-hero-meta-front {
  gap: 4px 8px;
}

.player-hero-meta-front span {
  font-size: 0.88rem;
}

.player-hero-meta-front span:first-child,
.player-hero-meta-front span:nth-child(2) {
  font-size: 1.15rem;
}

.player-hero-meta-front span + span::before {
  margin-right: 8px;
}

.player-hero-meta-front .player-hero-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.stat-card-header {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  text-align: center;
  background: var(--bg);
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

.stat-card-teams {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
}

.stat-card-grid-cells {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 4px;
  padding: 14px 8px 16px;
}

.stat-card-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.stat-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}

.stat-card-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-card-cell.stat-card-highlight .stat-card-value {
  color: var(--accent);
}

.stat-card-value .rank-badge {
  font-size: 0.6rem;
  margin-left: 2px;
}

.season-team {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

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

.stats-table.season-history-table {
  font-size: 0.74rem;
}

.stats-table.season-history-table th,
.stats-table.season-history-table td {
  padding: 6px 3px;
}

.stats-table.season-history-table th:nth-child(2),
.stats-table.season-history-table td:nth-child(2) {
  min-width: 0;
  white-space: nowrap;
}

/* ==========================================================================
   Logo dark fix
   The logo URLs everywhere (teamLogoUrl(), the D1 logo columns, app.js) are
   NHL's *_light.svg variants, drawn for light backgrounds. A few are mostly
   dark navy and nearly vanish on the dark theme's #191c22 cards. NHL's CDN
   serves a matching *_dark.svg (same artwork, white/brightened fills) for
   every team, so for just those teams the dark theme swaps the image via
   `content: url()`. The server can't know the viewer's theme and `src`
   can't be media-queried, hence CSS keyed on the src suffix. Other teams'
   light logos already carry their own outlines and stay untouched.
   Two selector groups (OS dark unless forced light / forced dark) because
   :root[data-theme] and prefers-color-scheme can't be combined in one rule.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) img[src$="/TBL_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/TBL_dark.svg"); }
  :root:not([data-theme="light"]) img[src$="/TOR_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/TOR_dark.svg"); }
  :root:not([data-theme="light"]) img[src$="/NSH_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/NSH_dark.svg"); }
}
:root[data-theme="dark"] img[src$="/TBL_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/TBL_dark.svg"); }
:root[data-theme="dark"] img[src$="/TOR_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/TOR_dark.svg"); }
:root[data-theme="dark"] img[src$="/NSH_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/NSH_dark.svg"); }
/* .hero-tinted tiles (team-colored, dark-shaded backgrounds) are dark in the
   light theme too, so they always want the dark logo. */
.hero-tinted img[src$="/TBL_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/TBL_dark.svg"); }
.hero-tinted img[src$="/TOR_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/TOR_dark.svg"); }
.hero-tinted img[src$="/NSH_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/NSH_dark.svg"); }

/* ===== Pistemiesbingo (_shared/bingo.ts, /bingo, /tulospiilo, Asetukset) =====
   Table sits directly on the hero-tinted tile (translucent, like the front
   page's top-5 teasers): no card box, no own white/grey backgrounds, and no
   dependence on .yf-table / .stand-table rules. */
.bingo-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: none;
  border: 0;
}

.bingo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  background: none;
  color: #fff;
}

.bingo-section {
  margin-top: 16px;
}

.bingo-section .section-title {
  color: rgba(255, 255, 255, 0.9);
}

.bingo-table td[colspan] {
  white-space: normal;
  min-width: 110px;
  line-height: 1.25;
}

.bingo-table th,
.bingo-table td {
  padding: 8px 4px;
  text-align: center;
  white-space: nowrap;
  background: transparent;
}

.bingo-table thead th {
  font-weight: 700;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.bingo-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.08);
}

.bingo-table .bingo-first {
  text-align: left;
  min-width: 0;
}

.bingo-table .player-cell {
  gap: 8px;
  color: inherit;
}

.bingo-table .player-cell img:not(.table-team-logo) {
  width: 32px;
  height: 32px;
}

.bingo-table .player-name {
  font-size: 0.88rem;
  white-space: normal;
  color: #fff;
}

.bingo-table .player-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
}

.bingo-table .table-team-logo {
  width: 18px;
  height: 18px;
  margin: 0;
  background: none;
  border-radius: 0;
  vertical-align: middle;
}

.bingo-table .bingo-game {
  font-weight: 600;
}

.bingo-table .bingo-pts {
  font-weight: 700;
  color: #fff;
}

.bingo-time,
.bingo-status {
  display: block;
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

.bingo-live {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8ab4ff;
}

.bingo-live .live-dot {
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}

/* Spoiler gate (Tulospiilo): stats of a started game stay "?" until the
   page's script marks the row .is-revealed. */
.bingo-q {
  display: none;
}

.bingo-row[data-gate]:not(.is-revealed) .bingo-val {
  display: none;
}

.bingo-row[data-gate]:not(.is-revealed) .bingo-q {
  display: inline;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.1em;
}

.bingo-row[data-gate]:not(.is-revealed) .bingo-revealed-only,
.bingo-row[data-gate].is-revealed .bingo-hidden-only {
  display: none;
}

.bingo-reveal {
  margin-top: 10px;
}

.bingo-chip {
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.bingo-group-title {
  margin: 14px 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

/* Asetukset tabs (Yleiset / Suosikit / Tulospiilo): links styled like the
   Sarjataulukko tab picker. */
.settings-tabs a.standings-tab {
  text-align: center;
  text-decoration: none;
}

/* xG/GSAx explainer (player card, maalivahtipörssi) -- collapsed by default. */
.xg-info {
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.xg-info summary {
  cursor: pointer;
}

.xg-info p {
  margin: 6px 0 0;
}

/* Playoffit: bracket diagram, standings tables with odds, probability pies. */
.pf-note { color: var(--muted); font-size: 0.8rem; margin: 6px 0 12px; }
.pf-warning { margin: 16px 0 0; }
.pf-bk {
  --rh: 70px;
  display: grid;
  grid-template-columns: 1fr 30px 30px 56px 30px 30px 1fr;
  grid-template-rows: auto repeat(8, var(--rh));
  margin: 10px 0 8px;
}
.pf-bk h4 { grid-row: 1; font: 600 1.2rem var(--font-display); letter-spacing: 0.04em; margin: 0 0 6px; }
.pf-m { display: flex; flex-direction: column; margin: 2px 0; border: 1px solid var(--border); border-radius: 9px; background: var(--card-bg); }
.pf-s {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 600; line-height: 1.15;
}
.pf-s::before {
  content: ""; position: absolute; top: 0; left: 14%; right: 14%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--tc);
}
.pf-s + .pf-s { border-top: 1px solid var(--border); }
.pf-s img { width: 30px; height: 30px; }
.pf-s small { color: var(--muted); font-weight: 500; font-size: 0.7rem; }
/* Later rounds are just connector lines: pairs of matchups sit at 25 % / 75 % of the element. */
.pf-j { position: relative; }
.pf-j::before { content: ""; position: absolute; top: 25%; bottom: 25%; left: 0; right: 0; border: 1px solid var(--muted); }
.pf-j.w::before { border-left: 0; }
.pf-j.e::before { border-right: 0; }
.pf-fin { position: relative; align-self: stretch; display: grid; place-items: center; color: var(--muted); font-size: 0.65rem; }
.pf-fin::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px solid var(--muted); }
.pf-fin span { position: relative; background: var(--bg); padding: 2px 0; text-align: center; }
.pf-fin svg { width: 30px; height: 30px; color: var(--accent); }

.pf-bk.fc { --rh: 54px; grid-template-columns: 1fr 40px 40px 76px 40px 40px 1fr; }
.pf-bk.fc .pf-s img { width: 24px; height: 24px; }
.pf-n { position: absolute; z-index: 1; transform: translate(-50%, -50%); text-align: center; }
.pf-j.w .pf-n { left: 100%; }
.pf-j.e .pf-n { left: 0; }
.pf-n img, .pf-champ img { display: block; box-sizing: border-box; width: 30px; height: 30px; padding: 3px; border-radius: 50%; background: #fff; border: 2px solid var(--tc); }
.pf-n small, .pf-champ small { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding: 0 3px; border-radius: 4px; background: var(--bg); font-size: 0.6rem; font-weight: 700; white-space: nowrap; }
.pf-champ { position: relative; margin: 0 auto 22px; width: 44px; }
.pf-champ img { width: 44px; height: 44px; padding: 5px; border: 3px solid #d4af37; box-shadow: 0 0 0 3px color-mix(in srgb, #d4af37 35%, transparent), 0 0 14px #d4af37; }
.pf-champ small { top: calc(100% + 5px); color: #d4af37; font-size: 0.7rem; }
.pf-div-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.pf-bar-row.sm { grid-template-columns: auto 1fr 38px; gap: 6px; font-size: 0.85rem; }
.pf-bar-row.sm img { width: 20px; height: 20px; }
.pf-sub { font: 600 1rem var(--font-display); letter-spacing: 0.04em; color: var(--muted); margin: 14px 0 6px; }
.pf-bar-row { display: grid; grid-template-columns: 70px 1fr 46px; gap: 10px; align-items: center; padding: 4px 0; font-variant-numeric: tabular-nums; }
.pf-bar-row .tm { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.pf-bar-row img { width: 22px; height: 22px; }
.pf-bar-row .bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.pf-bar-row .bar span { display: block; height: 100%; border-radius: 4px; background: var(--tc); }
.pf-bar-row b { text-align: right; }

.pf-head, .pf-row {
  display: grid;
  grid-template-columns: 38px 1fr 22px 22px 22px 22px 28px 40px 46px;
  gap: 4px; align-items: center; font-size: 0.85rem; font-variant-numeric: tabular-nums;
}
.pf-head.no-sim, .pf-row.no-sim { grid-template-columns: 38px 1fr 22px 22px 22px 22px 28px; }
.pf-head { color: var(--muted); font-size: 0.72rem; padding: 0 10px; margin-bottom: 4px; }
.pf-head span, .pf-row span { text-align: right; }
.pf-head span:nth-child(-n+2), .pf-row span:nth-child(-n+2) { text-align: left; }
.pf-row {
  padding: 8px 10px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 4px; box-shadow: inset 4px 0 0 var(--tc);
}
.pf-row.in { border-color: #0a7d32; }
.pf-row .tm { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.pf-row img { width: 24px; height: 24px; }
.pf-row .pp { font-weight: 700; }
.pf-row .pts { font-weight: 700; color: var(--accent); }
.pf-cut { border-top: 2px dashed var(--muted); opacity: 0.6; margin: 2px 4px 6px; }

.pf-sort { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.pf-sort > span { color: var(--muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.pf-sort .tab-bar { margin: 0; }

/* Game preview goaltending: big headshot left, name beside it, team logo right
   (overrides the centered column header the player cards use). */
.goalie-card .stat-card-header {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
}

.goalie-card .stat-card-headshot {
  width: 72px;
  height: 72px;
  border: 2px solid var(--border);
}

.goalie-card .stat-card-name {
  white-space: normal;
  line-height: 1.2;
}

.goalie-card .stat-card-team-logo {
  width: 40px;
  height: 40px;
}

/* Game preview: "Pelaajat seurattavaksi" -- two narrow player cards per row. */
.pw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pw-grid-label {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-align: center;
}

.pw-grid-label:first-child {
  margin-top: 0;
}

.pw-card {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.pw-card-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.pw-card.goalie-card .stat-card-header {
  gap: 6px;
  padding: 8px;
  font-size: 0.78rem;
}

.pw-card.goalie-card .stat-card-headshot {
  width: 40px;
  height: 40px;
}

.pw-card.goalie-card .stat-card-team-logo {
  width: 22px;
  height: 22px;
}

.pw-card .stat-card-grid-cells {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 2px;
  padding: 10px 4px 12px;
}

.pw-card .stat-card-value {
  font-size: 1rem;
}

/* /joukkueet index + /odotetut */
.team-index-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .team-index-grid { grid-template-columns: 1fr 1fr; } }
.stat-card-header.team-index-header { flex-direction: row; justify-content: flex-start; gap: 10px; text-align: left; font-size: 1rem; font-weight: 700; text-decoration: none; }
.team-index-header .stat-card-team-logo { margin-left: 0; order: -1; }
.team-index-grid .stat-card-value { font-size: 1.1rem; }

/* Game preview goalie cards reuse .pw-card; "V-H-JH" is longer than the other cells. */
.pw-card .stat-card-cell.pw-cell-sm .stat-card-value { font-size: 0.78rem; line-height: 1.55; }

/* /odotetut Joukkueet: plain logos, no round headshot background */
.porssi-table .player-cell img.team-logo-plain,
.porssi-table .player-cell img:not(.table-team-logo).team-logo-plain {
  border-radius: 0;
  background: none;
  box-shadow: none;
}

/* Win-probability header: team logo + abbrev (away: logo first, home: logo last) */
.wp-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}
.wp-team img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.wp-team-home {
  justify-content: flex-end;
}

/* ---------- Redesign step 3a: ottelukortti (kaksi pelipaitaa diagonaalilla) ---------- */

.game-card.jersey-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #0a0a0c;
  color: #fff;
}

.jersey-card .score-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 104px;
  padding: 0 18px;
}

/* Oma jersey-tekstuuri: joukkueen väri + reikämalli, ei NHL:n kuvia. */
.jc-half {
  position: absolute;
  inset: 0;
  background-color: var(--c);
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.28) 1.6px, transparent 2.2px),
    radial-gradient(circle, rgba(0, 0, 0, 0.28) 1.6px, transparent 2.2px);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
}

.jc-away {
  --c: var(--ca);
  clip-path: polygon(0 0, 58% 0, 42% 100%, 0 100%);
}

.jc-home {
  --c: var(--ch);
  clip-path: polygon(58% 0, 100% 0, 100% 100%, 42% 100%);
}

.jc-half::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

/* Oma "wires"-korvike: iso ääriviivatunnus joukkuekoodista. */
.jc-half::after {
  content: attr(data-abbr);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font: 700 100px/1 var(--font-display);
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.22);
}

.jc-away::after {
  left: -6px;
}

.jc-home::after {
  right: -6px;
}

.jersey-card .team {
  position: relative;
  z-index: 1;
  width: auto;
  gap: 10px;
}

.jersey-card .logo {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.jersey-card .abbrev {
  font: 600 1.8rem/1 var(--font-display);
  letter-spacing: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.jersey-card .score {
  position: relative;
  z-index: 1;
  gap: 8px;
  font: 700 3.8rem/1 var(--font-display);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.jersey-card .dash {
  color: #fff;
  opacity: 0.6;
  font-weight: 700;
}

.jersey-card .score-time {
  font: 600 2.6rem/1 var(--font-display);
  color: #fff;
}

/* Tumma alapalkki: tila, suomalaiset, vihje. */
.jersey-card .ot-tag,
.jersey-card .live-tag,
.jersey-card .finn-stats,
.jersey-card .game-card-hint {
  margin: 0;
  padding: 7px 18px;
  background: #0a0a0c;
  color: #b8b8c0;
  text-transform: none;
  letter-spacing: 0;
}

.jersey-card .ot-tag {
  color: var(--gold, #f5c84c);
  font-size: 0.8rem;
}

.jersey-card .live-tag {
  justify-content: flex-start;
  color: #ff5c5c;
  font-size: 0.8rem;
}

.jersey-card .game-card-hint {
  text-align: left;
  font-size: 0.8rem;
}

.jersey-card .finn-stats {
  gap: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.jersey-card .stat-line {
  align-items: center;
  color: #fff;
  font-weight: 500;
}

.jersey-card .stat-line .team-tag {
  color: #b8b8c0;
}

.jersey-card .stat-line .value {
  color: #f5c84c;
  font: 600 1.5rem/1 var(--font-display);
}

/* Paitataustan päällä aina tumman tilan logo (tumma logo katoaisi väriin). */
.jersey-card img[src$="/TBL_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/TBL_dark.svg"); }
.jersey-card img[src$="/TOR_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/TOR_dark.svg"); }
.jersey-card img[src$="/NSH_light.svg"] { content: url("https://assets.nhle.com/logos/nhl/svg/NSH_dark.svg"); }

.jersey-card .dash {
  font-size: 2.6rem;
  font-weight: 500;
}

/* ---------- Redesign step 3b: avattu ottelun tiedot-paneeli ---------- */

.team-detail:not(.hero-tinted) {
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 0 0 24px 0;
  padding: 12px 14px 16px;
}

.team-detail:not(.hero-tinted) .team-detail-name {
  font: 600 1.6rem/1 var(--font-display);
}

.team-detail:not(.hero-tinted) .tp-section-title {
  font: 600 1.1rem/1 var(--font-display);
  letter-spacing: 0.02em;
}

/* Erätauot: kullanvärinen vinoreunainen kaista. */
.mt-band {
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  border-left: 3px solid var(--accent);
  font: 600 1rem/1 var(--font-display);
  letter-spacing: 0.04em;
}

.mt-band-score {
  font-size: 1.1rem;
  margin-right: 8px;
}

.mt-time,
.mt-pill-score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.mt-pill {
  border-radius: 0 0 8px 0;
}

/* Tilastopalkit: vinot, pelipaitatekstuuriset segmentit (väri tulee inline-tyylistä). */
.pts-bar {
  height: 14px;
  border-radius: 0;
}

.pts-bar-away,
.pts-bar-home {
  position: relative;
}

.pts-bar-away::after,
.pts-bar-home::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.28) 1px, transparent 1.6px);
  background-size: 6px 6px;
}

.gd-stat-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.gd-stat-value.gd-stat-better {
  color: var(--accent);
}

.gd-stat-team {
  font: 600 1.2rem/1 var(--font-display);
}

/* ---------- Redesign step 3c: otteluesikatselu ja otteluohjelma ---------- */

/* Rivin vasen reuna: vieras- ja kotijoukkueen väri päällekkäin (paitakaistale). */
.primetime-row {
  position: relative;
  padding-left: 18px;
  border-radius: 0 0 16px 0;
  overflow: hidden;
}

.primetime-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(to bottom, var(--ca, var(--accent)) 50%, var(--ch, var(--accent)) 50%);
}

.primetime-time,
.primetime-score {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}

.wp-team {
  font: 600 1.3rem/1 var(--font-display);
}

.jersey-card .mt-final-label,
.jersey-card .game-card-youtube {
  margin: 0;
  padding: 7px 18px;
  background: #0a0a0c;
  color: #b8b8c0;
}

.jersey-card .ot-tag,
.jersey-card .mt-final-label {
  text-align: center;
}

.jersey-card .game-card-youtube {
  color: var(--accent);
  padding-bottom: 12px;
}


/* ---------- Redesign step 4: taulukot (B-paneeli + paitakaistale) ---------- */

/* Pörssirivin joukkueväri data-team-attribuutista (rivit eivät kanna inline-väriä). */
.porssi-table tr[data-team="ANA"] > td:first-child { --tc: #F47A38; }
.porssi-table tr[data-team="BOS"] > td:first-child { --tc: #FFB81C; }
.porssi-table tr[data-team="BUF"] > td:first-child { --tc: #002654; }
.porssi-table tr[data-team="CAR"] > td:first-child { --tc: #CC0000; }
.porssi-table tr[data-team="CBJ"] > td:first-child { --tc: #002654; }
.porssi-table tr[data-team="CGY"] > td:first-child { --tc: #D2001C; }
.porssi-table tr[data-team="CHI"] > td:first-child { --tc: #CF0A2C; }
.porssi-table tr[data-team="COL"] > td:first-child { --tc: #6F263D; }
.porssi-table tr[data-team="DAL"] > td:first-child { --tc: #006847; }
.porssi-table tr[data-team="DET"] > td:first-child { --tc: #CE1126; }
.porssi-table tr[data-team="EDM"] > td:first-child { --tc: #FF4C00; }
.porssi-table tr[data-team="FLA"] > td:first-child { --tc: #C8102E; }
.porssi-table tr[data-team="LAK"] > td:first-child { --tc: #A2AAAD; }
.porssi-table tr[data-team="MIN"] > td:first-child { --tc: #154734; }
.porssi-table tr[data-team="MTL"] > td:first-child { --tc: #AF1E2D; }
.porssi-table tr[data-team="NJD"] > td:first-child { --tc: #CE1126; }
.porssi-table tr[data-team="NSH"] > td:first-child { --tc: #FFB81C; }
.porssi-table tr[data-team="NYI"] > td:first-child { --tc: #00539B; }
.porssi-table tr[data-team="NYR"] > td:first-child { --tc: #0038A8; }
.porssi-table tr[data-team="OTT"] > td:first-child { --tc: #C52032; }
.porssi-table tr[data-team="PHI"] > td:first-child { --tc: #F74902; }
.porssi-table tr[data-team="PIT"] > td:first-child { --tc: #FCB514; }
.porssi-table tr[data-team="SEA"] > td:first-child { --tc: #99D9D9; }
.porssi-table tr[data-team="SJS"] > td:first-child { --tc: #006D75; }
.porssi-table tr[data-team="STL"] > td:first-child { --tc: #002F87; }
.porssi-table tr[data-team="TBL"] > td:first-child { --tc: #002868; }
.porssi-table tr[data-team="TOR"] > td:first-child { --tc: #00205B; }
.porssi-table tr[data-team="UTA"] > td:first-child { --tc: #71AFE5; }
.porssi-table tr[data-team="VAN"] > td:first-child { --tc: #00205B; }
.porssi-table tr[data-team="VGK"] > td:first-child { --tc: #B4975A; }
.porssi-table tr[data-team="WPG"] > td:first-child { --tc: #041E42; }
.porssi-table tr[data-team="WSH"] > td:first-child { --tc: #C8102E; }

.stand-scroll,
.stats-table-wrap:has(> .porssi-table),
.stat-card {
  border-radius: 0 0 24px 0;
}

.stand-table thead th,
.porssi-table thead th {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.stand-table td.st-pts,
.porssi-table td.stat-strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.stand-table .st-abbrev {
  font: 600 1.2rem/1 var(--font-display);
}

/* Paitakaistale: 5 px joukkueen väriä rivin vasemmassa reunassa. */
.stand-row td.st-first,
.stand-row.qualified td.st-first,
.porssi-table td.col-rank {
  box-shadow: inset 5px 0 0 var(--tc, transparent);
}

/* Pörssin pelaajakuvat: isompi pyöreä kuva joukkueen värirenkaalla. */
.porssi-table .player-cell img:not(.table-team-logo) {
  width: 34px;
  height: 34px;
  box-shadow: 0 0 0 2px var(--tc, var(--border));
}

/* Playoff-raja kultaisena. */
.wc-cutoff-line {
  border-top: 2px solid var(--accent);
  opacity: 1;
}

/* Kausi- ja uratilastokortit */
.stat-card-header {
  font: 600 1.05rem/1 var(--font-display);
  letter-spacing: 0.03em;
  border-left: 5px solid var(--accent);
}

.stat-card-table thead th {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
}

.stat-card-table tbody td {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* ---------- Redesign step 5: heron ja loppusivujen viimeistely ---------- */

.hero-banner {
  border-radius: 0 0 24px 0;
}

.hero-banner h1 {
  font: 600 2.6rem/1 var(--font-display);
  letter-spacing: 0.01em;
}

.team-page-header h1 {
  font-size: 3rem;
}

.player-hero-meta {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
}

.player-hero-photo {
  border-radius: 0 0 16px 0;
}

.team-hero-logo {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* Kausikohtaiset ja rosteri-taulukot: Teko-numerot ja -otsikot */
.stats-table thead th {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.stats-table td.stat-strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.player-hero-meta span {
  font-size: 1.2rem;
}

.player-hero-meta .player-hero-flag {
  font-size: 1rem;
}

/* ---------- Omat ikonit (/static/icons.svg) ---------- */

.ic {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.17em;
  flex-shrink: 0;
}

.nav-list a .ic,
.nav-group-toggle .ic {
  width: 22px;
  height: 22px;
  margin-right: 12px;
  vertical-align: -5px;
}

.page-header h1 .ic,
.section-title .ic {
  width: 0.85em;
  height: 0.85em;
  vertical-align: -0.1em;
  color: var(--accent);
}

.icon-btn .ic {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.nav-group-toggle {
  justify-content: flex-start;
  text-align: left;
}

.nav-group-toggle .nav-group-chevron {
  margin-left: auto;
}

/* SVG-liput (flag-icons, MIT) */
.flag-img {
  height: 0.85em;
  width: auto;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  vertical-align: -0.08em;
  box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.35);
  object-fit: cover;
}

.player-meta .flag-img,
.player-cell .player-meta img.flag-img,
.porssi-table .player-cell img.flag-img,
.yf-table .player-cell img.flag-img,
.bingo-table .player-cell img.flag-img {
  width: auto;
  height: 0.75rem;
  border-radius: 2px;
  background: none;
}

.hero-fav-star .ic {
  --ic-fill: currentColor;
}

.hero-fav-star {
  color: rgba(255, 255, 255, 0.55);
}

/* Heron oma "wires"-korvike: iso ääriviivatunnus, kuten pelikorteissa. */
.hero-banner {
  overflow: hidden;
}

.hero-banner[data-abbr]::after {
  content: attr(data-abbr);
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
  font: 700 150px/1 var(--font-display);
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.2);
  pointer-events: none;
}



.hero-banner > *:not(.player-hero-flip-hint) {
  position: relative;
  z-index: 1;
}

/* Pelaajaheron sisältö mahtuu myös kun nimi rivittyy kahdelle riville. */
.player-hero-flip-inner {
  min-height: 300px;
}

.player-hero-photo {
  width: 34vw;
  max-width: 120px;
  height: 34vw;
  max-height: 120px;
}

.player-card-header h1 {
  font-size: clamp(1.9rem, 9vw, 2.6rem);
}

/* Käännetyn kortin etupuolen sisältö ei saa näkyä peilikuvana taustapuolen läpi. */
.hero-banner.player-hero-face > *,
.hero-banner.player-hero-face::after {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Pelaaherokortti: etupuolella nimi, numero, pelipaikka, lippu ja logo; kuva kiinni alareunaan. */
.hero-banner.player-hero-front {
  padding-bottom: 0;
  justify-content: space-between;
}

.player-hero-front .player-hero-meta {
  margin-bottom: 0;
}

.player-hero-front .player-hero-footer {
  margin-top: auto;
}

.player-hero-front .player-hero-photo {
  border-radius: 0;
  max-width: 175px;
  max-height: 175px;
  width: 45vw;
  height: 45vw;
  object-position: center bottom;
}

.player-hero-front .player-hero-team-logo {
  margin: 0 22px 16px 0;
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* Käännön aikana näkyvä puoli vaihdetaan visibilityllä animaation puolivälissä
   (0.225 s / 0.45 s), ettei backface-visibility (Safari) vuoda peilikuvaa. */
.player-hero-flip {
  perspective: 1200px;
}

.player-hero-flip-inner {
  min-height: 245px;
  transition: transform 0.45s ease, min-height 0.3s ease;
}

/* Poistuva puoli häivytetään heti käännön alussa ja saapuva tuodaan esiin
   vasta kun kortti on reunasta (0.225 s), jolloin kuva/logo eivät vuoda läpi. */
/* Taustat pysyvät aina näkyvissä (backface piilottaa väärän puolen), vain
   sisältö häivytetään, ettei kortti katoa hetkeksi. */
.hero-banner.player-hero-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hero-banner.player-hero-face > *,
.hero-banner.player-hero-face::after {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease 0.03s, visibility 0s 0.225s;
}

.hero-banner.player-hero-back {
  transform: rotateY(180deg);
}

.player-hero-flip .hero-banner.player-hero-face.is-active > *,
.player-hero-flip .hero-banner.player-hero-face.is-active::after {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease 0.225s, visibility 0s 0.225s;
}


.mt-strength-tag {
  align-self: center;
  margin: 0 5px;
  padding: 0 4px;
  border: 1px solid var(--accent);
  border-radius: 0 0 6px 0;
  color: var(--accent);
  font: 600 0.68rem/1.25 var(--font-display);
  letter-spacing: 0.04em;
}

/* ---------- Yhtenäistys: otsikot, joukkuenauhat joukkuekorteissa ja bracketissa ---------- */

.page-header h1 {
  font: 600 2.2rem/1.05 var(--font-display);
  letter-spacing: 0.01em;
}

.page-header .brand-heading {
  font-size: 2.2rem;
}

.stat-card.team-index-header,
.stat-card .team-index-header {
  border-left-color: var(--tc, var(--accent));
}

.division-row {
  box-shadow: inset 5px 0 0 var(--tc, transparent);
}

.matchup-abbrev {
  font: 600 1.4rem/1 var(--font-display);
  letter-spacing: 0.03em;
}

.matchup-points,
.division-points,
.division-rank {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}

.matchup-seed {
  font-size: 0.78rem;
}


.player-hero-front h1 {
  font-size: clamp(1.8rem, 8vw, 2.4rem);
}

/* Labelit: Bio sentence case + Teko-arvot, osio-otsikot Tekolla ilman kapitaaleja */
.player-hero-back-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.85);
}

.player-hero-bio-label {
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.6);
}

.player-hero-bio-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.player-hero-bio-value .flag-img {
  vertical-align: -2px;
}

.tp-section-title,
.division-header,
.roster-group-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* Suosikkitähti pysyy oikeassa yläkulmassa (.hero-banner > * asettaisi relativen) */
.hero-banner > .hero-fav-form {
  position: absolute;
}

/* Joukkuesivun hero: iso logo + tekstit vasemmalla, lyhenne oikealla kuten pelaajilla */
.team-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 22px 12px;
  min-height: 150px;
}

.team-page-header .team-hero-logo {
  width: 96px;
  height: 96px;
  margin: 0;
  flex: none;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.team-page-header .team-hero-text {
  min-width: 0;
  padding-right: 0;
}

.team-page-header h1 {
  font-size: 2.6rem;
  margin: 0;
}

/* Vanhat tummat teaser-laatat saavat heron muodon, suosikkijoukkuekortti lyhenteen */
.hero-tinted {
  border-radius: 0 0 24px 0;
}

.fav-team-card[data-abbr] {
  overflow: hidden;
}

.fav-team-card[data-abbr]::after {
  content: attr(data-abbr);
  position: absolute;
  right: -6px;
  top: 8px;
  z-index: 0;
  font: 700 84px/1 var(--font-display);
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.mt-col {
  min-width: 0;
}

.mt-away .mt-col {
  text-align: left;
}

.mt-home .mt-col {
  text-align: right;
}

/* ---------- Bracket redesign: yksi kortti per ottelupari, kierros kerrallaan ---------- */

.bracket-round-title {
  margin: 14px 0 8px;
  font: 600 1.05rem/1 var(--font-display);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.bracket-matches {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 700px) {
  .bracket-matches {
    grid-template-columns: 1fr 1fr;
  }
}

.matchup-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.matchup-team {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 12px 12px 22px;
  min-width: 0;
}

.matchup-team.is-right {
  align-items: flex-end;
  text-align: right;
  padding: 14px 22px 12px 12px;
}

.matchup-team::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 9px;
  width: 4px;
  border-radius: 2px;
  background: var(--tc, transparent);
}

.matchup-team.is-right::before {
  left: auto;
  right: 9px;
}

.matchup-logo {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
}

.matchup-abbrev {
  font-size: 1.9rem;
}

.matchup-seed {
  margin: 0;
  line-height: 1.2;
}

.matchup-points {
  margin: 4px 0 0;
  font-size: 1.1rem;
  color: var(--muted);
}

.matchup-mid {
  align-self: center;
  padding: 0 4px;
  font: 600 1.1rem/1 var(--font-display);
  color: var(--muted);
}

/* Tuleville kierroksille: tyhjä paikka ja sarjan tilanne keskellä (esim. "2 - 1") */
.matchup-card.is-tbd .matchup-team {
  opacity: 0.55;
}

.matchup-card.is-tbd .matchup-abbrev {
  font-size: 1.3rem;
}

.matchup-card.is-tbd .matchup-team::before {
  background: var(--border);
}

/* ---------- Suosikkijoukkuelaatta: pelipaitatyyli, sama koko ja tiedot ---------- */

.fav-team-card {
  gap: 8px;
  padding: 12px;
}

.fav-team-card-logo {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.fav-team-card-name {
  font: 600 1.25rem/1.05 var(--font-display);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.fav-team-card .fav-row-meta {
  font-size: 0.72rem;
}

.fav-team-card-schedule {
  gap: 2px;
  margin: 0 -4px;
  padding: 5px 6px;
  border-radius: 0 0 10px 0;
  background: rgba(0, 0, 0, 0.35);
}

.fav-team-card-game {
  gap: 5px;
  color: #fff;
  font-size: 0.8rem;
}

.fav-team-card-game-logo {
  width: 18px;
  height: 18px;
}

.fav-team-card-game .fav-row-meta {
  margin-left: auto;
  font: 600 0.95rem/1 var(--font-display);
  color: #fff;
}

.fav-team-card-scorer {
  padding-top: 8px;
}

.fav-team-card-photo {
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.fav-team-card[data-abbr]::after {
  font-size: 72px;
  top: 4px;
  opacity: 0.8;
}

/* Jatkoaika / voittolaukaukset: JA / VL tuloksen alla, samalla fontilla */
.jersey-card .score-note {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 1;
  transform: translateX(-50%);
  font: 600 1.3rem/1 var(--font-display);
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.jersey-card .score-row.has-note .score {
  transform: translateY(-9px);
}

/* ---------- Kuntopuntari ---------- */

.form-row {
  position: relative;
  overflow: hidden;
  padding-left: 14px;
  box-shadow: inset 5px 0 0 var(--tc, transparent);
}

.form-row .division-rank {
  font-size: 1.3rem;
}

.form-row .division-name {
  font: 600 1.15rem/1 var(--font-display);
  letter-spacing: 0.02em;
}

.form-chips {
  gap: 3px;
}

.form-chip {
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
  font: 600 0.9rem/1 var(--font-display);
  color: #fff;
}

.form-chip.result-w {
  background: #1f9d55;
}

.form-chip.result-l {
  background: #cf3b34;
}

.form-chip.result-otl {
  background: #d98a1c;
}

/* Uusin tulos (oikealla) korostettuna */
.form-chip:last-child {
  box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3.5px currentColor;
}

.form-record {
  min-width: 44px;
  text-align: right;
  font: 600 1.1rem/1 var(--font-display);
  color: var(--text);
}

.form-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--border);
}

.form-bar i {
  display: block;
  height: 100%;
  background: var(--tc, var(--accent));
}

/* Kuntopuntari: kaksi riviä, ylhäällä joukkue + saldo + pisteet, alla 10 tuloksen jono */
.form-row {
  grid-template-columns: 24px 1fr auto;
  row-gap: 8px;
  padding: 10px 12px 12px 14px;
}

.form-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.form-record {
  min-width: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.form-points {
  font: 600 1.5rem/1 var(--font-display);
  color: var(--text);
}

.form-points small {
  margin-left: 1px;
  font: 500 0.8rem var(--font-display);
  color: var(--muted);
}

.form-row .form-chips {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}

.form-row .form-chip {
  min-width: 0;
  height: 22px;
  width: 100%;
}

.form-chip.is-empty {
  background: var(--border);
  opacity: 0.5;
}

.division-header .form-summary {
  font-weight: 600;
}

/* ---------- Tulospiilo: samat pelipaitabannerit kuin etusivulla ---------- */

.spoiler-game {
  display: flex;
  flex-direction: column;
}

.spoiler-game .spoiler-reveal-toggle {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.spoiler-game .spoiler-score-row {
  order: 1;
  padding: 0;
  margin: 0;
  border-radius: 0;
  opacity: 1;
}

.spoiler-game .spoiler-reveal-toggle:checked ~ .spoiler-score-row:hover,
.spoiler-game .spoiler-reveal-toggle:checked ~ .spoiler-score-row:focus-visible {
  background: none;
  filter: brightness(1.08);
}

.spoiler-game .spoiler-placeholder {
  color: #fff;
  letter-spacing: 0.06em;
}

.spoiler-game .spoiler-score-row .spoiler-reveal-hint {
  margin: 0;
  padding: 7px 18px;
  color: var(--gold, #f5c84c);
}

.spoiler-game .spoiler-check-label {
  order: 2;
  margin: 0;
  padding: 9px 18px;
  background: #0a0a0c;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #b8b8c0;
}

.spoiler-game .spoiler-check-text {
  color: #b8b8c0;
}

.spoiler-check-box {
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
}

.spoiler-reveal-toggle:checked + .spoiler-score-row ~ .spoiler-check-label .spoiler-check-box,
.spoiler-reveal-toggle:checked ~ .spoiler-check-label .spoiler-check-box {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 80% no-repeat;
  border-color: var(--accent);
}

.spoiler-reveal-toggle:focus-visible ~ .spoiler-check-label .spoiler-check-box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.spoiler-game .game-card-youtube {
  order: 3;
}

/* Sarjataulukko / kuntopuntari: suodatinpillerit */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-bar[hidden],
.team-index-group.is-hidden,
.sub-item.is-hidden,
.sub-wrap.is-hidden,
.venue-sec.is-hidden,
.form-sec.is-hidden {
  display: none;
}

.form-row .form-chips {
  grid-template-columns: repeat(var(--n, 10), 1fr);
}

/* Tulospiilo: avautuva ottelupaneeli istuu pelipaitakortin sisällä, joten
   se ei saa periä kortin valkoista tekstiä / mustaa YouTube-palkkia. */
.spoiler-game .team-detail {
  order: 1;
  margin: 8px;
  color: var(--text);
}

.spoiler-game .team-detail .game-card-youtube {
  margin-top: 10px;
  padding: 0;
  background: none;
}

.spoiler-game .team-detail .game-card-hint {
  background: none;
}

/* Vaalealla teemalla paneeli on valkoinen: takaisin vaalean taustan logoihin. */
:root[data-theme="light"] .spoiler-game .team-detail img[src$="/TBL_light.svg"],
:root[data-theme="light"] .spoiler-game .team-detail img[src$="/TOR_light.svg"],
:root[data-theme="light"] .spoiler-game .team-detail img[src$="/NSH_light.svg"] { content: normal; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .spoiler-game .team-detail img[src$="/TBL_light.svg"],
  :root:not([data-theme]) .spoiler-game .team-detail img[src$="/TOR_light.svg"],
  :root:not([data-theme]) .spoiler-game .team-detail img[src$="/NSH_light.svg"] { content: normal; }
}
.standings-legend + .filter-pills { margin-top: 12px; }

/* Alavalitsimet käyttävät samaa alleviivattua tab-tyyliä kuin sarjataulukon päävälilehdet. */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 12px 0 14px;
}

.tab-bar[hidden] {
  display: none;
}

/* Toissijaiset tab-rivit hieman kevyempinä kuin päävälilehdet. */
.tab-bar { margin-top: 0; }
.tab-bar .standings-tab { font-size: 0.85rem; padding: 8px 4px; }
.standings-legend + .tab-bar { margin-top: 12px; }

/* Kaikki muut pillerivalitsimet (paitsi päiväselain) samaan alleviivattuun tab-tyyliin. */
.season-type-picker,
.team-games-picker,
.player-filter-picker,
.analytiikka-view-picker,
.streak-picker,
.division-picker,
.sarjataulukko-view-picker {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin: 12px 0 14px;
}

:is(.season-type-picker, .team-games-picker, .player-filter-picker, .analytiikka-view-picker, .streak-picker, .division-picker, .sarjataulukko-view-picker) .day-pill {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
}

:is(.season-type-picker, .team-games-picker, .player-filter-picker, .analytiikka-view-picker, .streak-picker, .division-picker, .sarjataulukko-view-picker) .day-pill.active {
  background: none;
  border-bottom-color: var(--text);
  color: var(--text);
  font-weight: 700;
}

/* Tab-rivit vierivät vaakaan, kun sisältö ei mahdu; tabit eivät kutistu alle sisältönsä. */
.standings-tab-picker,
.tab-bar,
.day-picker {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.standings-tab-picker::-webkit-scrollbar,
.tab-bar::-webkit-scrollbar,
.day-picker::-webkit-scrollbar,
:is(.season-type-picker, .team-games-picker, .player-filter-picker, .analytiikka-view-picker, .streak-picker, .division-picker, .sarjataulukko-view-picker)::-webkit-scrollbar {
  display: none;
}

.standings-tab,
:is(.season-type-picker, .team-games-picker, .player-filter-picker, .analytiikka-view-picker, .streak-picker, .division-picker, .sarjataulukko-view-picker) .day-pill {
  flex: 1 0 auto;
  padding-left: 14px;
  padding-right: 14px;
}

/* Päiväselain samaan tab-tyyliin. */
.day-picker {
  gap: 0;
  margin: 12px 0 14px;
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.day-picker .day-pill {
  padding: 10px 14px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
}

.day-picker .day-pill.active {
  background: none;
  border-bottom-color: var(--text);
  color: var(--text);
  font-weight: 700;
}

/* Etusivun päiväotsikko: otsikko + pienempi päivämäärä/ottelumäärä -rivi. */
#day-title .day-title-sub {
  display: block;
  margin-top: 4px;
  font: 500 0.95rem/1.2 var(--font-body, inherit);
  color: var(--muted);
}

#day-title { line-height: 1.05; }
#day-title .day-title-sub { margin-top: 0; line-height: 1.1; }

/* Päiväselaimen nuolet + päivitys: ympyränappi, viivaikoni, sama paino kuin muissa ikoneissa. */
.day-nav-btn,
.refresh-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  color: var(--text);
}

.day-nav-btn .ic,
.refresh-btn .ic {
  width: 22px;
  height: 22px;
}

.refresh-btn .ic {
  width: 20px;
  height: 20px;
}

/* ---------- Leveä ruutu: etusivu (pääsarake + sivupalsta) ---------- */

.dashboard,
.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 860px) {
  main:has(> .dashboard) {
    max-width: 1100px;
  }

  .dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 24px;
    align-items: start;
  }

  /* Ottelukortit rinnakkain; avautuva paneeli vie koko rivin. */
  .dashboard-main .game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
  }

  .dashboard-main .game-list > .team-detail {
    grid-column: 1 / -1;
  }

}

/* Alle noin 1100 px:n sisältöleveyden sivupalsta putoaa pääsarakkeen alle. */
@media (min-width: 860px) and (max-width: 1099px) {
  .dashboard {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Kapeat pelipaitakortit (kaksi korttia rinnakkain, pieni puhelin): pienempi sisältö. */
.game-card.jersey-card {
  container-type: inline-size;
}

@container (max-width: 400px) {
  .jersey-card .score-row {
    padding: 0 12px;
  }

  .jersey-card .team {
    gap: 6px;
  }

  .jersey-card .logo {
    width: 34px;
    height: 34px;
  }

  .jersey-card .abbrev {
    font-size: 1.4rem;
  }

  .jersey-card .score {
    font-size: 3rem;
    gap: 5px;
  }

  .jc-half::after {
    font-size: 80px;
  }
}

.dashboard-side > section {
  overflow-x: auto;
}

.dashboard-side :is(th, td) {
  padding-left: 6px;
  padding-right: 6px;
}

/* Sarjataulukko leveällä ruudulla: konferenssit/divisioonat rinnakkain. */
@media (min-width: 1300px) {
  main:has(.sarjataulukko-view-picker) {
    max-width: 1100px;
  }

  .standings-tab-section[data-tab="wildcard"],
  .venue-sec:has(> section) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
  }

  .form-sec {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    align-items: start;
  }

  .form-sec > .form-block:only-child {
    grid-column: 1 / -1;
  }

  .form-sec > .form-block:only-child .division-table {
    display: block;
    column-count: 2;
    column-gap: 24px;
  }

  .form-sec > .form-block:only-child .division-row {
    break-inside: avoid;
    margin-bottom: 4px;
  }

  .form-sec > .form-block:only-child .division-header {
    display: none;
  }
}

/* Pörssit ja odotetut leveällä ruudulla: tilaa kaikille sarakkeille. */
@media (min-width: 860px) {
  main:has(.porssi-table),
  main:has(.division-chart) {
    max-width: 900px;
  }
}

/* Pelaaja- ja joukkuesivu: hero vasemmalla, sisältö oikealla leveällä ruudulla. */
.split,
.split-side,
.split-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 1100px) {
  main:has(> .split),
  main:has(.split) {
    max-width: 1100px;
  }

  .split {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .split-side {
    position: sticky;
    top: 16px;
  }
}

/* Joukkueet-listaus: divisioonaryhmät; leveällä ruudulla 2 tai 4 saraketta. */
.team-index-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-index-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  main:has(.team-index-grid) {
    max-width: 1100px;
  }

  .team-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
    align-items: start;
  }
}

@media (min-width: 1300px) {
  .team-index-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1300px) {
  main:has(.team-index-grid) {
    max-width: 1200px;
  }

  .team-index-grid {
    column-gap: 10px;
  }

  .team-index-grid .stat-card-grid-cells {
    padding-left: 4px;
    padding-right: 4px;
  }

  .team-index-grid .stat-card-label {
    font-size: 0.68rem;
  }

  .team-index-grid .stat-card-value {
    font-size: 1rem;
  }

  .team-index-grid .stat-card-cell {
    padding-left: 2px;
    padding-right: 2px;
  }
}

/* Tulospiilo: sama ottelukortti kuin etusivulla; tulosta paljastavat osat
   (jatkoaika-merkintä, suomalaisten pisteet) näkyvät vasta kun tulos avataan. */
.spoiler-score-row:not(.is-shown) .score-note,
.spoiler-score-row:not(.is-shown) .finn-stats {
  display: none;
}

.bug-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.bug-form textarea {
  width: 100%;
  max-width: 560px;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  resize: vertical;
}

/* ---------- /suosikit ---------- */

.sk-when {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.sk-digest {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5.5vw, 2.4rem);
  font-weight: 500;
  line-height: 1.1;
}

.sk-hit {
  color: var(--accent);
}

.sk-h {
  margin: 24px 0 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.05;
}

/* Teams + players side by side, also on a phone. */
.sk-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.sk-list {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.sk-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: inherit;
  text-decoration: none;
}

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

.sk-grow {
  flex: 1;
  min-width: 0;
}

.sk-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.sk-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.sk-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.sk-score {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1;
  white-space: nowrap;
}

.sk-hot {
  box-shadow: inset 3px 0 0 var(--accent);
}

.sk-hot .sk-score {
  color: var(--accent);
}

.sk-dim,
.sk-dim .sk-score {
  color: var(--muted);
}

.sk-none {
  font-size: 0.75rem;
}

.sk-res {
  min-width: 18px;
  height: 16px;
  padding: 0 3px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
}

.sk-res.w {
  background: #1f9d55;
}

.sk-res.l {
  background: #cf3b34;
}

.sk-res.otl {
  background: #d98a1c;
}

.sk-night-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

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

.sk-time {
  width: 52px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}

.sk-night-fav {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.sk-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sk-seg {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.sk-stats .stats-table-wrap {
  margin-bottom: 14px;
}

.sk-l,
.sk-last .sk-s {
  display: none;
}

.sk-last .sk-l {
  display: inline;
}

.sk-next {
  color: var(--muted);
  font-size: 0.78rem;
}

/* Dashboard refresh: top toast + spinning button while the page reloads. */
.refresh-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: refresh-toast-in 0.2s ease-out;
}

.refresh-toast.is-leaving {
  opacity: 0;
  transition: opacity 0.3s;
}

.refresh-toast-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: refresh-spin 0.8s linear infinite;
}

.refresh-btn.is-loading svg {
  animation: refresh-spin 0.8s linear infinite;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes refresh-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .refresh-toast,
  .refresh-toast-spinner,
  .refresh-btn.is-loading svg {
    animation: none;
  }
}

/* Longer message variant (favorite-player limit): wraps instead of overflowing a phone. */
.refresh-toast.refresh-toast-wrap {
  width: max-content;
  max-width: calc(100vw - 32px);
  white-space: normal;
  border-radius: 16px;
}


/* ---------- Joukkueen Stanley Cup -puoli ja pelaajan palkintohuone ---------- */

/* Pokaalikuvien musta tausta on muutettu läpinäkyväksi PNG:ksi (alpha = kirkkaus). */
.trophy-img {
  display: block;
  width: auto;
}

.cup-years {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 5px;
}

.cup-years span {
  padding: 3px 6px 2px;
  border-radius: 5px;
  background: rgba(245, 200, 76, 0.18);
  color: #f5c84c;
  font: 600 1rem/1 var(--font-display);
  letter-spacing: 0.04em;
}

/* Käännettävä joukkuehero: etupuoli on entinen rivi, takapuoli pelkät pokaalit. */
.player-hero-flip.team-hero-flip .player-hero-flip-inner {
  min-height: 150px;
}

.hero-banner.team-page-header.player-hero-face {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
}

.hero-banner.team-page-header.team-hero-back {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 18px 16px 30px;
}

.team-cups {
  width: 100%;
  text-align: left;
  color: #fff;
}

.team-cups-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #fff;
}

.team-cups-head .trophy-img {
  height: 46px;
}

.team-cups-head b {
  font: 700 2rem/1 var(--font-display);
}

.hero-banner.player-hero-room {
  display: block;
  padding: 16px 16px 30px;
  text-align: left;
  color: #fff;
}

.trophy-room-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 10px;
}

.trophy-room-title h2 {
  margin: 0;
  font: 600 1.5rem/1 var(--font-display);
  letter-spacing: 0.03em;
}

.trophy-room-title span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

.trophy-room-cup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.trophy-room-cup .trophy-img {
  height: 96px;
  flex: none;
}

.trophy-count {
  font: 700 1.15rem/1 var(--font-display);
}

.trophy-room-cup .trophy-count {
  margin-bottom: 6px;
  font-size: 1.6rem;
}

.trophy-count i {
  font: 500 0.75rem var(--font-body);
  font-style: normal;
  color: rgba(255, 255, 255, 0.65);
}

.trophy-shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.trophy-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.trophy-pic {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 62px;
  padding-bottom: 2px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.28);
}

.trophy-pic .trophy-img {
  height: 60px;
}

.trophy-item .trophy-count {
  margin-top: 4px;
}

.trophy-item b {
  font-size: 0.74rem;
  line-height: 1.15;
}

.trophy-item small {
  font-size: 0.66rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.7);
}


.team-cups-head + .cup-years {
  margin-bottom: 10px;
}

.team-shelf {
  gap: 8px;
  padding: 8px 10px;
}

.live-tag.soon-tag,
.jersey-card .live-tag.soon-tag {
  color: var(--gold, #f5c84c);
}

.team-detail-body .muted {
  margin: 0;
  padding: 12px 0;
  text-align: center;
  opacity: 0.7;
}

/* Game preview "Viimeiset 5 ottelua": two chip groups + label don't fit on a
   phone, so the label drops to its own line above the chips. */
@media (max-width: 520px) {
  .gd-form-row {
    grid-template-columns: 1fr 1fr;
  }

  .gd-form-row .gd-stat-label {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

/* Ottelun kulku: player names link to the player page without looking like links. */
.mt-link {
  color: inherit;
  text-decoration: none;
}

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