:root {
  --bg: #0D0D0F;
  --surface: #151519;
  --surface-hover: #1A1A20;
  --border: #23232B;
  --border-light: #32323D;

  --yellow: #FFC800;
  --text: #F4F4F6;
  --text-muted: #8A8A96;
  --text-dim: #50505A;

  --green: #22C55E;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #EF4444;
  --red-bg: rgba(239, 68, 68, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 3.5rem;
  line-height: 1.5;
}

.app-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.logo {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.95rem;
  font-weight: 600;
  color: #FFF;
  letter-spacing: -0.5px;
}

.logo-mark {
  color: var(--yellow);
  margin-left: 1px;
}

.puzzle-id {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.streak-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: border-color 0.15s;
}

.streak-btn:hover { border-color: var(--border-light); }

/* TASK BAR: Protilehlé strany */
.task-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.task-side {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.task-sub {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.task-val {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--yellow);
}

.points-side {
  position: relative;
}

.points-val {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
/* ÚVODNÍ KARTA (ČISTÝ, NEARKÁDOVÝ MINIMALISMUS) */
.welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.35rem;
  animation: slideDown 0.2s ease-out;
}

.welcome-logo {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 600;
  color: #FFF;
  letter-spacing: -0.5px;
  line-height: 1;
}

.welcome-challenge {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: 0.2px;
}

/* 2. ÚPRAVA: BODOVÁNÍ JE JEŠTĚ DECENATNĚJŠÍ, BODY ZMENŠENY */
.welcome-scoring {
  width: 100%;
  max-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

.score-row b {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem; /* zmenšeno, aby netrčelo */
  font-weight: 700;
  color: var(--text-dim);
}

.score-row.best {
  color: var(--text);
}
.score-row.best b {
  color: var(--yellow);
  font-weight: 800;
}

/* 3. ÚPRAVA: TLAČÍTKO BEZ KŘIKLAVÉHO GLOW, POUZE ČISTÝ TAH */
.btn-start {
  width: 75%;
  max-width: 230px;
  background: var(--yellow);
  color: #000;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  /* Decentní stín namísto zářícího neónu */
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  margin-top: 0.35rem;
}

.btn-start:hover {
  transform: translateY(-2px);
  background-color: #ffd01a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.btn-start:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* 1. a 4. ÚPRAVA: ČÍSLO EDICE MÁ VĚTŠÍ ODSTUP A JE VELMI NENÁPADNÉ */
.welcome-edition {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-top: 0.75rem; /* dostatek prostoru pod tlačítkem */
  opacity: 0.7;
}

/* INDÍCIE A JEJICH POSTUPNÉ ROZBALOVÁNÍ */
.clues-stream {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.clue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.clue-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.clue-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.clue-pts {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--yellow);
}

.clue-text {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text);
}

/* OBRÁZKY V INDICIÍCH */
.clue-image-wrap {
  width: 100%;
  max-height: 280px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.clue-img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

/* ODKRÝVÁNÍ DALŠÍ INDICIE */
.reveal-wrapper {
  margin-top: 0.75rem;
}

.btn-reveal-next {
  width: 100%;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reveal-next:hover {
  background: var(--surface-hover);
  color: #FFF;
  border-color: var(--border-light);
}

/* HÁDACÍ FORMULÁŘ */
.action-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.input-wrap {
  display: flex;
  gap: 0.5rem;
}

input[type="text"] {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus {
  border-color: var(--yellow);
}

.btn-submit {
  background: var(--yellow);
  color: #000;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 0 1.35rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-submit:hover { opacity: 0.9; }

.action-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 0.25rem;
}

.feedback {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red);
}

.btn-give-up {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-give-up:hover {
  background: var(--surface-hover);
  color: var(--text-muted);
  border-color: var(--border-light);
}

.btn-give-up:active {
  transform: scale(0.98);
}

/* VÝSLEDKOVÁ KARTA – DRAMATICKÝ „AHA!“ OKAMŽIK */
.result-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  flex-direction: column;
  gap: 1.5rem;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.result-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.result-state-text {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  margin-bottom: 1.15rem;
}

/* PORTRÉT / FOTKA NA VÝSLEDKOVÉ KARTĚ */
/* OBRÁZEK NA VÝSLEDKOVÉ KARTĚ (ZACHOVÁVÁ PŮVODNÍ POMĚR STRAN) */
.result-hero-img {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: block;
}
/* STAVY: VÝHRA VS PROHRA */
.result-hero.won .result-icon-badge {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green);
}
.result-hero.won .result-state-text { color: var(--green); }

.result-hero.lost .result-icon-badge {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red);
}
.result-hero.lost .result-state-text { color: var(--red); }

/* TYPOGRAFIE ROZLUŠTĚNÉHO OBJEKTU */
.result-entity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.entity-author {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-muted);
}

.entity-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: #FFF;
  line-height: 1.15;
}

.entity-meta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ČÍSLOVANÁ FAKTA V KROUŽCÍCH */
.facts-heading {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.facts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fact-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  font-size: 0.88rem;
  color: #D6D6DC;
  line-height: 1.55;
}

.fact-badge {
  background: var(--bg);
  border: 1px solid rgba(255, 200, 0, 0.4); /* decentní žluté orámování */
  color: var(--yellow);                      /* žlutá číslice pro čisté propojení */
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* GLOBÁLNÍ STATISTIKY */
.stats-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.stat-highlight {
  color: var(--yellow);
  font-size: 1rem;
  font-weight: 800;
}

.bars-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.bar-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bar-line span:first-child { width: 65px; color: var(--text-muted); }

.bar-bg {
  flex: 1;
  background: var(--surface);
  height: 6px;
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  background: var(--yellow);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}

.bar-line.fail .bar-fill { background: var(--red); }
.bar-num { width: 30px; text-align: right; color: var(--text); }

.stats-footer {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  text-align: right;
}

/* SDÍLECÍ TLAČÍTKO */
.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: #FFF;
  color: #000;
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-share:hover { opacity: 0.9; }

/* MODÁL PRO STREAK */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 100;
}

.modal-overlay.open { display: flex; }

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: popIn 0.2s ease-out;
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-top h3 { font-size: 1rem; font-weight: 800; color: #FFF; }

.btn-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-streak-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
}

.streak-big-fire { font-size: 2.2rem; }
.streak-big-number { font-size: 2.5rem; font-weight: 800; color: var(--yellow); }
.streak-big-label { font-size: 0.85rem; color: var(--text-muted); }

.modal-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  text-align: center;
}

.mstat-item {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.75rem 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mstat-val { font-size: 1.15rem; font-weight: 800; color: #FFF; }
.mstat-lbl { font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; font-weight: 700; }

/* Jemný otřes při špatném tipu */
@keyframes microShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.input-wrap.shake {
  animation: microShake 0.28s ease-in-out;
}

/* Odletující body (+3 / +2 / +1) */
@keyframes floatScoreUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translateY(-4px) scale(1.1);
  }
  80% {
    opacity: 1;
    transform: translateY(-16px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-24px) scale(0.9);
  }
}

.score-floater {
  position: absolute;
  right: 0;
  top: -4px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--yellow);
  pointer-events: none;
  animation: floatScoreUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
