.adv {
  --mint: #00e676;
  --amber: #f5ac40;
  --muted: #a0aba8;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 7px clamp(8px, 2vw, 20px) 10px;
  color: #f4f8f6;
}
.adv__art {
  position: absolute;
  inset: 2px 6% 2px auto;
  width: 39%;
  height: calc(100% - 4px);
  object-fit: contain;
  object-position: right center;
  pointer-events: none;
  z-index: -1;
}
.adv__progress {
  padding: 8px 16px 5px;
  margin-bottom: 8px;
  background: #15191a;
  border: 0;
  border-radius: 12px;
}
.adv__progress-top { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 750; }
.adv__track { position: relative; margin: 9px 12px 21px 0; }
.adv__progress-bar { height: 6px; overflow: hidden; border-radius: 5px; background: #2b3633; }
.adv__progress-fill { width: 0; height: 100%; background: #191b1d;  transition: width .35s ease; }
.adv-milestone { position: absolute; left: var(--position); top: 3px; transform: translate(-50%, -50%); display: grid; place-items: center; width: 17px; height: 17px; border: 0; border-radius: 50%; background: #202726; color: #b9c5c0; font-size: 9px; }
.adv-milestone b { position: absolute; top: 16px; color: #acb8b3; font-size: .68rem; }
.adv-milestone:last-child {  color: #f5ac40; }
.adv-milestone.is-reached { background: #164b36;  color: #abffce; }
.adv__grid { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 9px; }
.adv-door {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: start;
  min-height: clamp(48px, calc((100svh - 365px) / 4), 98px);
  min-width: 0;
  padding: 7px;
  overflow: hidden;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: #242729;
  
  color: #e9efed;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.adv-door__num { position: relative; z-index: 1; font-size: clamp(1.15rem, 2.8vw, 1.85rem); font-weight: 830; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.055em; }
.adv-door__badge { position: absolute; top: 7px; right: 7px; color: #899790; font-size: .65rem; }
.adv-door__ico { align-self: center; justify-self: center; font-size: clamp(.95rem,2.2vw,1.65rem); line-height: 1; color: #a8b8b21e; }
.adv-door__claim, .adv-door__reward { display: none; position: relative; z-index: 1; }
.adv-door.is-locked:hover { transform: translateY(-3px);  }
.adv-door.is-missed { background: #1c1e20; cursor: default; color: #87948e; }
.adv-door.is-missed .adv-door__ico { opacity: .45; }
.adv-door.is-today { z-index: 1; color: #f1fff7;  background: #1a3024; cursor: pointer; }
.adv-door.is-today:hover, .adv-door.is-open:hover { transform: translateY(-3px); }
.adv-door.is-today .adv-door__badge { display: none; }
.adv-door.is-today .adv-door__ico { color: #8cfcc1;  }
.adv-door.is-today .adv-door__claim { display: block; padding: 3px 6px; border-radius: 4px; background: #00e676; color: #062315; font-size: .67rem; font-weight: 820; }
.adv-door.is-open { background: #191b1d;  cursor: pointer; }
.adv-door.is-open .adv-door__badge, .adv-door.is-open .adv-door__ico { color: #7be6ad; }
.adv-door.is-open .adv-door__reward { display: block; width: 100%; color: #b5dec8; font-size: .69rem; line-height: 1.15; overflow-wrap: anywhere; }
.adv-door.is-finale { grid-column: span 2; }
.adv-door:focus-visible, .adv-modal button:focus-visible { outline: 2px solid #adffd3; outline-offset: 3px; }
.adv-modal { position: fixed; inset: 0; width: min(390px, calc(100% - 28px)); max-height: calc(100% - 28px); margin: auto; padding: 0; overflow: auto; border: 0; border-radius: 16px; background: #151d1a; color: #f7fffb; }
.adv-modal::backdrop { background: #060b09bf; backdrop-filter: blur(6px); }
.adv-modal__card { position: relative; isolation: isolate; overflow: hidden; text-align: center; padding: 28px 24px 22px; background: #191b1d; }
.adv-modal__dismiss { position: absolute; top: 8px; right: 9px; width: 34px; height: 34px; background: transparent; border: 0; color: #bed4c8; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.adv-modal__icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 3px auto 14px; border: 0; border-radius: 15px; color: #a6ffca; background: #1b533a; font-size: 1.75rem;  }
.adv-modal.is-revealed .adv-modal__icon { animation: adv-unbox .52s cubic-bezier(.22,.8,.24,1); }
@keyframes adv-unbox { 0% { transform: scale(.7) rotate(-12deg); } 65% { transform: scale(1.18) rotate(6deg); } }
.adv-modal__day { margin: 0 0 6px; color: #8fefbe; font-size: .77rem; font-weight: 750; }
.adv-modal__title { margin: 0; color: #fff; font-weight: 820; font-size: 1.45rem; }
.adv-modal__text { margin: 10px 0 0; color: #c0d1c8; font-size: .89rem; }
.adv-modal__text:empty { display: none; }
.adv-modal__btn { display: block; width: 100%; margin-top: 22px; padding: 12px; border: 0; border-radius: 8px; background: #00e676; color: #072414; font-weight: 830; cursor: pointer; }
.adv-modal__btn:hover { background: #68f6a9; }
.adv-modal__hint { margin: 10px 0 0; color: #99aca2; font-size: .72rem; }
.adv-confetti { position: absolute; inset: 0; pointer-events: none; }
.adv-confetti span { position: absolute; left: 50%; top: 67px; width: 5px; height: 9px; background: #52f9a0; border-radius: 1px; animation: adv-burst .95s ease-out both; }
.adv-confetti span:nth-child(3n) { background: #effff6; }
.adv-confetti span:nth-child(4n) { width: 4px; height: 5px; }
@keyframes adv-burst { from { opacity: 0; transform: scale(.25); } 18% { opacity: 1; } to { opacity: 0; transform: translate(var(--x),var(--y)) rotate(var(--turn)); } }
.adv-toast { position: fixed; bottom: 75px; left: 50%; z-index: 1200; transform: translateX(-50%); padding: 10px 14px; border: 0; border-radius: 8px; background: #232c29; color: #fff; opacity: 0; transition: opacity .2s; }
.adv-toast.is-on { opacity: 1; }
@media (max-width: 680px) {
  .adv__grid { gap: 5px; }
  .adv-door { min-height: clamp(43px, calc((100svh - 390px) / 4), 70px); padding: 5px; border-radius: 6px; }
  .adv-door__num { font-size: clamp(.78rem, 3vw, 1.25rem); }
  .adv-door__badge { top: 5px; right: 4px; font-size: .47rem; }
  .adv-door__ico { font-size: clamp(.64rem, 2.8vw, 1.12rem); }
  .adv-door.is-today .adv-door__claim { padding: 2px 0; width: 100%; text-align: center; font-size: clamp(.39rem, 1.5vw, .64rem); }
  .adv-door.is-open .adv-door__reward { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .6rem; }
  .adv__art { right: 3%; width: 35%; height: 78%; top: auto; bottom: 1px; }
}
@media (max-width: 440px) {
  .adv__grid { gap: 3px; }
  .adv-door { padding: 3px 2px; }
  .adv-door__badge { top: 4px; right: 2px; }
  .adv__art { right: 1%; width: 30%; }
}
@media (prefers-reduced-motion: reduce) {
  .adv *, .adv-modal *, .adv-toast { animation: none !important; transition: none !important; }
}


.adv-modal__code { margin-top: 14px; max-width: 100%; padding: 8px 11px; border: 0; background: #10271c; color: #b0ffd2; border-radius: 7px; font: 700 .84rem ui-monospace, monospace; overflow-wrap: anywhere; cursor: pointer; }
.adv-modal__code[hidden] { display: none; }
.adv-modal__btn:disabled { opacity: .6; cursor: wait; }

.adv .page-topbar { margin: 0 0 10px; }
.adv__art { right: 3%; width: 33%; }
.adv-door.is-premium:not(.is-today):not(.is-open) { background: #27241f; }
@media (max-width: 680px) {
  .adv .page-topbar { margin-bottom: 7px; }
}

/* Calendar doors share two stone materials; colour denotes availability. */
.adv-door {
  --stone: url('/img/advent-slate.webp');
  --stone-opacity: .56;
  background: #242729;
  border-radius: 7px;
}
.adv-door::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: center / cover no-repeat var(--stone);
  opacity: var(--stone-opacity);
  pointer-events: none;
}
.adv-door:nth-child(3n + 2)::before { transform: scaleX(-1); }
.adv-door:nth-child(3n)::before { background-position: 76% center; }
.adv-door.is-premium {
  --stone: url('/img/advent-slate-amber.webp');
  --stone-opacity: .84;
}
.adv-door.is-premium:not(.is-today):not(.is-open) { background: #29251f; }
.adv-door.is-missed { --stone-opacity: .32; background: #181a1c; }
.adv-door.is-today { --stone-opacity: .42; background: #155736; }
.adv-door.is-open { --stone-opacity: .38; background: #20362c; }
.adv-door.is-locked .adv-door__ico, .adv-door.is-missed .adv-door__ico { visibility: hidden; }
.adv-door.is-locked:hover { transform: none; }
.adv-door.is-finale::before { background-position: center 58%; }
.adv-door__badge { z-index: 1; }
.adv__progress-fill { background: #00b85d; }


.adv__intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 13px 18px 8px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #191b1d;
}
.adv__intro-copy { width: 77%; }
.adv__intro-copy h2 { margin: 0; color: #f4f8f6; font-size: clamp(1.15rem, 3.2vw, 1.8rem); font-weight: 800; line-height: 1.12; }
.adv__intro-copy p { margin: 5px 0 0; color: #b2b9b6; font-size: .78rem; line-height: 1.35; }
.adv__intro .adv__art { top: 4px; right: 2%; bottom: auto; width: 26%; height: calc(100% - 9px); }
.adv__intro .adv__progress { max-width: 72%; background: transparent; margin: 0; padding: 10px 0 0; }
.adv__progress-top { color: #b2b9b6; font-size: .76rem; }
.adv__progress-top strong { color: #eef6f1; font-variant-numeric: tabular-nums; }
@media (max-width: 680px) {
  .adv__intro { padding: 10px 11px 5px; }
  .adv__intro-copy p { font-size: .7rem; }
  .adv__intro .adv__art { width: 26%; }
}

.adv-countdown { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 5px; color: #b2b9b6; font-size: .72rem; }
.adv-countdown[hidden], .adv-modal__timer[hidden] { display: none; }
.adv-countdown strong, .adv-modal__timer { color: #8ce6b1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adv-modal__timer { width: fit-content; margin: 13px auto 0; padding: 7px 12px; border-radius: 6px; background: #242a27; font-size: 1.15rem; font-weight: 750; }
.adv-door.is-locked:not(:disabled), .adv-door.is-missed:not(:disabled) { cursor: pointer; }
.adv-door.is-locked:not(:disabled):hover .adv-door__badge { color: #e7f4ec; }
@media (max-width: 680px) {
  .adv-countdown { font-size: .65rem; }
}
