/* ==========================================================================
   Advent calendar ("Polar Supply Drops") - prototype block.

   Two parts: the calendar grid (.advent, .advent-door) and the full-screen
   airdrop (.advent-drop) that plays when a visitor opens the day's door.
   Colours and fonts come from base.2.0.0.css; nothing here restyles a shared
   class. Aurora uses brand green, yellow is kept for the one door that can be
   opened today and for the card's primary action.
   ========================================================================== */

.advent {
  --adv-night-1: #081014;
  --adv-night-2: #0E1F28;
  --adv-night-3: #17313B;
  --adv-steel-1: #343E45;
  --adv-steel-2: #252C32;
  --adv-steel-3: #1A2025;
  --adv-ice: #D5E8EE;
  position: relative;
  overflow: hidden;
  padding: 56px 0 64px;
  background: linear-gradient(180deg, var(--adv-night-1) 0%, var(--adv-night-2) 58%, var(--color-black-heat) 100%);
}
.advent [hidden] { display: none !important; }

/* Sky dressing: cold moonlight from above, and snow falling behind the doors. Decorative only. (No
   green here: the aurora belongs to the airdrop scene, where it is drawn as one.) The snow is a canvas
   the script draws on, flake by flake. */
.advent__sky { position: absolute; inset: 0; pointer-events: none; }
.advent__sky::before {
  content: '';
  position: absolute;
  inset: -10% -10% 35% -10%;
  background:
    radial-gradient(ellipse 50% 62% at 26% 0%, rgba(126, 168, 235, 0.16), transparent 70%),
    radial-gradient(ellipse 40% 50% at 74% 4%, rgba(150, 190, 240, 0.10), transparent 72%);
  animation: adventAurora 14s ease-in-out infinite alternate;
}
.advent__snow { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
@keyframes adventAurora {
  from { transform: translateX(-3%) scaleY(1); opacity: 0.75; }
  to   { transform: translateX(4%) scaleY(1.12); opacity: 1; }
}

.advent > .container { position: relative; z-index: 1; }

/* ---- Heading row ------------------------------------------------------- */
.advent__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 28px;
}
.advent__eyebrow {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-green);
}
.advent__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.4vw + 0.6rem, 2.25rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}
.advent__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: rgba(18, 25, 29, 0.6);
  min-width: 190px;
}
.advent__status-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.advent__status-value {
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
/* As wide as the grid under it (Luke, 19 Nov): no measure of its own. */
.advent__lead {
  margin: -8px 0 26px;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
}
.advent__lead [id="adventLocalTime"] { color: var(--text-muted); }
.advent__note {
  margin: 22px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.advent__live { min-height: 1.4em; margin: 10px 0 0; font-size: 0.875rem; color: var(--color-green); }

/* ---- Grid ---------------------------------------------------------------
   21 daily doors are 7 x 3 on wide screens and 3 x 7 on phones (21 divides by
   both, so no row is ever left ragged); the final door spans the full row. */
.advent__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.advent-door { position: relative; margin: 0; }
.advent-door--final { grid-column: 1 / -1; }

.advent-door__btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.06;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease;
}
.advent-door--final .advent-door__btn { aspect-ratio: auto; min-height: 132px; }
.advent-door__btn:focus-visible { outline: 2px solid var(--color-yellow); outline-offset: 3px; }

/* The lid: a supply-crate hatch with the date stencilled on it. The top-right
   corner is cut at the 45 degrees of the HEAT symbol. */
.advent-door__lid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 58 35'%3E%3Cpath fill='%23F8F7F6' fill-opacity='0.07' fill-rule='evenodd' d='M35.116 8.80331L22.884 21.0004V26.2021L14.0565 35H0V21.0004L21.0577 0H35.1142V8.80152L35.116 8.80331ZM58 14.0122L36.9405 35H22.884V26.2021L35.116 14.0122V8.80331L43.9435 0.00179222H58V14.0122Z'/%3E%3C/svg%3E") right 12px top 14px / 44% auto no-repeat,
    linear-gradient(180deg, rgba(248, 247, 246, 0.07), rgba(248, 247, 246, 0) 42%),
    linear-gradient(155deg, var(--adv-steel-1) 0%, var(--adv-steel-2) 52%, var(--adv-steel-3) 100%);
  box-shadow: inset 0 0 0 1px rgba(248, 247, 246, 0.12);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  overflow: hidden;
}
/* Hazard band along the lid's bottom edge. */
.advent-door__lid::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--color-yellow) 0 8px, var(--color-black-heat) 8px 16px);
}
/* A lit top edge, so the lid reads as a raised panel and not a flat tile. */
.advent-door__lid::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(248, 247, 246, 0.28), rgba(248, 247, 246, 0.06));
}
.advent-door__month {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.advent-door__num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.625rem);
  line-height: 1;
  letter-spacing: 0.02em;
}
.advent-door__tag {
  position: absolute;
  top: 10px; left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.advent-door__mark { position: absolute; right: 10px; bottom: 16px; width: 18px; height: 18px; opacity: 0.55; }
.advent-door__mark svg { display: block; width: 100%; height: 100%; }
.advent-door__mark img { display: block; width: 100%; height: auto; }

/* Locked: a day that has not arrived. Frosted over, nothing to see. */
.advent-door--locked .advent-door__btn { cursor: default; }
.advent-door--locked .advent-door__lid {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 58 35'%3E%3Cpath fill='%23F8F7F6' fill-opacity='0.07' fill-rule='evenodd' d='M35.116 8.80331L22.884 21.0004V26.2021L14.0565 35H0V21.0004L21.0577 0H35.1142V8.80152L35.116 8.80331ZM58 14.0122L36.9405 35H22.884V26.2021L35.116 14.0122V8.80331L43.9435 0.00179222H58V14.0122Z'/%3E%3C/svg%3E") right 12px top 14px / 44% auto no-repeat,
    linear-gradient(180deg, rgba(213, 232, 238, 0.10), rgba(213, 232, 238, 0) 50%),
    linear-gradient(155deg, #2C353B 0%, #21282D 52%, #191E22 100%);
}
.advent-door--locked .advent-door__lid::after { opacity: 0.22; filter: grayscale(1); }
.advent-door--locked .advent-door__num { color: rgba(248, 247, 246, 0.42); }
.advent-door--locked .advent-door__month { color: rgba(248, 247, 246, 0.36); }
.advent-door--nudge .advent-door__btn { animation: adventNudge 0.36s ease; }
@keyframes adventNudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  82% { transform: translateX(-2px); }
}

/* A locked door that is clicked says when it opens, on the door itself, for a few seconds. */
.advent-door__note {
  position: absolute;
  left: 6px; right: 6px; top: 6px;
  z-index: 2;
  padding: 6px 8px;
  border: 1px solid rgba(248, 247, 246, 0.28);
  background: rgba(8, 16, 20, 0.94);
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--text);
  pointer-events: none;
  animation: adventNote 3s ease both;
}
@keyframes adventNote {
  0%   { opacity: 0; transform: translateY(-4px); }
  7%   { opacity: 1; transform: none; }
  88%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Ready: today's door, not opened yet. The only yellow in the grid. */
.advent-door--ready .advent-door__btn { filter: drop-shadow(0 0 12px rgba(255, 216, 92, 0.38)); }
.advent-door--ready .advent-door__lid::before { content: none; }
.advent-door--ready .advent-door__lid {
  box-shadow: inset 0 0 0 2px var(--color-yellow);
  background:
    linear-gradient(180deg, rgba(255, 216, 92, 0.16), rgba(255, 216, 92, 0) 55%),
    linear-gradient(155deg, #3A444B 0%, #2A3238 52%, #1E2529 100%);
}
.advent-door--ready .advent-door__tag { color: var(--color-yellow); }
.advent-door--ready .advent-door__tag::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-yellow);
  animation: adventBeacon 1.4s ease-in-out infinite;
}
.advent-door--ready .advent-door__mark { opacity: 1; width: 34px; height: auto; right: 12px; top: 24px; bottom: auto; animation: adventBob 2.6s ease-in-out infinite; }
.advent-door--ready .advent-door__btn:hover,
.advent-door--open .advent-door__btn:hover { transform: translateY(-3px); }
@keyframes adventBeacon {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 216, 92, 0.7); }
  60% { opacity: 0.5; box-shadow: 0 0 0 7px rgba(255, 216, 92, 0); }
}
@keyframes adventBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(5px) rotate(4deg); }
}

