/* ============================================================================
   turnajlive v2 — visual system
   Mobile-first. Brand: Spartak Hrdlořezy blue + white. Orange for LIVE,
   red for warnings, dedicated green for the football-pitch silhouette only.
   ============================================================================ */

:root {
  /* Brand palette. Variable names kept as --green-* for backwards-compat
     with ~70 references across CSS and templates; the *values* are now
     Spartak blue (anchor: --green-700 = #0082c9). Rename of the variable
     identifiers themselves is a deferred cleanup. */
  --green-900: #06325c;   /* deep navy — headings, brand wordmark dark side */
  --green-700: #0082c9;   /* primary brand — Spartak Hrdlořezy blue */
  --green-600: #006da8;   /* primary brand hover (darker) */
  --green-500: #5eb3e0;   /* lighter accent */
  --green-50:  #e7f4fb;   /* subtle blue-tinted background */

  /* Green reserved for the football pitch silhouette in the hero only —
     keeps the football metaphor without confusing the brand chrome. */
  --pitch-700: #1e4d2b;
  --pitch-500: #3f7a52;

  --orange-500: #ff6b1a;  /* signal — LIVE, calls to action */
  --orange-600: #e85a0a;
  --orange-50:  #fff1e8;

  --ink:        #1a1a1a;
  --ink-soft:   #3a3a3a;
  --muted:      #6b7280;
  --line:       #e5e7eb;
  --line-soft:  #f3f4f6;
  --paper:      #ffffff;
  --bg:         #faf8f5;  /* warm off-white, easier on eyes than pure white */

  --warn:       #ad7d00;
  --warn-bg:    #fff8e6;
  --ok:         #1e4d2b;  /* success indicator — kept green (standard) */
  --ok-bg:      #eef6f0;
  --err:        #b3261e;
  --err-bg:     #fbe8e7;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  /* Shadow tint follows the new navy primary. */
  --shadow-sm: 0 1px 2px rgba(6, 50, 92, 0.07);
  --shadow:    0 4px 16px rgba(6, 50, 92, 0.10);
  --shadow-lg: 0 12px 40px rgba(6, 50, 92, 0.14);

  --tap: 44px; /* minimum touch target */

  /* Native system font stack — what the user's OS already renders crisply
     (Segoe UI on Windows, SF Pro on macOS/iOS, Roboto on Android). No webfont
     fetch, no FOUT, matches the MVP look. --font-mono points at the same
     stack so numeric labels (times, scores, codes) sit in the same family
     instead of standing out as a separate technical-looking font. */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }

/* ---------- Layout shell ---------- */
.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--green-900);
  font-size: 1.05rem; letter-spacing: 0.01em;
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--green-700); color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px;
}
.brand-name { color: var(--ink); }
.brand-name .live { color: var(--orange-500); }
.nav-spacer { flex: 1; }
.nav-link {
  color: var(--muted);
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-weight: 500;
}
.nav-link:hover { background: var(--line-soft); text-decoration: none; }

.site-main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 20px 16px;
}
.site-footer a { color: var(--muted); }

/* ---------- Typography ---------- */
h1, h2, h3 { color: var(--green-900); margin: 0 0 12px; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8rem; }
.center { text-align: center; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card-tight { padding: 14px 16px; }
.card-emph { border: 2px solid var(--green-700); }
.card-warn { border-left: 4px solid var(--warn); background: var(--warn-bg); }
.card-ok   { border-left: 4px solid var(--ok); background: var(--ok-bg); }
.card-err  { border-left: 4px solid var(--err); background: var(--err-bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  text-decoration: none;
}
.btn:hover { border-color: var(--green-500); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--green-700); color: #fff; border-color: var(--green-700);
}
.btn-primary:hover { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn-accent {
  background: var(--orange-500); color: #fff; border-color: var(--orange-500);
}
.btn-accent:hover { background: var(--orange-600); border-color: var(--orange-600); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--green-700); }
.btn-ghost:hover { background: var(--green-50); border-color: var(--green-50); }
.btn-block { display: flex; width: 100%; }
.btn-large { min-height: 56px; font-size: 1.05rem; padding: 14px 24px; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field-label {
  display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft);
}
.field-label .req { color: var(--orange-500); }
.field-hint { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }
.field-error { color: var(--err); font-size: 0.875rem; margin-top: 4px; }

input[type="text"], input[type="date"], input[type="email"],
input[type="number"], input[type="time"], textarea, select {
  width: 100%;
  font: inherit; color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  min-height: var(--tap);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--green-500);
  outline-offset: 1px;
  border-color: var(--green-500);
}

