:root {
  --bg: #f3f9f7;
  --bg-alt: #ffffff;
  --text: #0b1a15;
  --text-dim: #53685f;
  --primary: #0ea87e;
  --primary-dim: #0b7f60;
  --border: #d9e9e2;
  --card-bg: #ffffff;
  --card-hover: #e8f7f1;
  --win: #128a3e;
  --loss: #c8392a;
  --otl: #b8860b;
  --shadow: 0 1px 3px rgba(9, 33, 25, 0.08);
  --shadow-lg: 0 18px 50px -12px rgba(9, 33, 25, 0.28), 0 4px 14px rgba(9, 33, 25, 0.1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  --bg: #060b09;
  --bg-alt: #0b1512;
  --text: #e8f7f1;
  --text-dim: #8fada2;
  --primary: #22d3a5;
  --primary-dim: #17a884;
  --border: #17281f;
  --card-bg: #0d1913;
  --card-hover: #123023;
  --win: #34d05a;
  --loss: #ef4444;
  --otl: #eab308;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px -12px rgba(0, 0, 0, 0.65), 0 4px 16px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
}

header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  flex: 0 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

h1 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.brand-accent { color: var(--primary); }

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 32px;
  width: 32px;
  border-radius: 22%;
  flex: 0 0 auto;
}

#leaguePicker .brand-logo {
  height: 64px;
  width: 64px;
}

/* ===== Úvodní výběr ligy ===== */
#leaguePicker {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  min-height: 100%;
  text-align: center;
  animation: overlayIn 0.4s var(--ease-out);
}

#leaguePicker[hidden] { display: none; }

#leaguePicker h1 {
  font-size: 2.2rem;
  animation: riseIn 0.5s var(--ease-out) backwards;
}

.league-picker-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}

.league-picker-btn[hidden] {
  display: none;
}

.league-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 34px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 18px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease-out), box-shadow 0.15s ease;
  animation: riseIn 0.45s var(--ease-out) backwards;
}

.league-picker-options .league-picker-btn:nth-child(1) { animation-delay: 0.1s; }
.league-picker-options .league-picker-btn:nth-child(2) { animation-delay: 0.18s; }
.league-picker-options .league-picker-btn:nth-child(3) { animation-delay: 0.26s; }

.league-picker-btn:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  background: var(--card-hover);
  box-shadow: var(--shadow-lg);
}

.league-picker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.league-picker-logo {
  width: 60%;
  height: 60%;
  object-fit: contain;
}

.league-picker-fallback {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

#appShell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#appShell[hidden] { display: none; }

/* ===== Hlavní navigace (tab bar) ===== */
/* Čtyři sekce appky dohromady zabírají zhruba třetinu šířky hlavičky. */
.main-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  width: 34%;
  min-width: 440px;
  max-width: 680px;
  margin: 0 auto;
  padding: 6px 20px 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-tabs::-webkit-scrollbar { display: none; }

.main-tab {
  position: relative;
  flex: 0 0 auto;
  font-size: 1.35rem;
  font-weight: 700;
  padding: 12px 4px 14px;
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.main-tab::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 150px;
  height: 68px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--primary) 40%, transparent) 0%, transparent 72%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.main-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.2s var(--ease-out);
}

.main-tab:hover { color: var(--text); }

.main-tab.active {
  color: var(--primary);
}

.main-tab.active::before { opacity: 1; }
.main-tab.active::after { transform: scaleX(1); }

.tab-panel[hidden] { display: none; }

.schedule-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 12px;
}

