/* ====================================================================
   ŽABA QUEST 2026 – Hráčská obrazovka (/quest)
   Vychází z css/tokens.css. Všechny třídy a id používané skriptem
   v quest/index.php zůstávají; mění se jen vzhled.

   Priority obrazovky (hraje se venku, v noci, jednou rukou):
   1. aktuální výzva a tlačítko „Splnit“  2. skóre a pořadí týmu
   3. navigace mezi Úkoly / Žebříček / Tým. Vše ostatní ustupuje.
   ==================================================================== */

:root {
  /* Názvy proměnných, které používá JS a inline styly v šabloně */
  --bg-dark: var(--bg);
  --bg-card: var(--surface-solid);
  --bg-card-hover: var(--surface-2);
  --border-color: var(--line);
  --border-highlight: var(--brand-line);
  --primary-green: var(--brand);
  --primary-glow: transparent;
  --gold: var(--warn);
  --gold-bright: #f6cf72;
  --silver: var(--platinum);
  --bronze: #c58a55;
  --text-white: var(--text);
  --text-muted: var(--text-2);
  --cyan: #7fc3e6;
  --nav-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  background-image: radial-gradient(900px 420px at 50% -160px, rgba(132, 204, 22, 0.09), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

:where(a, button, input, label, [onclick]):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button { font-family: inherit; touch-action: manipulation; }

/* -------- Horní lišta -------- */
.quest-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: rgba(7, 18, 11, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-col-left { display: flex; justify-content: flex-start; }
.nav-col-center { display: flex; justify-content: center; }
.nav-col-right { display: flex; justify-content: flex-end; }

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
 .back-home-btn:active { color: var(--text); background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .back-home-btn:hover { color: var(--text); background: var(--surface-2); } }
@media (max-width: 380px) { .back-home-btn span { display: none; } .back-home-btn { width: 40px; padding: 0; justify-content: center; } }

.quest-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); white-space: nowrap; }
.quest-brand img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); object-fit: cover; }
.quest-brand span { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.06em; color: var(--text); }
.quest-brand .year { color: var(--text-3); font-weight: 500; letter-spacing: 0; }

.nav-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--brand);
  white-space: nowrap;
}
.nav-live-indicator .pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: questLive 2.4s ease-in-out infinite;
}
@keyframes questLive { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* -------- Kontejner -------- */
.quest-container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* -------- Bleskové oznámení -------- */
.flash-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--warn-line);
  background: linear-gradient(var(--warn-soft), var(--warn-soft)), var(--surface-solid);
}
.flash-banner i { font-size: 18px; color: var(--warn); margin-top: 2px; }
.flash-text { flex: 1; font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.45; color: var(--text); }
.flash-text strong {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warn);
  margin-bottom: 4px;
}

