/* ============================================================
   The Advent Door: cream, teal and gold. Mobile first.
   ============================================================ */
.advent-page {
  --cream: #FFF8E7;
  --cream-2: #FCEFCB;
  background: var(--cream);
  color: var(--charcoal);
}
.advent-page .sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.adv-wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 56px; }

.adv-head { text-align: center; margin-bottom: 20px; }
.adv-logo { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--yellow); }
.adv-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-dk); }
.adv-head h1 { font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 900; letter-spacing: -0.03em; color: var(--ink); margin: 4px 0 8px; }
.adv-sub { font-size: 1rem; line-height: 1.5; color: var(--grey); }

.adv-card {
  background: var(--white); border: 1px solid rgba(7,39,44,0.1); border-radius: var(--r-card);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.adv-card h2 { font-size: 1.15rem; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.adv-card a { color: var(--teal-dk); font-weight: 700; }
.adv-muted { font-size: 0.9rem; line-height: 1.45; color: var(--grey); }

.adv-platforms { border: 0; display: flex; gap: 8px; margin: 14px 0 12px; }
.adv-platforms label { flex: 1; }
.adv-platforms input { position: absolute; opacity: 0; pointer-events: none; }
.adv-platforms span {
  display: block; text-align: center; padding: 11px 8px; border-radius: var(--r-pill); font-weight: 700;
  border: 2px solid rgba(7,39,44,0.15); background: var(--white); cursor: pointer;
}
.adv-platforms input:checked + span { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.adv-platforms input:focus-visible + span { outline: 3px solid var(--yellow-dk); outline-offset: 2px; }

.adv-label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.adv-input {
  width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border-radius: 14px;
  border: 2px solid rgba(7,39,44,0.2); background: var(--white); color: var(--charcoal);
}
.adv-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(19,199,182,0.25); }
.adv-error { color: #B3261E; font-weight: 600; font-size: 0.9rem; min-height: 1.2em; margin-top: 8px; }

.adv-note { text-align: center; font-weight: 700; color: var(--ink); margin: 6px 0 14px; min-height: 1.4em; }

/* The 25 doors */
.adv-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.adv-door {
  position: relative; aspect-ratio: 3 / 4; width: 100%; padding: 4px 2px; border-radius: 12px 12px 6px 6px;
  border: 2px solid var(--teal-dk); background: linear-gradient(180deg, var(--teal) 0%, var(--teal-dk) 100%);
  color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: inherit; box-shadow: 0 3px 0 rgba(7,39,44,0.25); transition: transform 0.12s ease;
}
.adv-door:hover { transform: translateY(-2px); }
.adv-door b { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.adv-door small { font-size: 0.58rem; font-weight: 700; line-height: 1.15; text-align: center; }
.adv-door::after { content: ''; position: absolute; right: 7px; top: 52%; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 1px rgba(7,39,44,0.3); }
.adv-door.is-locked { background: var(--cream-2); border-color: rgba(7,39,44,0.2); color: var(--grey); box-shadow: none; }
.adv-door.is-locked::after { background: rgba(7,39,44,0.25); box-shadow: none; }
.adv-door.is-today { border-color: var(--yellow-dk); box-shadow: 0 0 0 3px var(--yellow), 0 6px 18px rgba(232,184,0,0.5); animation: advGlow 2.2s ease-in-out infinite; }
.adv-door.is-done { background: var(--ink); border-color: var(--ink); color: var(--yellow); }
.adv-door.is-done::after { display: none; }
.adv-door:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@keyframes advGlow { 50% { box-shadow: 0 0 0 5px rgba(253,205,44,0.75), 0 8px 22px rgba(232,184,0,0.6); } }
@media (prefers-reduced-motion: reduce) { .adv-door.is-today { animation: none; } .adv-door { transition: none; } }

.adv-fine { text-align: center; font-size: 0.82rem; color: var(--grey); line-height: 1.5; }

.adv-btn {
  display: inline-block; width: 100%; text-align: center; font: inherit; font-weight: 800; padding: 14px 18px; border-radius: var(--r-pill);
  border: 0; background: var(--yellow); color: var(--ink); text-decoration: none; margin-top: 12px; box-shadow: var(--shadow-xs);
}
.adv-btn:hover { background: var(--yellow-dk); }
.adv-btn:disabled { opacity: 0.6; cursor: default; }
.adv-btn--ghost { background: transparent; border: 2px solid var(--teal-dk); }
.adv-card .adv-btn { color: var(--ink); }

/* Popup */
.adv-modal { position: fixed; inset: 0; z-index: 200; background: rgba(7,39,44,0.6); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.adv-modal[hidden] { display: none; }
.adv-modal-card {
  position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--cream);
  border-radius: 24px 24px 0 0; padding: 28px 22px 26px; border-top: 6px solid var(--yellow); text-align: center;
}
@media (min-width: 560px) { .adv-modal { align-items: center; padding: 16px; } .adv-modal-card { border-radius: 24px; } }
.adv-x { position: absolute; right: 12px; top: 8px; width: 44px; height: 44px; font-size: 1.8rem; line-height: 1; background: none; border: 0; color: var(--grey); }
.adv-door-num { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-dk); }
.adv-act { font-size: 1.4rem; font-weight: 800; line-height: 1.3; color: var(--ink); margin: 10px 0 8px; letter-spacing: -0.015em; }
.adv-pts { display: inline-block; font-weight: 800; background: var(--ink); color: var(--yellow); border-radius: var(--r-pill); padding: 4px 14px; margin-bottom: 10px; }
.adv-pts:empty { display: none; }
.adv-code-box { margin-top: 12px; }
.adv-code { font-size: 1.8rem; font-weight: 900; letter-spacing: 0.08em; color: var(--ink); background: var(--white); border: 2px dashed var(--teal-dk); border-radius: 16px; padding: 12px 8px; margin: 6px 0 4px; user-select: all; word-break: break-all; }

.advent-page [hidden] { display: none !important; }
.advent-page .adv-door.is-locked::after { display: none; }

/* Claim: initials of the person the act was for (doors aimed at one person). */
.adv-init { text-align: left; margin: 4px 0 14px; }
.adv-init[hidden] { display: none; }
.adv-init .adv-input { text-transform: uppercase; letter-spacing: .12em; }
.adv-init-note { margin: 6px 0 0; font-size: .82rem; }