/* Validation error state — applied to inputs in real time by the dirty-tracking
   JS (duplicate name detection) and on server-rendered error rerenders. */
input.is-error, input.is-error:focus {
  border-color: var(--err);
  outline-color: var(--err);
  background: var(--err-bg);
}

/* Modal — used to confirm "save before leave" when the organiser clicks
   POKRAČOVAT with unsaved changes in the Teams or Fields form. Simple
   centered box on a dimmed backdrop, three stacked buttons. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 50, 92, 0.55);
}
.modal-box {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin: 0 0 8px; color: var(--green-900); }
.modal-box p  { margin: 0 0 18px; color: var(--ink-soft); }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-actions .btn { width: 100%; justify-content: center; }
.btn-danger {
  background: var(--err); color: #fff; border-color: var(--err);
}
.btn-danger:hover {
  background: #8c1d18; border-color: #8c1d18; color: #fff;
}

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.radio:hover { border-color: var(--green-500); background: var(--green-50); }
.radio input { margin-top: 4px; }
.radio-title { font-weight: 600; }
.radio-desc { color: var(--muted); font-size: 0.875rem; margin-top: 2px; }

.checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; padding: 8px 0;
}
.checkbox input { margin-top: 4px; }

/* ---------- Hero / landing ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 24px 40px;
  margin-bottom: 20px;
  overflow: hidden;
}
.hero h1 { color: #fff; font-size: 1.9rem; margin-bottom: 4px; }
.hero p.lead { color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; margin-bottom: 24px; }
.hero-field {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.12; pointer-events: none;
}
.hero-actions {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 12px;
}
.hero-actions .btn-large { font-size: 1.1rem; }

.code-input-row {
  display: flex; gap: 8px; align-items: stretch;
}
.code-input-row input {
  flex: 1; background: rgba(255, 255, 255, 0.95);
  font-family: var(--font-mono); font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.code-input-row .btn { flex-shrink: 0; }

/* ---------- Promo strip on homepage (live tournaments teaser) ---------- */
.promo-strip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.promo-strip .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--orange-500);
  animation: live-pulse 1.4s infinite;
  flex-shrink: 0;
}
.promo-strip .text { flex: 1; }
.promo-strip .btn-small { flex-shrink: 0; }

@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.6; }
}

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--orange-500); color: #fff;
  padding: 2px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.live-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
  animation: live-pulse 1.4s infinite;
}

/* ---------- Code reveal cards (step 2 of setup) ---------- */
.code-block {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--paper);
}
/* Unified code cards: same neutral frame for all three; the label and any
   warning text inside the card carry the meaning, not the colour. */
.code-block.secret,
.code-block.public,
.code-block.roster { border-color: var(--line); background: var(--paper); }