/* -------- Karta týmu (skóre) -------- */
.team-badge-card {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.team-card-top { display: flex; align-items: center; gap: 14px; }
.team-avatar-box {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.team-meta { flex: 1; min-width: 0; }
.team-title { font-size: var(--fs-md); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-subline { font-size: var(--fs-xs); color: var(--text-2); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.16em;
  cursor: pointer;
  user-select: all;
}
.team-code-pill i { color: var(--text-3); letter-spacing: 0; font-size: 11px; }
.team-score-badge { text-align: right; flex-shrink: 0; }
.score-num {
  font-size: var(--fs-2xl);
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.score-lbl { font-size: var(--fs-2xs); font-weight: 500; letter-spacing: 0.1em; color: var(--text-3); margin-top: 6px; text-transform: uppercase; }
#team-rank-display { color: var(--brand); font-weight: 600; }

.tier-progress-section { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.tier-info-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: var(--fs-xs); }
.tier-current { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.tier-current strong { color: var(--text); font-weight: 600; }
.tier-next { color: var(--text-3); font-size: var(--fs-xs); text-align: right; }
.progress-bar-bg { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width 600ms var(--ease); }
.tier-reward-text { font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.tier-reward-text i { color: var(--warn); }

/* -------- Úvod pro hráče bez týmu -------- */
.guest-hero-card {
  border: 1px solid var(--brand-line);
  background: linear-gradient(var(--brand-soft), var(--brand-soft)), var(--surface-solid);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.guest-hero-title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--text); display: flex; align-items: flex-start; gap: 10px; }
.guest-hero-title i { font-size: 16px; margin-top: 4px; }
.guest-hero-subtitle { font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.5; color: var(--text-2); margin-top: 8px; max-width: 46ch; }
.guest-hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-sm-guest { padding: 0 14px !important; font-size: var(--fs-sm) !important; }

/* -------- Tlačítka -------- */
.btn-quest-primary, .btn-quest-secondary, .btn-tinder-action, .btn-tinder-skip, .task-action-btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn-quest-primary, .btn-tinder-action, .task-action-btn { background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); }
@media (hover: hover) and (pointer: fine) { .btn-quest-primary:hover,.btn-tinder-action:hover,.task-action-btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); transform: none; box-shadow: none; } }
.btn-quest-secondary, .btn-tinder-skip { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
@media (hover: hover) and (pointer: fine) { .btn-quest-secondary:hover,.btn-tinder-skip:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); transform: none; } }
.btn-quest-primary:active, .btn-quest-secondary:active, .btn-tinder-action:active, .btn-tinder-skip:active, .task-action-btn:active { transform: scale(0.98); }
.btn-quest-primary:disabled, .btn-tinder-action:disabled { opacity: 0.6; cursor: progress; }
.task-action-btn { width: 100%; }
.task-action-btn.btn-disabled { background: var(--surface-2); border-color: var(--line); color: var(--text-3); cursor: not-allowed; }

/* -------- Hlavní záložky (lepkavé pod lištou) -------- */
.tabs-row {
  position: sticky;
  top: calc(var(--nav-h) + env(safe-area-inset-top));
  z-index: 40;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(16, 33, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tab-btn {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .tab-btn:hover { color: var(--text); } }
.tab-btn.active { background: var(--brand); color: var(--brand-ink); border: 0; box-shadow: none; }

/* -------- Podzáložky výzev (podtržené – nižší úroveň) -------- */
.deck-mode-bar {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0 4px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.deck-mode-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 2px;
  margin-bottom: -1px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .deck-mode-btn:hover { color: var(--text); } }
.deck-mode-btn.active { color: var(--text); border-bottom-color: var(--brand); background: none; box-shadow: none; }
.deck-mode-btn.active i { color: var(--brand); }
.deck-mode-btn .badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--fs-2xs);
  font-weight: 600;
  text-align: center;
}
.deck-mode-btn.active .badge { background: var(--brand-soft); color: var(--brand); }

/* -------- Karta aktivní výzvy -------- */
.tinder-card-wrapper { display: flex; flex-direction: column; gap: 12px; width: 100%; }

.tinder-deck-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 20px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
  animation: questCardIn 320ms var(--ease) backwards;
  transition: transform 220ms var(--ease), opacity 220ms var(--ease);
}
.tinder-deck-card.is-flash { border-color: var(--warn-line); background: linear-gradient(var(--warn-soft), var(--warn-soft)), var(--surface-solid); box-shadow: var(--shadow-md); }
.tinder-deck-card.swipe-out { opacity: 0; transform: translateX(-32px) rotate(-3deg); }
@keyframes questCardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.tinder-card-header { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.tinder-card-header > div:first-child { flex-wrap: wrap; gap: 6px; }
.tinder-cat-badge {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--surface-3);
  padding: 4px 10px;
  border-radius: 999px;
}
.tinder-flash-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 0;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  padding: 3px 9px;
  border-radius: 999px;
}
.tinder-pts-badge, .tinder-deck-card.is-flash .tinder-pts-badge {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--brand);
  background: none;
  border: 0;
  padding: 0;
  font-variant-numeric: tabular-nums;
}
.tinder-deck-card.is-flash .tinder-pts-badge { color: var(--warn); }

