@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,700;1,500&family=Source+Sans+3:wght@400;600;700&display=swap');

/* ── Launcher (inline trigger) ── */
.advent-launcher {
  --ad-gold: #d4af37;
  --ad-gold-soft: #f0d78c;
  --ad-forest: #163528;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.advent-launch-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1a3a2a, #0f2419 55%, #3d1f14);
  color: var(--ad-gold-soft);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 28px rgba(15, 36, 25, 0.35), inset 0 0 0 1px rgba(212, 175, 55, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.advent-launch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(15, 36, 25, 0.45), inset 0 0 0 1px rgba(212, 175, 55, 0.5);
}

.advent-launch-btn span.icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.45);
  font-size: 18px;
}

/* ── Floating FAB (frontend) ── */
.advent-fab {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 9991;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.3px;
  display: none;
  align-items: center;
  gap: 10px;
  color: #f0d78c;
  background: linear-gradient(135deg, #1a3a2a 0%, #0f2419 55%, #3d1f14 100%);
  box-shadow: 0 10px 28px rgba(15, 36, 25, 0.4);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  transition: transform 0.2s ease, filter 0.2s ease;
  animation: advent-fab-pulse 2.4s ease-in-out infinite;
}

.advent-fab.is-visible {
  display: inline-flex;
}

.advent-fab:hover {
  transform: scale(1.06) translateY(-2px);
  filter: brightness(1.08);
}

.advent-fab i {
  font-size: 16px;
}

.advent-fab-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  background: #b42828;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@keyframes advent-fab-pulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(15, 36, 25, 0.4); }
  50% { box-shadow: 0 12px 34px rgba(212, 175, 55, 0.35); }
}

@media (max-width: 560px) {
  .advent-fab {
    left: 14px;
    bottom: 14px;
    padding: 12px 14px;
    font-size: 13px;
  }
  .advent-fab span.advent-fab-label {
    display: none;
  }
}

/* ── Fullscreen stage ── */
.advent-stage {
  --ad-night: #0b1a14;
  --ad-forest: #163528;
  --ad-pine: #1f4634;
  --ad-gold: #d4af37;
  --ad-gold-soft: #f0d78c;
  --ad-crimson: #8b1e2d;
  --ad-snow: #f7f3ea;
  --ad-ink: #e8dfd0;
  --ad-muted: rgba(232, 223, 208, 0.72);
  --ad-door: #214a37;
  position: fixed;
  inset: 0;
  z-index: 100000;
  /* Zárva: display:none – ne villanjon fel CSS betöltés előtt sem */
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ad-ink);
}

.advent-stage.is-open {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.advent-stage *,
.advent-stage *::before,
.advent-stage *::after {
  box-sizing: border-box;
}

.advent-stage-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212, 175, 55, 0.2), transparent 42%),
    radial-gradient(ellipse at 85% 15%, rgba(139, 30, 45, 0.28), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(26, 58, 42, 0.55), transparent 50%),
    linear-gradient(165deg, #07140f 0%, #12291f 40%, #1a221c 70%, #241410 100%);
}

.advent-stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.45), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.advent-snow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.advent-snow i {
  position: absolute;
  top: -12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  opacity: 0.55;
  animation: advent-fall linear infinite;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

@keyframes advent-fall {
  0% { transform: translate3d(0, -10px, 0); opacity: 0; }
  15% { opacity: 0.75; }
  100% { transform: translate3d(22px, 110vh, 0); opacity: 0; }
}

.advent-stage-panel {
  --ad-panel-ink: #143528;
  --ad-panel-muted: rgba(20, 53, 40, 0.72);
  --ad-panel-snow: #123528;
  position: relative;
  z-index: 2;
  width: min(680px, 100%);
  max-height: min(86vh, 780px);
  max-height: min(86dvh, 780px);
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2.5vw, 26px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 22px;
  border: 1px solid rgba(46, 125, 70, 0.35);
  /* Világos zöldes panel */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.55), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(200, 230, 201, 0.65), transparent 45%),
    linear-gradient(165deg, #f1f8f2 0%, #e3f2e5 40%, #d7edd9 100%);
  box-shadow: 0 28px 80px rgba(20, 53, 40, 0.28);
  animation: advent-stage-in 0.45s cubic-bezier(0.22, 0.8, 0.25, 1);
  color: var(--ad-panel-ink);
}

