:root {
  --bg: #090c0a;
  --panel: #101512;
  --panel-2: #141a16;
  --line: rgba(226, 236, 227, .13);
  --line-soft: rgba(226, 236, 227, .075);
  --text: #eef2ed;
  --muted: #a3aca4;
  --muted-2: #778279;
  --accent: #61dc70;
  --accent-soft: rgba(97, 220, 112, .09);
  --danger: #f18b80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(71, 105, 67, .09), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, Montserrat, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
a { color: inherit; }
.page-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }

/* Hlavička a úvod */
.live-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 17px;
  border-bottom: 1px solid var(--line);
}
.brand {
  flex: 0 0 62px;
  width: 62px;
  height: 54px;
  display: grid;
  place-items: center;
  text-decoration: none;
}
.brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.header-title { display: grid; gap: 5px; }
.header-title strong { font-size: 17px; font-weight: 650; letter-spacing: .015em; }
.eyebrow, .section-kicker {
  color: var(--accent);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .19em;
}
.back-link {
  margin-left: auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  transition: color .2s;
}
.back-link span { color: var(--accent); font-size: 14px; margin-left: 5px; }
.back-link:hover, .live-footer a:hover { color: var(--accent); }

.intro-section {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 46px 0 30px;
}
.intro-section h1 {
  margin: 9px 0 8px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: .98;
  letter-spacing: -.05em;
  font-weight: 700;
}
.intro-section h1 span { color: var(--accent); }
.intro-copy, .section-description { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }
.connection-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 30px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: .09em;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #d7a64a; }
.connection-status.is-online .status-dot { background: var(--accent); }
.connection-status.is-error .status-dot { background: var(--danger); }

/* Společné sekce */
.section-block { padding: 28px 0 34px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.08;
}
.section-index { color: rgba(255, 255, 255, .18); font-size: 26px; font-weight: 600; line-height: 1; }

/* Přímý přenos */
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #030504; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: radial-gradient(circle at center, rgba(95, 224, 106, .065), transparent 45%), #080b09;
  text-align: center;
  padding: 20px;
}
.youtube-mark { display: grid; place-items: center; width: 54px; height: 38px; border-radius: 9px; background: #d91e27; color: white; font-size: 17px; padding-left: 3px; }
.video-placeholder strong { font-size: 12px; font-weight: 650; letter-spacing: .14em; }
.video-placeholder p, .stream-note { color: var(--muted-2); font-size: 11px; margin: 0; }
.stream-note { margin-top: 10px; }
/* Odkaz na kompletní záznam turnaje */
.playlist-link-wrap {
  margin-top: 18px;
}

.playlist-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: background .2s, border-color .2s;
}

.playlist-link:hover {
  background: var(--panel-2);
  border-color: var(--accent);
}

.playlist-youtube-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 25px;
  border-radius: 6px;
  background: #e62117;
  color: white;
  font-size: 12px;
}

.playlist-link-text {
  display: grid;
  gap: 5px;
}

.playlist-link-text strong {
  font-size: 10px;
  letter-spacing: .12em;
}

.playlist-link-text small {
  color: var(--muted);
  font-size: 11px;
}

.playlist-link-arrow {
  margin-left: 8px;
  color: var(--accent);
  font-size: 18px;
}

@media (max-width: 480px) {
  .playlist-link {
    width: 100%;
    padding: 13px 12px;
    gap: 10px;
  }

  .playlist-link-text strong {
    font-size: 9px;
  }

  .playlist-link-text small {
    font-size: 10px;
  }
}

