:root {
  --ink: #2b2724;
  --muted: #7c726b;
  --accent: #c25b54;
  --accent-strong: #a84840;
  --line: rgba(43, 39, 36, 0.12);
  --card: #fffdfb;
  --bg1: #f6ece4;
  --bg2: #ecd7cb;
}

/* Barvy pozadí jako animovatelné proměnné → plynulý přechod z tepla do chladu. */
@property --bg1 {
  syntax: '<color>';
  inherits: true;
  initial-value: #f6ece4;
}
@property --bg2 {
  syntax: '<color>';
  inherits: true;
  initial-value: #ecd7cb;
}
/* Barva podpisu v patičce se mění s náladou, ať je čitelný i na tmavém pozadí. */
@property --foot {
  syntax: '<color>';
  inherits: true;
  initial-value: #7a6e66;
}
html {
  transition: --bg1 0.8s ease, --bg2 0.8s ease, --foot 0.8s ease;
}

* { box-sizing: border-box; }

/* Atribut hidden musí skrýt i prvky s vlastním display (např. .field{display:flex}). */
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Plovoucí emoji na pozadí – decentní a sporé */
.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.hearts span {
  position: absolute;
  bottom: -40px;
  opacity: 0.4;
  filter: saturate(0.85);
  animation: drift linear infinite;
  will-change: transform, opacity;
}
@keyframes drift {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  12%  { opacity: 0.42; }
  88%  { opacity: 0.42; }
  100% { transform: translateY(-112vh) translateX(16px); opacity: 0; }
}

.card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 48px 44px;
  box-shadow: 0 30px 60px -28px rgba(43, 39, 36, 0.3);
  text-align: center;
}

.screen { display: none; }
.screen.active { display: block; animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.kicker {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.question {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ink);
}

.hint {
  margin: 0 auto 28px;
  max-width: 42ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  min-height: 1.55em;
}
.hint.shake { animation: nudge 0.4s ease; color: var(--accent); }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.buttons { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }

.btn {
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  padding: 13px 28px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }

.btn-yes {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(43, 39, 36, 0.12);
}
.btn-yes:hover { background: var(--accent-strong); }

.btn-no {
  background: #efe5dd;
  color: var(--ink);
  border-color: rgba(43, 39, 36, 0.16);
}
.btn-no:hover { background: #e7dad0; border-color: rgba(43, 39, 36, 0.3); }
.btn-no.runaway {
  position: fixed; z-index: 40; margin: 0;
  transition: left 0.16s ease-out, top 0.16s ease-out, font-size 0.18s ease,
    background 0.18s ease, border-color 0.18s ease;
}

.btn-block { width: 100%; margin-top: 6px; }

/* Formulář */
.form { display: flex; flex-direction: column; gap: 16px; text-align: left; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.field small { color: var(--muted); opacity: 0.7; font-weight: 400; }
.field input {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field input::placeholder { color: #b8ada6; }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 91, 84, 0.14);
}

/* Výběr termínů */
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.slot:hover { border-color: var(--muted); }
.slot.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.slot-custom { color: var(--muted); }
.slot-custom.selected { color: #fff; }

/* Povinné zaškrtnutí – Akala */
.check {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; padding: 2px 0; margin-top: 2px;
}
.check input {
  width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto;
  accent-color: var(--accent); cursor: pointer;
}
.check span { font-size: 14px; line-height: 1.45; color: var(--ink); }
.check strong { font-weight: 600; }
.check small { color: var(--muted); }
.check.invalid span { color: var(--accent-strong); }

.error { color: var(--accent-strong); font-size: 14px; margin: 2px 0 0; }

.badge {
  width: 56px; height: 56px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(194, 91, 84, 0.12);
  color: var(--accent);
  font-size: 26px; font-weight: 600;
}
.big-when { font-size: 17px; color: var(--ink); font-weight: 500; }

.foot {
  position: relative; z-index: 1;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  color: var(--foot);
}
/* krátká linka nad podpisem */
.foot-rule {
  width: 44px; height: 1px;
  background: currentColor;
  opacity: 0.35;
}
.foot-text {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.01em;
}

/* Popup „Fakt vážně?" – záměrně ujetý gif v kultivovaném rámu */
.popup-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 26, 24, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade 0.25s ease;
}
.popup-overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.popup {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 20px 22px;
  width: min(360px, 100%);
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.5);
  animation: rise 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.popup-gif-wrap {
  width: 100%; height: 170px;
  border-radius: 12px; overflow: hidden;
  background: #f0e6df;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.popup-gif { width: 100%; height: 100%; object-fit: cover; }
.popup-gif-fallback {
  display: none;
  font-size: 76px; line-height: 1;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.popup-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-size: 22px;
  margin: 0 0 8px; color: var(--ink);
}
.popup-text { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.5; }

@media (max-width: 480px) {
  .card { padding: 36px 24px; }
  .popup-gif-wrap { height: 150px; }
}

/* Ohleduplnost k pohybu */
@media (prefers-reduced-motion: reduce) {
  .hearts span { animation: none; opacity: 0.25; }
  .screen.active, .popup, .popup-overlay { animation: none; }
  html { transition: none; }
  .hint.shake { animation: none; }
}