@keyframes advent-stage-in {
  from { opacity: 0; transform: scale(0.96) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.advent-stage-top {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  margin-bottom: clamp(10px, 2vw, 18px);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 6;
  text-align: center;
  padding-top: 2px;
  padding-bottom: 8px;
  background: linear-gradient(
    180deg,
    rgba(241, 248, 242, 0.98) 0%,
    rgba(241, 248, 242, 0.92) 70%,
    rgba(241, 248, 242, 0) 100%
  );
}

.advent-stage-brand {
  min-width: 0;
  width: 100%;
  padding: 0 44px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.advent-kicker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #2e7d46;
  margin-bottom: 8px;
  opacity: 0.95;
  font-weight: 600;
}

.advent-kicker-tree {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 28%, rgba(255, 255, 255, 0.28), transparent 42%),
    radial-gradient(circle at 50% 70%, rgba(212, 175, 55, 0.22), transparent 55%),
    linear-gradient(160deg, #248a4a, #0d3320 70%);
  border: 1.5px solid rgba(240, 215, 140, 0.65);
  box-shadow:
    0 0 10px rgba(125, 206, 160, 0.45),
    0 0 22px rgba(212, 175, 55, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.35);
  color: #9aefb5;
  font-size: 26px;
  line-height: 1;
  animation: advent-tree-glow 2.6s ease-in-out infinite;
}

.advent-kicker-tree i {
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.75))
    drop-shadow(0 0 12px rgba(125, 206, 160, 0.55));
}

@keyframes advent-tree-glow {
  0%, 100% {
    box-shadow:
      0 0 8px rgba(125, 206, 160, 0.4),
      0 0 18px rgba(212, 175, 55, 0.3),
      0 4px 12px rgba(0, 0, 0, 0.3);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 18px rgba(125, 206, 160, 0.85),
      0 0 36px rgba(212, 175, 55, 0.65),
      0 0 48px rgba(240, 215, 140, 0.35),
      0 4px 16px rgba(0, 0, 0, 0.3);
    filter: brightness(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .advent-kicker-tree { animation: none; }
}

.advent-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.55rem, 3.4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  color: #143528;
  text-shadow: none;
  text-align: center;
}

.advent-subtitle {
  margin: 8px auto 0;
  max-width: 460px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(20, 53, 40, 0.72);
  text-align: center;
}

.advent-meta {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.advent-demo-bar {
  margin: 0 auto 12px;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.advent-demo-bar label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ad-gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.advent-demo-bar select {
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ad-snow);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}

.advent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(46, 125, 70, 0.1);
  border: 1px solid rgba(46, 125, 70, 0.28);
  color: #1b5e2f;
}

.advent-stage-close {
  appearance: none;
  border: 1px solid rgba(20, 53, 40, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: #143528;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
}

.advent-stage-close:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.05);
}

.advent-stage-body {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  min-height: 0;
  position: relative;
}

/* ── Calendar grid view ── */
.advent-view {
  width: 100%;
  position: relative;
  z-index: 1;
  transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
}

.advent-view.is-dimmed {
  opacity: 0.18;
  filter: blur(2px);
  pointer-events: none;
  transform: scale(0.97);
}

.advent-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 14px);
}

