/* ==========================================================
   VITKOV OPEN GAME — výsledkový server
   Navazuje na vizuální identitu vitkovopengame.cz
   ========================================================== */

:root {
  --navy: #0f1e52;
  --navy-light: #1a3080;
  --navy-dark: #0a1438;
  --gold: #ffb800;
  --gold-light: #ffd04a;
  --gold-dark: #e6a600;
  --white: #ffffff;
  --off-white: #f7f8fc;
  --gray-50: #f0f1f5;
  --gray-100: #e2e4eb;
  --gray-200: #c5c9d6;
  --gray-400: #8b90a0;
  --gray-600: #5a5f72;
  --gray-800: #2d3142;
  --text: #1a1d2e;
  --live: #d81f36;
  --live-dark: #8c1122;
  --ok: #12855a;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 30, 82, .08);
  --shadow-md: 0 4px 20px rgba(15, 30, 82, .1);
  --shadow-lg: 0 12px 40px rgba(15, 30, 82, .15);
  --transition: .25s cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--off-white);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }

h1, h2, h3, .display {
  font-family: 'Bebas Neue', 'DM Sans', sans-serif;
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.05;
}

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* — Hlavička — */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0, 0, 0, .18);
}

.header-bar {
  display: flex; align-items: center; gap: 18px;
  min-height: 62px;
}

.brand { display: flex; align-items: center; padding: 10px 0; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400; font-size: 21px; color: var(--white); letter-spacing: .04em;
}
.brand-text small { font-size: 11px; color: var(--gold); font-weight: 600; text-transform: uppercase; }

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

.header-admin {
  margin-left: auto;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--gold); padding: 7px 14px; border: 1px solid rgba(255, 184, 0, .4);
  border-radius: 100px;
}
.header-admin:hover { background: var(--gold); color: var(--navy); }

/* — Hlavní navigace — */
.main-nav { background: var(--navy-dark); }
.main-nav ul { display: flex; overflow-x: auto; scrollbar-width: none; }
.main-nav ul::-webkit-scrollbar { display: none; }

.main-nav a {
  display: block; padding: 13px 18px;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  color: rgba(255, 255, 255, .62); white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--white); }
.main-nav a.is-active { color: var(--gold); border-bottom-color: var(--gold); }

/* — Pruh kategorií — */
.cat-bar { background: var(--white); border-bottom: 1px solid var(--gray-100); }
.cat-bar-inner { display: flex; gap: 8px; padding: 12px 0; overflow-x: auto; scrollbar-width: none; }
.cat-bar-inner::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: 100px;
  border: 1px solid var(--gray-100); background: var(--white);
  font-size: 13px; font-weight: 600; color: var(--gray-600);
  white-space: nowrap; transition: all var(--transition);
}
.chip:hover { border-color: var(--gray-200); color: var(--navy); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: var(--gold); }
.chip small { font-size: 11px; opacity: .7; font-weight: 500; }

/* — Obsah — */
main { padding: 26px 0 70px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 38px; color: var(--navy); }
.page-title em { font-style: normal; color: var(--gold-dark); }
.page-sub { font-size: 14px; color: var(--gray-600); }

.section-label {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--gold-dark); margin-bottom: 10px;
}
.section-label::before { content: ''; width: 22px; height: 2px; background: var(--gold); }

