/* zyczenia.podreka.com — kartki: święta, urodziny, imieniny, Dzień Babci i Dziadka.
   Duże litery i przyciski, żeby wygodnie czytały też starsze osoby. */
:root {
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "DejaVu Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
body.t-swieta {
  --bg1: #0e2a2b; --bg2: #123d34; --bg3: #1b2340;
  --ink: #f6f1e7; --accent: #e8b04a; --accent-hover: #f5c66b; --accent-ink: #1d1a10; --soft: #4d6f62;
  --card: rgba(9, 28, 30, 0.66); --card-line: rgba(232, 176, 74, 0.3); --btn-bg: rgba(255, 255, 255, 0.04); --glow: rgba(232, 176, 74, 0.3);
}
body.t-urodziny {
  --bg1: #fff0f6; --bg2: #fff5d6; --bg3: #e3f2ff;
  --ink: #3b1f4a; --accent: #8b3fd9; --accent-hover: #7432bb; --accent-ink: #fff; --soft: #d3b8f2;
  --card: rgba(255, 255, 255, 0.7); --card-line: rgba(255, 255, 255, 0.95); --btn-bg: #fff; --glow: rgba(139, 63, 217, 0.25);
}
body.t-imieniny {
  --bg1: #f6efff; --bg2: #ffe9f3; --bg3: #eaf6ff;
  --ink: #3d2457; --accent: #b0459a; --accent-hover: #963a83; --accent-ink: #fff; --soft: #e5bfdc;
  --card: rgba(255, 255, 255, 0.7); --card-line: rgba(255, 255, 255, 0.95); --btn-bg: #fff; --glow: rgba(176, 69, 154, 0.25);
}
body.t-dzien {
  --bg1: #fff6e6; --bg2: #ffe7d1; --bg3: #fff1c4;
  --ink: #4a2e12; --accent: #c2552a; --accent-hover: #a84721; --accent-ink: #fff; --soft: #f0c8a6;
  --card: rgba(255, 255, 255, 0.72); --card-line: rgba(255, 255, 255, 0.95); --btn-bg: #fff; --glow: rgba(194, 85, 42, 0.25);
}

* { box-sizing: border-box; }
html { background: #0e2a2b; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 19px/1.65 var(--sans);
  background: linear-gradient(150deg, var(--bg1), var(--bg2), var(--bg3), var(--bg1));
  background-size: 300% 300%;
  animation: drift 26s ease-in-out infinite;
  overflow-x: hidden;
}
@keyframes drift { 0%, 100% { background-position: 0% 40%; } 50% { background-position: 100% 60%; } }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 24px 20px 70px; }
#gift { text-align: center; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 28px;
  padding: 26px 22px 22px;
  box-shadow: 0 20px 50px rgba(30, 10, 30, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn {
  font: inherit;
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--accent);
  background: var(--btn-bg);
  border: 2px solid var(--soft);
  border-radius: 999px;
  padding: 13px 22px;
  min-height: 52px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { border-color: var(--accent); }
.btn-main { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 20px var(--glow); }
.btn-main:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { min-height: 44px; padding: 8px 16px; font-size: 0.95rem; }
.btn-wide { width: 100%; }
.btn[aria-pressed="true"] { border-color: var(--accent); }
.btn-main[aria-pressed="true"] { background: var(--accent-hover); }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Tworzenie ---------- */
.m-title { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(2.3rem, 9vw, 3.6rem); line-height: 1.08; margin: 22px 0 12px; color: var(--accent); }
.m-lead { margin: 0 0 24px; }
.m-form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.lbl { font-weight: 700; padding: 0; margin: 0; font-size: 1.02rem; }
.lbl em { font-weight: 400; font-style: normal; opacity: 0.75; }
.field input[type="text"] {
  font: inherit;
  color: #23121c;
  background: #fff;
  border: 2px solid var(--soft);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 54px;
  width: 100%;
}
.field input[type="text"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--glow); }
.help { font-size: 0.86rem; opacity: 0.8; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip input, .occ-item input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 9px 15px;
  border-radius: 999px;
  border: 2px solid var(--soft);
  background: var(--btn-bg);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span, .occ-item input:focus-visible ~ span:last-child { outline: 3px solid var(--ink); outline-offset: 2px; }
.occ { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.occ-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 2px solid var(--soft);
  background: var(--btn-bg);
  cursor: pointer;
  font-weight: 650;
  line-height: 1.25;
  min-width: 0;
}
.occ-item:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.occ-ico { font-size: 1.6rem; line-height: 1; }
.preview { display: grid; gap: 10px; }
.prev-card {
  background: rgba(255, 255, 255, 0.92);
  color: #2b1a24;
  border-radius: 18px;
  padding: 16px 18px;
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.55;
}
.prev-card p { margin: 0 0 8px; }
.prev-card p:last-child { margin: 0; }
.prev-card .ph { font-style: italic; color: #8a1f4e; }
.preview .btn { justify-self: start; }
.err { color: #b3123f; font-weight: 650; margin: 0; }
.err:empty { display: none; }
.t-swieta .err { color: #ff9db0; }
.m-result { margin-top: 18px; text-align: center; }
.m-result h2 { margin: 0 0 12px; font-size: 1.25rem; }
.r-link { width: 100%; font: inherit; font-size: 0.95rem; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--soft); background: #fff; color: #23121c; margin-bottom: 14px; }
.r-msg { margin: 12px 0 0; font-weight: 600; min-height: 1.4em; }
.m-foot { font-size: 0.86rem; opacity: 0.8; text-align: center; margin: 22px 0 0; }

/* ---------- Kartka ---------- */
.hero-wrap { width: min(70vw, 280px); margin: 4px auto 0; filter: drop-shadow(0 14px 22px var(--glow)); }
.hero { width: 100%; height: auto; overflow: visible; display: block; }
.hero .pop { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0.05); opacity: 0; }
.hero.go .pop { animation: pop 1.1s cubic-bezier(.2, .8, .3, 1.2) forwards; }
.hero .fade { opacity: 0; }
.hero.go .fade { animation: fade 1s ease-out forwards; }
@keyframes pop { to { transform: scale(1); opacity: 1; } }
@keyframes fade { to { opacity: 1; } }
.hero .light { animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.hero .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 0.35s ease-in-out infinite alternate; transition: opacity 0.4s, transform 0.4s; }
@keyframes flicker { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(0.9, 1.08) rotate(3deg); } }
.hero .flame.out { animation: none; opacity: 0; transform: scale(0.2); }
.hero .smoke { opacity: 0; }
.hero .smoke.on { animation: smoke 1.6s ease-out forwards; }
@keyframes smoke { 0% { opacity: 0.8; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-30px); } }
.hero .cake-hit { cursor: pointer; }
.hero.sway { animation: sway 7s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

.blow-hint { margin: 6px 0 0; font-weight: 650; }
#blow-actions { margin-top: 8px; }
.hello {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 14vw, 5rem);
  line-height: 1.05;
  margin: 10px 0 14px;
  color: var(--accent);
  word-break: break-word;
  text-shadow: 0 10px 30px var(--glow);
}
.t-urodziny .hello, .t-imieniny .hello, .t-dzien .hello { text-shadow: 0 2px 0 #fff, 0 10px 30px var(--glow); }
.wish { text-align: left; }
.wish-text { font-family: var(--serif); font-size: clamp(1.2rem, 4.6vw, 1.45rem); line-height: 1.6; transition: opacity 0.35s ease; }
.wish-text.out { opacity: 0; }
.wish-text p { margin: 0 0 14px; }
.wish-text p.close { font-style: italic; color: var(--accent); font-size: 1.15em; margin-bottom: 0; }
.sign { font-family: var(--serif); font-style: italic; font-size: 1.15rem; margin: 18px 0 0; text-align: right; color: var(--accent); }
.g-actions { margin-top: 22px; }
.again { margin: 30px 0 0; font-size: 0.95rem; }

[hidden] { display: none !important; }

@media (max-width: 420px) {
  .occ { grid-template-columns: 1fr; }
  .card { padding: 22px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .hero .pop, .hero .fade { transform: none; opacity: 1; animation: none !important; }
  .hero .light, .hero .flame, .hero.sway { animation: none; }
  .wish-text { transition: none; }
}
