/* Ganzseitiger Adventkalender – Winterszene + Buch + Türchen-Motiv */

.glr-advent {
  --adv-cream: #f3e6cf;
  --adv-gold: #c9a84c;
  --adv-gold-soft: #e8d5a0;
  --adv-deep: #061018;
  --adv-ink: #1a140e;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: var(--adv-deep);
}

.glr-advent[hidden] {
  display: none !important;
}

.glr-advent__scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 16, 24, 0.28) 0%, rgba(6, 16, 24, 0.18) 45%, rgba(6, 14, 22, 0.55) 100%),
    url('../img/advent-scene.jpg') center / cover no-repeat;
}

.glr-advent__stars {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}

.glr-advent__star {
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: var(--adv-gold-soft);
  box-shadow:
    0 0 6px rgba(250, 246, 238, 0.55),
    0 0 14px rgba(201, 168, 76, 0.55);
  opacity: 0.58;
  animation-name: glr-advent-star-rise;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  pointer-events: none;
}

.glr-advent__star--cross {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0.5;
  filter:
    drop-shadow(0 0 2px rgba(245, 235, 211, 0.95))
    drop-shadow(0 0 5px rgba(201, 168, 76, 0.45));
}

.glr-advent__star--cross::before,
.glr-advent__star--cross::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(232, 213, 160, 0.88);
}

.glr-advent__star--cross::before {
  width: 1px;
  height: 4px;
}

.glr-advent__star--cross::after {
  width: 4px;
  height: 1px;
}

@keyframes glr-advent-star-rise {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  12% {
    opacity: 0.68;
  }
  88% {
    opacity: 0.52;
  }
  100% {
    transform: translateY(-120vh);
    opacity: 0;
  }
}

.glr-advent__shell {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(0.45rem + env(safe-area-inset-top)) 0.5rem calc(0.5rem + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.glr-advent__chrome {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 1.35rem 2.5rem 0.55rem;
  flex: 0 0 auto;
}

.glr-advent__close {
  position: absolute;
  top: 0;
  right: 0.1rem;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 999px;
  background: rgba(8, 16, 28, 0.45);
  color: var(--adv-gold-soft);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.glr-advent__brand {
  display: inline-block;
  margin: 0.15rem 0 0;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(250, 246, 238, 0.88);
}

.glr-advent__brand:hover,
.glr-advent__brand:focus-visible {
  color: var(--adv-gold-soft);
}

.glr-advent__title {
  margin: 1.1rem 0 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 7.5vw, 2.9rem);
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--adv-gold-soft);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

.glr-advent__ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: min(100%, 9rem);
  margin: 0.55rem auto 0.35rem;
}

.glr-advent__ornament-line {
  flex: 1 1 2.75rem;
  max-width: 3.25rem;
  min-width: 1.5rem;
  height: 1px;
  background: rgba(184, 152, 79, 0.62);
}

.glr-advent__ornament-heart {
  flex: 0 0 auto;
  width: 0.72rem;
  height: 0.72rem;
  opacity: 0.92;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14' fill='none'%3E%3Cpath d='M8 13S1 8.6 1 4.8C1 2.7 2.6 1 4.6 1c1.2 0 2.3.6 3 1.6.7-1 1.8-1.6 3-1.6 2 0 3.6 1.7 3.6 3.8C14.4 8.6 8 13 8 13z' fill='%23c9a84c'/%3E%3C/svg%3E");
}

.glr-advent__sub {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 213, 160, 0.72);
}

/* Türchen-Raster ohne Buch */
.glr-advent__book {
  position: relative;
  flex: 1 1 auto;
  width: min(620px, 96vw);
  max-height: calc(100dvh - 9.5rem);
  margin: 1.1rem auto 0;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.2rem 0.15rem 0.6rem;
  box-sizing: border-box;
}

.glr-advent__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  box-sizing: border-box;
}

.glr-advent__grid--row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: calc((100% - 5 * 0.35rem) * 5 / 6 + 4 * 0.35rem);
  max-width: 100%;
  margin: 0 auto;
}

/* Türchen = Motivbild + weiße Nummer */
.glr-advent__cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  border-radius: 22%;
  padding: 0;
  background:
    url('../img/advent-door.jpg') center / cover no-repeat;
  color: #faf6ee;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(0.95rem, 3vw, 1.25rem);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.65),
    0 0 8px rgba(0, 0, 0, 0.35);
}