.settings-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle, .lang-toggle {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

.lang-toggle {
  height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.team-filter {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  max-width: 200px;
}

.news-toggle {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.league-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.odds-panel {
  padding: 16px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.odds-table {
  max-width: 420px;
  margin: 0 auto 10px;
}

.odds-book {
  text-align: left !important;
  text-transform: capitalize;
  color: var(--text-dim);
  font-weight: 600;
}

.standings-table {
  max-width: 720px;
  margin: 0 auto;
}

.standings-conferences {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
}

.standings-conference {
  flex: 1 1 480px;
  max-width: 720px;
}

.standings-team {
  text-align: left !important;
  font-weight: 600;
}

.news-toggle:hover {
  border-color: var(--active-display, var(--primary));
}

main {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px;
}

.news-panel {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px;
}

.news-panel .legend {
  max-width: 640px;
  margin: 0 auto 16px;
}

.news-all-link {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--active-display, var(--primary));
  margin-bottom: 20px;
}

.insider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.insider-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--bg-alt);
  text-decoration: none;
  color: var(--text);
}

.insider-card:hover {
  border-color: var(--active-display, var(--primary));
}

.insider-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.insider-handle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.insider-card-new {
  border-color: var(--active-display, var(--primary));
  box-shadow: 0 0 0 1px var(--active-display, var(--primary));
}

.insider-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--active-display, var(--primary));
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
}

.insider-latest {
  font-size: 0.85rem;
  margin-top: 8px;
  line-height: 1.35;
}