.code-block-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.code-block .value {
  font-family: var(--font-mono);
  font-size: 1.8rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--green-900);
  margin: 4px 0 12px;
  word-break: break-all;
}
.code-block.secret .value { color: var(--green-900); }
.code-block .meta { color: var(--muted); font-size: 0.875rem; margin-bottom: 10px; }
.code-block .meta.danger {
  color: var(--err);
  font-weight: 700;
  background: var(--err-bg);
  border-left: 3px solid var(--err);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.code-block .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Gating "brána" panel on the codes screen. Big red full-width button below
   the admin-key card; clicking it reveals the bottom navigation. */
.gate-cta {
  display: block;
  width: 100%;
  background: var(--err);
  color: #fff;
  border: 2px solid var(--err);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 16px 0 18px;
  cursor: pointer;
  text-align: center;
  font: inherit;
  text-decoration: none; /* element is an <a> — override global link underline */
  box-shadow: var(--shadow);
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}
.gate-cta:hover {
  background: #8c1d18;
  border-color: #8c1d18;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}
.gate-cta:active { transform: translateY(1px); }
.gate-cta-confirm {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
@media (min-width: 720px) {
  .gate-cta-confirm { font-size: 1.35rem; }
}
.gate-cta-action {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  opacity: 0.95;
}
.gate-cta-hint {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.4;
}
.code-block .qr {
  display: block; margin: 8px 0 12px;
  width: 160px; height: 160px;
  background: #fff; padding: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}

/* Public-tournament URL rendered as a clickable link. Used on the codes
   setup page (below the prominent code) and in the admin dashboard's
   quick-access strip. overflow-wrap:anywhere lets the URL break on long
   strings; render-side <wbr> hints at "/", "." and "-" give the browser
   preferred break points so the line wraps at boundaries instead of
   mid-word.  */
.public-url-link {
  color: var(--green-700);
  font-weight: 500;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.public-url-link:hover { color: var(--green-900); text-decoration: underline; }

/* When the link is the small line under a prominent code block. */
.code-block .public-url-link {
  display: inline-block;
  font-size: 0.95rem;
  margin: 2px 0 12px;
}

/* ---------- Confirmation / status alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.alert-ok   { background: var(--ok-bg);   color: var(--ok); border-left: 4px solid var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-left: 4px solid var(--warn); }
.alert-err  { background: var(--err-bg);  color: var(--err); border-left: 4px solid var(--err); }

/* ---------- Misc helpers ---------- */
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row-tight { gap: 6px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack-12 > * + * { margin-top: 12px; }
.stack-20 > * + * { margin-top: 20px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 0.9rem; margin-bottom: 12px;
}

/* ---------- Tournament list ---------- */
.tournament-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 10px;
  text-decoration: none; color: inherit;
}
.tournament-row:hover { border-color: var(--green-500); text-decoration: none; }
.tournament-row .name { font-weight: 600; color: var(--ink); }
.tournament-row .meta { color: var(--muted); font-size: 0.875rem; }
.tournament-row .grow { flex: 1; min-width: 0; }

/* ---------- Desktop refinement ---------- */
@media (min-width: 720px) {
  .site-main { padding: 32px 24px 96px; }
  h1 { font-size: 2.1rem; }
  .hero { padding: 56px 48px 64px; }
  .hero h1 { font-size: 2.8rem; }
  .hero-actions { max-width: 480px; }
  .code-block .value { font-size: 2.2rem; }
}

/* ============================================================================
   HOMEPAGE — sections beyond the hero. Mobile-first, generous vertical rhythm.
   ============================================================================ */

/* Vertical rhythm between sections. Modern landing pages breathe. */
.section { margin: 48px 0; }
@media (min-width: 720px) { .section { margin: 88px 0; } }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.section-head .eyebrow {
  display: inline-block;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--orange-500); margin-bottom: 8px;
}
.section-head h2 { font-size: 1.6rem; }
@media (min-width: 720px) { .section-head h2 { font-size: 2rem; } }
.section-head p {
  color: var(--muted); font-size: 1.05rem; margin: 0;
}

/* Strengthen the hero — bigger heading, tighter type, room to breathe. */
.hero h1 { font-weight: 800; letter-spacing: -0.02em; }
.hero p.lead { max-width: 480px; font-size: 1.1rem; line-height: 1.4; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff; font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.15s;
}
.hero-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  text-decoration: none; color: #fff;
}
.hero-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange-500);
  animation: live-pulse 1.4s infinite;
}
.hero-pill-arrow { color: rgba(255, 255, 255, 0.7); }

/* Hero lists — TOP 5 live a TOP 5 upcoming přímo v hero sekci, pod CTA
   tlačítkem. Mírně poloprůhledné pozadí, bílý text, jemný hover. */
.hero-list { margin-top: 16px; }
.hero-list-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px;
  font-size: 0.95rem; font-weight: 700; color: #fff;
  letter-spacing: 0.02em;
}
.hero-list-count { color: rgba(255, 255, 255, 0.7); font-weight: 500; }
.hero-list-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
}
.hero-list-dot.is-live     { background: var(--orange-500); animation: live-pulse 1.4s infinite; }
.hero-list-dot.is-upcoming { background: #6ad28a; }
.hero-list-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: #fff; text-decoration: none;
  transition: background 0.12s ease;
}
.hero-list-row:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none; color: #fff;
}
.hero-list-name { font-weight: 700; font-size: 0.98rem; }
.hero-list-meta { font-size: 0.82rem; color: rgba(255, 255, 255, 0.75); }
/* Univerzální odkaz pod oběma seznamy — vede na /turnaje, kde je
   i sekce "Nedávno skončilo" (na homepage ji záměrně neukazujeme). */