/* Ikona typu výzvy: malá, v řádku se štítkem – žádná dlaždice nad nadpisem */
.tinder-icon-circle {
  display: none;
}
.tinder-type-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}
.tinder-deck-card.is-flash .tinder-type-label { color: var(--warn); }
.tinder-card-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
  text-wrap: balance;
}
.tinder-card-desc {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text-2);
  max-width: 46ch;
  margin: 0 0 16px;
}
.tinder-hint-box {
  width: 100%;
  margin: 0 0 8px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text);
  text-align: left;
  max-width: none;
}
.tinder-hint-box strong { color: var(--warn); font-family: var(--font-mono); font-weight: 600; margin-right: 4px; }
.btn-toggle-hint {
  min-height: 40px;
  margin-left: -8px;
  padding: 0 8px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .btn-toggle-hint:hover { color: var(--text); background: var(--surface-2); } }
.btn-toggle-hint i { color: var(--warn); }
.tinder-card-counter {
  width: 100%;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-3);
  letter-spacing: 0;
}
.tinder-card-counter strong { color: var(--text-2); font-weight: 600; }

.tinder-actions-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; width: 100%; }
.btn-tinder-action { font-size: var(--fs-md); min-height: 52px; }
.btn-tinder-skip { min-height: 52px; color: var(--text-2); }

/* Prázdný balíček */
.tinder-empty-state {
  width: 100%;
  padding: 40px 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.tinder-empty-state .empty-icon { font-size: 36px; margin-bottom: 4px; }
.tinder-empty-state h3 { font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.tinder-empty-state p { font-family: var(--font-sans); font-size: var(--fs-md); color: var(--text-2); line-height: 1.55; max-width: 36ch; }

/* -------- Historie splněných úkolů -------- */
.tasks-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-solid);
  transition: border-color var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .task-card:hover { border-color: var(--line-strong); background: var(--surface-solid); } }
.task-card.task-done { border-color: var(--line); background: var(--surface-solid); }
.task-card.task-pending { border-color: var(--warn-line); background: var(--surface-solid); }
.task-card.task-flash { border-color: var(--warn-line); box-shadow: none; }
.task-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-meta-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag-category, .tag-flash, .tag-status-done, .tag-status-pending {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.tag-category { background: var(--surface-3); color: var(--text-2); border: 0; }
.tag-flash, .tag-status-pending { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.tag-status-done { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line); }
.task-points-box {
  background: none; border: 0; padding: 0;
  color: var(--brand);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.task-body { display: flex; flex-direction: column; gap: 6px; }
.task-title { font-size: var(--fs-md); font-weight: 600; color: var(--text); line-height: 1.35; }
.task-desc { font-family: var(--font-sans); font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }
.task-hint-btn { align-self: flex-start; background: none; border: 0; color: var(--text-2); font-size: var(--fs-xs); min-height: 36px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .task-hint-btn:hover { color: var(--text); } }
.task-hint-text { font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text); background: var(--warn-soft); border: 1px solid var(--warn-line); padding: 10px 12px; border-radius: var(--r-md); margin-top: 4px; display: none; }
.task-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; margin-top: 2px; border-top: 1px solid var(--line); }
.task-footer > div { font-size: var(--fs-xs) !important; font-weight: 500 !important; }

/* -------- Žebříček -------- */
#view-leaderboard > div:first-child { flex-wrap: wrap; align-items: baseline !important; gap: 4px 12px; }
#view-leaderboard > div:first-child span { white-space: nowrap; }
#view-leaderboard > div:first-child h3 { font-size: var(--fs-md) !important; font-weight: 600 !important; }
#view-leaderboard > div:first-child span { font-size: var(--fs-xs) !important; color: var(--text-3) !important; }
@keyframes shimmerGold { from { opacity: 1; } to { opacity: 1; } }
@keyframes shimmerPlatinum { from { opacity: 1; } to { opacity: 1; } }
@keyframes shimmerBronze { from { opacity: 1; } to { opacity: 1; } }