.insider-date {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.insider-no-feed {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 8px;
}

.team-news-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-news-list a {
  color: var(--active-display, var(--primary));
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.team-news-list a:hover {
  text-decoration: underline;
}

.highlight-game-link {
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
  margin: 0 -6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.highlight-game-link:hover {
  background: var(--card-hover);
  color: var(--primary);
}

.team-news-meta {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.week-grid {
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.week-grid[hidden] { display: none; }

.day-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  animation: riseIn 0.32s var(--ease-out) backwards;
}

.week-grid .day-col:nth-child(1) { animation-delay: 0.02s; }
.week-grid .day-col:nth-child(2) { animation-delay: 0.06s; }
.week-grid .day-col:nth-child(3) { animation-delay: 0.1s; }
.week-grid .day-col:nth-child(4) { animation-delay: 0.14s; }
.week-grid .day-col:nth-child(5) { animation-delay: 0.18s; }

.day-header {
  flex: 0 0 auto;
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.day-header .dow {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.day-header .ddate {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.day-games {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
}

.game-card {
  display: flex;
  align-items: stretch;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  font-size: 1.05rem;
  transition: background 0.15s ease, transform 0.15s var(--ease-out), box-shadow 0.15s ease, border-color 0.15s ease;
}

.game-card:hover {
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(15, 40, 25, 0.25);
}

.game-card:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: 0.05s;
}

/* Domácí tým vlevo, hostující vpravo — logo v pozadí (slabě viditelné),
   jméno týmu v popředí ve stejné barvě, jakou má i po rozkliknutí zápasu. */
.game-side {
  --active-logo: var(--logo-light);
  --active-display: var(--team-display-light);
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  overflow: hidden;
  isolation: isolate;
}

:root[data-theme="dark"] .game-side {
  --active-logo: var(--logo-dark);
  --active-display: var(--team-display-dark);
}

.game-side::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--active-logo);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 68%;
  opacity: 0.14;
  pointer-events: none;
}

.game-side[data-role="home"]::before { background-position: 115% center; }
.game-side[data-role="away"]::before { background-position: -15% center; }

.game-side-name {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--active-display, var(--text));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.game-center {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0 10px;
  text-align: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.game-score-pair {
  font-weight: 700;
  font-size: 1.15rem;
}

.game-time {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ===== Rozklikávací karty v Zajímavostech (tým/hráč) — stejný vzhled
   jako karty zápasů: logo v pozadí, jméno v popředí barvou týmu. ===== */
.highlight-card {
  display: flex;
  align-items: stretch;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: background 0.15s ease, transform 0.15s var(--ease-out), box-shadow 0.15s ease, border-color 0.15s ease;
}

.highlight-card.clickable {
  cursor: pointer;
}

.highlight-card.clickable:hover {
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(15, 40, 25, 0.25);
}

.highlight-card.clickable:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: 0.05s;
}

.highlight-info {
  --active-logo: var(--logo-light);
  --active-display: var(--team-display-light);
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 14px;
  overflow: hidden;
  isolation: isolate;
}

:root[data-theme="dark"] .highlight-info {
  --active-logo: var(--logo-dark);
  --active-display: var(--team-display-dark);
}

.highlight-info::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--active-logo);
  background-repeat: no-repeat;
  background-position: 108% center;
  background-size: 60%;
  opacity: 0.13;
  pointer-events: none;
}

.highlight-info-name {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 1rem;
  color: var(--active-display, var(--text));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.highlight-info-sub {
  position: relative;
  z-index: 1;
  font-size: 0.76rem;
  color: var(--text-dim);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.highlight-stat {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 68px;
  padding: 8px 14px;
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--card-hover);
}

.highlight-stat-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

.highlight-stat.hot {
  background: linear-gradient(135deg, #ffc266, #ff8a1e);
  color: #3a1c00;
}

.highlight-stat.cold {
  background: linear-gradient(135deg, #ff9b8a, #e0342a);
  color: #3a0c08;
}

/* Karty s jen 1 splněným faktorem — druhá, méně nápadná sekce pod
   prominentními příležitostmi/riziky (2+ faktorů). Stejný layout, jen
   zmenšený a s tlumenou barvou místo plné gradace. */
.info-block-title.minor {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 4px;
}

.highlight-card.minor .highlight-info {
  padding: 7px 12px;
}

.highlight-card.minor .highlight-info-name {
  font-size: 0.88rem;
}

.highlight-card.minor .highlight-info-sub {
  font-size: 0.72rem;
}

.highlight-card.minor .highlight-stat {
  min-width: 54px;
  padding: 6px 10px;
  font-size: 0.92rem;
}

.highlight-card.minor .highlight-stat-label {
  font-size: 0.6rem;
}

.highlight-card.minor .highlight-stat.hot {
  background: color-mix(in srgb, var(--win) 20%, var(--card-hover));
  color: var(--win);
}

.highlight-card.minor .highlight-stat.cold {
  background: color-mix(in srgb, var(--loss) 20%, var(--card-hover));
  color: var(--loss);
}

.load-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.load-error button {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
}

.load-error button:hover { background: var(--card-hover); }

.empty-day {
  grid-column: 1 / -1;
  padding: 14px 8px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 9, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: overlayIn 0.18s ease-out;
}

.modal {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: min(1600px, 98vw);
  max-height: 96vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg, var(--shadow));
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
  /* Zápasové okno se samo posouvá (overflow-y: auto) — tlačítko zavřít musí
     zůstat viditelné i po scrollu hluboko dolů, proto position:fixed vůči
     viewportu, ne vůči scrollované .modal. Na šířku spočtené tak, aby
     sedělo k pravému okraji karty i na širokých monitorech, kde karta
     nezabírá celou šířku obrazovky (min(1600px, 98vw)). */
  position: fixed;
  top: 20px;
  right: max(10px, calc((100vw - min(1600px, 98vw)) / 2 + 10px));
  border: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
  z-index: 51;
  transition: background 0.15s ease, transform 0.12s ease;
}

.modal-close:hover { background: var(--card-hover); }
.modal-close:active { transform: scale(0.9); }

.modal-body { padding: 18px 20px 22px; }

.player-modal-overlay { z-index: 60; }

.player-modal {
  width: min(560px, 92vw);
}

/* Užší okno hráče má jinou šířku než okno zápasu, takže zavírací tlačítko
   potřebuje vlastní výpočet, aby sedělo k JEHO pravému okraji, ne k okraji
   toho širšího zápasového okna. */
.player-modal .modal-close {
  right: max(10px, calc((100vw - min(560px, 92vw)) / 2 + 10px));
}

.player-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  padding-right: 26px;
  margin-bottom: 6px;
}

.player-modal-header .player-headshot {
  width: 56px;
  height: 56px;
}

.player-modal-name {
  font-weight: 700;
  font-size: 1.15rem;
}

.player-modal-badges {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.player-card {
  cursor: pointer;
}

.player-card:hover {
  border-color: var(--active-display, var(--primary));
}

.loading {
  padding: 40px;
  text-align: center;
  color: var(--text-dim);
  animation: pulse 1.3s ease-in-out infinite;
}

.matchup-date {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.summary-line {
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
}

.summary-line strong {
  color: var(--active-display, var(--primary));
}

.summary-warn {
  color: #b8860b;
}

.view-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 -20px 20px;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.hints-toggle {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-dim);
  cursor: pointer;
}

/* "Skrýt vysvětlivky" — schová jen šedé texty vycentrované přes celou šířku
   sloupce (vysvětlující odstavce), ne drobné vycentrované popisky uvnitř
   řádků/buněk (např. "Pro"/"Proti", pozice hráče) — ty zůstávají vždy vidět. */
.modal.hide-hints .legend,
.modal.hide-hints .result-detail,
.modal.hide-hints .period-note,
.modal.hide-hints .placeholder-note,
.modal.hide-hints .missing-note {
  display: none;
}

.view-tab {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-dim);
  cursor: pointer;
}

.view-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.info-block {
  padding: 16px 8px;
  border-bottom: 1px solid var(--border);
}

.info-block:last-child { border-bottom: none; }

.info-block-title {
  text-align: center;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--active-display, var(--primary));
  margin-bottom: 10px;
}

.roster-change-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roster-change-list li {
  text-align: center;
  font-size: 0.9rem;
  padding: 4px 0;
}

.window-caption {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
  margin-top: 10px;
}

.h2h-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  padding: 5px 8px;
  margin-bottom: 4px;
  border-left: 3px solid var(--border);
  border-radius: 0 6px 6px 0;
  background: var(--bg-alt);
  cursor: pointer;
  transition: background 0.15s ease;
}

.h2h-row:hover { background: var(--card-hover); }
.h2h-row.active { background: var(--card-hover); box-shadow: inset 0 0 0 1px var(--border); }

.h2h-date { color: var(--text-dim); flex: 0 0 auto; }
.h2h-score { font-weight: 600; }
.h2h-winner { font-weight: 700; }

.h2h-detail {
  margin: -2px 0 10px;
  padding: 10px 8px 4px;
  border-left: 3px solid var(--border);
  background: var(--bg-alt);
}

.game-box-scorers-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
  margin-bottom: 12px;
}

.game-box-scorers {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: left;
}

@media (max-width: 480px) {
  .game-box-scorers-cols { grid-template-columns: 1fr; }
}

.h2h-row.prev-season {
  border-left-style: dashed;
  opacity: 0.85;
}

.h2h-season-badge {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-dim);
  vertical-align: middle;
}

