:root {
  --bg: #f5f6fa;
  --bg-elevated: #ffffff;
  --bg-muted: #eceef4;
  --text: #1b1e27;
  --text-muted: #5b6072;
  --border: #dfe2ea;
  --accent: #2f6fed;
  --accent-contrast: #ffffff;
  --success: #1f9d55;
  --error: #d64545;
  --warning: #c9821f;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 24, 40, 0.08), 0 1px 2px rgba(20, 24, 40, 0.06);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #14161c;
  --bg-elevated: #1c1f28;
  --bg-muted: #20232d;
  --text: #eceef4;
  --text-muted: #9aa0b4;
  --border: #2c3040;
  --accent: #5b8dfb;
  --accent-contrast: #0c1220;
  --success: #3fbf72;
  --error: #ef6767;
  --warning: #e0a53f;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161c;
    --bg-elevated: #1c1f28;
    --bg-muted: #20232d;
    --text: #eceef4;
    --text-muted: #9aa0b4;
    --border: #2c3040;
    --accent: #5b8dfb;
    --accent-contrast: #0c1220;
    --success: #3fbf72;
    --error: #ef6767;
    --warning: #e0a53f;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-toggle {
  display: none;
}

.clock-widget {
  font-size: 0.82rem;
  line-height: 1.3;
  text-align: right;
  margin-left: auto;
  display: flex;
  flex-direction: column;
}

.nav-sep {
  flex: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

/* banner pres celou sirku nad navigaci */
.site-banner {
  display: block;
  width: 100%;
  line-height: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

/* contain (ne cover): obrazek se nikde neorizne, vidi se cely */
.site-banner img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: contain;
  object-position: center;
}

.site-banner:hover {
  text-decoration: none;
}

@media (max-width: 900px) {
  .site-banner img { height: 200px; }
}

@media (max-width: 640px) {
  .site-banner img { height: 140px; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  order: 3;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.nav-links a {
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-muted);
  color: var(--text);
  text-decoration: none;
}

.spacer {
  flex: 1;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text);
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.icon-btn:hover {
  border-color: var(--accent);
}

main {
  padding: 24px 0 64px;
}

h1, h2, h3 {
  letter-spacing: -0.01em;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

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

.sport-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.sport-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.sport-card .icon {
  font-size: 1.8rem;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tabs a {
  padding: 8px 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  font-size: 0.94rem;
}

.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover td {
  background: var(--bg-muted);
}

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

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-muted);
}

.badge.finished { color: var(--success); }
.badge.scheduled { color: var(--accent); }
.badge.postponed, .badge.cancelled { color: var(--warning); }

.fixture-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.fixture-row:last-child {
  border-bottom: none;
}

.fixture-teams {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

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

.fixture-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-danger {
  color: var(--error);
}

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

label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.flash.success { background: rgba(31, 157, 85, 0.15); color: var(--success); }
.flash.error { background: rgba(214, 69, 69, 0.15); color: var(--error); }
.flash.info { background: rgba(47, 111, 237, 0.15); color: var(--accent); }

.row-actions {
  display: flex;
  gap: 6px;
}

/* forma tymu - posledni zapasy jako barevne znacky */
.form-strip {
  display: inline-flex;
  gap: 4px;
  margin-top: 6px;
}

.form-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  cursor: default;
}

.form-W { background: var(--success); }
.form-D { background: var(--text-muted); }
.form-L { background: var(--error); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.best-odd {
  font-weight: 700;
  color: var(--success);
}

/* kalendar */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-weekdays {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.cal-day {
  position: relative;
  min-height: 62px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-muted);
}

.cal-day.other-month {
  opacity: 0.4;
}

.cal-day.today {
  border-color: var(--accent);
  border-width: 2px;
}

.cal-day.has-matches {
  background: var(--bg-muted);
  color: var(--text);
  text-decoration: none;
}

.cal-day.has-matches:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.cal-daynum {
  font-weight: 600;
  font-size: 0.9rem;
}

.cal-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.72rem;
  font-weight: 700;
  align-self: flex-start;
}

.cal-sports {
  font-size: 0.72rem;
  line-height: 1;
  margin-top: auto;
}

@media (max-width: 640px) {
  .cal-day {
    min-height: 48px;
    padding: 4px;
  }
  .cal-daynum { font-size: 0.78rem; }
  .cal-count { min-width: 16px; height: 16px; font-size: 0.65rem; }
  .cal-sports { display: none; }
}

.muted {
  color: var(--text-muted);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 24px 0;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }
  /* na mobilu je menu schovane pod hamburgerem a rozbaluje se pod listu */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 10px 12px;
    font-size: 0.95rem;
  }
  .nav-sep {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
  }
  .clock-widget {
    font-size: 0.75rem;
  }
  .fixture-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* statistiky tipujiciho */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

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

/* jednoduchy pruhovy ukazatel (uspesnost, body podle sportu) */
.bar {
  height: 8px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
  min-width: 60px;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

/* graf vyvoje bodu (inline SVG, bez knihoven) */
.chart {
  width: 100%;
  min-width: 420px;
  height: auto;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--accent);
}

/* chybove stranky */
.error-page {
  text-align: center;
  padding: 48px 16px;
}

.error-code {
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
}
