/* ==========================================================
   SkvěléČesko – Akční vánoční kalendář
   Barvy převzaté z core.css skvelecesko.cz
   ========================================================== */
:root {
  --purple: #543178;
  --purple-dark: #1f0935;
  --purple-deep: #2d1748;
  --green: #24ce7b;
  --coral: #ff5859;
  --cream: #fff7ec;
  --gold: #ffd166;
  --grey: #718191;
  --white: #fff;
  --radius: 18px;
  --font: "Nunito", "Museo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

html { background: var(--purple-dark); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--white);
  background: radial-gradient(ellipse 120% 70% at 50% 0%, var(--purple) 0%, var(--purple-deep) 45%, var(--purple-dark) 100%) no-repeat;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--green); }

/* ---------- Sníh ---------- */
.snow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.snow i {
  position: absolute; top: -10px;
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  opacity: var(--o);
  animation: fall var(--d) linear infinite;
  animation-delay: var(--dl);
  left: var(--x);
}
@keyframes fall {
  to { transform: translate3d(var(--drift), 105vh, 0); }
}

/* ---------- Hlavička ---------- */
.hero {
  position: relative; z-index: 1;
  text-align: center;
  padding: 28px 20px 12px;
  max-width: 760px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--white);
  font-weight: 700; font-size: 1.05rem; letter-spacing: .2px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--green); color: var(--purple-dark);
  display: grid; place-items: center;
  font-weight: 900; font-size: 1.2rem;
  transform: rotate(-6deg);
}
.brand-name b { color: var(--green); }

.hero-title {
  margin: 22px 0 10px;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.5px;
}
.hero-kicker {
  display: inline-block;
  background: var(--coral); color: var(--white);
  font-size: .38em; padding: 6px 14px; border-radius: 999px;
  transform: rotate(-3deg) translateY(-6px);
  letter-spacing: 1px; text-transform: uppercase;
  box-shadow: 0 6px 0 rgba(0,0,0,.18);
  margin-bottom: 6px;
}
.hero-lead {
  margin: 0 auto; max-width: 560px;
  font-size: 1.05rem; line-height: 1.55;
  color: rgba(255,255,255,.85);
}

.progress {
  display: flex; align-items: center; gap: 14px; justify-content: center;
  margin: 22px auto 0; max-width: 420px;
}
.progress-bar {
  flex: 1; height: 12px; border-radius: 999px;
  background: rgba(255,255,255,.15); overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 999px;
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.progress-text { font-weight: 700; font-size: .95rem; white-space: nowrap; }

/* ---------- Kalendář ---------- */
.calendar {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  max-width: 960px;
  margin: 28px auto 40px;
  padding: 0 20px;
  perspective: 1200px;
}
@media (max-width: 860px) { .calendar { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .calendar { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 12px; } }

.window {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  cursor: pointer;
  transform-style: preserve-3d;
  background: none; border: 0; padding: 0;
  font: inherit; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.window:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

/* Vnitřek okénka (za dvířky) */
.window-inner {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: var(--cream);
  display: grid; place-items: center;
  font-size: 2.2rem;
  box-shadow: inset 0 0 0 4px rgba(84,49,120,.15), inset 0 10px 30px rgba(0,0,0,.12);
  color: var(--purple);
}
.window-inner small {
  position: absolute; bottom: 8px; left: 0; right: 0;
  font-size: .68rem; font-weight: 900; letter-spacing: .5px;
  text-transform: uppercase; color: var(--purple);
}
.window.done .window-inner { background: var(--green); color: var(--purple-dark); }
.window.done .window-inner small { color: var(--purple-dark); }

/* Dvířka */
.window-door {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  transform-origin: left center;
  transition: transform .8s cubic-bezier(.4,.05,.2,1.1), box-shadow .3s;
  backface-visibility: hidden;
  display: grid; place-items: center;
  background: var(--door-bg, var(--coral));
  box-shadow: 0 8px 0 rgba(0,0,0,.18), 0 12px 24px rgba(0,0,0,.25);
  border: 3px solid rgba(255,255,255,.22);
}
.window-door::before {
  /* lesk */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.28), transparent 45%, rgba(0,0,0,.08));
  pointer-events: none;
}
.window-door::after {
  /* klička */
  content: ""; position: absolute; right: 12%; top: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.7); transform: translateY(-50%);
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.window-num {
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  font-weight: 900;
  color: var(--white);
  text-shadow: 0 3px 0 rgba(0,0,0,.2);
  transform: rotate(var(--tilt, 0deg));
}
.window-deco {
  position: absolute; top: 10px; left: 12px;
  font-size: 1.1rem; opacity: .9;
}

/* Barevné varianty dvířek */
.window:nth-child(4n+1) .window-door { --door-bg: var(--coral); }
.window:nth-child(4n+2) .window-door { --door-bg: var(--green); }
.window:nth-child(4n+3) .window-door { --door-bg: #7a4fb3; }
.window:nth-child(4n+4) .window-door { --door-bg: var(--gold); }
.window:nth-child(4n+4) .window-num,
.window:nth-child(4n+2) .window-num { color: var(--purple-dark); text-shadow: 0 3px 0 rgba(255,255,255,.25); }

/* Stavy */
.window.available:hover .window-door { transform: rotateY(-18deg); }
.window.open .window-door { transform: rotateY(-125deg); box-shadow: -4px 8px 20px rgba(0,0,0,.35); }

.window.locked { cursor: not-allowed; }
.window.locked .window-door { filter: saturate(.35) brightness(.7); }
.window.locked .window-num { opacity: .7; }
.window.locked .window-door::after { display: none; }
.window-lock {
  position: absolute; right: 10px; bottom: 10px;
  font-size: .95rem; opacity: .9;
}
.window.today .window-door { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 0 rgba(0,0,0,.18), 0 12px 24px rgba(0,0,0,.25), 0 0 0 0 rgba(255,209,102,.7); }
  50% { box-shadow: 0 8px 0 rgba(0,0,0,.18), 0 12px 24px rgba(0,0,0,.25), 0 0 0 14px rgba(255,209,102,0); }
}
.window.shake { animation: shake .45s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px) rotate(-1.5deg); }
  40%, 80% { transform: translateX(7px) rotate(1.5deg); }
}