.h2h-empty {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 8px 0;
}

.team-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 36px;
  align-items: start;
}

.view-panel[hidden] { display: none; }

.team-col {
  --active-display: var(--team-display-light);
  --active-for: var(--team-for-light);
  --active-against: var(--team-against-light);
  --active-logo: var(--logo-light);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-top: 5px solid var(--team-color, var(--primary));
  background:
    radial-gradient(ellipse 120% 220px at 50% 0%, color-mix(in srgb, var(--team-color, var(--primary)) 30%, transparent), transparent 70%),
    var(--card-bg);
  border-radius: 0 0 12px 12px;
  padding: 0 4px 16px;
}

:root[data-theme="dark"] .team-col {
  --active-display: var(--team-display-dark);
  --active-for: var(--team-for-dark);
  --active-against: var(--team-against-dark);
  --active-logo: var(--logo-dark);
}

.team-col::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 440px;
  z-index: 0;
  background-image: var(--active-logo);
  background-repeat: no-repeat;
  background-size: min(58%, 380px);
  opacity: 0.09;
  pointer-events: none;
}

.team-col::before { background-position: center top -8%; }

.team-col-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 18px;
  text-align: center;
}

.role-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--active-display, var(--primary));
}

.team-name {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--active-display, var(--primary));
}

.acc-section {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
}

.acc-section summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 12px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--active-display, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  transition: background 0.15s ease;
}

.acc-section summary:hover { background: var(--card-hover); }

.acc-section summary::-webkit-details-marker { display: none; }

.acc-section summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.18s var(--ease-out);
}

.acc-section[open] summary::before {
  transform: rotate(90deg);
}

.acc-body {
  padding: 6px 16px 22px;
  font-size: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .acc-section[open] .acc-body {
    animation: fadeInUp 0.22s var(--ease-out);
  }
}

.app-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.72rem;
  line-height: 1.4;
  padding: 14px 16px 18px;
  opacity: 0.75;
}