.leaderboard-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.leaderboard-row td { background: var(--surface-solid); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background var(--t-fast) var(--ease); }
.leaderboard-row td:first-child { border-left: 1px solid var(--line); }
.leaderboard-row td:last-child { border-right: 1px solid var(--line); }
.leaderboard-row.rank-1-row, .leaderboard-row.rank-2-row, .leaderboard-row.rank-3-row {
  border: 0 !important; background: none !important; animation: none !important; box-shadow: none !important;
}
.leaderboard-row.my-team-row { border: 0 !important; box-shadow: none !important; }
.leaderboard-row.my-team-row td { background: linear-gradient(var(--brand-soft), var(--brand-soft)), var(--surface-solid); border-color: var(--brand-line); }

.leaderboard-cell { padding: 14px 12px; font-size: var(--fs-sm); vertical-align: middle; }
.leaderboard-cell.rank-col { width: 52px; text-align: center; border-top-left-radius: var(--r-md); border-bottom-left-radius: var(--r-md); padding-right: 0; }
.leaderboard-cell.score-col {
  border-top-right-radius: var(--r-md); border-bottom-right-radius: var(--r-md);
  text-align: right; white-space: nowrap;
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.leaderboard-cell.score-col strong { font-weight: 600; }
.rank-badge-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rank-badge-pill.rank-1 { background: var(--gold); color: #1a1405; }
.rank-badge-pill.rank-2 { background: var(--platinum); color: #10181a; }
.rank-badge-pill.rank-3 { background: #c58a55; color: #1b1008; }
.team-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.team-av { font-size: 16px; }
.team-title-txt { font-size: var(--fs-sm); color: var(--text); font-weight: 600; }
.my-team-pill {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
}
.team-tier-txt { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.pts-unit { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }

/* -------- Záložka Náš tým -------- */
#team-registered-block .team-badge-card > div:first-child { flex-wrap: wrap; margin-bottom: 16px !important; }
#team-registered-block .team-badge-card > div:first-child > div { flex: 1 1 220px; }
.onboarding-card {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 20px;
  text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  box-shadow: none;
}
.onboarding-icon {
  width: auto; height: auto;
  background: none; border: 0; border-radius: 0;
  font-size: 22px;
  color: var(--brand);
}
.onboarding-title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.onboarding-desc { font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.55; color: var(--text-2); max-width: 46ch; }
.onboarding-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: none; margin-top: 8px; }

.btn-member-action {
  min-width: 36px; min-height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-xs);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .btn-member-action:hover { background: var(--surface-3); color: var(--text); } }
@media (hover: hover) and (pointer: fine) { .btn-member-remove:hover { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); } }

/* -------- Modální okna (mobil: spodní list) -------- */
.quest-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(4, 10, 6, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: questFade 200ms var(--ease);
}
@keyframes questFade { from { opacity: 0; } to { opacity: 1; } }
.quest-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  animation: questSheetIn 260ms var(--ease);
}
.quest-modal::before {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  width: 36px; height: 4px;
  margin-left: -18px;
  border-radius: 999px;
  background: var(--line-strong);
}
@keyframes questSheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .quest-modal-backdrop { align-items: center; padding: 24px; }
  .quest-modal { border-bottom: 1px solid var(--line-strong); border-radius: var(--r-xl); padding-bottom: 24px; }
  .quest-modal::before { display: none; }
}
.modal-close-btn {
  position: absolute;
  top: 12px; right: 12px;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  font-size: 24px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .modal-close-btn:hover { background: var(--surface-2); color: var(--text); } }
.modal-header h3 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; color: var(--text); padding-right: 44px; line-height: 1.3; }
.modal-header p { font-family: var(--font-sans); font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); margin-top: 6px; }
.modal-header .tag-category { margin-bottom: 4px; }

