/* =====================================================================
   Bence & Hani – meghívó: „új kinézet” réteg
   Csak html.glow alatt él. A régi kinézet (?regi=1) változatlan marad.
   A tartalom JS nélkül is látszik: a beúszó animációk csak akkor
   rejtik el előre a kártyákat, ha a glow.js betöltött (html.glow-js).
   ===================================================================== */
html.glow {
  --gold: #E9C987;
  --gold-deep: #C9A55F;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* háttér: mélyebb, bársonyos borvörös + csipkeháló */
html.glow body {
  background:
    radial-gradient(1000px 700px at 50% -10%, #8A1D47 0%, transparent 60%),
    radial-gradient(800px 600px at 110% 60%, rgba(79,12,39,.9), transparent 60%),
    radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.4px) 0 0 / 9px 9px,
    var(--wine);
  background-attachment: fixed, fixed, scroll, scroll;
}
html.glow main { position: relative; z-index: 1; }

/* lebegő kártyaszínek a háttérben */
.g-suits { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.g-suits span {
  position: absolute; bottom: -60px; color: #fff; opacity: 0; line-height: 1;
  animation: g-rise linear infinite; will-change: transform, opacity;
}
html:not(.glow) .g-suits, html:not(.glow) .g-progress, html:not(.glow) .g-extra { display: none !important; }

/* görgetés-jelző csík */
.g-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), #fff);
  transform-origin: 0 50%; transform: scaleX(0);
  box-shadow: 0 0 10px rgba(233,201,135,.7);
}

/* ---------------- Nyitó kártya ---------------- */
html.glow .hero { padding-top: 6px; }
/* Telefonbarát: csak 2D mozgás, nincs filter / 3D / keverési mód a kártyán
   (iOS Safari ezektől néha el is tüntette a képet). */
html.glow .hero-card { border-radius: 4%; overflow: hidden; }
html.glow-js .hero-card { animation: g-deal-hero 1s var(--ease-out) both; }
html.glow .hero-card::after {
  /* fény-csillanás végigfut a kártyán */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.28) 48%, rgba(255,255,255,.06) 54%, transparent 66%);
  background-size: 260% 100%; background-position: 160% 0;
  animation: g-shine 6.5s ease-in-out 1.8s infinite;
}
html.glow .hero-card.g-idle { animation: g-hover 7s ease-in-out infinite; }
html.glow .scroll-hint {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--gold); opacity: .95;
}
html.glow .scroll-hint span { display: inline-block; animation: g-nudge 1.8s ease-in-out infinite; }

/* ---------------- Kártyák (szekciók) ---------------- */
html.glow .card {
  box-shadow:
    0 0 0 6px var(--lace), 0 0 0 7px rgba(255,255,255,.55),
    0 2px 4px rgba(0,0,0,.08), 0 22px 44px rgba(30,0,12,.35);
}
html.glow .card::before, html.glow .card::after { font-family: var(--f-index); font-size: 22px; transition: transform .6s var(--ease-spring); }
html.glow-js .card.g-reveal { opacity: 0; transform: translateY(60px) rotate(var(--g-rot, -2deg)) scale(.97); }
html.glow-js .card.g-reveal.g-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out);
}
html.glow-js .card.g-reveal:nth-of-type(even) { --g-rot: 2deg; }

/* címek: díszes elválasztó a kártya színével */
html.glow-js h2 { position: relative; padding-bottom: 14px; }
html.glow-js h2::after {
  content: '— ' attr(data-g-suit) ' —';
  display: block; margin-top: 6px; font-family: var(--f-index); font-size: 14px; letter-spacing: .3em; color: var(--wine-soft); opacity: .7;
}

/* idézet: kézírásos hatás – soronként beúszik */
html.glow .quote { font-size: clamp(24px, 6.2vw, 30px); }
html.glow-js .card.g-in .quote { animation: g-ink 1.6s var(--ease-out) .2s both; }