/* Open: the lid is off and the reward sits in the crate. */
.advent-door__inside {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 26px 8px 10px;
  background:
    radial-gradient(circle at 50% 46%, rgba(190, 220, 245, 0.11), transparent 62%),
    #10171B;
  box-shadow: inset 0 0 0 1px rgba(248, 247, 246, 0.14), inset 0 12px 22px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
/* The lid, seen edge-on where it has been flipped back. */
.advent-door__inside::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--adv-steel-1), var(--adv-steel-2));
}
.advent-door__chip {
  position: absolute;
  top: 11px; left: 10px;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.advent-door__art {
  flex: 1 1 auto;
  min-height: 0;
  width: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.advent-door__art img,
.advent-door__art svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55));
}
.advent-door__art svg { width: 100%; height: 100%; }
.advent-door__name {
  flex: 0 0 auto;
  width: 100%;
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.advent-door__inside { padding-bottom: 28px; }
.advent-door__strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 4px 6px;
  font-size: 0.625rem;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  background: var(--color-yellow);
  color: var(--color-black-heat);
  font-weight: 700;
}
/* A past drop: it can no longer be collected, so it is shown spent. */
.advent-door--past .advent-door__inside { background: #12181C; }
.advent-door--past .advent-door__art img,
.advent-door--past .advent-door__art svg { filter: grayscale(1) brightness(0.85); opacity: 0.8; }
.advent-door--past .advent-door__name { color: rgba(248, 247, 246, 0.5); }
.advent-door--past .advent-door__chip { color: rgba(248, 247, 246, 0.42); }
.advent-door--past .advent-door__strip { background: rgba(248, 247, 246, 0.07); color: rgba(248, 247, 246, 0.5); font-weight: 500; }
.advent-door--fresh .advent-door__inside { animation: adventFresh 1.1s ease-out; }
@keyframes adventFresh {
  0% { box-shadow: inset 0 0 0 2px var(--color-yellow), inset 0 0 44px rgba(255, 216, 92, 0.55); }
  100% { box-shadow: inset 0 0 0 1px rgba(248, 247, 246, 0.14), inset 0 12px 22px rgba(0, 0, 0, 0.6); }
}

/* Final door: one wide crate across the bottom row, tied with a ribbon. */
.advent-door__ribbon { position: absolute; top: 0; bottom: 0; right: 84px; width: 18px; background: linear-gradient(90deg, #AB391B 0 28%, var(--color-red) 28%); }
.advent-door--locked .advent-door__ribbon { opacity: 0.4; }
.advent-door--final .advent-door__lid { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 14px 20px 20px; }
.advent-door--final .advent-door__lid { background-size: 120px auto, auto, auto; background-position: right 130px top 16px, 0 0, 0 0; }
.advent-door--final.advent-door--ready .advent-door__lid { background-size: auto; background-position: 0 0; }
.advent-door--final .advent-door__date { display: flex; flex-direction: column; }
.advent-door--final .advent-door__num { font-size: clamp(2rem, 4vw, 3.25rem); }
.advent-door__final-label {
  font-family: var(--font-display);
  font-size: clamp(0.9375rem, 1.6vw, 1.375rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
}
.advent-door--final.advent-door--locked .advent-door__final-label { color: rgba(248, 247, 246, 0.42); }
.advent-door--final .advent-door__mark { position: static; flex: 0 0 auto; }
.advent-door--final.advent-door--ready .advent-door__mark { position: static; width: 46px; height: auto; }
.advent-door--final .advent-door__inside { flex-direction: row; gap: 20px; padding: 18px 24px 34px; justify-content: flex-start; }
.advent-door--final .advent-door__art { flex: 0 0 auto; width: 150px; height: 96px; }
.advent-door--final .advent-door__name { width: auto; text-align: left; font-size: 1.0625rem; font-family: var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; }
.advent-door--final .advent-door__chip { position: static; order: 3; margin-left: auto; align-self: flex-start; }
/* A drop of several things (the final one): each with its picture and name. On the final door they
   stand in a row, the first (the vehicle) larger; in the card they are a list. A set of pictures for
   one item (three boosters) overlaps like a hand of cards. */
.advent-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.advent-item__art { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 64px; height: 48px; }
.advent-item__art img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.advent-item__art--set img { max-width: 46%; margin-left: -12%; }
.advent-item__art--set img:first-child { margin-left: 0; }
.advent-item__name { font-size: 0.8125rem; line-height: 1.25; text-align: left; }
.advent-door__items { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.advent-door__items .advent-item { flex: 0 1 auto; }
.advent-door__items .advent-item--lead .advent-item__art { width: 150px; height: 96px; }
.advent-door__items .advent-item--lead .advent-item__name { max-width: 290px; font-family: var(--font-display); font-size: 1.0625rem; letter-spacing: 0.05em; text-transform: uppercase; }
/* The final door with its items listed is as tall as the list needs (on a phone the row wraps), so its
   inside is laid out in the flow and not stretched over a door of fixed height. */
.advent-door--final .advent-door__inside { position: relative; inset: auto; min-height: 132px; align-items: center; }
.advent-door--past .advent-item__art img { filter: grayscale(1) brightness(0.85); opacity: 0.8; }
.advent-door--past .advent-item__name { color: rgba(248, 247, 246, 0.6); }
.advent-card__items { display: grid; gap: 10px; margin-top: 8px; }
.advent-card__items .advent-item__art { width: 76px; height: 52px; }
.advent-card__items .advent-item__name { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.03em; color: var(--color-yellow); }
.advent-card--ended .advent-card__items .advent-item__name { color: var(--color-gray-300); }
.advent-card--ended .advent-item__art img { filter: grayscale(1) brightness(0.8); }
/* The ribbon reads as the lid's right-hand edge, so the label is centred in what lies left of it
   (equal space to the lid's left edge and to the ribbon: 222px = 120px + the ribbon's 18px + its 84px). */
.advent-door--final .advent-door__final-label { position: absolute; left: 120px; right: 222px; bottom: 20px; text-align: center; }

/* ---- Festive finish ------------------------------------------------------
   The calendar's Christmas colours. Each door is a crate wrapped in one of three deep colours taken
   from the drop scene: spruce green, the red of the bundle's band and bow, and frosted steel. The
   script gives every door its colour (data-tone) in an order where no two neighbours match, in the
   7-column grid or the 3-column one. A door keeps its colour once it is opened and after its drop
   has ended, so the grid does not turn grey as December goes on. A locked door's hazard band becomes
   candy-cane stripes. Today's door stays the only yellow.
   Nothing is drawn on top of the doors (lights and snow caps were tried and taken out): the colour
   is the doors' own. Without advent--festive on the section (?festive=0 on the address) the doors
   are the plain steel ones above. */
.advent--festive .advent-door[data-tone="pine"]      { --tone-1: #2D6651; --tone-2: #1C4636; --tone-3: #112D23; --tone-in: #0E211A; --tone-glow: rgba(132, 255, 177, 0.11); }
.advent--festive .advent-door[data-tone="cranberry"] { --tone-1: #8C3A2C; --tone-2: #66261E; --tone-3: #411611; --tone-in: #24110E; --tone-glow: rgba(255, 109, 70, 0.13); }
.advent--festive .advent-door[data-tone="frost"]     { --tone-1: #66839A; --tone-2: #465F72; --tone-3: #2E4252; --tone-in: #111D26; --tone-glow: rgba(190, 220, 245, 0.13); }
.advent--festive .advent-door--locked .advent-door__lid {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 58 35'%3E%3Cpath fill='%23F8F7F6' fill-opacity='0.11' fill-rule='evenodd' d='M35.116 8.80331L22.884 21.0004V26.2021L14.0565 35H0V21.0004L21.0577 0H35.1142V8.80152L35.116 8.80331ZM58 14.0122L36.9405 35H22.884V26.2021L35.116 14.0122V8.80331L43.9435 0.00179222H58V14.0122Z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(248, 247, 246, 0.10), rgba(248, 247, 246, 0) 46%),
    linear-gradient(155deg, var(--tone-1, #2C353B) 0%, var(--tone-2, #21282D) 52%, var(--tone-3, #191E22) 100%);
  box-shadow: inset 0 0 0 1px rgba(248, 247, 246, 0.16);
}
.advent--festive .advent-door--locked .advent-door__lid::after {
  opacity: 0.86;
  filter: none;
  background: repeating-linear-gradient(-45deg, #F1ECE4 0 8px, #D8432F 8px 16px);
}
.advent--festive .advent-door--locked .advent-door__num { color: rgba(248, 247, 246, 0.95); }
.advent--festive .advent-door--locked .advent-door__month { color: rgba(248, 247, 246, 0.74); }
.advent--festive .advent-door--locked .advent-door__mark { opacity: 0.72; }
.advent--festive .advent-door--locked .advent-door__ribbon { opacity: 1; }
.advent--festive .advent-door--final.advent-door--locked .advent-door__final-label { color: rgba(248, 247, 246, 0.95); }
/* Opened, and ended: the crate is lined in the door's colour, and its flipped-back lid shows it too. */
.advent--festive .advent-door__inside,
.advent--festive .advent-door--past .advent-door__inside {
  background:
    radial-gradient(circle at 50% 46%, var(--tone-glow, rgba(190, 220, 245, 0.11)), transparent 66%),
    var(--tone-in, #10171B);
}
.advent--festive .advent-door__inside::before { height: 6px; background: linear-gradient(90deg, var(--tone-1, #343E45), var(--tone-2, #252C32)); }
.advent--festive .advent-door--past .advent-door__strip { background: var(--tone-3, rgba(248, 247, 246, 0.07)); color: rgba(248, 247, 246, 0.72); }
.advent--festive .advent-door--past .advent-door__name { color: rgba(248, 247, 246, 0.66); }
.advent--festive .advent-door--past .advent-door__chip { color: rgba(248, 247, 246, 0.56); }

@media (max-width: 860px) {
  .advent-door__name { font-size: 0.6875rem; }
  .advent-door__lid { padding: 8px 8px 14px; }
  .advent-door__tag { left: 8px; top: 8px; font-size: 0.5625rem; letter-spacing: 0.08em; }
  .advent-door__chip { left: 8px; }
  .advent__grid { gap: 8px; }
}
@media (max-width: 700px) {
  .advent { padding: 40px 0 48px; }
  .advent__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .advent__status { align-items: flex-start; width: 100%; }
  .advent-door__num { font-size: 2rem; }
  .advent-door__name { font-size: 0.75rem; }
  .advent-door__tag { font-size: 0.625rem; }
  .advent-door--final .advent-door__art { width: 96px; height: 70px; }
  .advent-door--final .advent-door__inside { padding: 16px 16px 36px; gap: 12px; }
  .advent-door--final .advent-door__name { font-size: 0.875rem; }
  .advent-door__items { gap: 8px 14px; }
  .advent-door__items .advent-item--lead { flex-basis: 100%; }
  .advent-door__items .advent-item--lead .advent-item__art { width: 96px; height: 64px; }
  .advent-door__items .advent-item--lead .advent-item__name { font-size: 0.875rem; }
  .advent-item__art { width: 40px; height: 32px; }
  .advent-item__name { font-size: 0.6875rem; }
  /* Too narrow for equal margins: the label takes the room between the date and the ribbon. */
  .advent-door--final .advent-door__final-label { position: static; flex: 1 1 auto; padding-right: 56px; }
}

/* ==========================================================================
   The airdrop. A pop-up window over the page: a cargo plane crosses the polar
   sky, a wrapped cargo bundle comes down under a parachute, lands, and the
   reward rises out of it; then the day's card slides in beside the scene.

   The plane, cargo bundle and parachutes are renders of the game's models
   (advent/art/). Each step is a class the script adds in order (is-flying,
   is-dropping, is-landed, is-opened, is-card). Every element's resting look is
   written against those classes, and the movement is added only while
   is-animated is also set. Skipping, reduced motion and re-opening a past door
   all add the classes at once without is-animated, which lands on the same
   final frame.
   ========================================================================== */
.advent-drop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 11, 14, 0.82);
  color: var(--text);
  opacity: 0;
  transition: opacity 0.22s ease;
  --adv-night-1: #081014;
  --adv-night-2: #0E1F28;
  --adv-night-3: #17313B;
}
.advent-drop[hidden] { display: none; }
.advent-drop.is-in { opacity: 1; }
html.advent-drop-open, html.advent-drop-open body { overflow: hidden; }

.advent-drop__window {
  position: relative;
  display: flex;
  flex-direction: row;
  width: min(1120px, 100%);
  height: min(660px, 100%);
  background: var(--adv-night-1);
  border: 1px solid rgba(248, 247, 246, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.advent-drop.is-in .advent-drop__window { transform: none; }

.advent-drop__scene {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  /* clip, where the browser knows it: a hidden box can still be scrolled (by focus, by a script), and the
     aircraft waiting beyond the right-hand edge gives it somewhere to scroll to. The script guards the rest. */
  overflow: hidden;
  overflow: clip;
  background: linear-gradient(180deg, #03060F 0%, #09132A 40%, #1A2D4D 62%, #2B3B5C 100%);
}
/* The night, back to front: sky, two aurora curtains, the landscape behind the bundle (mountains and
   the facility on the horizon, forest, the middle distance), and the near ground in front of it. The
   pictures all have the same proportions and each covers the scene from its bottom centre, so they
   stay in register in any window shape. The gradient on the scene shows until they have loaded. */
.advent-drop__layer {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  pointer-events: none;
}
.advent-drop__sky { background-image: url('art/sky.webp?v=ee3443cf'); }
/* The landscape is the path-traced render (light followed as it bounces between surfaces). The
   ordinary render of the same scene is kept for comparison: ?art=plain on the address shows it. */
.advent-drop__land--back,
.advent-drop__land--beam { background-image: url('art/land-back-pt.webp?v=200b0df1'); }
.advent-drop__land--near { background-image: url('art/land-near-pt.webp?v=abc30330'); }
.advent-drop--plain .advent-drop__land--back,
.advent-drop--plain .advent-drop__land--beam { background-image: url('art/land-back.webp?v=f9268f97'); }
.advent-drop--plain .advent-drop__land--near { background-image: url('art/land-near.webp?v=38575772'); }
/* The facility's beam stands far beyond the aircraft, but it is painted into the same picture as the
   trees, which stand in front of the aircraft. So the strip of sky the beam rises through is drawn
   from that picture behind the aircraft (--beam), and the copy in front (--back) leaves the strip out.
   The masks are drawn in the picture's own pixels and sized and placed as the picture is, so they stay
   in register in any window shape. The strip behind is a little larger than the gap in front and
   reaches a little way into the solid mountain, so the two meet only on empty sky or solid ground and
   leave no seam. The prototype's build_scene_art script measures the strip and rewrites the next two
   rules (sprites.json "beam"). */
.advent-drop__land--beam { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2400' height='1350'%3E%3Cpath d='M872 0H977V625H872Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2400' height='1350'%3E%3Cpath d='M872 0H977V625H872Z'/%3E%3C/svg%3E"); }
.advent-drop__land--back { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2400' height='1350'%3E%3Cpath fill-rule='evenodd' d='M0 0H2400V1350H0ZM880 0H969V605H880Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2400' height='1350'%3E%3Cpath fill-rule='evenodd' d='M0 0H2400V1350H0ZM880 0H969V605H880Z'/%3E%3C/svg%3E"); }
.advent-drop__land--beam,
.advent-drop__land--back {
  -webkit-mask-size: cover;
          mask-size: cover;
  -webkit-mask-position: center bottom;
          mask-position: center bottom;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}
/* The aurora is two curtains that drift against each other and brighten and fade out of step, with a
   slow band of light travelling along them. */
.advent-drop__aurora {
  -webkit-mask-image: linear-gradient(100deg, #000 0%, rgba(0, 0, 0, 0.5) 28%, #000 52%, rgba(0, 0, 0, 0.55) 78%, #000 100%);
          mask-image: linear-gradient(100deg, #000 0%, rgba(0, 0, 0, 0.5) 28%, #000 52%, rgba(0, 0, 0, 0.55) 78%, #000 100%);
  -webkit-mask-size: 200% 100%;
          mask-size: 200% 100%;
  animation: adventShimmer 19s linear infinite;
}
.advent-drop__curtain { position: absolute; inset: 0; background: center bottom / cover no-repeat; transform-origin: 50% 100%; }
.advent-drop__curtain--a { background-image: url('art/aurora-a.webp?v=405b444d'); animation: adventCurtainA 9s ease-in-out infinite alternate; }
.advent-drop__curtain--b { background-image: url('art/aurora-b.webp?v=95e29b46'); animation: adventCurtainB 13s ease-in-out infinite alternate; }
@keyframes adventCurtainA {
  from { opacity: 0.5; transform: translateX(-1.3%) scaleY(1); }
  to   { opacity: 1; transform: translateX(1.5%) scaleY(1.07); }
}
@keyframes adventCurtainB {
  from { opacity: 0.95; transform: translateX(1.7%) scaleY(1.06); }
  to   { opacity: 0.45; transform: translateX(-1.5%) scaleY(1); }
}
@keyframes adventShimmer {
  from { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
  to   { -webkit-mask-position: 200% 0; mask-position: 200% 0; }
}
/* Darker towards the edges, as a night photograph is. */
.advent-drop__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 80% at 50% 60%, rgba(2, 5, 12, 0) 45%, rgba(2, 5, 12, 0.5) 100%);
}
/* Falling snow: a canvas the script draws on (flakes at different depths, sizes and speeds). */
.advent-drop__snow {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes adventTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Heads-up line while the drop is in the air. */
.advent-drop__hud {
  position: absolute;
  left: 0; right: 0; top: 20px;
  text-align: center;
  padding: 0 64px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.advent-drop.is-flying .advent-drop__hud { opacity: 1; }
.advent-drop.is-opened .advent-drop__hud { opacity: 0; }
.advent-drop__hud-line {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(0.8125rem, 1.4vw, 1.0625rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-green);
}
.advent-drop__hud-day { display: block; margin-top: 4px; font-size: 0.8125rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }

/* The gunship, nose to the left, a long way off: it comes in, passes over and climbs away. The script
   sets where it enters and leaves (--advent-plane-from, --advent-plane-to) and how long the pass takes.
   It crosses at a steady speed; it grows a little as it nears and shrinks as it goes, and the picture
   inside rocks gently, as a heavy aircraft does. */
.advent-drop__plane {
  position: absolute;
  top: 6%;
  left: 0;
  width: min(390px, 54%);
  transform: translate(var(--advent-plane-from, 120vw), 14px) scale(0.86);
  opacity: 0;
}
.advent-drop__plane-rock { position: relative; transform-origin: 60% 50%; }
.advent-drop__plane-rock img { display: block; max-width: none; }
.advent-drop__plane-body { position: relative; width: 100%; height: auto; }
.advent-drop.is-animated.is-flying .advent-drop__plane { opacity: 1; animation: adventPlane var(--advent-plane-ms, 6200ms) linear both; }
.advent-drop.is-animated.is-flying .advent-drop__plane-rock { animation: adventPlaneRock 2.1s ease-in-out infinite alternate; }
/* The cargo ramp. The game's gunship is one sealed hull, so the render cuts the ramp out of the aircraft
   (plane.webp is what is left) and it is laid back here as a picture of its own. Opening: the ramp
   turns down about its front edge to just below level. Where it sits, its hinge and the angle are
   measured from the renders by the prototype's build_scene_art script, as shares of the aircraft's
   picture (the script rewrites the next two rules). */
.advent-drop__plane-ramp { left: 59.01%; top: 83.88%; width: 12.85%; transform-origin: 7.73% 99.17%; }
.advent-drop__plane { --advent-ramp-open: 29.6deg; --advent-ramp-slope: 8.9deg; }
.advent-drop__plane-rock .advent-drop__plane-ramp { position: absolute; height: auto; }
.advent-drop.is-ramp .advent-drop__plane-rock .advent-drop__plane-ramp { transform: rotate(var(--advent-ramp-open)); }
.advent-drop.is-animated .advent-drop__plane-rock .advent-drop__plane-ramp { transition: transform 0.9s cubic-bezier(0.3, 0, 0.3, 1); }
/* The bundle on its way out, at the aircraft's own scale. It is drawn behind the hull, so it shows only
   in the gap the open ramp leaves and beyond the aircraft's outline, as cargo in the hold would. Its
   box stands on the ramp's edge (left and top are that point) and leans with the ramp; the slide brings
   it there from just inside the hold, along the ramp, gathering speed as an extraction parachute would
   pull it (it starts a bundle and a half back: any further and the hull hides most of the run), then
   over the edge and down until it is clear of the hull. Only there does the script hand over to the
   rig below, at this size and place: the rig is drawn in front of everything, so a bundle that still
   overlapped the aircraft would look stuck on its side. */
.advent-drop__cargo {
  position: absolute;
  left: 70.85%; top: 102.19%;
  width: 10.27%;
  opacity: 0;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--advent-ramp-slope));
}
.advent-drop__cargo img { width: 100%; height: auto; }
/* the rig's bow, where the rig's bundle wears it (the build script rewrites this rule from sprites.json) */
.advent-drop__cargo-bow { position: absolute; left: calc(100% * 50.7 / 210); top: calc(100% * -7.6 / 161.7); width: calc(100% * 30.2 / 210); height: calc(100% * 72.4 / 161.7); }
.advent-drop__cargo .advent-drop__cargo-bow img { width: 100%; height: 100%; }
.advent-drop.is-animated.is-sliding .advent-drop__cargo { opacity: 1; animation: adventCargoSlide var(--advent-slide-ms, 1250ms) linear both; }
/* (as specific as the rule above, and after it: once the rig has taken over, the small bundle is gone) */
.advent-drop.is-animated.is-dropping .advent-drop__cargo,
.advent-drop.is-dropping .advent-drop__cargo { opacity: 0; animation: none; }
@keyframes adventCargoSlide {
  from { transform: translate(-50%, -100%) rotate(var(--advent-ramp-slope)) translateX(-150%); animation-timing-function: cubic-bezier(0.4, 0, 0.85, 0.75); }
  /* at the ramp's edge: from here it goes over, tipping, and drops clear of the hull */
  72%  { transform: translate(-50%, -100%) rotate(var(--advent-ramp-slope)) translateX(0); animation-timing-function: cubic-bezier(0.3, 0, 0.7, 0.6); }
  to   { transform: translate(-50%, -100%) rotate(var(--advent-ramp-slope)) translate(95%, 82%) rotate(16deg); }
}
/* Steady across (the sideways position is a straight line in time: the script times the release by
   it), but not on rails: it comes in a little low and nose-down, levels out over the drop, then
   climbs away nose-up, growing as it nears and shrinking as it goes. */
@keyframes adventPlane {
  from { transform: translate(var(--advent-plane-from, 120vw), 30px) scale(0.8) rotate(-2.6deg); }
  28%  { transform: translate(calc(var(--advent-plane-from, 120vw) * 0.72 + var(--advent-plane-to, -120%) * 0.28), 10px) scale(0.92) rotate(-1.4deg); }
  52%  { transform: translate(calc(var(--advent-plane-from, 120vw) * 0.48 + var(--advent-plane-to, -120%) * 0.52), 0) scale(1) rotate(0deg); }
  76%  { transform: translate(calc(var(--advent-plane-from, 120vw) * 0.24 + var(--advent-plane-to, -120%) * 0.76), -16px) scale(0.95) rotate(2.2deg); }
  to   { transform: translate(var(--advent-plane-to, -120%), -46px) scale(0.84) rotate(4.5deg); }
}
@keyframes adventPlaneRock {
  from { transform: rotate(-1.5deg) translateY(-3px); }
  to   { transform: rotate(1.3deg) translateY(3px); }
}
.advent-drop__navlight {
  position: absolute;
  width: 6px; height: 6px;
  margin: -1px 0 0 -3px;
  border-radius: 50%;
  background: var(--color-red);
  box-shadow: 0 0 9px 3px rgba(255, 109, 70, 0.75);
  animation: adventTwinkle 0.7s steps(2, end) infinite;
}

/* The rig: parachute plus cargo bundle. It stands on the ground line (--advent-ground, measured by the
   script from how the landscape is scaled) at the size the bundle has at its distance (--advent-fit).
   While it falls the script positions it; these rules are where it rests. */
.advent-drop__rig {
  position: absolute;
  left: 50%;
  bottom: var(--advent-ground, 22.8%);
  width: 250px;
  margin-left: -125px;
  opacity: 0;
  /* the script also scales the rig while it falls (small at the aircraft, full size on the ground): about the bundle's base */
  transform-origin: 50% 100%;
}
/* The landing site shares the rig's footprint: a zero-height box on the line the bundle's base rests
   on, scaled with it. The bundle is sandwiched between two pictures rendered with the same camera as
   the bundle itself: the snow it sinks into with the shadow it casts (under), and the snow banked
   against its base (over). Offsets are in the rig's own pixels (bundle 210 wide, starting 20 in) and
   come from sprites.json, written by the prototype's build_scene_art script. */
.advent-drop__site {
  position: absolute;
  left: 50%;
  bottom: var(--advent-ground, 22.8%);
  width: 250px;
  height: 0;
  margin-left: -125px;
  transform-origin: 50% 100%;
  transform: scale(var(--advent-fit, 0.54));
  pointer-events: none;
}
.advent-drop__seat,
.advent-drop__site-shadow,
.advent-drop__site-glow { position: absolute; display: block; max-width: none; opacity: 0; transition: opacity 0.22s ease; }
.advent-drop__seat--under { left: -304.3px; top: -54.3px; width: 858.5px; height: 67.6px; }
.advent-drop__seat--over { left: -171.1px; top: -51.9px; width: 592.2px; height: 53.5px; }
.advent-drop__site-glow { left: -90px; top: -42px; width: 430px; height: 90px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(255, 216, 92, 0.38), rgba(255, 216, 92, 0) 68%); mix-blend-mode: screen; }
.advent-drop.is-landed .advent-drop__seat { opacity: 1; }
.advent-drop.is-opened .advent-drop__site-glow { opacity: 1; transition-duration: 0.7s; }
.advent-drop.is-past .advent-drop__site-glow { display: none; }
.advent-drop:not(.is-animated) .advent-drop__site * { transition: none; }
.advent-drop.is-dropping .advent-drop__rig { opacity: 1; }
.advent-drop__fit { position: relative; transform-origin: 50% 100%; transform: scale(var(--advent-fit, 0.54)); }
/* The load swings under the canopy: the turning point is the canopy's middle. */
.advent-drop__sway { position: relative; transform-origin: 50% 14%; }

/* The parachute: the canopy the game drops vehicles under, with its lines. The script fills it, lets it
   breathe, and on touchdown lets it sink, lean over downwind and empty. */
.advent-drop__chute { display: block; width: 290px; height: 352.4px; max-width: none; margin: 0 0 0 -20px; transform-origin: 50% 20%; opacity: 0; }
.advent-drop.is-dropping .advent-drop__chute { opacity: 1; }
.advent-drop.is-landed .advent-drop__chute { opacity: 0; }

/* The cargo bundle, tied with a red band and the holiday set's bow. */
.advent-crate { position: relative; width: 210px; height: 161.7px; margin: -12px auto 0; --advent-rise: -166px; }
.advent-drop.is-animated.is-landed .advent-crate { animation: adventThud 0.5s ease-out both; transform-origin: 50% 100%; }
.advent-drop.is-animated.is-opened .advent-crate { animation: adventPop 0.5s ease-out both; transform-origin: 50% 100%; }
@keyframes adventThud {
  0%   { transform: scale(1, 1); }
  22%  { transform: scale(1.06, 0.9); }
  55%  { transform: scale(0.98, 1.04); }
  100% { transform: scale(1, 1); }
}
@keyframes adventPop {
  0%   { transform: scale(1, 1) rotate(0deg); }
  20%  { transform: scale(1.03, 0.95) rotate(-1.5deg); }
  45%  { transform: scale(0.98, 1.05) rotate(1.5deg); }
  100% { transform: scale(1, 1) rotate(0deg); }
}
.advent-crate__open,
.advent-crate__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.advent-crate__open { z-index: 2; opacity: 0; }
.advent-crate__img { z-index: 3; }
/* The two halves of the wrap (each a copy of the whole picture, cut down its middle with a hair's
   overlap). Opening: each half falls away to its own side, hinged at its outer foot, and sinks into
   the snow, leaving the pallet it covered. */
.advent-crate__img--l { -webkit-clip-path: polygon(0 0, 50.4% 0, 50.4% 100%, 0 100%); clip-path: polygon(0 0, 50.4% 0, 50.4% 100%, 0 100%); transform-origin: 6% 100%; }
.advent-crate__img--r { -webkit-clip-path: polygon(49.6% 0, 100% 0, 100% 100%, 49.6% 100%); clip-path: polygon(49.6% 0, 100% 0, 100% 100%, 49.6% 100%); transform-origin: 94% 100%; }
.advent-drop.is-opened .advent-crate__open { opacity: 1; }
.advent-drop.is-opened .advent-crate__img { opacity: 0; }
.advent-drop.is-animated.is-opened .advent-crate__img--l { animation: adventPeelL 1s cubic-bezier(0.45, 0, 0.85, 0.6) both; }
.advent-drop.is-animated.is-opened .advent-crate__img--r { animation: adventPeelR 1s cubic-bezier(0.45, 0, 0.85, 0.6) 0.05s both; }
@keyframes adventPeelL {
  0%   { opacity: 1; transform: none; }
  14%  { opacity: 1; transform: translate(-3px, -6px) rotate(-3deg); }
  70%  { opacity: 1; transform: translate(-22px, 4px) rotate(-58deg); }
  100% { opacity: 0; transform: translate(-34px, 22px) rotate(-86deg) scaleY(0.8); }
}
@keyframes adventPeelR {
  0%   { opacity: 1; transform: none; }
  14%  { opacity: 1; transform: translate(3px, -6px) rotate(3deg); }
  70%  { opacity: 1; transform: translate(22px, 4px) rotate(58deg); }
  100% { opacity: 0; transform: translate(34px, 22px) rotate(86deg) scaleY(0.8); }
}
/* The bow, tied where the band folds over the top edge (its box comes from sprites.json). Thrown off,
   it moves as a thrown thing does: sideways at a steady pace (the box), up and then down under gravity
   (the picture inside it, on a parabola), tumbling, and fluttering in width as cloth does in the air. */
.advent-crate__bow { position: absolute; z-index: 4; left: 50.7px; top: -7.6px; width: 30.2px; height: 72.4px; }
.advent-crate__bow img { display: block; width: 100%; height: 100%; max-width: none; transform-origin: 50% 25%; }
.advent-drop.is-opened .advent-crate__bow { opacity: 0; }
.advent-drop.is-animated.is-opened .advent-crate__bow { animation: adventBowDrift 1.25s linear both; }
.advent-drop.is-animated.is-opened .advent-crate__bow img { animation: adventBowArc 1.25s linear both; }
@keyframes adventBowDrift {
  from { transform: translateX(0); opacity: 1; }
  82%  { opacity: 1; }
  to   { transform: translateX(-165px); opacity: 0; }
}
@keyframes adventBowArc {
  0%   { transform: translateY(0) rotate(0deg) scaleX(1); }
  12%  { transform: translateY(-51px) rotate(-42deg) scaleX(0.78); }
  25%  { transform: translateY(-85px) rotate(-96deg) scaleX(1); }
  38%  { transform: translateY(-96px) rotate(-150deg) scaleX(0.74); }
  50%  { transform: translateY(-86px) rotate(-204deg) scaleX(1); }
  63%  { transform: translateY(-54px) rotate(-256deg) scaleX(0.78); }
  75%  { transform: translateY(-5px) rotate(-302deg) scaleX(1); }
  88%  { transform: translateY(70px) rotate(-346deg) scaleX(0.8); }
  100% { transform: translateY(160px) rotate(-392deg) scaleX(1); }
}
/* A short burst of light as the wrap comes away. */
.advent-drop__flash { position: absolute; z-index: 4; left: 50%; top: 30%; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 244, 214, 0.95), rgba(255, 216, 92, 0.5) 34%, rgba(255, 216, 92, 0) 68%); opacity: 0; transform: scale(0.3); pointer-events: none; }
.advent-drop.is-animated.is-opened .advent-drop__flash { animation: adventFlash 0.55s ease-out both; }
@keyframes adventFlash { 0% { opacity: 0; transform: scale(0.3); } 25% { opacity: 0.9; } 100% { opacity: 0; transform: scale(1.7); } }

/* Snow kicked up on landing. */
.advent-drop__puff { position: absolute; z-index: 5; bottom: -8px; width: 130px; height: 48px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(196, 210, 240, 0.8), rgba(196, 210, 240, 0) 70%); opacity: 0; }
.advent-drop__puff--l { left: -56px; }
.advent-drop__puff--r { right: -56px; }
.advent-drop.is-animated.is-landed .advent-drop__puff { animation: adventPuff 0.9s ease-out both; }
.advent-drop.is-animated.is-landed .advent-drop__puff--r { animation-name: adventPuffR; }
@keyframes adventPuff  { from { transform: translate(30px, 6px) scale(0.3); opacity: 0.9; } to { transform: translate(-46px, -22px) scale(1.5); opacity: 0; } }
@keyframes adventPuffR { from { transform: translate(-30px, 6px) scale(0.3); opacity: 0.9; } to { transform: translate(46px, -22px) scale(1.5); opacity: 0; } }

/* Light from the opened bundle, and the reward coming out of it. The bundle stands in the middle
   distance and is drawn small; the reward comes up and towards the viewer, ending at its full size
   (--advent-unfit undoes the rig's scale) and clear of the bundle (--advent-rise, set by the script;
   further for a charm, whose picture is mostly hook and cord at the top). */
.advent-drop__glow {
  position: absolute;
  z-index: 0;
  left: 50%; top: calc(var(--advent-rise) - 102px);
  width: 340px; height: 340px;
  margin-left: -170px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 216, 92, 0.16) 0 9deg, rgba(255, 216, 92, 0) 9deg 22deg),
    radial-gradient(circle, rgba(255, 216, 92, 0.42), rgba(255, 216, 92, 0) 62%);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%);
          mask-image: radial-gradient(circle, #000 20%, transparent 68%);
  opacity: 0;
  transform: scale(0.3);
}
.advent-drop.is-opened .advent-drop__glow { opacity: 1; transform: scale(var(--advent-unfit, 1)); }
.advent-drop.is-animated.is-opened .advent-drop__glow { animation: adventGlowIn 0.8s ease-out 0.15s both, adventGlowTurn 26s linear 0.95s infinite; }
@keyframes adventGlowIn { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(var(--advent-unfit, 1)); } }
@keyframes adventGlowTurn { from { transform: scale(var(--advent-unfit, 1)) rotate(0deg); } to { transform: scale(var(--advent-unfit, 1)) rotate(360deg); } }

.advent-drop__reward {
  position: absolute;
  z-index: 1;
  left: 50%; top: -30px;
  width: 190px; height: 196px;
  margin-left: -95px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(30px) scale(0.25);
}
.advent-drop__reward img,
.advent-drop__reward svg { display: block; max-width: 100%; max-height: 100%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)); }
.advent-drop__reward svg { width: 100%; height: 100%; }
.advent-drop.is-opened .advent-drop__reward { opacity: 1; transform: translateY(var(--advent-rise)) scale(var(--advent-unfit, 1)); }
.advent-drop.is-animated.is-opened .advent-drop__reward { animation: adventRise 1s cubic-bezier(0.2, 1.15, 0.4, 1) 0.2s both; }
@keyframes adventRise {
  from { opacity: 0; transform: translateY(30px) scale(0.25); }
  25%  { opacity: 1; }
  to   { opacity: 1; transform: translateY(var(--advent-rise)) scale(var(--advent-unfit, 1)); }
}

/* Controls over the scene. */
.advent-drop__close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 5;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(18, 25, 29, 0.72);
  color: var(--text);
  cursor: pointer;
}
.advent-drop__close:hover { border-color: var(--color-yellow); color: var(--color-yellow); }
.advent-drop__close svg { width: 20px; height: 20px; display: block; }
.advent-drop__skip {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  z-index: 4;
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: rgba(18, 25, 29, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.advent-drop__skip:hover { border-color: var(--color-yellow); color: var(--color-yellow); }
.advent-drop.is-card .advent-drop__skip { display: none; }
.advent-drop__close:focus-visible,
.advent-drop__skip:focus-visible,
.advent-card__replay:focus-visible { outline: 2px solid var(--color-yellow); outline-offset: 2px; }

/* The day's card. Beside the scene in a wide window, under it in a narrow one. */
.advent-card {
  flex: 0 0 auto;
  width: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border-left: 1px solid var(--line);
  opacity: 0;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.35s ease 0.15s;
}
.advent-drop.is-card .advent-card { width: min(440px, 46%); opacity: 1; }
.advent-drop:not(.is-animated) .advent-card { transition: none; }
.advent-card__scroll {
  width: 100%;
  min-width: 300px;
  height: 100%;
  overflow-y: auto;
  padding: 64px 32px 28px;
  -webkit-overflow-scrolling: touch;
}
.advent-card__eyebrow { margin: 0 0 10px; font-size: 0.8125rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-green); }
.advent-card__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 0.9vw + 0.6rem, 1.3125rem);
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.advent-card__title:focus { outline: none; }
.advent-card__reward {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--color-yellow);
  background: rgba(255, 216, 92, 0.07);
}
.advent-card__reward-label { display: block; font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.advent-card__reward-name { display: block; margin-top: 4px; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.03em; color: var(--color-yellow); }
.advent-card__text { font-size: 1rem; line-height: 1.6; color: var(--text); }
.advent-card__text p { margin: 0 0 14px; }
.advent-card__text ul { margin: 0 0 14px; padding-left: 20px; }
.advent-card__text li { margin-bottom: 6px; }
.advent-card__text strong { color: var(--color-white-heat); font-weight: 700; }
.advent-card__claim { margin: 0 0 16px; padding: 10px 14px; font-size: 0.9375rem; line-height: 1.45; }
.advent-card__claim--live { border: 1px solid var(--color-green); color: var(--color-green); background: rgba(132, 255, 177, 0.06); }
.advent-card__claim--ended { border: 1px solid var(--line); color: var(--text-muted); }
.advent-card--ended .advent-card__play { display: none; }
.advent-card--ended .advent-card__reward { border-left-color: var(--color-gray-600); background: rgba(248, 247, 246, 0.04); }
.advent-card--ended .advent-card__reward-name { color: var(--color-gray-300); }
.advent-drop.is-past .advent-drop__reward img,
.advent-drop.is-past .advent-drop__reward svg { filter: grayscale(1) brightness(0.7) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)); }
.advent-drop.is-past .advent-drop__glow { display: none; }
html.surface-wgc .advent-card__play { display: none; }
.advent-card__placeholder { margin: 0 0 14px; font-size: 0.75rem; color: var(--text-muted); }
/* The actions stay in view at the foot of the card while its text scrolls. */
.advent-card__actions {
  position: sticky;
  bottom: -28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 18px -32px -28px;
  padding: 22px 32px 22px;
  background: linear-gradient(to top, var(--panel) 72%, rgba(30, 37, 41, 0));
}
.advent-card__actions .btn { min-height: 44px; padding: 0.6em 1.4em; }
.advent-card__replay {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.advent-card__replay:hover { color: var(--color-yellow); }

/* Narrow or portrait: the window is taller than wide, scene on top, card underneath. */
@media (max-width: 700px), (orientation: portrait) {
  .advent-drop { padding: 12px; }
  .advent-drop__window { flex-direction: column; height: min(820px, 100%); }
  .advent-card {
    width: 100%;
    max-height: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    transition: max-height 0.5s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.35s ease 0.15s;
  }
  .advent-drop.is-card .advent-card { width: 100%; max-height: 54%; display: flex; flex-direction: column; }
  .advent-card__scroll { min-width: 0; height: auto; min-height: 0; flex: 1 1 auto; padding: 22px 20px 26px; }
  .advent-card__actions { bottom: -26px; margin: 14px -20px -26px; padding: 20px 20px 18px; }
  .advent-drop__scene { min-height: 200px; }
  .advent-drop__hud { top: 16px; }
}

/* Reduced motion: no flight, no fall, no drifting sky. The script also skips
   straight to the opened bundle and the card. */
@media (prefers-reduced-motion: reduce) {
  .advent__sky::before,
  .advent-drop__aurora, .advent-drop__curtain, .advent-drop__plane-rock, .advent-drop__cargo,
  .advent-drop__navlight,
  .advent-door--ready .advent-door__mark,
  .advent-door--ready .advent-door__tag::before,
  .advent-door__note { animation: none; }
  .advent-card, .advent-drop__window, .advent-drop__fit { transition: none; }
  .advent-door__btn { transition: none; }
}

/* Preview-only time machine (the script adds it on localhost, never on the CDN). */
.advent-dev {
  position: fixed;
  left: 12px; bottom: 12px;
  z-index: 2500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  background: rgba(18, 25, 29, 0.94);
  border: 1px dashed var(--color-green);
  font-size: 0.75rem;
}
.advent-dev__label { color: var(--color-green); letter-spacing: 0.1em; text-transform: uppercase; margin-right: 4px; }
.advent-dev a, .advent-dev button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.advent-dev a[aria-current="true"] { border-color: var(--color-yellow); color: var(--color-yellow); }
.advent-dev a:hover, .advent-dev button:hover { border-color: var(--color-yellow); }

/* A short, wide window (a phone on its side, a small launcher pane). */
@media (max-height: 520px) and (min-width: 701px) and (orientation: landscape) {
  .advent-drop { padding: 10px; }
  .advent-card__scroll { padding: 54px 22px 20px; }
  .advent-card__title { margin-bottom: 12px; }
  .advent-card__reward { margin-bottom: 14px; padding: 8px 12px; }
}
