@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
  --bg: #f6f3ef;
  --surface: #ffffff;
  --surface-2: #f1f6f3;
  --ink: #1f2937;
  --ink-muted: #5b6472;
  --accent: #b8472d;
  --accent-2: #176f65;
  --accent-3: #225b8f;
  --border: #e1e5ea;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --spacing: 1rem;
  --font-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(184, 71, 45, 0.14), transparent 60%),
    radial-gradient(700px 420px at 90% 0%, rgba(23, 111, 101, 0.14), transparent 55%),
    radial-gradient(900px 500px at 50% 120%, rgba(34, 91, 143, 0.13), transparent 50%),
    var(--bg);
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem 0;
}

h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
}

main {
  padding: 2.5rem 0 4rem;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin: 0 auto;
}

.content-stack > * + * {
  margin-top: 1.75rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 243, 239, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(225, 229, 234, 0.7);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.3rem 0;
}

.brand {
  flex: 0 1 auto;
  min-width: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  color: var(--ink);
}

.brand-link:hover {
  color: var(--ink);
}

.brand-mark {
  display: block;
  width: 3rem;
  height: auto;
  flex: 0 0 auto;
}

.brand-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-tagline {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.nav-toggle {
  display: none;
  position: relative;
  flex: 0 0 auto;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  position: absolute;
  left: 50%;
  width: 1.15rem;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  transform: translateX(-50%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-lines {
  top: 50%;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
}

.nav-toggle-lines::before {
  top: -0.38rem;
}

.nav-toggle-lines::after {
  top: 0.38rem;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
  top: 0;
  transform: translateX(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
  top: 0;
  transform: translateX(-50%) rotate(-45deg);
}

.site-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: all 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: rgba(184, 71, 45, 0.13);
}

.site-main h2,
.site-main h3 {
  color: var(--ink);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.8rem, 4vw, 3.2rem);
  animation: rise 0.55s ease both;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.1;
  max-width: 20ch;
}

.hero-title-muted {
  display: block;
  color: var(--ink-muted);
}

.hero-lead {
  margin: 1.1rem 0 1.8rem;
  max-width: 62ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink-muted);
}

.hero-logo {
  display: grid;
  place-items: center;
  width: 100%;
}

.hero-logo img {
  display: block;
  width: min(100%, 360px);
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 93, 168, 0.16));
}

.hero-stats {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 1.35rem 0 0;
  border-top: 1px solid var(--border);
}

.hero-stat {
  display: grid;
  gap: 0.1rem;
  padding: 0 1.5rem;
  border-right: 1px solid var(--border);
}

.hero-stat:first-child {
  padding-left: 0;
}

.hero-stat:last-child {
  border-right: 0;
}

.hero-stat dt {
  grid-row: 2;
  color: var(--ink-muted);
  font-size: 0.86rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stat dd {
  grid-row: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 1.2rem;
  align-items: stretch;
}

.home-search-panel,
.recent-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.35rem, 3vw, 1.8rem);
  animation: rise 0.55s ease both;
}

.home-search-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.4rem;
  background:
    radial-gradient(420px 240px at 100% 100%, rgba(34, 91, 143, 0.12), transparent 65%),
    var(--surface-2);
}

.recent-panel {
  background: var(--surface);
}

.section-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent-2);
  font-family: var(--font-display);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.player-quick-search {
  display: grid;
  gap: 0.4rem;
}

