body {
  position: relative;

  background-image: url('/images/zabavny_kviz_pozadi.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  background-color: #f0f0f0;

  color: #222;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  font-size: 17px;

  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Přidáme blur přes vrstvu před body */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: -1;
}

.container {
  padding: 24px 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  width: auto;
  text-align: center;

  min-height: 100vh;

  display: flex;
  flex-direction: column;
}

.filter-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

select {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23666" height="10" viewBox="0 0 10 6" width="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 0l5 6 5-6z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  padding-right: 32px;
  transition: border-color 0.2s;
}

select:hover,
select:focus {
  border-color: #888;
  outline: none;
}

.table-wrapper {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: visible;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  background: white;
}

table {
  display: inline-table;
  width: auto;
  border-collapse: collapse;
  font-size: 1rem;
  table-layout: auto;
  white-space: nowrap;
}

thead tr {
  background-color: #2d2d2d;
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

thead th {
  background-color: #2d2d2d;
  color: #fff;
}

/* --- Klikatelné řazení sloupců --- */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable .indicator { opacity: .6; margin-left: .35rem; font-size: .85em; }
th.sortable[aria-sort="asc"]  .indicator::after { content: "▲"; }
th.sortable[aria-sort="desc"] .indicator::after { content: "▼"; }
th.sortable[aria-sort="none"] .indicator::after { content: "↕"; }

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th.text-center,
td.text-center {
  text-align: center;
}

tbody tr:hover {
  background-color: #f9f9f9;
  transition: background-color 0.3s;
}

.team-detail-row td {
  background-color: #fafafa;
  color: #555;
  font-style: italic;
  padding: 16px;
}

tbody tr:nth-child(odd) {
  background-color: #fff;
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr.expanded {
  background-color: #d6f0ff !important;
  font-weight: 600;
}

tbody tr:hover {
  background-color: #cceeff;
  transition: background-color 0.3s;
}

/* --- Mobilní úpravy --- */
@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 16px 12px;
    min-height: auto; /* lépe scrollovatelný obsah */
    width: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .filter-section {
    grid-template-columns: 1fr; /* filtry pod sebou */
    gap: 10px;
    padding: 12px;
  }

  select {
    font-size: 1rem;
    padding: 10px;
  }


  .table-wrapper {
    overflow-x: auto;
    box-shadow: none;
    border-radius: 0;
    -webkit-overflow-scrolling: touch;
  }

  table {
    width: max-content;
    min-width: 100%;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  thead tr {
    display: table-row;
  }

  th, td {
    padding: 10px 8px;
    border-bottom: 1px solid #ccc;
  }

  /* Scrollbar pro table-wrapper na Webkitu */
  .table-wrapper::-webkit-scrollbar {
    height: 6px;
  }
  .table-wrapper::-webkit-scrollbar-thumb {
    background-color: #bbb;
    border-radius: 3px;
  }

  tbody tr {
    cursor: pointer; /* indikace kliknutí */
  }
  
    .team-detail-row td {
    font-size: 0.6rem;
    line-height: 1.3;
  }
}