@media (max-width: 720px) {
  .advent-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Mobile: ~5px margó, kicsit kisebb ablakok, nagy fénylő fa */
@media (max-width: 560px) {
  .advent-stage {
    padding: 5px;
    align-items: stretch;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  .advent-stage-panel {
    width: 100%;
    height: 100%;
    max-height: calc(100% - 0px);
    max-height: calc(100dvh - 10px);
    border-radius: 12px;
    /* Extra top padding: status bar / notch ne takarja a címet */
    padding:
      max(10px, calc(6px + env(safe-area-inset-top, 0px)))
      8px
      max(8px, calc(6px + env(safe-area-inset-bottom, 0px)));
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .advent-stage-top {
    position: relative;
    flex: 0 0 auto;
    margin-bottom: 8px;
    padding: 4px 0 6px;
    background: transparent;
    top: auto;
  }

  .advent-stage-brand {
    padding: 0 40px 0 4px;
  }

  .advent-kicker {
    display: flex !important;
    flex-direction: column;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: none;
    margin-bottom: 6px;
    line-height: 1.25;
    padding-top: 2px;
    gap: 6px;
  }

  .advent-kicker-tree {
    width: 58px;
    height: 58px;
    font-size: 30px;
    border-width: 2px;
  }

  .advent-title {
    display: block !important;
    font-size: clamp(1.02rem, 5vw, 1.28rem);
    line-height: 1.2;
    padding-top: 0;
  }

  .advent-subtitle {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .advent-meta {
    margin-top: 4px;
    gap: 4px;
  }

  .advent-chip {
    font-size: 9px;
    padding: 2px 6px;
    max-width: 100%;
    word-break: break-word;
  }

  .advent-stage-close {
    width: 34px;
    height: 34px;
    font-size: 20px;
    top: 2px;
    right: 2px;
    z-index: 8;
  }

  .advent-demo-bar {
    flex-shrink: 0;
    margin-bottom: 6px;
    padding: 6px 8px;
    gap: 6px;
  }

  .advent-stage-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
  }

  .advent-view {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  /* Ablakok: kicsit kisebbek, légzés a panelben */
  .advent-grid {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
    gap: 4px;
    height: auto;
    /* ~8–10%-kal kevesebb magasság → kisebb ablakok, alul/felül légzés */
    max-height: min(100%, 68dvh);
    align-content: center;
  }

  .advent-door {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    border-radius: 7px;
    animation: none;
  }

  .advent-door-face {
    border-radius: 8px;
    gap: 2px;
    padding: 3px 2px;
  }

  .advent-door-face::before {
    inset: 3px;
    border-radius: 5px;
  }

  .advent-door-face::after {
    width: 6px;
    height: 6px;
    right: 5px;
  }

  .advent-door-num {
    font-size: clamp(0.8rem, 3.4vw, 1.05rem);
  }

  .advent-door-icon {
    font-size: clamp(0.58rem, 2.4vw, 0.78rem);
    margin-bottom: 0;
  }

  .advent-door-badge {
    width: 13px;
    height: 13px;
    top: 3px;
    left: 3px;
    font-size: 7px;
  }

  .advent-footer-note {
    flex-shrink: 0;
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 10px;
    padding: 0 4px;
    line-height: 1.3;
  }

  .advent-test-reset-wrap {
    flex-shrink: 0;
    margin-top: 4px !important;
  }

  .advent-test-reset-wrap .advent-test-reset {
    font-size: 10px;
    padding: 5px 10px;
  }

  .advent-snow {
    display: none;
  }
}

/* Alacsony mobil: alcím / lábjegyzet elrejtése — cím + nagy fa MARAD */
@media (max-width: 560px) and (max-height: 700px) {
  .advent-subtitle { display: none; }
  .advent-kicker {
    display: flex !important;
    flex-direction: column;
    font-size: 9px;
    margin-bottom: 4px;
    gap: 4px;
  }
  .advent-kicker-tree {
    width: 48px;
    height: 48px;
    font-size: 26px;
  }
  .advent-title {
    display: block !important;
    font-size: 1.02rem;
  }
  .advent-stage {
    padding: 5px;
  }
  .advent-stage-panel {
    padding-top: max(10px, calc(6px + env(safe-area-inset-top, 0px)));
    padding-bottom: max(6px, calc(5px + env(safe-area-inset-bottom, 0px)));
    max-height: calc(100dvh - 10px);
    border-radius: 12px;
  }
  .advent-stage-top { margin-bottom: 4px; }
  .advent-grid { gap: 3px; max-height: min(100%, 64dvh); }
  .advent-footer-note { display: none; }
}

/* Nagyon alacsony (landscape) */
@media (max-width: 560px) and (max-height: 600px) {
  .advent-stage { padding: 5px; }
  .advent-stage-top { margin-bottom: 3px; padding-bottom: 2px; }
  .advent-kicker-tree {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
  .advent-grid { gap: 3px; max-height: min(100%, 58dvh); }
  .advent-door { border-radius: 6px; }
  .advent-door-num { font-size: 0.72rem; }
  .advent-door-icon { font-size: 0.52rem; }
}

.advent-door {
  position: relative;
  aspect-ratio: 1 / 1.12;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 12px;
  background: transparent;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
  animation: advent-door-in 0.5s cubic-bezier(0.22, 0.8, 0.25, 1) both;
}

.advent-door:nth-child(1) { animation-delay: 0.02s; }
.advent-door:nth-child(2) { animation-delay: 0.04s; }
.advent-door:nth-child(3) { animation-delay: 0.06s; }
.advent-door:nth-child(4) { animation-delay: 0.08s; }
.advent-door:nth-child(5) { animation-delay: 0.1s; }
.advent-door:nth-child(6) { animation-delay: 0.12s; }
.advent-door:nth-child(7) { animation-delay: 0.14s; }
.advent-door:nth-child(8) { animation-delay: 0.16s; }
.advent-door:nth-child(9) { animation-delay: 0.18s; }
.advent-door:nth-child(10) { animation-delay: 0.2s; }
.advent-door:nth-child(11) { animation-delay: 0.22s; }
.advent-door:nth-child(12) { animation-delay: 0.24s; }
.advent-door:nth-child(13) { animation-delay: 0.26s; }
.advent-door:nth-child(14) { animation-delay: 0.28s; }
.advent-door:nth-child(15) { animation-delay: 0.3s; }
.advent-door:nth-child(16) { animation-delay: 0.32s; }
.advent-door:nth-child(17) { animation-delay: 0.34s; }
.advent-door:nth-child(18) { animation-delay: 0.36s; }
.advent-door:nth-child(19) { animation-delay: 0.38s; }
.advent-door:nth-child(20) { animation-delay: 0.4s; }
.advent-door:nth-child(21) { animation-delay: 0.42s; }
.advent-door:nth-child(22) { animation-delay: 0.44s; }
.advent-door:nth-child(23) { animation-delay: 0.46s; }
.advent-door:nth-child(24) { animation-delay: 0.48s; }

@keyframes advent-door-in {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.advent-door:disabled { cursor: not-allowed; }

.advent-door-inner {
  position: absolute;
  inset: 0;
}

.advent-door-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.1), transparent 42%),
    linear-gradient(165deg, var(--ad-door), #12291f 70%, #0e1f18);
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(240, 215, 140, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.28);
  color: var(--ad-gold-soft);
  transition: filter 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.advent-door-face::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(240, 215, 140, 0.28);
  border-radius: 8px;
  pointer-events: none;
}

.advent-door-face::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9a8, var(--ad-gold) 55%, #8a6a12);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.55);
}

.advent-door-icon {
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  z-index: 1;
  opacity: 0.95;
  line-height: 1;
  margin-bottom: 0.2rem;
  color: #f0d78c;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35));
}
.advent-door.is-locked .advent-door-icon,
.advent-door.is-missed .advent-door-icon {
  opacity: 0.55;
  color: #c9b87a;
}

.advent-door-num {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.25rem, 2.8vw, 1.85rem);
  font-weight: 700;
  line-height: 1;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.advent-door.is-opened .advent-door-face {
  background:
    radial-gradient(circle at 50% 40%, rgba(212, 175, 55, 0.22), transparent 55%),
    linear-gradient(160deg, #4a1a24, #2a1014 60%, #140a0c);
  border-color: rgba(212, 175, 55, 0.4);
}

.advent-door.is-opened .advent-door-face::after {
  opacity: 0.35;
}

.advent-door.is-locked .advent-door-face,
.advent-door.is-missed .advent-door-face,
.advent-door.is-disabled .advent-door-face {
  filter: grayscale(0.85) brightness(0.62);
  opacity: 0.72;
  border-color: rgba(160, 160, 160, 0.28);
}

.advent-door.is-locked .advent-door-face::after,
.advent-door.is-missed .advent-door-face::after {
  filter: grayscale(1);
  opacity: 0.4;
}

.advent-door.is-available:not(:disabled):hover .advent-door-face {
  border-color: var(--ad-gold);
  box-shadow:
    inset 0 0 0 1px rgba(240, 215, 140, 0.2),
    0 0 0 3px rgba(212, 175, 55, 0.15),
    0 10px 22px rgba(0, 0, 0, 0.35);
}

.advent-door.is-available .advent-door-face {
  animation: advent-glow 2.8s ease-in-out infinite;
}

@keyframes advent-glow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(240,215,140,.12), 0 8px 18px rgba(0,0,0,.28); }
  50% { box-shadow: inset 0 0 0 1px rgba(240,215,140,.2), 0 0 18px rgba(212,175,55,.28), 0 8px 18px rgba(0,0,0,.28); }
}

.advent-door-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ad-gold-soft);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.advent-footer-note {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: rgba(20, 53, 40, 0.7);
}

.advent-test-reset-wrap .advent-test-reset {
  font-size: 12px;
  padding: 8px 14px;
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--ad-gold-soft);
}

