/* The public advent calendar (docs/19 afsnit 7). Unlike the game and quiz
   cards, the calendar OWNS the whole screen (ejerbeslutning 16/10-2026):
   the backdrop is Santa's bitcoin village, soft snow falls over it, and
   the doors scale with the viewport. The scene is night, so the page's
   text goes light with gentle scrims; the shop's light look lives on
   inside the overlays and door tiles. */
:root {
  --door: rgba(255, 255, 255, 0.94);
  --door-locked: rgba(255, 255, 255, 0.55);
  --door-num: #9b9b97;
  --night-ink: #ffffff;
  --night-sub: rgba(255, 255, 255, 0.85);
  --scrim: rgba(8, 18, 32, 0.55);
}

/* The village backdrop and its readability scrim: fixed layers, so the
   scroll stays cheap on an old phone. */
body { background: #0b1b2e; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url("/img/seasonal/advent-backdrop.jpg?v=1") center / cover
              no-repeat #0b1b2e;
}
/* Phones and tablets get the vertical recomposition of the same village
   (ejerbestilling 16/10-2026): the weathervane, miner window, whitepaper,
   snowman, statue and NODE INN all stay in view instead of being cropped
   away by the wide image. */
@media (orientation: portrait) {
  body::before {
    background-image: url("/img/seasonal/advent-backdrop-portrait.jpg?v=1");
    /* Focal point middle right (ejerrettelse 16/10-2026): when cover crops
       the sides, the miner window and whitepaper wall survive the cut. */
    background-position: right center;
  }
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(8, 18, 32, 0.45),
              rgba(8, 18, 32, 0.12) 30%, rgba(8, 18, 32, 0.18) 70%,
              rgba(8, 18, 32, 0.55));
}

/* The snow canvas floats over the scene and under the content. */
#snow { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
header.cal-site, main.cal-stage, footer.cal-site { position: relative; z-index: 1; }

/* Header and footer against the night: the white logo straight on the
   scene, no box (ejerrettelse 16/10-2026). */
footer.cal-site .tagline, footer.cal-site .shop-line { color: var(--night-ink); }
footer.cal-site .shop-line strong { color: var(--night-ink); }
.scrim-note { background: var(--scrim); color: var(--night-ink);
              border-radius: 14px; max-width: 460px; margin: 60px auto;
              padding: 30px 20px; }

/* The stage: full width, the grid is the hero, and on a tall screen the
   CONTENT OWNS THE WHOLE HEIGHT (ejerrettelse 16/10-2026): the page is a
   flex column, the air between sections flexes, and nothing pools at the
   bottom. When content outgrows the viewport, normal flow takes over. */
body { min-height: 100svh; display: flex; flex-direction: column; }
main.cal-stage { max-width: none; width: 100%; padding: 0 12px;
                 flex: 1 1 auto; display: flex; flex-direction: column; }
#cal:not([hidden]) { flex: 1 1 auto; display: flex; flex-direction: column;
                     justify-content: space-evenly; }
.cal-head { text-align: center; margin: 0 auto; max-width: 760px; }
.cal-head h1 { color: var(--btc); margin: 0 0 8px;
               font-size: clamp(24px, 4vw, 40px); }
.cal-sub { color: var(--night-sub); font-size: clamp(13px, 1.6vw, 16px);
           line-height: 1.5; margin: 0 auto;
           max-width: 620px; }
.cal-sub strong { color: var(--night-ink); }

/* The big countdown before 1 December (ejerbestilling 16/10-2026): four
   gold numbers ticking toward the first door. */
.cal-count { display: flex; justify-content: center; gap: clamp(10px, 2vw, 26px);
             margin: 0 auto; }
.cal-count-cell { display: flex; flex-direction: column; align-items: center;
                  min-width: clamp(64px, 10vw, 120px);
                  background: var(--scrim); border-radius: 14px;
                  padding: clamp(10px, 1.6vw, 18px) 6px; }
.cal-count-cell span { color: var(--btc); font-weight: 800;
                       font-size: clamp(30px, 6vw, 64px); line-height: 1;
                       font-variant-numeric: tabular-nums; }
.cal-count-cell small { color: var(--night-sub); font-size: clamp(10px, 1.2vw, 13px);
                        text-transform: uppercase; letter-spacing: 1.5px;
                        margin-top: 6px; }

.cal-join { text-align: center; margin: 0; }

/* The season-over page after the 24th: a quiet goodbye on the scene. */
.cal-after { text-align: center; max-width: 560px; width: 100%;
             margin: auto;
             background: var(--scrim); border-radius: 16px;
             padding: 34px 22px; }
.cal-after h1 { color: var(--btc); margin: 0 0 10px;
                font-size: clamp(24px, 4vw, 38px); }
.cal-after-cta { margin: 18px 0 0; }

/* The grid fills the screen: 4 doors across on a phone, 6 on a laptop,
   8 on a wide screen, and the tiles scale with the viewport. */
.cal-grid { display: grid; grid-template-columns: repeat(3, 1fr);
            gap: clamp(8px, 1.2vw, 16px);
            width: min(1500px, 100%); margin: 8px auto; }