.legend {
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.82rem;
  text-align: center;
  margin-bottom: 10px;
}

.results-timeline {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin-top: 6px;
}

.tl-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}

.results-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.result-pill.latest {
  box-shadow: 0 0 0 2px var(--active-display, var(--primary));
}

.result-pill {
  font: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 2px solid transparent;
  color: #fff;
  cursor: pointer;
}

.result-pill.W { background: var(--win); }
.result-pill.L { background: var(--loss); }
.result-pill.OT { background: var(--otl); color: #1a1400; }
.result-pill.TBP { background: transparent; border-color: var(--border); color: var(--text-dim); }

.result-pill.active { border-color: var(--text); }

/* Zápasy z minulé sezóny na začátku nové: jen obrys, bez výplně */
.result-pill.prev-season {
  background: transparent;
  border-style: dashed;
}
.result-pill.prev-season.W { color: var(--win); border-color: var(--win); }
.result-pill.prev-season.L { color: var(--loss); border-color: var(--loss); }
.result-pill.prev-season.OT { color: var(--otl); border-color: var(--otl); }
.result-pill.prev-season.active { border-style: solid; }

.result-detail {
  font-size: 0.9rem;
  color: var(--text-dim);
  padding: 10px 0 2px;
  min-height: 1.3em;
  text-align: center;
}

.fa-pair {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.1rem;
}

.fa-for { color: var(--active-for); }
.fa-against { color: var(--active-against); }
.fa-slash { color: var(--text-dim); margin: 0 4px; font-weight: 400; }

.stat-num-lg {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--active-display, var(--primary));
}

.window-table, .stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.window-table th, .window-table td,
.stat-table th, .stat-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.window-table td:first-child, .window-table th:first-child,
.stat-table td:first-child, .stat-table th:first-child {
  text-align: left;
  color: var(--text-dim);
  width: 34%;
}

.row-for td:not(:first-child) { color: var(--active-for); font-weight: 700; }
.row-against td:not(:first-child) { color: var(--active-against); font-weight: 700; }

/* Číslo dopočítané z minulé sezóny (zatím málo odehraných zápasů) — jen obrys */
.stat-outline {
  display: inline-block;
  padding: 1px 8px;
  border: 1.5px dashed currentColor;
  border-radius: 6px;
}

.season-games-note {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
  display: block;
}

.stat-outline-cell {
  background: var(--bg-alt);
}

.stat-table caption {
  text-align: center;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  padding-bottom: 10px;
  font-weight: 700;
}

.venue-filter-btn {
  display: block;
  margin: 14px auto 0;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--active-display, var(--primary));
  cursor: pointer;
  font-weight: 600;
}

.venue-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.venue-toggle[hidden] { display: none; }

.venue-toggle button {
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-dim);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}

.venue-toggle button.active {
  background: var(--active-display, var(--primary));
  color: #fff;
  border-color: var(--active-display, var(--primary));
}

.period-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 10px;
  text-align: center;
}

.placeholder-note {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
}

.players-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.players-search {
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  min-width: 180px;
}

.players-sort-select {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

.players-mode-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.players-mode-toggle button {
  font-size: 0.82rem;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
}

.players-mode-toggle button.active {
  background: var(--active-display, var(--primary));
  color: #fff;
  border-color: var(--active-display, var(--primary));
}

.position-group {
  margin-bottom: 16px;
}

.position-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--active-display, var(--primary));
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.players-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
}

.player-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-alt);
}

.player-card[hidden] {
  display: none;
}

.player-modal-body .window-table {
  margin-top: 10px;
  font-size: 0.85rem;
}

.player-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

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

.player-name-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.player-name {
  font-weight: 700;
  font-size: 0.84rem;
  white-space: nowrap;
}

.player-pos {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.player-quick-stat {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-left: auto;
  white-space: nowrap;
  padding-left: 6px;
}

.player-quick-stat strong {
  color: var(--active-display, var(--primary));
  font-size: 0.86rem;
}

.player-quick-rookie {
  font-style: italic;
}

.player-quick-prev {
  color: var(--text-dim);
  opacity: 0.7;
  font-size: 0.92em;
}

.weak-matchups {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.weak-matchups-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.weak-matchups-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weak-matchup-severe {
  color: #c0392b;
  font-weight: 700;
}

.transfer-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--active-display, var(--primary));
  color: #fff;
}