/* ── Featured door open ceremony ── */
.advent-ceremony {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.advent-ceremony.is-active {
  display: flex;
}

.advent-ceremony-door {
  width: min(240px, 68vw);
  aspect-ratio: 3 / 4;
  perspective: 1600px;
  position: relative;
  transform: scale(0.82) translateY(24px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 0.8, 0.25, 1), opacity 0.35s ease;
}

.advent-ceremony.is-active .advent-ceremony-door {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.advent-ceremony-door.is-opening .advent-ceremony-hinge {
  transform: rotateY(-95deg);
}

.advent-ceremony-frame {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 45%, rgba(212, 175, 55, 0.35), transparent 55%),
    linear-gradient(160deg, #6b2430, #3a1218 55%, #140a0c);
  border: 2px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.advent-ceremony-gift {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 18px;
  text-align: center;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.35s ease 0.35s, transform 0.45s cubic-bezier(0.22, 0.8, 0.25, 1) 0.3s;
}

.advent-ceremony-door.is-opening .advent-ceremony-gift {
  opacity: 1;
  transform: scale(1);
}

.advent-ceremony-gift-day {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--ad-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ad-gold-soft);
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.advent-ceremony-gift-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  color: var(--ad-snow);
  line-height: 1.15;
}

.advent-ceremony-gift-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ad-gold);
}