/* Zápasy */
.match-group + .match-group { margin-top: 28px; }
.subheading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.subheading-row h3 { margin: 0; font-size: 11px; font-weight: 650; letter-spacing: .14em; }
.subheading-row span { color: var(--muted-2); font-size: 9px; font-weight: 550; letter-spacing: .09em; }
.match-list { display: grid; gap: 10px; }
.match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.match-card-head {
  padding: 11px 15px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.match-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.match-time { color: var(--accent); font-weight: 650; font-size: 12px; letter-spacing: .025em; }
.match-finished { color: var(--muted-2); font-size: 8px; font-weight: 600; letter-spacing: .11em; }
.match-main {
  --match-font-size: clamp(24px, 2.5vw, 27px);
  padding: 16px 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.match-team { min-width: 0; font-size: var(--match-font-size); font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.match-team:last-child { text-align: right; }
.match-score { text-align: center; font-size: var(--match-font-size); line-height: 1; font-weight: 700; letter-spacing: -.045em; white-space: nowrap; }
.match-score.is-empty { color: var(--muted-2); font-size: 12px; font-weight: 500; letter-spacing: .12em; }
.match-events { padding: 0 15px 12px; display: grid; gap: 6px; }
.goal-event {
  display: grid;
  width: min(82%, 650px);
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  justify-self: start;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(0, 0, 0, .13);
}
.goal-event--b {
  grid-template-columns: minmax(0, 1fr) 44px;
  justify-self: end;
}
.goal-score { color: var(--accent); font-size: 11px; font-weight: 650; white-space: nowrap; }
.goal-text { min-width: 0; font-size: 10px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.goal-text strong { font-size: 10px; font-weight: 650; }
.goal-event--b .goal-text { text-align: right; }
.goal-event--b .goal-score { grid-column: 2; grid-row: 1; text-align: right; }
.goal-assist { display: block; color: var(--muted-2); margin-top: 2px; font-weight: 400; }
.match-pending { padding: 0 15px 14px; color: var(--muted-2); font-size: 10px; }
.loading-card, .empty-card, .error-card { padding: 20px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.5; }
.error-card { border-color: rgba(241, 139, 128, .35); color: var(--danger); }

/* Výsledky základní skupiny */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d110e;
  scrollbar-color: #46554a #101512;
  -webkit-overflow-scrolling: touch;
}
.matrix-table { width: 100%; min-width: 790px; border-collapse: separate; border-spacing: 0; font-size: 11px; font-variant-numeric: tabular-nums; }
.matrix-table th, .matrix-table td {
  padding: 13px 11px;
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.matrix-table thead th {
  background: #18201a;
  color: #c8d2c9;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .07em;
}
.matrix-table thead th.summary { background: #202a22; color: #e0e9e1; }
.matrix-table tbody th {
  background: #141b16;
  color: var(--text);
  text-align: left;
  font-weight: 600;
  min-width: 130px;
}
.matrix-table tbody td { color: #cbd3cc; font-weight: 450; }
.matrix-table td.diagonal { background: rgba(255, 255, 255, .035); color: var(--muted-2); }
.matrix-table td.summary { background: rgba(255, 255, 255, .045); color: #e2e9e3; font-weight: 600; }
.matrix-table .rank-cell { color: var(--accent); font-weight: 650; }
.matrix-table tbody tr:hover th,
.matrix-table tbody tr:hover td:not(.diagonal) { background-color: rgba(97, 220, 112, .045); }
.matrix-table tr:last-child th, .matrix-table tr:last-child td { border-bottom: 0; }
.matrix-table th:last-child, .matrix-table td:last-child { border-right: 0; }
.scroll-hint { display: none; margin: 8px 0 0; color: var(--muted-2); font-size: 9px; text-align: right; }

/* Statistiky */
.tab-controls { display: flex; gap: 8px; margin: 0 0 13px; }
.tab-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .09em;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
.tab-button.is-active { border-color: rgba(97, 220, 112, .45); background: var(--accent-soft); color: var(--accent); }
.leaderboard-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.leaderboard-table th, .leaderboard-table td { padding: 12px 13px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.leaderboard-table thead th { color: var(--muted); background: var(--panel); font-size: 8px; font-weight: 600; letter-spacing: .1em; }
.leaderboard-table td.num, .leaderboard-table th.num { text-align: right; }
.leaderboard-table tbody tr:last-child td { border-bottom: 0; }
.leaderboard-table .player-rank { color: var(--accent); font-weight: 600; width: 38px; }
.leaderboard-table .player-name { font-weight: 600; }
.leaderboard-table .player-team { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; font-weight: 400; }
.leaderboard-table .points-cell { font-weight: 650; }

.last-updated-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 550;
  letter-spacing: .11em;
}
.last-updated-row strong { color: var(--muted); text-align: right; font-weight: 500; letter-spacing: .035em; }
.live-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 550;
  letter-spacing: .11em;
}
.live-footer a { text-decoration: none; }

@media (max-width: 700px) {
  .page-shell { width: min(100% - 28px, 560px); }
  .live-header { min-height: 70px; gap: 10px; }
  .brand { flex-basis: 50px; width: 50px; height: 44px; }
  .header-title strong { font-size: 14px; }
  .eyebrow { font-size: 8px; }
  .back-link { max-width: 75px; text-align: right; font-size: 8px; line-height: 1.5; }
  .intro-section { display: block; padding: 30px 0 22px; }
  .intro-section h1 { font-size: clamp(32px, 10vw, 45px); font-weight: 700; }
  .intro-copy { font-size: 12px; }
  .connection-status { margin-top: 17px; font-size: 8px; }
  .section-block { padding: 23px 0 27px; }
  .section-heading { margin-bottom: 15px; }
  .section-heading h2 { font-size: 22px; }
  .section-index { font-size: 21px; }
  .video-frame { border-radius: 7px; }
  .match-list { gap: 8px; }
  .match-card-head { padding: 10px 11px 8px; }
  .match-main {
  --match-font-size: 18px;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  gap: 7px;
  padding: 14px 10px;}
  .match-team {
  overflow-wrap: normal;
  word-break: normal;}
  .match-events { padding: 0 10px 10px; }
  .goal-event { width: 94%; grid-template-columns: 37px minmax(0, 1fr); gap: 7px; padding: 7px 8px; }
  .goal-event--b { grid-template-columns: minmax(0, 1fr) 37px; }
  .goal-text, .goal-text strong { font-size: 10px; }
  .scroll-hint { display: block; }
  .tab-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .tab-button { padding: 0 7px; font-size: 8px; letter-spacing: .06em; }
  .leaderboard-table { min-width: 430px; }
  .last-updated-row { font-size: 7px; }
  .live-footer { align-items: flex-start; flex-direction: column; gap: 10px; font-size: 8px; }
}

@media (max-width: 380px) {
  .page-shell { width: calc(100% - 22px); }
  .back-link { max-width: 60px; }
  .match-main {
  --match-font-size: 16px;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);}
  .goal-event { width: 98%; }}


/* Zvýraznění bodů a pořadí v tabulce */
.matrix-table tbody td:nth-last-child(-n + 2) {
  font-weight: 800;
}


/* Konečné pořadí turnaje */
.final-ranking-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.final-ranking-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.final-ranking-item.is-champion {
  border-color: rgba(95,224,106,.45);
  background: linear-gradient(
    110deg,
    rgba(95,224,106,.09),
    transparent 75%
  ), var(--panel);
}

.final-ranking-place {
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.final-ranking-team {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .final-ranking-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .final-ranking-item {
    min-height: 58px;
    padding: 11px 13px;
  }
}

.match-score-suffix {
  display: inline-block;
  margin-left: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  vertical-align: middle;
}



/* Dočasné skrytí sekce živého přenosu 
.stream-section {
    display: none !important;
}

*/