/* -------- Formuláře -------- */
.form-group { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.form-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.01em; text-transform: none; color: var(--text-2); }
.form-input {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-input-code { text-align: center; font-size: var(--fs-xl); font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; }

.avatar-picker { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; margin: 0; }
.avatar-opt {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .avatar-opt:hover { border-color: var(--text-3); } }
.avatar-opt.selected { border: 2px solid var(--brand); background: var(--brand-soft); transform: none; }

.photo-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-bottom: 4px; }
.btn-photo-pick {
  min-height: 96px;
  padding: 14px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.btn-photo-pick i { font-size: 22px; color: var(--brand); }
.btn-photo-pick span + span { font-family: var(--font-sans); color: var(--text-2); opacity: 1 !important; font-size: var(--fs-2xs) !important; font-weight: 400; }
 .btn-photo-pick:active { border-color: var(--brand-line); background: var(--surface-3); transform: none; }
@media (hover: hover) and (pointer: fine) { .btn-photo-pick:hover { border-color: var(--brand-line); background: var(--surface-3); transform: none; } }

.photo-upload-box { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 24px 16px; background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .photo-upload-box:hover { border-color: var(--brand-line); background: var(--surface-3); } }
.photo-upload-box i { color: var(--brand); }
.photo-preview-box { position: relative; width: 100%; border-radius: var(--r-md); overflow: hidden; max-height: 320px; }
.photo-preview-box img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-md); }
.photo-preview-box .remove-photo-btn {
  position: absolute; top: 8px; right: 8px;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgba(7, 18, 11, 0.8);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.quiz-options-list { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .quiz-opt-item:hover { border-color: var(--text-3); background: var(--surface-2); } }
.quiz-opt-item.selected { border: 2px solid var(--brand); padding: 11px 13px; background: var(--brand-soft); font-weight: 400; }
.quiz-opt-radio { accent-color: var(--brand); width: 18px; height: 18px; flex-shrink: 0; }

/* -------- Toasty -------- */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 200;
  width: calc(100% - 32px);
  max-width: 440px;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  animation: questToastIn 240ms var(--ease);
  pointer-events: auto;
}
.toast.toast-error { border-color: var(--danger-line); }
@keyframes questToastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 380px) {
  .guest-hero-actions, .onboarding-actions { grid-template-columns: 1fr; }
  .tinder-card-title { font-size: 21px; }
}

/* ====================================================================
   4.1 – audit: dotykové cíle, typ výzvy v metadatech, klidný stav „živě“
   ==================================================================== */
.back-home-btn { min-height: 44px; }
@media (max-width: 380px) { .back-home-btn { width: 44px; } }
.quest-brand { min-height: 44px; }
.btn-toggle-hint { min-height: 44px; }
.nav-live-indicator .pulse-dot { animation: none; }

.tinder-card-header { align-items: flex-start; }
.tinder-card-header .tinder-type-label {
  margin: 0 8px 0 0;
  padding: 4px 0;
  font-size: var(--fs-2xs);
  gap: 6px;
}
.tinder-card-header > div:first-child { gap: 8px; }

/* ====================================================================
   5.0 – víc života: světlo karet, kovové pořadí, barvy typů výzev
   ==================================================================== */