.card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 20px;
}
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--navy); color: var(--white);
}
.card-head h2, .card-head h3 { font-size: 22px; color: var(--white); }
.card-head .tag { margin-left: auto; }
.card-body { padding: 18px; }
.card-body--flush { padding: 0; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  background: var(--gray-50); color: var(--gray-600);
}
.tag--gold { background: var(--gold); color: var(--navy); }
.tag--navy { background: var(--navy); color: var(--gold); }
.tag--live { background: var(--live); color: var(--white); }
.tag--done { background: #d8f3e6; color: var(--ok); }
.tag--ghost { background: transparent; border: 1px solid rgba(255,255,255,.3); color: var(--white); }

/* — Filtry — */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

/* — Seznam zápasů — */
.day-heading {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 10px;
  font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: var(--navy);
}
.day-heading::after { content: ''; flex: 1; height: 1px; background: var(--gray-100); }
.day-heading:first-child { margin-top: 0; }

.match-list { display: flex; flex-direction: column; gap: 6px; }

.match-row {
  display: grid;
  grid-template-columns: 62px 68px 1fr 92px 58px;
  align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-left: 3px solid var(--gray-200);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.match-row:hover { border-color: var(--gray-200); box-shadow: var(--shadow-sm); }
.match-row--a { border-left-color: var(--navy); }
.match-row--b { border-left-color: var(--navy-light); }
.match-row--po { border-left-color: var(--gold); }
.match-row--live { border-left-color: var(--live); background: #fff8f8; box-shadow: 0 0 0 1px rgba(216,31,54,.12); }
.match-row--done { background: var(--white); }
.match-row--cancelled { opacity: .5; }

.match-time { display: flex; flex-direction: column; line-height: 1.2; }
.match-time strong { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--navy); letter-spacing: .03em; }
.match-time span { font-size: 11px; color: var(--gray-400); }

.match-pitch {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 4px; border-radius: var(--radius);
  background: var(--gray-50); font-size: 11px; font-weight: 700; color: var(--gray-600);
  text-align: center; line-height: 1.15; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.match-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-width: 0; }
.match-side { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-side--home { text-align: right; font-weight: 600; }
.match-side--away { font-weight: 500; }
.match-side.is-winner { font-weight: 700; color: var(--navy); }
.match-side.is-placeholder { color: var(--gray-400); font-style: italic; font-weight: 500; }

.match-score {
  font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: .04em;
  color: var(--navy); text-align: center; min-width: 54px;
  padding: 1px 8px; background: var(--gray-50); border-radius: var(--radius);
}
.match-score--empty { color: var(--gray-200); background: transparent; }
.match-score--live { background: var(--live); color: var(--white); }
.match-score small { display: block; font-family: 'DM Sans', sans-serif; font-size: 9px; letter-spacing: 0; opacity: .8; }

.match-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 11px; color: var(--gray-400); }

.match-code {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius);
  background: var(--navy); color: var(--gold);
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
}
.match-code--po { background: var(--gold); color: var(--navy); }

.live-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--live);
}
.live-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--live); animation: pulse 1.4s infinite;
}

.empty { padding: 40px 20px; text-align: center; color: var(--gray-400); font-size: 14px; }

/* — Hřiště (timeline) — */
.courts-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.court-now {
  padding: 18px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
}
.court-now--idle { background: var(--gray-50); color: var(--gray-600); }
.court-now .label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.court-now--idle .label { color: var(--gray-400); }
.court-now .teams { font-family: 'Bebas Neue', sans-serif; font-size: 26px; line-height: 1.15; }
.court-now .vs { color: var(--gold); padding: 0 6px; }
.court-now .score { font-family: 'Bebas Neue', sans-serif; font-size: 40px; color: var(--gold); line-height: 1; margin-top: 6px; }
.court-now .meta { font-size: 12px; opacity: .8; margin-top: 6px; }