.reserve-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--active-display, var(--primary));
  background: transparent;
  color: var(--active-display, var(--primary));
}

.rookie-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #2e8b57;
  color: #fff;
}

.missing-note {
  max-width: 340px;
  margin: 0 auto 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
}

.rest-travel-line {
  text-align: center;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.rest-travel-line.dense-stretch {
  color: #d98c00;
  font-weight: 600;
}

.missing-list-toggle summary {
  cursor: pointer;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--active-display, var(--primary));
  list-style: none;
}

.missing-list-toggle summary::-webkit-details-marker { display: none; }

.missing-reason {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.player-prev-total {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 8px;
}

.player-prev-total strong {
  color: var(--active-display, var(--primary));
  font-size: 1rem;
}

.player-total-muted {
  opacity: 0.65;
  margin-top: 2px;
}

.player-total-muted strong {
  color: var(--text-dim);
  font-size: 0.9rem;
}

@media (max-width: 1000px) {
  .matchup-header { grid-template-columns: 1fr; }
  .mh-side { display: none; }
  .team-columns { grid-template-columns: 1fr; gap: 18px; }
}

/* ===== Přepínač rozložení (Mobil / PC) ===== */
.layout-toggle {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.layout-toggle:hover { border-color: var(--primary); }

.mobile-team-switch { display: none; }

/* ===== Mobilní rozložení ===== */
:root[data-layout="mobile"],
:root[data-layout="mobile"] body {
  height: auto;
  min-height: 100%;
}

:root[data-layout="mobile"] body {
  display: block;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-layout="mobile"] header {
  padding-top: env(safe-area-inset-top, 0px);
}

:root[data-layout="mobile"] .header-inner {
  flex-wrap: wrap;
  padding: 10px 14px;
  gap: 10px 8px;
}

:root[data-layout="mobile"] h1 {
  flex: 1 1 auto;
  font-size: 1.15rem;
}

:root[data-layout="mobile"] .settings-cluster {
  order: 2;
  flex: 1 1 100%;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

:root[data-layout="mobile"] .settings-cluster::-webkit-scrollbar { display: none; }
:root[data-layout="mobile"] .settings-cluster > * { flex: 0 0 auto; }

:root[data-layout="mobile"] .theme-toggle { width: 40px; height: 40px; }

:root[data-layout="mobile"] .lang-toggle,
:root[data-layout="mobile"] .layout-toggle,
:root[data-layout="mobile"] .league-select,
:root[data-layout="mobile"] .team-filter,
:root[data-layout="mobile"] .news-toggle {
  height: 40px;
  font-size: 0.85rem;
}

/* iOS jinak při klepnutí do pole stránku přiblíží */
:root[data-layout="mobile"] .league-select,
:root[data-layout="mobile"] .team-filter,
:root[data-layout="mobile"] .players-search,
:root[data-layout="mobile"] .players-sort-select {
  font-size: 16px;
}


:root[data-layout="mobile"] main {
  padding: 12px 12px 28px;
  overflow: visible;
}

:root[data-layout="mobile"] .day-header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 14px;
}

:root[data-layout="mobile"] .day-header .dow { font-size: 1rem; }
:root[data-layout="mobile"] .day-header .ddate { font-size: 0.85rem; }

:root[data-layout="mobile"] .game-side {
  padding: 12px 6px;
}

:root[data-layout="mobile"] .game-side-name {
  font-size: 1rem;
}

:root[data-layout="mobile"] .game-card:hover { transform: none; }
:root[data-layout="mobile"] .game-card:active { background: var(--card-hover); }
:root[data-layout="mobile"] .empty-day { font-size: 0.85rem; }

:root[data-layout="mobile"] .main-tabs {
  width: 100%;
  min-width: 0;
  max-width: none;
  justify-content: space-around;
  flex-wrap: nowrap;
  padding: 4px 14px 12px;
}

:root[data-layout="mobile"] .main-tab {
  padding: 8px 2px 10px;
  font-size: 0.95rem;
}

:root[data-layout="mobile"] .news-panel {
  padding: 0;
  overflow-x: auto;
}

:root[data-layout="mobile"] .insider-grid { grid-template-columns: 1fr; }

:root[data-layout="mobile"] .standings-table { font-size: 0.8rem; }
:root[data-layout="mobile"] .standings-table th,
:root[data-layout="mobile"] .standings-table td { padding: 7px 4px; }

/* Okna: zápas přes celou obrazovku, hráč jako spodní list */
:root[data-layout="mobile"] .modal-overlay {
  padding: 0;
  align-items: flex-end;
}

:root[data-layout="mobile"] .modal {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  border: none;
  overscroll-behavior: contain;
}

:root[data-layout="mobile"] .player-modal {
  width: 100%;
  height: auto;
  max-height: 88dvh;
  border-radius: 18px 18px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-layout="mobile"] .modal-close {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: 10px;
  width: 42px;
  height: 42px;
  font-size: 1rem;
  z-index: 5;
}

:root[data-layout="mobile"] .player-modal .modal-close {
  position: absolute;
  top: 10px;
}

:root[data-layout="mobile"] .modal-body { padding: 14px 14px 32px; }
:root[data-layout="mobile"] .player-modal .modal-body { padding-top: 22px; }

:root[data-layout="mobile"] .view-tabs {
  position: static;
  flex-wrap: wrap;
  margin: 0 -14px 14px;
  padding: 10px 14px;
}

:root[data-layout="mobile"] .view-tab {
  flex: 1 1 0;
  padding: 10px 12px;
  font-size: 0.9rem;
}

:root[data-layout="mobile"] .hints-toggle {
  position: static;
  transform: none;
  flex: 1 1 100%;
  padding: 8px 10px;
}

:root[data-layout="mobile"] .mobile-team-switch {
  display: flex;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 -14px 12px;
  padding: 8px 64px 8px 14px; /* vpravo místo pro tlačítko zavřít */
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

:root[data-layout="mobile"] .mts-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-dim);
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
}

:root[data-layout="mobile"] .mts-btn span {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

:root[data-layout="mobile"] .mts-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

:root[data-layout="mobile"] #modalBody[data-mobile-show="away"] .team-col[data-role="home"],
:root[data-layout="mobile"] #modalBody[data-mobile-show="home"] .team-col[data-role="away"] {
  display: none;
}

:root[data-layout="mobile"] .team-columns {
  grid-template-columns: 1fr;
  gap: 0;
}

:root[data-layout="mobile"] .team-col { padding: 0 2px 12px; }
:root[data-layout="mobile"] .team-col::before { height: 300px; background-size: min(62%, 260px); }
:root[data-layout="mobile"] .team-col-header { padding: 12px 8px 14px; }
:root[data-layout="mobile"] .team-name { font-size: 1.3rem; }

:root[data-layout="mobile"] .acc-section summary {
  padding: 16px 10px;
  font-size: 0.9rem;
}

:root[data-layout="mobile"] .acc-body { padding: 4px 6px 20px; }

:root[data-layout="mobile"] .window-table,
:root[data-layout="mobile"] .stat-table { font-size: 0.86rem; }

:root[data-layout="mobile"] .window-table th,
:root[data-layout="mobile"] .window-table td,
:root[data-layout="mobile"] .stat-table th,
:root[data-layout="mobile"] .stat-table td { padding: 8px 3px; }

:root[data-layout="mobile"] .window-table td:first-child,
:root[data-layout="mobile"] .window-table th:first-child,
:root[data-layout="mobile"] .stat-table td:first-child,
:root[data-layout="mobile"] .stat-table th:first-child { width: 30%; }

:root[data-layout="mobile"] .stat-outline { padding: 1px 5px; }
:root[data-layout="mobile"] .result-pill { padding: 8px 12px; }
:root[data-layout="mobile"] .results-row { gap: 6px; }

:root[data-layout="mobile"] .players-body { grid-template-columns: 1fr; }
:root[data-layout="mobile"] .player-card { padding: 12px; }
:root[data-layout="mobile"] .player-name { font-size: 0.95rem; white-space: normal; }
:root[data-layout="mobile"] .player-quick-stat { font-size: 0.82rem; }
:root[data-layout="mobile"] .players-search { min-width: 0; flex: 1 1 100%; padding: 10px 14px; }
:root[data-layout="mobile"] .players-sort-select { padding: 10px 14px; }
:root[data-layout="mobile"] .players-mode-toggle button,
:root[data-layout="mobile"] .venue-toggle button,
:root[data-layout="mobile"] .venue-filter-btn { padding: 9px 14px; }
:root[data-layout="mobile"] .player-modal .window-table { font-size: 0.85rem; }

/* ===== Vizuální doladění: animace a interakce ===== */
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.theme-toggle,
.lang-toggle,
.team-filter,
.news-toggle,
.league-select,
.layout-toggle,
.load-error button,
.modal-close,
.player-card,
.result-pill,
.venue-filter-btn,
.venue-toggle button,
.players-mode-toggle button,
.view-tab {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.theme-toggle:hover,
.lang-toggle:hover,
.team-filter:hover,
.news-toggle:hover,
.league-select:hover,
.layout-toggle:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.theme-toggle:active,
.lang-toggle:active,
.news-toggle:active,
.layout-toggle:active,
.load-error button:active {
  transform: scale(0.94);
}

.theme-toggle:active { transform: scale(0.85) rotate(-8deg); }

.result-pill:hover { filter: brightness(1.08); transform: translateY(-1px); }

.player-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(15, 40, 25, 0.25);
}

/* Klávesové ovládání — viditelné zaostření bez rušení myšího hoveru */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
.game-card:focus-visible,
.player-card:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.team-col {
  animation: fadeInUp 0.3s var(--ease-out);
}

/* ===== Zajímavosti (league-wide highlights panel) ===== */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.highlight-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg-alt);
}

