﻿:root {
  --ink: #000000;
  --muted: #667085;
  --paper: #ffffff;
  --card: rgba(255, 255, 255, 0.94);
  --line: rgba(0, 0, 0, 0.14);
  --accent: #cc000c;
  --accent-dark: #990009;
  --field: #f5f5f5;
  --success: #147a3e;
  --danger: #cc000c;
  --nav-height: 86px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(204, 0, 12, 0.14), transparent 30rem),
    radial-gradient(circle at 92% 10%, rgba(8, 9, 13, 0.08), transparent 26rem),
    linear-gradient(135deg, #ffffff 0%, #f7f7f7 58%, #ffffff 100%);
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 2.5rem);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
  background-image:
    linear-gradient(90deg, rgba(23, 32, 51, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(23, 32, 51, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero,
.compact-header,
.page-shell {
  width: min(100%, 940px);
  margin: 0 auto;
}

.hero {
  padding: 2rem 1rem 1rem;
}

.hero h1,
.compact-header h1 {
  margin: 0;
  font-size: clamp(2.3rem, 12vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

.hero p,
.compact-header p {
  max-width: 36rem;
  color: var(--muted);
}

.compact-header {
  padding: 1.25rem 1rem 0.5rem;
}

.compact-header h1 {
  font-size: clamp(2rem, 9vw, 3.8rem);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent-dark) !important;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.hero-actions,
.admin-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-live {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

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

.page-shell {
  padding: 0.75rem 1rem 1.5rem;
}

.sport-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.25rem 0 1rem;
}

.sport-tab,
.primary-button,
.ghost-button {
  border: 0;
  border-radius: 18px;
  padding: 0.85rem 1rem;
  font-weight: 900;
}

.sport-tab {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.sport-tab.active,
.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 24px rgba(204, 0, 12, 0.18);
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}

.round-section,
.info-card,
.class-card,
.match-card,
.leaderboard-item {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 18px 40px rgba(75, 55, 25, 0.08);
  backdrop-filter: blur(14px);
}

.round-section {
  margin-bottom: 1rem;
  padding: 0.9rem;
}

.round-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 0 0 0.7rem;
}

.round-title h2 {
  margin: 0;
  font-size: 1.05rem;
}

.round-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.match-list {
  display: grid;
  gap: 0.7rem;
}

.match-card {
  padding: 0.8rem;
}

.match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.team-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem;
  border-radius: 18px;
  background: rgba(245, 245, 245, 0.9);
}

.team-row+.team-row {
  margin-top: 0.45rem;
}

.team-name {
  font-weight: 950;
}

.score {
  min-width: 2.25rem;
  text-align: center;
  border-radius: 12px;
  padding: 0.3rem 0.45rem;
  color: #fff;
  background: var(--ink);
  font-weight: 950;
}

.shirt {
  width: 28px;
  height: 28px;
  position: relative;
  flex: 0 0 auto;
  border: 2px solid rgba(23, 32, 51, 0.25);
  border-radius: 9px 9px 13px 13px;
  background: var(--shirt-color, #cfd4dc);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.shirt::before,
.shirt::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 10px;
  height: 12px;
  background: inherit;
  border: inherit;
  border-radius: 8px;
}

.shirt::before {
  left: -9px;
  transform: rotate(18deg);
}

.shirt::after {
  right: -9px;
  transform: rotate(-18deg);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  width: min(calc(100% - 0.75rem), 620px);
  min-height: var(--nav-height);
  padding: 0.5rem;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 250, 240, 0.78);
  border-radius: 28px;
  background: #000000;
  /* Pure black */
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

.bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  min-width: 0;
  min-height: 64px;
  border-radius: 22px;
  color: #fffaf0;
  text-decoration: none;
  font-size: clamp(0.72rem, 2.7vw, 0.86rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.bottom-nav a.active {
  color: #fff;
  background: var(--accent);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.16);
}

.info-card {
  padding: 1rem;
  margin-bottom: 1rem;
}

.info-card h2 {
  margin: 0 0 0.75rem;
}

.points-row,
.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.points-row {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.leaderboard-list,
.class-grid,
.admin-list,
.admin-match-list,
.prediction-fields,
.tips-results {
  display: grid;
  gap: 0.75rem;
}

.leaderboard-item {
  padding: 0.85rem;
}

.leaderboard-card {
  display: grid;
  gap: 0.55rem;
}

.leaderboard-button {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}

.leaderboard-card.is-expanded .leaderboard-button {
  border-color: rgba(204, 0, 12, 0.42);
}

.points-breakdown {
  border: 1px solid rgba(204, 0, 12, 0.22);
  border-radius: 24px;
  padding: 0.9rem;
  background:
    linear-gradient(135deg, rgba(204, 0, 12, 0.08), transparent 46%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 32px rgba(8, 9, 13, 0.08);
}

.points-breakdown h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.62rem 0;
  border-top: 1px solid var(--line);
}

.breakdown-row.total {
  margin-top: 0.2rem;
  color: #fff;
  border: 0;
  border-radius: 16px;
  padding: 0.7rem 0.85rem;
  background: var(--ink);
}

.rank-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  /* Fully round */
  color: #fff;
  background: var(--ink);
  font-weight: 950;
  flex-shrink: 0;
}

.leaderboard-card:nth-child(1) .rank-badge {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.leaderboard-card:nth-child(2) .rank-badge {
  background: linear-gradient(135deg, #c0c0c0, #8e8e8e);
  box-shadow: 0 4px 12px rgba(192, 192, 192, 0.4);
}

.leaderboard-card:nth-child(3) .rank-badge {
  background: linear-gradient(135deg, #cd7f32, #8b4513);
  box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

/* Base class-card: used by tipovačka buttons. Overridden on the Třídy page. */
.class-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.class-card strong {
  display: block;
  font-size: 1.25rem;
}

.class-card-header strong {
  display: block;
  font-size: 1.25rem;
}


.stack-form,
.modal-form {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.prediction-card {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(246, 234, 213, 0.5);
}

.result-bar {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.12);
}

.result-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.tip-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.6rem;
}

.clean-list {
  margin: 0;
  padding-left: 1.2rem;
}

.clean-list li {
  margin: 0.55rem 0;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(246, 234, 213, 0.45);
}

.admin-match-card {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
}

.live-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.live-button {
  min-height: 76px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  background: var(--ink);
  font-weight: 950;
}

.minor-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.modal-card {
  width: min(calc(100% - 2rem), 460px);
  border: 0;
  border-radius: 28px;
  padding: 1rem;
  color: var(--ink);
  background: var(--paper);
}

.modal-card::backdrop {
  background: rgba(23, 32, 51, 0.55);
  backdrop-filter: blur(6px);
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.hidden {
  display: none !important;
}

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

@media (min-width: 720px) {
  .sport-switcher {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .match-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tipy Progress Bar */
.tip-progress-container {
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 99px;
  margin-top: 12px;
  overflow: hidden;
  position: relative;
}

.tip-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 1s cubic-bezier(0.65, 0, 0.35, 1);
  border-radius: 99px;
  position: relative;
}

.tip-progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.3) 50%,
      rgba(255, 255, 255, 0) 100%);
  animation: loadingShimmer 2s infinite linear;
}

@keyframes loadingShimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

.bracket-root {
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scroll-snap-type: x proximity;
}



.bracket-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(82vw, 1fr));
  gap: 0.85rem;
  min-width: max-content;
  align-items: center;
}

.bracket-column {
  display: grid;
  align-content: center;
  min-height: 480px;
  scroll-snap-align: start;
}

.bracket-column:nth-child(2) .match-list {
  gap: 3rem;
}

.bracket-column:nth-child(3) .match-list {
  gap: 5rem;
}

.relay-placement {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 860px) {
  .bracket-board {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    min-width: 100%;
  }
}

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

.class-color-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.class-color-tools input[type="color"],
.admin-row input[type="color"] {
  width: 48px;
  height: 48px;
  padding: 0.2rem;
  border-radius: 16px;
}

.bracket-root {
  overflow-x: auto;
  padding-bottom: 0.8rem;
  scroll-snap-type: x proximity;
}



.bracket-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(82vw, 1fr));
  gap: 1.2rem;
  min-width: max-content;
  min-height: 620px;
  padding: 0 0.35rem;
  align-items: stretch;
}

.bracket-lines {
  position: absolute;
  inset: 2.9rem 0 0;
  width: 100%;
  height: calc(100% - 3rem);
  pointer-events: none;
  overflow: visible;
}

.bracket-lines path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.bracket-stage {
  display: grid;
  grid-template-rows: 36px repeat(4, minmax(105px, 1fr));
  gap: 0.75rem;
  min-width: 0;
  scroll-snap-align: start;
}

.bracket-stage h2 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  background: var(--ink);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bracket-match {
  position: relative;
  z-index: 1;
  align-self: center;
}

.slot-1 {
  grid-row: 2;
}

.slot-2 {
  grid-row: 3;
}

.slot-3 {
  grid-row: 4;
}

.slot-4 {
  grid-row: 5;
}

.stage-sf .slot-1 {
  grid-row: 2 / span 2;
}

.stage-sf .slot-2 {
  grid-row: 4 / span 2;
}

.stage-final .slot-1 {
  grid-row: 3 / span 2;
}

.round-section {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.relay-grid {
  display: grid;
  gap: 0.75rem;
}

.relay-order {
  display: grid;
  gap: 0.5rem;
}

.relay-chip {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  cursor: default;
}

.relay-run-card.is-editing {
  border-color: rgba(204, 0, 12, 0.45);
  box-shadow: 0 18px 42px rgba(204, 0, 12, 0.12);
}

.relay-run-card:not(.is-editing) {
  cursor: pointer;
}

.relay-chip.can-drag {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.relay-chip.dragging {
  opacity: 0.55;
  outline: 3px solid rgba(204, 0, 12, 0.26);
}

.relay-rank {
  font-weight: 950;
}

.relay-save {
  margin-top: 0.8rem;
  width: 100%;
}

.tip-class-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  color: var(--ink);
}

.tip-class-card>*:not(.tip-fill) {
  position: relative;
  z-index: 1;
}

.tip-fill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(204, 0, 12, 0.2), rgba(204, 0, 12, 0.08));
  transition: width 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.tip-percent {
  position: relative;
  z-index: 1;
  min-width: 3rem;
  text-align: right;
}

.tip-class-card.show-result {
  grid-template-columns: 1fr auto auto;
}

.tip-class-card:not(:disabled):hover {
  border-color: rgba(204, 0, 12, 0.45);
  transform: translateY(-1px);
}

.tip-class-card:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.sport-tab.is-complete::after {
  content: " ✓";
}

@media (min-width: 720px) {
  .relay-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {

  .hero,
  .compact-header,
  .page-shell {
    width: min(100%, 1180px);
  }

  .bracket-board {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    min-width: 100%;
    gap: 1.6rem;
  }


}

.expand-arrow {
  width: 14px;
  height: 14px;
  margin-left: 0.5rem;
  opacity: 0.4;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M6 9l6 6 6-6"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s ease, opacity 0.2s;
}

.leaderboard-card.is-expanded .expand-arrow {
  opacity: 0.8;
}

.leaderboard-info {
  flex: 1;
}

/* Layout spacing fixes */
.relay-grid {
  margin-bottom: 1.5rem;
  /* Decreased by 50% */
}

/* Animations */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body:not([data-page="results"]) .match-card,
body:not([data-page="results"]) .leaderboard-card,
body:not([data-page="results"]) .class-card,
body:not([data-page="results"]) .info-card {
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* On results page, only animate the initial container fade in, not each card refresh */
body[data-page="results"] .page-shell {
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Lengthen animations for all pages except výsledky */










.primary-button,
.sport-tab,
.leaderboard-item,
.class-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-button:active,
.sport-tab:active,
.leaderboard-item:active {
  transform: scale(0.97);
}

/* Smooth Žebříček Expansion */
.points-breakdown {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.leaderboard-card.is-expanded .points-breakdown {
  max-height: 800px;
  opacity: 1;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.class-accordion-card {
  width: 100%;
  display: grid;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.class-card-header {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 18px 40px rgba(75, 55, 25, 0.08);
  backdrop-filter: blur(14px);
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.class-accordion-card.is-expanded .class-card-header {
  border-color: rgba(204, 0, 12, 0.42);
}

.class-schedule {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0 1rem;
  border: 1px solid rgba(204, 0, 12, 0);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
}

.class-accordion-card.is-expanded .class-schedule {
  max-height: 1000px;
  opacity: 1;
  padding: 1rem;
  border-color: rgba(204, 0, 12, 0.22);
  box-shadow: 0 16px 32px rgba(8, 9, 13, 0.08);
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.schedule-row:first-of-type {
  border-top: 0;
}

.schedule-row span:first-child {
  font-weight: 800;
  color: var(--accent-dark);
  min-width: 5rem;
}

.schedule-row span:last-child {
  font-weight: 700;
  text-transform: capitalize;
}