.court-next { display: flex; flex-direction: column; }
.court-next li {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 16px; border-top: 1px solid var(--gray-100); font-size: 13px;
}
.court-next li strong { font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: var(--navy); }
.court-next .pair { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* — Tabulky — */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid thead th {
  padding: 10px 12px; text-align: left; background: var(--gray-50);
  font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100); white-space: nowrap;
}
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--gray-50); }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover { background: #fbfcfe; }
table.grid .num { text-align: center; width: 46px; font-variant-numeric: tabular-nums; }
table.grid .pts { font-weight: 700; color: var(--navy); }

.rank {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--gray-50); color: var(--gray-600);
  font-size: 12px; font-weight: 700;
}
tr.is-advancing .rank { background: var(--navy); color: var(--gold); }
tr.is-advancing td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
tr.is-medal-1 .rank { background: var(--gold); color: var(--navy); }
tr.is-medal-2 .rank { background: var(--gray-200); color: var(--navy); }
tr.is-medal-3 .rank { background: #cd7f32; color: var(--white); }

.team-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.team-badge {
  display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: var(--radius); font-size: 11px; font-weight: 700; color: var(--white);
}
.team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.form-dots { display: inline-flex; gap: 3px; }
.form-dots i {
  width: 7px; height: 7px; border-radius: 50%; display: block; background: var(--gray-200);
}
.form-dots i.w { background: var(--ok); }
.form-dots i.d { background: var(--gold); }
.form-dots i.l { background: var(--live); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 18px; font-size: 12px; color: var(--gray-600); background: var(--gray-50); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* — Pavouk — */
.bracket-scroll { overflow-x: auto; padding-bottom: 8px; }
.bracket { display: flex; gap: 16px; min-width: min-content; }
.bracket-round { display: flex; flex-direction: column; gap: 12px; min-width: 232px; flex: 1; }
.bracket-round-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .06em; padding-bottom: 6px;
  border-bottom: 2px solid var(--gray-100);
}
.bracket-matchups { display: flex; flex-direction: column; gap: 10px; justify-content: space-around; flex: 1; }

.bracket-match {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.bracket-seed {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; background: var(--navy); color: var(--gold);
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
}
.bracket-seed time { margin-left: auto; color: rgba(255,255,255,.7); font-weight: 600; }
.bracket-team {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px;
  border-bottom: 1px solid var(--gray-50);
}
.bracket-team:last-child { border-bottom: none; }
.bracket-team b { margin-left: auto; font-family: 'Bebas Neue', sans-serif; font-size: 17px; color: var(--navy); }
.bracket-team.is-winner { background: #fffdf3; font-weight: 700; }
.bracket-team.is-winner b { color: var(--gold-dark); }
.bracket-team.is-placeholder { color: var(--gray-400); font-style: italic; }
.bracket-match--final { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,184,0,.25); }
.bracket-match--final .bracket-seed { background: var(--gold); color: var(--navy); }

/* — Tlačítka — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius);
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  transition: all var(--transition); border: 1px solid transparent;
}
.btn--primary { background: var(--navy); color: var(--white); }
.btn--primary:hover { background: var(--navy-light); }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--gold-light); }
.btn--ghost { border-color: var(--gray-200); color: var(--gray-600); background: var(--white); }
.btn--ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn--danger { background: var(--live); color: var(--white); }
.btn--danger:hover { background: var(--live-dark); }
.btn--sm { padding: 7px 14px; font-size: 12px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* — Formuláře — */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--gray-600); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; font-weight: 400; text-transform: none; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--gray-100); border-radius: var(--radius);
  background: var(--white); color: var(--text);
  transition: border-color var(--transition);
}
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15,30,82,.08); }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.checkline { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 9px; }
.checkline input { width: 18px; height: 18px; accent-color: var(--navy); }

/* — Hlášky — */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.flash--ok { background: #d8f3e6; color: #0c6b47; border-left: 3px solid var(--ok); }
.flash--err { background: #ffe6e9; color: #8c1122; border-left: 3px solid var(--live); }
.flash--info { background: #fff6dd; color: #7a5600; border-left: 3px solid var(--gold); }

.notice {
  padding: 12px 16px; background: var(--gray-50); border-radius: var(--radius);
  font-size: 13px; color: var(--gray-600); margin-bottom: 16px;
}

/* — Patička — */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,.6); padding: 26px 0; font-size: 13px; }
.site-footer a { color: var(--gold); }
.footer-inner { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* — Mobil — */
@media (max-width: 860px) {
  .page-title { font-size: 30px; }
  .match-row { grid-template-columns: 52px 1fr 62px; gap: 9px; padding: 9px 11px; }
  .match-pitch { display: none; }
  .match-meta { display: none; }
  .match-score { font-size: 20px; min-width: 40px; padding: 1px 5px; }
  .brand-text small { display: none; }
  .courts-grid { grid-template-columns: 1fr; }

  /* Týmy pod sebou — na úzkém displeji se názvy neořezávají */
  .match-pair { grid-template-columns: 1fr; gap: 1px; }
  .match-side { font-size: 13.5px; }
  .match-side--home { text-align: left; }
  .match-dash { display: none; }
  .match-side.is-winner { color: var(--navy); }
  .match-side--away { color: var(--gray-600); }
  .match-side--away.is-winner { color: var(--navy); }
}

@media (max-width: 520px) {
  .page-title { font-size: 26px; }
}

@media print {
  .site-header, .main-nav, .cat-bar, .site-footer, .filters, .btn { display: none !important; }
  body { background: var(--white); }
  .card { break-inside: avoid; box-shadow: none; }
}

/* Vysvětlivka pravidla pod konečným pořadím */
.ranking-rule {
  margin: 0;
  padding: 12px 16px 16px;
  color: var(--gray-600);
  font-size: 13px;
  line-height: 1.5;
}