/* ---------- Patička ---------- */
.foot {
  position: relative; z-index: 1;
  text-align: center; padding: 10px 20px 40px;
  color: rgba(255,255,255,.6); font-size: .9rem;
}
.foot-hint { color: var(--gold); font-weight: 700; }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(31,9,53,.72);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadein .25s;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  position: relative;
  width: min(520px, 100%);
  background: var(--white); color: var(--purple-dark);
  border-radius: 26px;
  padding: 44px 30px 30px;
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
  animation: pop .45s cubic-bezier(.2,1.3,.4,1);
}
#modal-body { max-height: calc(100vh - 140px); overflow-y: auto; }
@keyframes pop { from { transform: scale(.7) translateY(30px); opacity: 0; } }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: #f2eef7; color: var(--purple); font-size: 1.5rem; line-height: 1;
  cursor: pointer; font-family: inherit;
}
.modal-close:hover { background: #e6dff0; }
.modal-day {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%) rotate(-4deg);
  background: var(--coral); color: var(--white);
  font-weight: 900; font-size: 1.3rem;
  padding: 8px 20px; border-radius: 999px;
  box-shadow: 0 6px 0 rgba(0,0,0,.15);
}
.modal h2 {
  margin: 0 0 6px; font-size: 1.5rem; line-height: 1.2; font-weight: 900; color: var(--purple);
}
.modal p { margin: 0 0 16px; line-height: 1.5; color: #4a3a5e; }
.modal .muted { color: var(--grey); font-size: .9rem; }

.quiz-q { font-size: 1.2rem; font-weight: 700; margin: 0 0 16px; color: var(--purple-dark); }
.quiz-options { display: grid; gap: 10px; margin-bottom: 8px; }
.quiz-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 14px;
  border: 2px solid #e6dff0; background: #faf8fd;
  font: inherit; font-weight: 700; font-size: 1rem; color: var(--purple-dark);
  cursor: pointer; transition: transform .15s, border-color .15s, background .15s;
}
.quiz-opt b {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--purple); color: var(--white); font-size: .9rem;
}
.quiz-opt:hover { transform: translateX(4px); border-color: var(--purple); }
.quiz-opt.wrong { border-color: var(--coral); background: #fff0f0; animation: shake .4s; }
.quiz-opt.right { border-color: var(--green); background: #e8fbf1; }
.quiz-opt.right b { background: var(--green); color: var(--purple-dark); }
.quiz-opt:disabled { cursor: default; opacity: .75; }
.quiz-feedback { min-height: 22px; font-weight: 700; color: var(--coral); }

.win-banner {
  background: linear-gradient(135deg, var(--green), #8ff0bf);
  color: var(--purple-dark);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 16px;
  font-weight: 700; display: flex; gap: 12px; align-items: flex-start;
}
.win-banner span { font-size: 1.6rem; line-height: 1; }
.win-banner p { margin: 0; color: var(--purple-dark); font-weight: 400; }

.email-form { display: flex; gap: 8px; flex-wrap: wrap; }
.email-form input {
  flex: 1 1 200px; min-width: 0;
  padding: 14px 16px; border-radius: 14px;
  border: 2px solid #e6dff0; font: inherit; font-size: 1rem;
  outline: none;
}
.email-form input:focus { border-color: var(--purple); }
.btn {
  padding: 14px 22px; border-radius: 14px; border: 0;
  background: var(--purple); color: var(--white);
  font: inherit; font-weight: 900; font-size: 1rem; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,.18);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(0,0,0,.18); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn-green { background: var(--green); color: var(--purple-dark); }
.btn-block { width: 100%; }
.consent { font-size: .8rem; color: var(--grey); margin: 10px 0 0; }
.consent a { color: var(--purple); }

.done-box { text-align: center; padding: 10px 0 0; }
.done-box .big { font-size: 3.5rem; line-height: 1; margin-bottom: 6px; }

/* ---------- Konfety ---------- */
.confetti {
  position: fixed; top: -12px; width: 10px; height: 14px; z-index: 60;
  pointer-events: none;
  animation: confetti-fall var(--d) ease-in forwards;
  left: var(--x); background: var(--c);
  border-radius: 2px;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(var(--r)); opacity: .9; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--purple-dark); color: var(--white);
  padding: 12px 20px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 70;
  animation: toastin .3s cubic-bezier(.2,1.3,.4,1);
  max-width: calc(100% - 40px); text-align: center;
}
@keyframes toastin { from { transform: translate(-50%, 30px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .snow { display: none; }
}