.glr-advent__cell:hover:not(:disabled),
.glr-advent__cell:focus-visible:not(:disabled) {
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    0 0 0 1px rgba(232, 213, 160, 0.55),
    0 8px 16px rgba(0, 0, 0, 0.3);
}

.glr-advent__cell:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35) brightness(0.85);
}

.glr-advent__cell.is-today {
  box-shadow:
    0 0 0 2px rgba(232, 213, 160, 0.85),
    0 0 18px rgba(255, 200, 100, 0.45);
}

.glr-advent__cell.is-opened {
  filter: saturate(0.85) brightness(0.92);
}

.glr-advent__cell.is-opened::after {
  content: '';
  position: absolute;
  right: 14%;
  bottom: 12%;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--adv-gold-soft);
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.8);
}

/* Offenes Türchen – Form wie Radio-Panel */
.glr-advent__door {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(0.65rem + env(safe-area-inset-top)) 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
  background: transparent;
  animation: glr-advent-open 0.32s ease;
  box-sizing: border-box;
}

.glr-advent__door[hidden] {
  display: none !important;
}

@keyframes glr-advent-open {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.glr-advent__daypanel {
  width: min(100%, 36rem);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.glr-advent__back {
  align-self: flex-start;
  width: 2.3rem;
  height: 2.3rem;
  margin: 0 0 0.55rem;
  flex: 0 0 auto;
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 999px;
  background: rgba(10, 18, 30, 0.55);
  color: var(--adv-gold-soft);
  font-size: 1.1rem;
  cursor: pointer;
}

.glr-advent__card {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 0;
  /* oben + unten je ~1/5 frei; Inhalt in der Mitte */
  padding: clamp(2.5rem, 18%, 6.5rem) 1.2rem clamp(3.5rem, 20%, 7rem);
  border-radius: 22px;
  border: 2.5px solid rgba(201, 168, 76, 0.92);
  /* leichter Schleier oben; unten Zweige/Schnee klar sichtbar */
  background:
    linear-gradient(180deg, rgba(8, 18, 36, 0.32) 0%, rgba(8, 18, 36, 0.1) 38%, rgba(6, 14, 28, 0) 62%),
    url('../img/advent-door-open.jpg') center bottom / cover no-repeat;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(232, 213, 160, 0.4),
    inset 0 1px 0 rgba(245, 235, 211, 0.3),
    inset 0 0 0 1px rgba(201, 168, 76, 0.32);
  box-sizing: border-box;
  overflow: auto;
}

.glr-advent__dayhead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: min(100%, 20rem);
  flex: 0 0 auto;
  margin: 0 0 0.65rem;
}

.glr-advent__dayhead-line {
  flex: 1 1 2.5rem;
  max-width: 3.5rem;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.85), transparent);
}

.glr-advent__daylabel {
  margin: 0;
  flex: 0 0 auto;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--adv-gold-soft);
}

.glr-advent__song-title {
  margin: 0 0 0.95rem;
  flex: 0 0 auto;
  max-width: 22rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.35rem, 4.6vw, 1.9rem);
  font-weight: 600;
  color: #faf6ee;
  line-height: 1.25;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.glr-advent__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
  margin: 0.15rem 0 1.55rem;
}

.glr-advent__icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 2px solid rgba(201, 168, 76, 0.85);
  background:
    radial-gradient(circle at 35% 30%, rgba(232, 213, 160, 0.28), rgba(201, 168, 76, 0.18) 55%, rgba(8, 14, 24, 0.5));
  color: var(--adv-gold-soft);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(245, 235, 211, 0.3);
}