.advent-ceremony-hinge {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.95s cubic-bezier(0.45, 0.05, 0.2, 1);
  border-radius: 18px;
  z-index: 2;
}

.advent-ceremony-panel {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12), transparent 40%),
    linear-gradient(165deg, var(--ad-door, #214a37), #12291f 70%, #0e1f18);
  border: 2px solid rgba(212, 175, 55, 0.65);
  box-shadow:
    inset 0 0 0 1px rgba(240, 215, 140, 0.15),
    8px 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ad-gold-soft);
  backface-visibility: hidden;
}

.advent-ceremony-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(240, 215, 140, 0.3);
  border-radius: 12px;
  pointer-events: none;
}

.advent-ceremony-panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9a8, var(--ad-gold) 55%, #8a6a12);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.7);
}

.advent-ceremony-icon {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  z-index: 1;
  opacity: 0.95;
  line-height: 1;
}

.advent-ceremony-num {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.2rem, 11vw, 5rem);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.advent-ceremony-spark {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(240, 215, 140, 0.35), transparent 40%);
  transition: opacity 0.4s ease;
}

.advent-ceremony-door.is-opening .advent-ceremony-spark {
  opacity: 1;
  animation: advent-spark-pulse 1.2s ease-out;
}

@keyframes advent-spark-pulse {
  0% { transform: scale(0.6); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* ── Reward overlay card ── */
.advent-reward {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 12, 9, 0.45);
  backdrop-filter: blur(4px);
}

.advent-reward.is-open {
  display: flex;
  animation: advent-fade 0.3s ease;
}

@keyframes advent-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.advent-reward-card {
  width: min(440px, 100%);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.25), transparent 45%),
    linear-gradient(180deg, #1b3528 0%, #12241c 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  padding: 28px 24px 22px;
  text-align: center;
  position: relative;
  transform: translateY(16px) scale(0.96);
  animation: advent-pop 0.4s cubic-bezier(0.22, 0.8, 0.25, 1) forwards;
}

@keyframes advent-pop {
  to { transform: translateY(0) scale(1); }
}

.advent-reward-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--ad-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.advent-reward-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid var(--ad-gold);
  color: var(--ad-gold-soft);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.advent-reward-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.85rem;
  color: var(--ad-snow);
  line-height: 1.15;
}

.advent-reward-label {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ad-gold);
}

.advent-reward-msg {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ad-muted);
}

.advent-code-box {
  margin: 18px 0 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px dashed rgba(212, 175, 55, 0.45);
}

.advent-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ad-gold-soft);
  word-break: break-all;
}

.advent-reward-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.advent-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease;
}

.advent-btn:hover { transform: translateY(-1px); }

.advent-btn-primary {
  background: linear-gradient(135deg, var(--ad-gold), #b8922a);
  color: #1a1204;
}

.advent-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ad-ink);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.advent-email-row {
  margin-top: 14px;
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.advent-email-row.is-visible { display: flex; }

.advent-email-row .advent-email-input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ad-snow);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.advent-email-row .advent-email-input:focus {
  border-color: var(--ad-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.advent-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ad-muted);
  cursor: pointer;
  user-select: none;
}

.advent-terms input {
  margin-top: 2px;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--ad-gold);
  cursor: pointer;
}

.advent-terms a {
  color: var(--ad-gold-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.advent-terms a:hover {
  color: var(--ad-gold);
}

.advent-email-row .advent-claim-confirm {
  width: 100%;
}

.advent-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #1a3a2a;
  color: #f0d78c;
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 100010;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.advent-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.advent-no-scroll {
  overflow: hidden !important;
}