@media (min-width: 560px) { .cal-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 760px) { .cal-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1240px) { .cal-grid { grid-template-columns: repeat(8, 1fr); } }

.cal-door {
  position: relative; aspect-ratio: 1; border-radius: clamp(10px, 1.4vw, 16px);
  border: 1px dashed rgba(255, 255, 255, 0.6); background: var(--door-locked);
  color: #6b6b68; font-size: clamp(18px, 3vw, 34px); font-weight: 700;
  font-family: inherit; display: flex; align-items: center;
  justify-content: center; cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.cal-door.is-today { cursor: pointer; }
.cal-door.is-past { border-style: solid; border-color: transparent;
                    background: var(--door); color: var(--door-num); }
.cal-door .cal-tag { position: absolute; bottom: 6%; left: 0; right: 0;
                     font-size: clamp(8px, 0.9vw, 11px); letter-spacing: 1px;
                     font-weight: 600; text-transform: uppercase;
                     color: var(--door-num); }
.cal-door.is-today .cal-tag { color: var(--btc-deep); }

/* TODAY'S DOOR demands the click (ejerbestilling 16/10-2026): it glows,
   swings and hops like a present that knows what it holds. */
.cal-door.is-today {
  border: 2px solid var(--btc); background: #fff7ea; color: var(--btc);
  animation: door-tease 3s ease-in-out infinite;
  z-index: 2;
}
.cal-door.is-today::before {
  content: ""; position: absolute; inset: -7px; border-radius: inherit;
  border: 2px solid rgba(247, 147, 26, 0.55);
  animation: door-halo 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes door-tease {
  0%, 55% { transform: none; }
  60% { transform: scale(1.1) rotate(-5deg); }
  65% { transform: scale(1.14) rotate(5deg); }
  70% { transform: scale(1.1) rotate(-4deg); }
  75% { transform: scale(1.12) rotate(3deg) translateY(-4%); }
  80% { transform: scale(1.06) rotate(-2deg); }
  85%, 100% { transform: none; }
}
@keyframes door-halo {
  0%, 55% { opacity: 0; transform: scale(0.92); }
  62% { opacity: 1; transform: scale(1); }
  85% { opacity: 0; transform: scale(1.16); }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cal-door.is-today, .cal-door.is-today::before { animation: none; }
}

.cal-legal { color: var(--night-sub); text-align: center; font-size: 12px;
             margin: 0 auto; max-width: 620px; }
.cal-legal a { color: var(--night-ink); }

/* The owner's test bar (the admin page's preview link): the simulated date
   on top of everything, unmistakably not the real page. */
.test-bar { position: sticky; top: 0; z-index: 50; display: flex; gap: 10px;
            align-items: center; justify-content: center; flex-wrap: wrap;
            padding: 8px 12px; background: #fff3dd;
            border-bottom: 1px solid var(--btc); font-size: 13px; }
.test-bar-label { font-weight: 700; text-transform: uppercase;
                  letter-spacing: 1.5px; font-size: 11px;
                  color: var(--btc-deep); }
.test-bar select { font: inherit; padding: 4px 8px; border-radius: 8px;
                   border: 1px solid var(--btc); background: #ffffff; }
.test-bar-note { color: var(--muted); font-size: 12px; }

/* Overlays: the door up close, and the signup that only appears when a
   stranger knocks (ejerbeslutning 16/10-2026). */
.overlay { position: fixed; inset: 0; z-index: 30;
           background: rgba(8, 18, 32, 0.6);
           display: flex; align-items: center; justify-content: center;
           padding: 16px; }
.overlay-card { position: relative; background: #ffffff; border-radius: 16px;
                width: 100%; max-width: 440px; max-height: 92vh;
                overflow: auto; padding: 24px 22px 22px;
                text-align: center; }
.overlay-close { position: absolute; top: 10px; right: 10px; border: 0;
                 width: 32px; height: 32px; border-radius: 50%;
                 display: flex; align-items: center; justify-content: center;
                 background: #f2f2f0; font-size: 18px; line-height: 1;
                 color: #6b6b68; cursor: pointer; padding: 0;
                 font-family: inherit; }
.overlay-close:hover { background: #e8e8e5; color: #121212; }

/* The signup: a real headline, the close button in its own corner (never
   over the text), and fields on the shop grey so they stand on the white
   card (ejerrettelse 16/10-2026). */
#r-form input[type="text"], #r-form input[type="email"] {
  background: #f2f2f0;
}
.signup-title { font-size: 19px; font-weight: 700; color: #121212;
                margin: 4px 26px 6px; line-height: 1.3; }
.signup-sub { color: var(--muted); font-size: 14px; line-height: 1.5;
              margin: 0 18px 16px; }
.signup-sub strong { color: #121212; }

/* The offer under the foil, on the tile itself: revealed bit by bit as
   the coin wears the gold away. */
.cal-door.is-today { overflow: hidden; touch-action: none; }
.door-offer-mini { position: absolute; inset: 0; display: flex;
                   flex-direction: column; align-items: center;
                   justify-content: center; gap: 4%; padding: 8%; }
.door-offer-mini .mini-big { color: var(--btc); font-weight: 800;
                             font-size: clamp(14px, 2.4vw, 28px);
                             line-height: 1.05; text-align: center; }
.door-offer-mini .mini-small { color: var(--muted); font-weight: 500;
                               font-size: clamp(8px, 1vw, 12px);
                               line-height: 1.2; text-align: center; }
canvas.door-foil { position: absolute; inset: 0; width: 100%; height: 100%;
                   border-radius: inherit; cursor: none;
                   transition: opacity 0.5s ease; }
canvas.door-foil.is-cleared { opacity: 0; pointer-events: none; }
/* The typed invitation over the foil, with a blinking caret; it dies at
   the first touch. */
.foil-hint { position: absolute; left: 0; right: 0; bottom: 9%;
             text-align: center; pointer-events: none; z-index: 2;
             color: rgba(255, 255, 255, 0.92); font-weight: 700;
             letter-spacing: 0.5px; font-size: clamp(9px, 1vw, 13px);
             min-height: 1.3em; }
.foil-hint::after { content: ""; display: inline-block; width: 1px;
                    height: 1em; margin-left: 2px; vertical-align: -12%;
                    background: rgba(255, 255, 255, 0.9);
                    animation: hint-caret 1s steps(1) infinite; }
@keyframes hint-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .foil-hint::after { animation: none; }
}
/* A door under the coin holds still (the tease animation would drag the
   foil away from the pointer). */
.cal-door.is-today.is-engaged,
.cal-door.is-today.is-engaged::before { animation: none; }

/* The OPENED door, its own page: the offer full size over the village. */
.door-view { text-align: center; max-width: 680px; width: 100%;
             margin: auto; padding: 0 4px; }
.door-back { text-align: left; margin: 0 0 12px; }
.door-back a { color: var(--night-sub); font-size: 14px; }
.door-big { background: var(--scrim); border-radius: 18px;
            padding: clamp(26px, 4vw, 46px) 20px; }
.door-big-day { color: var(--night-sub); text-transform: uppercase;
                letter-spacing: 2px; font-size: 12px; font-weight: 600;
                margin: 0 0 10px; }
.door-big-offer { color: var(--btc); font-weight: 800; margin: 0;
                  font-size: clamp(52px, 10vw, 112px); line-height: 1; }
.door-big-title { color: var(--night-ink); font-weight: 600;
                  font-size: clamp(16px, 2.4vw, 22px); margin: 12px 0 0; }
.door-urgency { display: flex; flex-wrap: wrap; justify-content: center;
                align-items: baseline; gap: 6px 12px;
                margin: 14px 0 0; font-size: 14px;
                color: var(--night-sub); }
.urgency-clock b { color: var(--btc); font-weight: 800;
                   font-variant-numeric: tabular-nums; }
.urgency-joke { color: var(--night-sub); }
.door-big .claim-note, .door-big #dp-empty { color: var(--night-sub); }
.door-big .confirm-note { background: rgba(255, 255, 255, 0.94);
                          border-radius: 12px; padding: 14px;
                          margin-top: 16px; }
.door-big .claim-code .code-pill { font-size: clamp(22px, 3.2vw, 30px); }

/* The scratch coin (ejerbestilling 16/10-2026): the tap game's bitcoin,
   tilted as a hand holds it while scratching. The ::before is the coin's
   edge, peeking out under the tilted face. The particles (foil shavings)
   live on the shared #fx canvas, lifted above the overlay. */
#fx { z-index: 40; pointer-events: none; }
.scratch-coin { position: fixed; width: 84px; height: 84px;
                pointer-events: none; z-index: 45;
                transform: translate(-50%, -84%) perspective(420px)
                           rotateX(38deg) rotate(-20deg);
                transition: transform 70ms linear;
                filter: drop-shadow(0 8px 14px rgba(201, 115, 18, 0.35)); }
.scratch-hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* The claim area under a revealed offer: the code big enough to read off a
   phone at the till, with its honest clock next to it. */
.claim-code { margin: 14px 0 0; }
.claim-code .code-pill { display: inline-flex; align-items: center; gap: 10px;
                         padding: 10px 18px; border-radius: 999px;
                         background: #121212; color: #ffffff; font-size: 22px;
                         font-weight: 700; letter-spacing: 2px; }
.claim-code .btn-plain { height: 36px; font-size: 13px; }
/* The copy icon inside the pill (ejerens ønske 25/10-2026): a big enough
   target for a thumb, in the pill's own colour. */
.code-copy { display: inline-flex; align-items: center; justify-content: center;
             width: 36px; height: 36px; margin: -6px -10px -6px 0; padding: 0;
             border: 0; border-radius: 999px; background: transparent;
             color: inherit; cursor: pointer; }
.code-copy:hover, .code-copy:focus-visible { background: rgba(255, 255, 255, .14); }
.claim-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.claim-cta { margin-top: 10px; }