.hero-list-all {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 0;
  font-size: 0.9rem; font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  width: 100%;
}
.hero-list-all:hover { color: #fff; text-decoration: underline; }
.hero-list-all-hint { color: rgba(255, 255, 255, 0.65); font-weight: 400; }

/* Trust strip — 3 promises, side by side on desktop. */
.trust-strip {
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
@media (min-width: 560px) {
  .trust-strip { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
.trust-item {
  text-align: center; padding: 18px 14px;
  border-radius: var(--radius);
  background: var(--green-50);
  border: 1px solid rgba(30, 77, 43, 0.1);
}
.trust-item .check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green-700); color: #fff;
  font-weight: 700; font-size: 1rem;
  margin-bottom: 8px;
}
.trust-item .label {
  display: block; font-weight: 700;
  color: var(--green-900); font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.trust-item .sub {
  display: block; color: var(--muted);
  font-size: 0.88rem; margin-top: 2px;
}

/* Three-step "how it works" cards. */
.steps {
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 22px; }
}
.step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--orange-500); color: #fff;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem;
  margin-bottom: 14px;
}
.step-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.step h3 {
  color: var(--green-900); font-size: 1.15rem;
  margin-bottom: 6px;
}
.step p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; line-height: 1.5; }

/* Features — 2-column grid on desktop, big icon + headline + short copy. */
.features {
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 720px) {
  .features { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
.feature {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; gap: 16px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.feature:hover {
  transform: translateY(-2px);
  border-color: var(--green-500);
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  font-size: 1.8rem; line-height: 1; flex-shrink: 0;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--green-50);
  border-radius: 12px;
}
.feature-body h3 {
  color: var(--green-900); margin-bottom: 4px; font-size: 1.05rem;
}
.feature-body p { color: var(--ink-soft); margin: 0; font-size: 0.94rem; line-height: 1.5; }

/* Personas — 3 cards, each with a coloured top stripe. */
.personas {
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 720px) {
  .personas { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
.persona {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--green-700);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.persona:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.persona.p-organizer { border-top-color: var(--orange-500); }
.persona.p-coach     { border-top-color: var(--green-700); }
.persona.p-viewer    { border-top-color: var(--green-500); }
.persona-icon { font-size: 1.6rem; margin-bottom: 8px; line-height: 1; }
.persona-label {
  display: block;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.72rem; font-weight: 700;
  color: var(--muted); margin-bottom: 6px;
}
.persona h3 {
  color: var(--green-900); margin-bottom: 6px; font-size: 1.1rem;
}
.persona p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }

/* Final CTA — big closing card. */
.final-cta {
  text-align: center;
  background: linear-gradient(135deg, var(--green-50) 0%, var(--paper) 100%);
  border: 1px solid var(--green-500);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
}
@media (min-width: 720px) { .final-cta { padding: 56px 40px; } }
.final-cta h2 {
  color: var(--green-900); margin-bottom: 8px;
  font-size: 1.5rem;
}
@media (min-width: 720px) { .final-cta h2 { font-size: 1.85rem; } }
.final-cta .lead { color: var(--ink-soft); margin: 0 auto 22px; max-width: 460px; font-size: 1.05rem; }
.final-cta .reassure { color: var(--muted); font-size: 0.9rem; margin-top: 16px; margin-bottom: 0; }
.final-cta .btn { min-width: 280px; }

/* ============================================================================
   ADMIN DASHBOARD — primary category CTA + quick-pick chips
   ============================================================================ */

/* Card framing the "start by choosing a category" block. Even when filled it
   stays visually present so the organiser always sees it as the page's
   primary surface. */
.cta-card {
  border: 2px solid var(--green-700);
  background: linear-gradient(180deg, var(--green-50) 0%, var(--paper) 70%);
}
.cta-heading {
  text-align: center;
  font-size: 1.35rem;
  color: var(--green-900);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
@media (min-width: 720px) { .cta-heading { font-size: 1.7rem; } }
.cta-sub {
  text-align: center;
  color: var(--ink-soft);
  font-size: 1rem;
  margin: 0 0 14px;
}
@media (min-width: 720px) { .cta-sub { font-size: 1.08rem; } }
.cta-sub strong { color: var(--green-900); }

/* Quick-pick chips for the empty-categories state. Tap targets ≥ 52 px high. */
.chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (min-width: 560px) { .chips { grid-template-columns: repeat(3, 1fr); } }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--green-900);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
  text-align: center;
}
.chip:hover {
  border-color: var(--green-700);
  background: var(--green-50);
  text-decoration: none;
}
.chip:active { transform: translateY(1px); }

/* Inline "vlastní kategorie" form: text input + Přidat button side-by-side. */
.custom-cat-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.custom-cat-form input[type="text"] {
  flex: 1;
  min-width: 0;
  min-height: 48px;
}
.custom-cat-form .btn { flex-shrink: 0; min-height: 48px; }

/* "+ Přidat další kategorii" collapsible on the populated dashboard — kept
   visible but secondary so the existing categories stay the focus. */
.add-cat-details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.add-cat-details > summary {
  cursor: pointer;
  color: var(--green-700);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  list-style: none;
  user-select: none;
}
.add-cat-details > summary::-webkit-details-marker { display: none; }
.add-cat-details[open] > summary { color: var(--green-900); }

/* Scoreboard rendering: team names use weight (winner bold, others normal,
   no colour), individual score digits get coloured underline showing the
   outcome from each side's perspective (green = win, red = loss, amber =
   draw). Keeps the row clean while still showing who won at a glance. */
.team-name { color: inherit; font-weight: 500; }
.team-name.is-winner { font-weight: 800; }
.score-num {
  font-family: var(--font-mono);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.score-num.is-win  { text-decoration-color: var(--ok); }
.score-num.is-lose { text-decoration-color: var(--err); }
.score-num.is-draw { text-decoration-color: var(--warn); }
.score-num.is-none { color: var(--muted); text-decoration: none; font-weight: 400; }

/* ============================================================================
   MATCH SCOREBOARD CARD — vertical layout: meta row on top, each team on its
   own row with name left and large score right. Built so long club names
   fit on a phone without wrapping into 3+ lines. Adopted from the MVP
   scoreboard pattern (commit c7e2713) and adapted to the v2 brand chrome.
   ============================================================================ */
.match-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  /* Offset for the sticky header when scrolling to #match-<id> anchor —
     ensures the card lands below the header bar, not behind it. */
  scroll-margin-top: 80px;
}
.match-card.is-live           { background: var(--orange-50); border-color: var(--orange-500); }
.match-card.is-awaiting       { background: var(--warn-bg);  border-color: var(--warn); }
.match-card.is-conflict       { background: var(--err-bg);   border-color: var(--err); }
.match-card.is-awaiting-teams { background: #eef4fb;        border-color: var(--green-500); }
.mc-awaiting-teams-msg {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: rgba(94, 179, 224, 0.12);
  border-top: 1px dashed var(--line);
  font-style: italic;
}
/* Penalty v playoff — malý řádek pod skórem karty se zápisem
   "PK 4:5". Skóre vítěze už nese „připsaný" gól, takže zelená/červená
   stačí na zobrazení vítěze — PK jen sděluje, ŽE rozhodly penalty. */
.mc-pk {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 0 10px;
  border-top: 1px dashed var(--line-soft);
  letter-spacing: 0.06em;
}

.mc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.mc-meta-info { flex: 1; min-width: 0; }
.mc-meta-info .mc-time {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green-900);
}
.mc-meta-info .mc-sep { margin: 0 4px; color: var(--line); }
.mc-meta-info .mc-branch {
  color: var(--green-700);
  font-weight: 600;
  margin-left: 8px;
}
.mc-meta-status { flex-shrink: 0; }
.mc-meta-arrows {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.mc-meta-arrows form { margin: 0; }
.mc-meta-arrows button {
  padding: 3px 7px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--muted);
}
.mc-meta-arrows button:hover {
  background: var(--green-50);
  border-color: var(--green-500);
  color: var(--green-900);
}

.mc-body {
  display: block;
  text-decoration: none;
  color: inherit;
}
.mc-body:hover {
  text-decoration: none;
  color: inherit;
  background: rgba(0, 130, 201, 0.04);
}

.mc-team {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}
.mc-team + .mc-team { border-top: 1px solid var(--line-soft); }
.mc-team .t-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 1rem;
  color: inherit;
  line-height: 1.3;
  word-break: break-word;
}
.mc-team.is-winner .t-name { font-weight: 800; }
.mc-team .t-name.is-placeholder { font-style: italic; color: var(--muted); font-weight: 400; }

/* Score pill — coloured background per outcome from each side's perspective.
   Adopted from the MVP scoreboard pattern (commit c7e2713). Green pill = win,
   red = loss, amber = draw, neutral grey = empty. Replaces the previous
   underlined treatment which looked like a hyperlink. */
.mc-team .t-score {
  flex-shrink: 0;
  display: inline-block;
  min-width: 42px;
  padding: 4px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-align: center;
  background: var(--line-soft);
  color: var(--ink-soft);
}
.mc-team .t-score.is-win   { background: #c4e8d1; color: #155a36; }
.mc-team .t-score.is-lose  { background: #f5cdc8; color: #7a2620; }
.mc-team .t-score.is-draw  { background: #ffd9a8; color: #6e4318; }
.mc-team .t-score.is-empty { background: transparent; color: var(--muted); font-weight: 400; }

/* Status badges in the meta row */
.mc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mc-badge.is-live { background: var(--orange-500); color: #fff; }
.mc-badge.is-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: live-pulse 1.4s infinite;
}
.mc-badge.is-awaiting { background: var(--warn); color: #fff; }

/* W-R-P outcome dots: one coloured dot per played match, summarising a
   team's record at a glance. Replaces three separate W/D/L number columns
   with a single visual strip (adopted from the MVP standings). Green = win,
   amber = draw, red = loss. */
.wdl-dots {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  max-width: 90px;
  vertical-align: middle;
  line-height: 0;
}
.wdl-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wdl-dot.is-w { background: #2e9c4d; }
.wdl-dot.is-d { background: #e89a30; }
.wdl-dot.is-l { background: #c0392b; }
.wdl-empty { color: var(--muted); font-weight: 400; }

/* Standings table — shared shell for the public + admin group tables.
   MVP-style: team column takes natural width (no ellipsis, full club name
   always visible); under 540 px three derived columns (Z, Skóre, +/−)
   collapse so #, Tým, V-R-P and B fit cleanly on a 360 px phone. */
.standings-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.standings-table th,
.standings-table td { padding: 8px; }
.standings-table .team-cell { text-align: left; padding-left: 4px; }
/* Fixed widths so dvě sousední skupiny mají sloupce na stejných pozicích —
   bez nich prohlížeč počítal šířky podle obsahu zvlášť pro každou tabulku
   a sloupce ve skupině s většími čísly se vizuálně posouvaly. */
.standings-table .col-played { width: 40px; }
.standings-table .col-vrp    { width: 110px; }
.standings-table .col-goals  { width: 70px; }
.standings-table .col-diff   { width: 50px; }
.standings-table .col-points { width: 40px; }
@media (max-width: 540px) {
  .standings-table { font-size: 0.88rem; }
  .standings-table th,
  .standings-table td { padding: 10px 6px; }
  .standings-table .col-played,
  .standings-table .col-goals,
  .standings-table .col-diff { display: none; }
}

/* Rank badges — gold / silver / bronze for top 3, neutral grey otherwise.
   Adopted 1:1 from the MVP look. Replaces plain "1." numerals with small
   coloured circles that visually anchor the medalist rows. */
.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef2f0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
}
.rank-num.gold   { background: #ffd966; color: #5d4500; box-shadow: 0 0 0 1px #e6b800 inset; }
.rank-num.silver { background: #d8dadc; color: #44514c; box-shadow: 0 0 0 1px #b8bcc0 inset; }
.rank-num.bronze { background: #d6a780; color: #5d3914; box-shadow: 0 0 0 1px #b48155 inset; }

/* Subtle row tints for top-3 finishers — harmonises with the rank badge so
   the medalist rows read as one coordinated unit. Applied only once the
   group has any played matches, so a fresh tournament doesn't paint half
   the standings yellow before anyone has kicked a ball. */
.standings-table tr.row-gold   td { background: #fff7d6; }
.standings-table tr.row-silver td { background: #f1f2f4; }
.standings-table tr.row-bronze td { background: #f8ece1; }
.standings-table tr.row-gold .team-cell { font-weight: 700; }

/* ============================================================================
   DISPLAY PAGE — full-screen 9:16 portrait foyer screen, no scroll, no touch.
   Statický layout: hlavička → ⚡ PROBÍHÁ → tabulky základních skupin →
   ⏱ CHYSTAJÍ SE → footer. Sekce "PROBÍHÁ" a "CHYSTAJÍ SE" se skryjí,
   pokud nemají co ukázat. display.js zajišťuje realtime refresh přes
   Socket.IO (fallback: full reload). Žádná auto-rotace mezi obrazovkami.
   ============================================================================ */
body.display-page {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
.display-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px;
  gap: 14px;
  box-sizing: border-box;
}
.display-header {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--green-700);
}
.display-header h1 {
  font-size: 2.8rem;
  margin: 0 0 6px;
  color: var(--green-900);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.display-header .display-info {
  font-size: 1.2rem;
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-style: italic;
}
.display-header .display-meta {
  font-size: 1.2rem;
  margin: 0;
  color: var(--muted);
}

/* ⚡ PROBÍHÁ — malé písmo, jednoduchý řádek bez velkého rámečku. */
.display-live { text-align: center; }
.display-live h2 {
  font-size: 1rem;
  margin: 0 0 6px;
  color: var(--orange-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.display-live-row {
  font-size: 1.05rem;
  color: var(--green-900);
  padding: 3px 0;
}
.display-live-teams { font-weight: 700; }
.display-live-field { color: var(--muted); margin-left: 6px; }

/* Tabulky základních skupin — hlavní obsah, vezme zbylou výšku. */
.display-standings {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.display-standings-block { margin: 0; }
.display-standings-block h3 {
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--green-700);
}

/* Společná display-table — používá se i v AFTER konečném pořadí. */
.display-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.35rem;
  margin-bottom: 0;
}
.display-table thead th {
  background: var(--green-50);
  text-align: left;
  padding: 10px 12px;
  font-weight: 800;
  color: var(--green-900);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.display-table thead th.rank-col   { width: 60px; text-align: center; }
.display-table thead th.points-col { width: 60px; text-align: center; }
.display-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.display-table td.rank-col {
  text-align: center;
  font-weight: 700;
  color: var(--green-900);
  white-space: nowrap;
}
.display-table td.team-col { font-weight: 600; }
.display-table td.points-col {
  text-align: center;
  font-weight: 800;
  color: var(--green-700);
  font-size: 1.5rem;
}
.display-table tr.is-medal td { background: rgba(255, 215, 102, 0.18); }

/* ⏱ CHYSTAJÍ SE — malé písmo, dva řádky s časem a hřištěm. */
.display-upcoming { text-align: center; }
.display-upcoming h2 {
  font-size: 1rem;
  margin: 0 0 6px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.display-upcoming-row {
  font-size: 1.05rem;
  color: var(--green-900);
  padding: 3px 0;
}
.display-upcoming-time {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--green-900);
  margin-right: 8px;
}
.display-upcoming-teams { font-weight: 600; }
.display-upcoming-field { color: var(--muted); margin-left: 6px; }

/* Společný "vs" separator (live i upcoming řádky). */
.display-vs {
  color: var(--muted);
  font-weight: 400;
  margin: 0 6px;
}

/* AFTER — konečné pořadí statické přes celou obrazovku. */
.display-final {
  flex: 1;
  overflow: hidden;
  text-align: center;
}
.display-final > h2 {
  font-size: 2.4rem;
  margin: 0 0 24px;
  color: var(--green-900);
}
.display-final-category {
  margin-bottom: 24px;
  text-align: left;
}
.display-final-category h3 {
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--green-700);
}

/* Footer pill */
.display-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

/* Tournament status banner — shown on admin dashboard and public tournament
   page. Big rounded badge for the overall phase plus an optional "Připraví
   se týmy" list with the upcoming wave of matches. */
.tournament-status {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.tournament-status-badge {
  display: inline-block;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  border-radius: 999px;
  text-transform: uppercase;
}
.tournament-status-badge.is-empty    { background: var(--line-soft); color: var(--muted); }
.tournament-status-badge.is-before   { background: var(--green-50); color: var(--green-900); }
.tournament-status-badge.is-during   { background: var(--orange-500); color: #fff; }
.tournament-status-badge.is-ceremony { background: #ffd966; color: #5d4500; }
.tournament-status-badge.is-after    { background: var(--ok-bg); color: var(--ok); }

.upcoming-section { margin-top: 12px; }
.upcoming-section h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.upcoming-match {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
  font-size: 0.92rem;
}
.upcoming-match:first-of-type { border-top: none; }
.upcoming-match .um-time {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green-900);
  min-width: 48px;
}
.upcoming-match .um-cat {
  font-weight: 700;
  color: var(--green-700);
}
.upcoming-match .um-field { color: var(--muted); font-size: 0.85rem; }
.upcoming-match .um-teams { flex: 1; min-width: 0; }

/* Tab navigation strip used on per-category admin pages (Rozpis / Playoff /
   Konečné pořadí) and on the public final-standings page. Mobile-first —
   wraps to multiple lines if there isn't room on one. */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 2px solid var(--line);
  margin: 0 0 20px;
}
.tab {
  padding: 10px 16px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover {
  color: var(--green-700);
  text-decoration: none;
}
.tab.is-active {
  color: var(--green-900);
  border-bottom-color: var(--green-700);
}

/* Flash highlight applied after a reorder swap completes. Brief orange aura
   + warm background pulse so the eye catches where an item landed without
   scrolling away. Generic class — used by both the match-card swap on the
   schedule view and the tiebreaker criteria reorder list. */
.is-just-moved {
  animation: just-moved-flash 0.9s ease-out;
}
@keyframes just-moved-flash {
  0%   { box-shadow: 0 0 0 0 rgba(255, 107, 26, 0.55); background-color: var(--orange-50); }
  60%  { box-shadow: 0 0 0 10px rgba(255, 107, 26, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 26, 0); }
}