.player-quick-search label {
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.search-control {
  display: flex;
  gap: 0.55rem;
}

.search-control input {
  min-width: 0;
}

.search-control .btn {
  flex: 0 0 auto;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  color: var(--accent-2);
  font-weight: 700;
}

.text-link:hover {
  color: #105c54;
}

.recent-tournament-list {
  display: grid;
  gap: 0;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.recent-tournament-list li {
  margin: 0;
  border-top: 1px solid var(--border);
}

.recent-tournament-list a {
  display: grid;
  grid-template-columns: 5.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0.2rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, padding 0.2s ease;
}

.recent-tournament-list a:hover {
  padding-inline: 0.65rem;
  background: var(--surface-2);
  color: var(--ink);
}

.recent-date {
  display: grid;
  gap: 0.05rem;
  padding-right: 0.9rem;
  border-right: 1px solid var(--border);
  color: var(--ink-muted);
  font-size: 0.76rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.recent-date strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.recent-tournament-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.recent-tournament-copy strong {
  overflow: hidden;
  font-family: var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-tournament-copy > span {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-arrow {
  color: var(--accent-2);
  font-size: 1.15rem;
  font-weight: 700;
}

.recent-tournament-list .empty-state {
  padding: 1.2rem 0;
  color: var(--ink-muted);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.section-subtitle {
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.year-block {
  margin-top: 1.5rem;
}

.year-title {
  margin: 0 0 0.8rem;
  font-size: 1.4rem;
  color: var(--ink);
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem;
  animation: rise 0.55s ease both;
}

.card-body h3 {
  margin-bottom: 0.4rem;
}

.card-meta {
  color: var(--ink-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dot {
  color: var(--ink-muted);
}

.card-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
}

.pill-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(58, 110, 165, 0.12);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

/* A tier badge is a .pill tinted by tier, so it sits naturally beside the others.
   The gender badge on a player's profile borrows the same shape. */
.tier-badge,
.gender-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  vertical-align: middle;
  --tier: var(--accent-3);
  color: var(--tier);
  background: color-mix(in srgb, var(--tier) 12%, transparent);
}

/* I. třída (incl. Mistrovství republiky) is the top tier - give it the accent. */
.tier-first {
  --tier: var(--accent);
}

.tier-second {
  --tier: var(--accent-3);
}

.tier-club {
  --tier: var(--ink-muted);
}

.gender-m {
  --tier: var(--accent-3);
}

.gender-f {
  --tier: var(--accent);
}

.gender-o {
  --tier: var(--ink-muted);
}

.button-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid rgba(225, 229, 234, 0.7);
  background: rgba(241, 246, 243, 0.8);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.footer-meta {
  font-weight: 500;
}

.filter-form {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.filter-field {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-field label {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  align-self: end;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* The year picker sits among pills, chips and pill-shaped buttons, so it wears
   the same rounded outline and its own chevron rather than the browser's field. */
select.year-filter {
  width: auto;
  margin-bottom: 1rem;
  padding: 0.5rem 2.3rem 0.5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235b6472' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 0.7rem;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

select.year-filter:hover {
  color: var(--ink);
  border-color: var(--accent-2);
}

.pill-tab {
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pill-tab:not(:last-child) {
  border-right: 1px solid var(--border);
}

.pill-tab:hover {
  background: rgba(42, 157, 143, 0.08);
}

.pill-tab.active {
  background: rgba(42, 157, 143, 0.15);
  color: var(--ink);
  font-weight: 600;
}

.filter-form label {
  display: block;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

th.orderable a {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

th.orderable a::after {
  content: "↕";
  font-size: 0.75rem;
  opacity: 0.3;
}

th.asc a::after {
  content: "↑";
  opacity: 0.7;
}

th.desc a::after {
  content: "↓";
  opacity: 0.7;
}

input,
select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(42, 157, 143, 0.7);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #963720);
  color: #ffffff;
}

.btn-outline-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-muted);
}

.btn-outline-secondary:hover {
  color: var(--ink);
  border-color: var(--accent-2);
}

.btn-outline-primary {
  background: transparent;
  border-color: rgba(42, 157, 143, 0.6);
  color: var(--accent-2);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.table-container {
  overflow-x: auto;
  background: var(--surface);
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
}

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

.table thead {
  background: rgba(58, 110, 165, 0.12);
}

.table th {
  text-align: left;
  padding: 0.9rem 0.75rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.table td {
  padding: 0.8rem 0.75rem;
  border-top: 1px solid var(--border);
  white-space: nowrap;
}

.table th.col-num,
.table td.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.results-count {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.table-striped tbody tr:nth-child(even) {
  background: rgba(241, 246, 243, 0.7);
}

.table-hover tbody tr {
  transition: background 0.2s ease;
}

.table-hover tbody tr:hover {
  background: rgba(231, 111, 81, 0.12);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  font-weight: 600;
}

.pagination a {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.2s ease;
}

.pagination a:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

#player-results {
  transition: opacity 0.2s ease;
}

#player-results[aria-busy="true"] {
  opacity: 0.5;
  pointer-events: none;
}

ul {
  padding-left: 1.2rem;
}

ul li {
  margin-bottom: 0.4rem;
}

.list-card {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 0.75rem;
}

.list-card li {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-card li:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.list-card a {
  font-weight: 600;
  color: var(--ink);
}

details.player-tournament {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

details.player-tournament summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1rem;
  font-weight: 600;
}

details.player-tournament summary::-webkit-details-marker {
  display: none;
}

details.player-tournament[open] summary {
  border-bottom: 1px solid var(--border);
}

.sub-block {
  margin: 0.8rem 1rem 1rem;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.sub-block h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.tournament-card {
  gap: 0;
}

.tournament-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.tournament-summary {
  flex: 1;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.toggle-arrow {
  font-size: 1.2rem;
  color: var(--ink-muted);
  transition: transform 0.2s ease;
  padding: 0 0.2rem;
}

.tournament-card.open .toggle-arrow {
  transform: rotate(90deg);
}

.tournament-details {
  display: none;
  padding-top: 1.2rem;
}

.tournament-card.open .tournament-details {
  display: grid;
  gap: 0.9rem;
}

.card-stack {
  display: grid;
  gap: 1.2rem;
}

.category-stack {
  display: grid;
  gap: 0.9rem;
}

.category-card {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.8rem 0.9rem;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.category-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* A category and how it ended read as one chip split into segments, so the two
   halves stay legible without a colon holding them together. The emphasised
   segment is always the result. */
.entry-chip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  overflow: hidden;
}

.entry-chip-part {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
}

.entry-chip-part + .entry-chip-part {
  border-left: 1px solid var(--border);
}

.entry-chip-part.is-strong {
  background: rgba(58, 110, 165, 0.12);
  color: var(--ink);
  font-weight: 600;
}

.entry-chip-part.is-medal {
  background: rgba(212, 160, 23, 0.18);
}

.category-header h4 {
  margin: 0;
  font-size: 1rem;
}

.match-list-compact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.match-list-compact li {
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(225, 229, 234, 0.8);
}

.match-label {
  font-weight: 600;
  color: var(--ink-muted);
}

.match-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.h2h-card .card-body {
  display: grid;
  gap: 0.6rem;
}

.stage-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.stage-section + .stage-section {
  margin-top: 1.5rem;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stage-note {
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.stage-section .empty-state {
  margin: 0;
  color: var(--ink-muted);
}

/* ── Postavení hráče v žebříčku (profil hráče) ─── */

.rank-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.8rem;
}

.rank-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.rank-card:hover {
  color: inherit;
  border-color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* The same flattened medal tint the žebříček gives its top three rows. */
.rank-card.is-podium {
  background: #fcf8ef;
}

.rank-card-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.4rem;
  line-height: 1.15;
}

.rank-card-rank {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-card-field {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.rank-card-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.rank-card-category {
  font-weight: 600;
}

.rank-card-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* The year filter sits in the heading row, so it drops its stacked spacing. */
.matches-header h3 {
  margin: 0;
}

.matches-header select.year-filter {
  margin-bottom: 0;
}

.group-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 1rem;
}

.group-standings {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  border: 1px solid var(--border);
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.standings-table th,
.standings-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(225, 229, 234, 0.7);
  text-align: left;
}

.standings-table th {
  font-weight: 600;
  color: var(--ink-muted);
}

.standings-table tr.advanced {
  background: rgba(42, 157, 143, 0.09);
}

.standings-table tr.advanced td:first-child {
  border-left: 3px solid var(--accent-2);
}

.match-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}

.match-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background: var(--surface-2);
}

.match-meta {
  color: var(--ink-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.match-players {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.match-players .team a {
  color: inherit;
  text-decoration: none;
}

.match-players .team a:hover {
  text-decoration: underline;
  color: var(--accent-2);
}

.match-players .team {
  flex: 1 1 220px;
}

.match-players .vs {
  color: var(--ink-muted);
  font-weight: 700;
}

.team.winner {
  color: var(--accent-2);
}

.match-score {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.match-score-inline {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(58, 110, 165, 0.14);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.match-score-inline--center {
  margin: 0 0.6rem;
}

.match-divider {
  display: inline-flex;
  align-items: center;
  margin: 0 0.6rem;
  color: var(--ink-muted);
  font-weight: 700;
}

.bracket {
  display: flex;
  align-items: stretch;
  gap: 2.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  padding-top: 0.5rem;
}

.bracket-column {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  flex: 1;
}

.bracket-match[data-round] {
  position: relative;
  margin-top: 1.5rem;
}

.bracket-match[data-round]::before {
  content: attr(data-round);
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  white-space: nowrap;
}

.bracket-slots {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 0;
}

.bracket-match {
  background: var(--surface);
  padding: 0;
  position: relative;
}

.bracket-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.bracket-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s;
}

.bracket-match .bracket-player:first-child {
  border-top-left-radius: calc(var(--radius-md) - 1px);
  border-top-right-radius: calc(var(--radius-md) - 1px);
}

.bracket-match .bracket-player:last-of-type {
  border-bottom-left-radius: calc(var(--radius-md) - 1px);
  border-bottom-right-radius: calc(var(--radius-md) - 1px);
}

.bracket-player a {
  color: inherit;
  text-decoration: none;
}

.bracket-player a:hover {
  text-decoration: underline;
  color: var(--accent-2);
}

.bracket-player.winner {
  background: rgba(42, 157, 143, 0.09);
  border-left: 3px solid var(--accent-2);
  color: var(--ink);
}

.bracket-player.bye {
  color: var(--ink-muted);
  font-weight: 400;
  font-style: italic;
}

.bracket-player-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-player-score {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-2);
  white-space: nowrap;
  background: rgba(42, 157, 143, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.bracket-player-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.bracket-match-status {
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-align: center;
  padding: 0.25rem 0.5rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  letter-spacing: 0.03em;
}

.match-winner {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent-2);
  font-weight: 600;
}

.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.pl-4 { padding-left: 1rem; }
.pl-5 { padding-left: 1.25rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.border { border: 1px solid var(--border); }
.border-l-4 { border-left: 4px solid var(--accent-2); }
.rounded { border-radius: var(--radius-sm); }
.text-xl { font-size: 1.2rem; }
.text-gray-600 { color: var(--ink-muted); }
.font-semibold { font-weight: 600; }
.bg-blue-50 { background: rgba(42, 157, 143, 0.1); }
.bg-blue-600 { background: var(--accent-2); }
.border-blue-500 { border-color: var(--accent-2); }
.text-white { color: #ffffff; }
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }
.space-y-4 > * + * { margin-top: 1rem; }

/* ── Searchable select ─────────────────────────── */

.ss-wrap {
  position: relative;
}

.ss-input {
  width: 100%;
  padding-right: 2rem;
}

.ss-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
}

.ss-clear:hover {
  color: var(--accent);
}

.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 100;
  display: none;
}

.ss-dropdown.ss-open {
  display: block;
}

.ss-item {
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.12s;
}

.ss-item:hover,
.ss-item.ss-active {
  background: rgba(42, 157, 143, 0.12);
}

.ss-item.ss-selected {
  background: rgba(42, 157, 143, 0.18);
  font-weight: 600;
}

.ss-item mark {
  background: rgba(231, 111, 81, 0.25);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.ss-empty {
  padding: 0.7rem 0.8rem;
  color: var(--ink-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ── H2H picker ───────────────────────────────── */

.h2h-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.2rem;
  align-items: start;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.h2h-player-slot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.h2h-player-slot label {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.h2h-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink-muted);
}

.h2h-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .h2h-picker {
    grid-template-columns: 1fr;
  }

  .h2h-vs {
    padding-top: 0;
    padding-bottom: 0;
  }
}

.h2h-controls {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.h2h-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.h2h-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.8rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.h2h-stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.h2h-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
}

.h2h-stat-parts {
  display: flex;
  gap: 1.1rem;
}

.h2h-stat-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
  max-width: 7rem;
}

.h2h-stat-num {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}

.h2h-stat-part.is-win .h2h-stat-num {
  color: var(--accent-2);
}

.h2h-stat-part.is-loss .h2h-stat-num {
  color: var(--accent);
}

.h2h-stat-cap {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.25;
}

.h2h-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.h2h-column h4 {
  margin-bottom: 0.75rem;
}

@media (max-width: 700px) {
  .h2h-columns {
    grid-template-columns: 1fr;
  }
}

/* ── Player detail opponent picker ────────────── */

.opponent-picker {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.opponent-picker .picker-field {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.opponent-picker .picker-field label {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(190px, 0.8fr);
    gap: 2rem;
  }

  .home-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .header-inner {
    position: relative;
    gap: 0.75rem;
    padding: 0.8rem 0;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .js .site-nav {
    position: absolute;
    top: calc(100% - 0.2rem);
    right: 0;
    left: 0;
    display: none;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
  }

  .js .site-nav.is-open {
    display: block;
  }

  .site-nav .nav-list {
    display: grid;
    gap: 0.2rem;
  }

  .site-nav a {
    display: flex;
    width: 100%;
    padding: 0.65rem 0.8rem;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-logo {
    width: min(100%, 360px);
    justify-self: center;
  }
}

@media (max-width: 600px) {
  main {
    padding-top: 2rem;
  }

  .container {
    width: min(100% - 1.5rem, 1120px);
  }

  .brand-tagline {
    display: none;
  }

  .brand-mark {
    width: 2.7rem;
  }

  .brand-title {
    font-size: 1rem;
    line-height: 1.25;
    text-wrap: balance;
  }

  .hero {
    padding: 1.45rem;
  }

  .hero-title {
    font-size: clamp(2rem, 11vw, 2.8rem);
  }

  .hero-stats {
    gap: 0;
  }

  .hero-stat {
    padding: 0 0.7rem;
  }

  .hero-stat dt {
    font-size: 0.72rem;
  }

  .search-control {
    flex-direction: column;
  }

  .search-control .btn {
    width: 100%;
  }

  .recent-panel .section-header {
    align-items: flex-start;
  }

  .recent-tournament-list a {
    grid-template-columns: 3.75rem minmax(0, 1fr) auto;
    gap: 0.7rem;
  }

  .recent-date {
    padding-right: 0.65rem;
  }

  .recent-tournament-copy > span {
    white-space: normal;
  }

  .filter-form {
    padding: 1rem;
  }

  .group-layout {
    grid-template-columns: 1fr;
  }
}

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

/* ------------------------------------------------------------- konečné pořadí */

.results-table {
  max-width: 640px;
}

.results-table .result-place {
  width: 5.5rem;
  white-space: nowrap;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.results-table .result-points {
  width: 4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.results-table tr.medal-row {
  background: rgba(212, 160, 23, 0.07);
}

.medal {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  vertical-align: baseline;
}

.medal-1 { background: #d4a017; }
.medal-2 { background: #9aa3ad; }
.medal-3 { background: #b06a3b; }


.card-winner {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.card-winner a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.card-winner a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------------- žebříček */

.ranking-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-bottom: 1.5rem;
}

.ranking-section-label {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.ranking-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ranking-categories .pill-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.ranking-categories .pill-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* One column per tournament: the table scrolls sideways however many there are,
   while the rank, the name and the total stay pinned to the left. */
.ranking-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.ranking-table {
  min-width: 100%;
  white-space: nowrap;
}

.ranking-table th,
.ranking-table td {
  background: var(--surface);
}

.ranking-table tr.medal-row th,
.ranking-table tr.medal-row td {
  /* The translucent medal tint flattened, so the pinned cells match the row. */
  background: #fcf8ef;
}

.ranking-table .ranking-rank,
.ranking-table .ranking-player,
.ranking-table .ranking-points {
  position: sticky;
  z-index: 1;
}

.ranking-table .ranking-rank {
  left: 0;
  width: 4.25rem;
  min-width: 4.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ranking-table .ranking-player {
  left: 4.25rem;
  width: 11rem;
  min-width: 11rem;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-table .ranking-points {
  left: 15.25rem;
  width: 3.5rem;
  min-width: 3.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: 1px 0 0 var(--border);
}

.ranking-table .ranking-tournament {
  min-width: 3.6rem;
  text-align: center;
  font-weight: 500;
}

.ranking-table .ranking-tournament a {
  color: var(--ink-muted);
  text-decoration: none;
}

.ranking-table .ranking-tournament a:hover {
  color: var(--accent);
}

.ranking-year {
  display: block;
  font-size: 0.7rem;
  opacity: 0.65;
}

.ranking-table .ranking-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ranking-table .ranking-cell.is-absent {
  color: #c3c9d1;
}

@media (max-width: 640px) {
  .ranking-table .ranking-player {
    width: 7.5rem;
    min-width: 7.5rem;
    max-width: 7.5rem;
  }

  .ranking-table .ranking-points {
    left: 11.75rem;
  }
}