/* tények: kis kártyalapok */
html.glow .facts { border: 0; gap: 10px; padding: 0; }
html.glow .facts > div {
  padding: 12px 6px 10px; border-radius: 14px; background: linear-gradient(180deg, #FFF, #FBF4F7);
  box-shadow: 0 0 0 1px var(--line), 0 6px 14px rgba(106,18,53,.08);
  transition: transform .4s var(--ease-spring);
}
html.glow-js .card.g-in .facts > div { animation: g-flip-in .8s var(--ease-out) both; }
html.glow-js .card.g-in .facts > div:nth-child(2) { animation-delay: .12s; }
html.glow-js .card.g-in .facts > div:nth-child(3) { animation-delay: .24s; }

/* visszaszámláló */
.g-countdown { margin: 4px 0 22px; text-align: center; }
.g-countdown-label { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .2em; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.g-countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 360px; margin: 0 auto; }
.g-countdown-cell {
  position: relative; border-radius: 12px; padding: 10px 2px 7px; color: #fff;
  background: linear-gradient(180deg, var(--wine-soft), var(--wine) 55%, var(--wine-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 14px rgba(106,18,53,.25);
  overflow: hidden;
}
.g-countdown-cell::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.18); }
.g-countdown-num { display: block; font-family: var(--f-display); font-size: 30px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.g-countdown-num.g-tick { animation: g-tick .45s var(--ease-out); }
.g-countdown-unit { display: block; font-family: var(--f-display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }

/* naptár gombok */
.g-cal { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -4px 0 18px; }
.g-cal a, .g-cal button {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 16px; cursor: pointer;
  color: var(--wine); background: #FBF5F7; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  text-decoration: none; transition: transform .25s var(--ease-spring), background .2s, box-shadow .2s;
}
.g-cal a:hover, .g-cal button:hover { background: #fff; box-shadow: 0 4px 12px rgba(106,18,53,.12); transform: translateY(-1px); }
.g-cal svg { width: 17px; height: 17px; }

/* villa-illusztráció (ha megérkezett) */
.g-villa { display: block; width: min(100%, 360px); height: auto; margin: 0 auto 10px; mix-blend-mode: multiply; opacity: .9; }
/* rózsa a közleményeknél (ha megérkezett) */
.g-rose { position: absolute; right: -18px; top: -58px; width: 84px; height: auto; transform: rotate(14deg); filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); pointer-events: none; }
html.glow-js .card.g-in .g-rose { animation: g-rose-in 1.2s var(--ease-spring) .3s both; }

/* ---------------- Gomb ---------------- */
html.glow .btn {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #84204A, var(--wine) 60%, var(--wine-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 20px rgba(106,18,53,.35);
  transition: transform .25s var(--ease-out), box-shadow .25s, background .2s;
}
html.glow .btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  background-size: 250% 100%; background-position: 140% 0;
  animation: g-shine 4.5s ease-in-out 2s infinite;
}
html.glow .btn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 12px 26px rgba(106,18,53,.42); }
html.glow .btn:active { transform: scale(.97); }
html.glow .btn-ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--wine); }
html.glow .btn-ghost::after { display: none; }

/* ---------------- Űrlap ---------------- */
html.glow .choice { position: relative; transition: border-color .2s, background .25s, transform .25s var(--ease-spring), box-shadow .25s; }
html.glow .choice:active { transform: scale(.985); }
html.glow .choice:has(input:checked) { box-shadow: 0 6px 16px rgba(106,18,53,.12); }
html.glow .choice input[type=radio] {
  appearance: none; -webkit-appearance: none; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #CDB3BF; background: #fff; margin-top: 1px;
  transition: border-color .2s, background .2s;
}
html.glow .choice input[type=radio]::after {
  content: '♥'; font-size: 13px; line-height: 1; color: #fff; transform: scale(0); transition: transform .35s var(--ease-spring);
}
html.glow .choice input[type=radio]:checked { border-color: var(--wine); background: var(--wine); }
html.glow .choice input[type=radio]:checked::after { transform: scale(1); }
html.glow input:not([type=radio]), html.glow textarea { transition: border-color .2s, box-shadow .25s; }
html.glow input:not([type=radio]):focus, html.glow textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 4px rgba(106,18,53,.12); }
html.glow #codeInput { background: linear-gradient(180deg, #fff, #FBF5F7); }
html.glow [data-if-attending]:not([hidden]), html.glow [data-if-partner-named]:not([hidden]), html.glow [data-if-special]:not([hidden]) { animation: g-fade-up .45s var(--ease-out) both; }
html.glow .state:not([hidden]) { animation: g-fade-up .5s var(--ease-out) both; }

/* elküldve: animált pipa + jutalomkártya */
.g-done-badge { display: block; width: 74px; height: 74px; margin: 0 auto 6px; }
.g-done-badge circle { stroke-dasharray: 220; stroke-dashoffset: 220; animation: g-draw 1s var(--ease-out) .1s forwards; }
.g-done-badge path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: g-draw .5s var(--ease-out) .8s forwards; }
.g-reward { margin: 18px auto 6px; width: min(78%, 260px); perspective: 1000px; }
.g-reward img { display: block; width: 100%; height: auto; border-radius: 6%; box-shadow: 0 16px 34px rgba(0,0,0,.3); animation: g-deal-hero 1.2s var(--ease-out) .3s both; }
.g-reward figcaption { text-align: center; font-style: italic; color: var(--muted); font-size: 16px; margin-top: 8px; }