.glr-advent__icon-btn[data-glr-advent-play] {
  width: 4.35rem;
  height: 4.35rem;
  border-width: 2.5px;
  border-color: rgba(232, 213, 160, 0.95);
  background:
    radial-gradient(circle at 35% 28%, #f5ebd3 0%, var(--adv-gold-soft) 28%, var(--adv-gold) 62%, #9a7a2e 100%);
  color: #1a140e;
  font-size: 1.35rem;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    0 0 22px rgba(201, 168, 76, 0.35),
    inset 0 1px 0 rgba(255, 248, 230, 0.55);
}

.glr-advent__icon-btn:hover,
.glr-advent__icon-btn:focus-visible {
  border-color: #f5ebd3;
  color: #f5ebd3;
  outline: none;
}

.glr-advent__icon-btn[data-glr-advent-play]:hover,
.glr-advent__icon-btn[data-glr-advent-play]:focus-visible {
  color: #0e1016;
  filter: brightness(1.06);
}

.glr-advent__scripture {
  flex: 0 0 auto;
  width: 100%;
  margin: 0.35rem 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 1.15rem 1.15rem 1.25rem;
  border-radius: 18px;
  border: 2px solid rgba(201, 168, 76, 0.78);
  background: rgba(8, 18, 36, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(245, 235, 211, 0.14),
    inset 0 0 0 1px rgba(245, 235, 211, 0.05);
  box-sizing: border-box;
}

.glr-advent__verse-label {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 213, 160, 0.72);
}

.glr-advent__verse-source {
  margin: 0;
  max-width: 22rem;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: clamp(0.95rem, 3.2vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: rgba(250, 246, 238, 0.88);
}

.glr-advent__ornament--soft {
  margin: 0.2rem auto;
  opacity: 0.9;
}

.glr-advent__verse {
  margin: 0;
  width: 100%;
  max-width: 22rem;
  padding: 0.1rem 0.2rem 0;
  border: 0;
  background: transparent;
  box-sizing: border-box;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.4;
  color: var(--adv-gold-soft);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.glr-advent__install-hint {
  flex: 0 0 auto;
  margin: 0.95rem 0 0;
}

.glr-advent__install-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid rgba(232, 213, 160, 0.7);
  border-radius: 999px;
  background: transparent;
  color: #faf6ee;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.glr-advent__install-btn:hover,
.glr-advent__install-btn:focus-visible {
  background: rgba(201, 168, 76, 0.2);
  border-color: #e8d5a0;
  outline: none;
}

.glr-advent-hint {
  margin: 0.85rem 0 0;
  max-width: 18rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 76, 0.38);
  background: rgba(10, 22, 40, 0.35);
  color: rgba(232, 213, 160, 0.92);
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.35;
}

.glr-advent-hint[hidden] {
  display: none !important;
}

.glr-advent-hint--embed {
  margin-top: 0.65rem;
  max-width: 16rem;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.glr-advent-reopen {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin: 0.85rem 0 0;
  min-height: 2.45rem;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 76, 0.65);
  background: rgba(10, 22, 40, 0.55);
  color: var(--adv-gold-soft);
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.glr-advent-reopen:hover,
.glr-advent-reopen:focus-visible {
  background: rgba(201, 168, 76, 0.18);
  border-color: rgba(232, 213, 160, 0.85);
  outline: none;
}

.glr-advent-reopen[hidden] {
  display: none !important;
}

body.glr-advent-open .stage,
body.glr-advent-open .notes {
  visibility: hidden;
}

/* Handy: Türchen füllen die ganze Seite */
@media (max-width: 700px) {
  .glr-advent__shell {
    width: 100%;
    padding:
      calc(0.25rem + env(safe-area-inset-top)) 0.35rem
      calc(0.35rem + env(safe-area-inset-bottom));
  }

  .glr-advent__chrome {
    padding: 0.35rem 2.2rem 0.2rem;
  }

  .glr-advent__brand {
    font-size: 0.58rem;
    letter-spacing: 0.12em;
  }

  .glr-advent__title {
    margin-top: 0.35rem;
    font-size: clamp(1.35rem, 6.5vw, 1.85rem);
  }

  .glr-advent__ornament {
    margin: 0.25rem auto 0.15rem;
  }

  .glr-advent__sub {
    font-size: 0.58rem;
  }

  .glr-advent__close {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.25rem;
  }

  .glr-advent__book {
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0.35rem 0 0;
    flex: 1 1 auto;
    overflow: hidden;
    gap: 0.45rem;
    padding: 0.1rem 0.1rem 0.25rem;
    justify-content: stretch;
  }

  .glr-advent__grid {
    flex: 4 1 0;
    min-height: 0;
    gap: 0.45rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    align-content: stretch;
  }

  .glr-advent__grid--row {
    flex: 1 1 0;
    min-height: 0;
    gap: 0.45rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    width: calc((100% - 5 * 0.45rem) * 5 / 6 + 4 * 0.45rem);
    max-width: 100%;
  }

  .glr-advent__cell {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    font-size: clamp(1.05rem, 4.8vw, 1.45rem);
  }
}

body.embed-page .glr-advent-reopen {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  min-height: 2.25rem;
  padding: 0.45rem 1.15rem;
}