:root { --ease-out-expo: cubic-bezier(0.2, 0.9, 0.25, 1); }
.team-badge-card, .guest-hero-card, .onboarding-card {
  background: linear-gradient(180deg, rgba(30, 58, 36, 0.95), rgba(13, 29, 19, 0.96) 70%);
  border-color: rgba(155, 216, 67, 0.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 18px 34px -20px rgba(0, 0, 0, 0.8);
}
.score-num { color: var(--sec-green); font-weight: 600; }
.progress-bar-fill { background: linear-gradient(90deg, var(--sec-green), #c6ef8a); }

.tinder-deck-card {
  background: linear-gradient(180deg, #1c3a25, #0e2015 75%);
  border: 1px solid rgba(155, 216, 67, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 26px 50px -26px rgba(0, 0, 0, 0.9);
  animation: questCardIn 460ms var(--ease-out-expo) backwards;
}
.tinder-deck-card.is-flash {
  background: linear-gradient(180deg, #3a2f12, #17140a 75%);
  border-color: rgba(242, 189, 79, 0.65);
}
@keyframes questCardIn { from { opacity: 0; transform: translateY(18px) rotate(-1.2deg) scale(0.98); } to { opacity: 1; transform: none; } }
.tinder-pts-badge { padding: 4px 12px; border-radius: 999px; background: rgba(155, 216, 67, 0.16); border: 1px solid rgba(155, 216, 67, 0.45); color: var(--sec-green); font-size: 15px; }
.tinder-deck-card.is-flash .tinder-pts-badge { background: rgba(242, 189, 79, 0.16); border-color: rgba(242, 189, 79, 0.6); color: var(--sec-gold); }
.tinder-card-header .tinder-type-label { color: var(--sec-green); }
.btn-tinder-action { box-shadow: 0 14px 26px -14px rgba(155, 216, 67, 0.9); }
@media (hover: hover) and (pointer: fine) { .btn-tinder-action:hover { transform: translateY(-1px); } }
.tab-btn { transition: background 220ms var(--ease), color 220ms var(--ease), transform 160ms var(--ease-out-expo); }
.tab-btn:active { transform: scale(0.96); }

.leaderboard-row.rank-1-row td { background: linear-gradient(110deg, rgba(242, 189, 79, 0.2), rgba(242, 189, 79, 0.05)), var(--surface-solid); border-color: rgba(242, 189, 79, 0.6); }
.leaderboard-row.rank-2-row td { background: linear-gradient(110deg, rgba(215, 223, 228, 0.15), rgba(215, 223, 228, 0.03)), var(--surface-solid); border-color: rgba(215, 223, 228, 0.5); }
.leaderboard-row.rank-3-row td { background: linear-gradient(110deg, rgba(214, 145, 88, 0.18), rgba(214, 145, 88, 0.04)), var(--surface-solid); border-color: rgba(214, 145, 88, 0.55); }
.leaderboard-row.my-team-row td { box-shadow: inset 0 0 0 9999px rgba(155, 216, 67, 0.06); }
.leaderboard-cell.score-col { color: var(--sec-green); }
.tinder-pts-badge { white-space: nowrap; flex-shrink: 0; }

/* ====================================================================
   5.1 – opravy: logo bez rámečku, čitelný žebříček, počítadlo výměn
   ==================================================================== */
/* Logo se nikdy neořezává ani nerámuje */
.quest-brand img { width: auto; height: 36px; border: 0; border-radius: 0; object-fit: contain; }

/* Žebříček: kovové pořadí jen u prvních tří, vlastní tým jen štítkem a zeleným jménem */
.leaderboard-row.my-team-row td { box-shadow: none; background: var(--surface-solid); border-color: var(--line); }
.leaderboard-row.my-team-row.rank-1-row td { background: linear-gradient(110deg, rgba(242, 189, 79, 0.2), rgba(242, 189, 79, 0.05)), var(--surface-solid); border-color: rgba(242, 189, 79, 0.6); }
.leaderboard-row.my-team-row.rank-2-row td { background: linear-gradient(110deg, rgba(215, 223, 228, 0.15), rgba(215, 223, 228, 0.03)), var(--surface-solid); border-color: rgba(215, 223, 228, 0.5); }
.leaderboard-row.my-team-row.rank-3-row td { background: linear-gradient(110deg, rgba(214, 145, 88, 0.18), rgba(214, 145, 88, 0.04)), var(--surface-solid); border-color: rgba(214, 145, 88, 0.55); }
.leaderboard-row.my-team-row .team-title-txt { color: var(--sec-green); }
.leaderboard-cell.score-col { color: var(--text); }

/* Výměna výzvy: zbývající počet přímo na tlačítku */
.btn-tinder-skip .skip-count {
  min-width: 34px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(155, 216, 67, 0.16);
  color: var(--sec-green);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.btn-tinder-skip.is-spent { opacity: 0.55; }
.btn-tinder-skip.is-spent .skip-count { background: rgba(244, 124, 116, 0.16); color: var(--sec-red); }
.tinder-actions-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.btn-tinder-skip, .btn-tinder-action { padding: 0 12px; font-size: 13px; }

/* Nesplněný kvíz (jeden pokus) */
.task-card.task-failed { border-color: rgba(244, 124, 116, 0.45); }
.tag-status-failed { background: rgba(244, 124, 116, 0.14); color: var(--sec-red); border: 1px solid rgba(244, 124, 116, 0.45); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.task-card.task-failed .task-points-box { color: var(--text-3); text-decoration: line-through; }

/* Skener QR kódu stanoviště */
.qr-scan-btn { width: 100%; }
.qr-or { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; color: var(--text-3); font-size: var(--fs-xs); }
.qr-or::before, .qr-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.qr-scanner { position: fixed; inset: 0; z-index: 400; display: none; background: #000; }
.qr-scanner.is-open { display: block; }
.qr-scanner-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qr-scanner-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.qr-scanner-frame span {
  width: min(68vw, 300px); aspect-ratio: 1;
  border-radius: 24px;
  border: 3px solid var(--sec-green);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
}
.qr-scanner-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 16px max(20px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; align-items: stretch;
  background: linear-gradient(transparent, rgba(7, 18, 11, 0.95) 35%);
}
.qr-scanner-text { margin: 0; text-align: center; font-family: var(--font-sans); font-size: var(--fs-md); color: var(--text); }

/* Žabí hodnosti */
.tier-help-btn {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; margin: 2px 0 -6px -8px; padding: 0 8px;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--sec-green); font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .tier-help-btn:hover { background: rgba(155, 216, 67, 0.1); } }
.tier-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tier-step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.tier-step.is-done { opacity: 0.65; }
.tier-step.is-current { border-color: var(--sec-green); background: linear-gradient(110deg, rgba(155, 216, 67, 0.16), rgba(155, 216, 67, 0.03)), var(--surface-2); }
.tier-step-badge { font-size: 24px; flex-shrink: 0; width: 32px; text-align: center; }
.tier-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tier-step-body strong { font-size: var(--fs-md); }
.tier-step-body span { font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text-2); line-height: 1.4; }
.tier-step-pts { flex-shrink: 0; font-size: var(--fs-xs); font-weight: 700; color: var(--sec-green); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tier-step.is-current .tier-step-pts::after { content: " · vy"; color: var(--text-2); font-weight: 500; }

/* Mobilní zpřesnění Questu */
body { min-height: 100vh; min-height: 100dvh; }
.deck-mode-btn:active, .nav-tab:active, .quest-nav-btn:active, .tier-help-btn:active { transform: scale(0.97); }
.deck-mode-btn, .tier-help-btn { transition: transform 120ms var(--ease-out-expo), color 160ms var(--ease), border-color 160ms var(--ease); }
.quest-fade, .quest-modal-overlay { overscroll-behavior: contain; }

/* Nejhorší data: dlouhý název týmu se zalomí na dva řádky místo oříznutí bez možnosti přečíst celé jméno */
.team-title {
  white-space: normal; overflow: hidden; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  line-height: 1.25;
}

/* Žebříček: avatar zůstává vedle jména i při dlouhém názvu týmu */
.team-name-row { flex-wrap: nowrap; align-items: flex-start; }
.team-name-row .team-av { flex-shrink: 0; }
.team-name-row .team-title-txt { min-width: 0; overflow-wrap: break-word; }
.team-name-row .my-team-pill { flex-shrink: 0; white-space: nowrap; }