.highlight-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  margin-bottom: 8px;
}

.highlight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.7;
}

.highlight-list li + li {
  margin-top: 8px;
}

/* --- Sázkový panel --- */
.betting-panel {
  display: block;
  padding: 4px 8px 16px;
}

.betting-lambda {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 6px 0 14px;
}

.betting-disclaimer {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-dim);
  background: var(--card-hover);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 10px;
}

.betting-prev-season-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 12px;
}

.betting-section-title {
  text-align: center;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--active-display, var(--primary));
  margin: 22px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.betting-group {
  margin-bottom: 14px;
}

.betting-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.betting-group-markets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.betting-market {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.betting-market-label {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.betting-options {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.betting-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-dim);
}

.betting-option.tip {
  background: var(--card-hover);
  color: var(--text);
  font-weight: 600;
}

.betting-option-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.betting-option-prob {
  min-width: 44px;
  text-align: right;
}


.betting-note {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--text-dim);
  font-style: italic;
}

.betting-more-toggle {
  display: block;
  margin: 8px auto 0;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.betting-more-toggle:hover {
  background: var(--card-hover);
}

.betting-more-toggle.expanded::after {
  content: " ▴";
}

.betting-more-toggle:not(.expanded)::after {
  content: " ▾";
}

.betting-group-extra {
  margin-top: 8px;
}

/* .betting-group-markets sets display:grid, which (same specificity as the
   UA [hidden] rule) would otherwise win the cascade and keep collapsed
   content visible — force it explicitly for every toggle-able container. */
.betting-group-extra[hidden],
.betting-player-body[hidden] {
  display: none;
}

.betting-player {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.betting-player-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: var(--card-bg);
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.betting-player-header:hover {
  background: var(--card-hover);
}

.betting-player-name {
  font-weight: 700;
  flex: 1;
}

.betting-player-hot {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--otl);
  white-space: nowrap;
}

.betting-player-caret {
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.betting-player-header.expanded .betting-player-caret {
  transform: rotate(180deg);
}

.betting-player-preview,
.betting-player-body {
  padding: 8px 10px 10px;
}

.betting-player-preview {
  border-top: 1px dashed var(--border);
}

.betting-player-body {
  border-top: 1px solid var(--border);
}