/* ---------------- Menetrend ---------------- */
html.glow .timeline li::after { transition: transform .4s var(--ease-spring); }
html.glow-js .card.g-reveal .timeline li { opacity: 0; transform: translateX(-12px); }
html.glow-js .card.g-in .timeline li { opacity: 1; transform: none; transition: opacity .5s var(--ease-out), transform .6s var(--ease-out); transition-delay: calc(var(--g-i) * 90ms + 200ms); }
html.glow .timeline::before { background: linear-gradient(180deg, transparent, var(--line) 8%, var(--line) 92%, transparent); }
html.glow .timeline li:hover::after { transform: scale(1.5); }

/* ---------------- Menü ---------------- */
html.glow #menu h3 { display: flex; align-items: center; gap: 12px; justify-content: center; }
html.glow #menu h3::before, html.glow #menu h3::after { content: ''; flex: 0 1 42px; height: 1px; background: linear-gradient(90deg, transparent, var(--wine-soft)); }
html.glow #menu h3::after { background: linear-gradient(90deg, var(--wine-soft), transparent); }

/* ---------------- Közlemények ---------------- */
html.glow .notes { list-style: none; padding: 0; counter-reset: g-note; }
html.glow .notes li { position: relative; padding: 14px 14px 14px 54px; margin-bottom: 10px; border-radius: 14px; background: #FDF8FA; border: 1px solid var(--line); counter-increment: g-note; }
html.glow .notes li::before {
  content: counter(g-note); position: absolute; left: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--f-display); font-size: 17px; color: #fff;
  background: linear-gradient(180deg, var(--wine-soft), var(--wine));
}

/* ---------------- Zárás ---------------- */
html.glow .closing-text .heart { animation: g-heartbeat 1.6s ease-in-out infinite; color: #C0294F; }
html.glow-js .card.g-reveal .photo-frame { transform: rotate(-3deg) translateY(30px); opacity: 0; }
html.glow-js .card.g-in .photo-frame { transform: rotate(-1.5deg); opacity: 1; transition: transform 1.1s var(--ease-spring) .25s, opacity .8s ease .25s; }
html.glow .photo-frame:hover { transform: rotate(0) scale(1.01); }

/* ---------------- Lábléc ---------------- */
html.glow .footer-mark span { display: inline-block; color: var(--gold); animation: g-heartbeat 2s ease-in-out infinite; }

/* konfetti */
.g-confetti { position: fixed; z-index: 100; pointer-events: none; line-height: 1; will-change: transform, opacity; }

/* ---------------- Animációk ---------------- */
@keyframes g-deal-hero {
  0% { opacity: 0; transform: translateY(60px) rotate(-8deg) scale(.88); }
  100% { opacity: 1; transform: none; }
}
@keyframes g-hover { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(.4deg); } }
@keyframes g-shine { 0%, 70% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
@keyframes g-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes g-rise {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: var(--o, .1); }
  90% { opacity: var(--o, .1); }
  100% { transform: translateY(-110vh) rotate(var(--r, 180deg)); opacity: 0; }
}
@keyframes g-flip-in { from { opacity: 0; transform: rotateY(90deg) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes g-ink { from { opacity: 0; filter: blur(6px); letter-spacing: .06em; } to { opacity: 1; filter: none; } }
@keyframes g-tick { 0% { transform: translateY(-40%); opacity: .2; } 100% { transform: none; opacity: 1; } }
@keyframes g-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes g-draw { to { stroke-dashoffset: 0; } }
@keyframes g-heartbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } 60% { transform: scale(1); } }
@keyframes g-rose-in { from { opacity: 0; transform: rotate(40deg) scale(.4); } to { opacity: 1; transform: rotate(14deg); } }

@media (prefers-reduced-motion: reduce) {
  html.glow *, html.glow *::before, html.glow *::after { animation: none !important; transition: none !important; }
  html.glow-js .card.g-reveal, html.glow-js .card.g-reveal .timeline li, html.glow-js .card.g-reveal .photo-frame { opacity: 1 !important; transform: none !important; }
  .g-suits { display: none; }
}
