/* Advento eglutė — /advento-eglute (Pages/Advent). Port of the approved C1X prototype.
   Every class is .advent-*; site classes (glass-card, bp-countdown-*, action-btn, modal-footer-modern)
   are reused by name, never copied.

   Layout follows the scene's own width through container queries, not the viewport: with the fixed
   sidebar, a viewport breakpoint would still pick three columns when the middle one is too narrow
   for the tree. Inside the tree, --u is one unit of its 680 x 800 drawing, so baubles, strings and
   labels scale with the tree and the phone sizes fall out on their own.

   Sole font-size exception: bauble glyphs (number, day badge, tag) are artwork sized in --u, so they
   shrink with the tree. Every other text size is a Bootstrap utility in the markup. */

:root {
    --advent-gold: 255, 203, 49;
    --advent-cyan: 13, 202, 240;
}

/* ---------- shared bits ---------- */
.advent-text-gold { color: rgb(var(--advent-gold)); }
.advent-minw0 { min-width: 0; }
.advent-mono { font-variant-numeric: tabular-nums; letter-spacing: .5px; }

/* The entry points' tree glyph (sidebar, notification card): green, or at nav size it reads as a bell. */
.advent-tree-ico { color: #3ecf72; filter: drop-shadow(0 0 4px rgba(62, 207, 114, .5)); }

.advent-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.advent-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: rgba(var(--rc), .14);
    border: 1px solid rgba(var(--rc), .55);
    color: rgb(var(--rc));
    font-weight: 600;
    white-space: nowrap;
}
.advent-chip-plain {
    --rc: 255, 255, 255;
    color: rgba(255, 255, 255, .78);
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .16);
}

.advent-gold-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    border: 0;
    border-radius: .6rem;
    padding: .85rem 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2a1d00;
    background: linear-gradient(135deg, #ffe58a 0%, #ffc531 45%, #e99a00 100%);
    box-shadow: 0 8px 26px rgba(255, 190, 40, .35), inset 0 1px 0 rgba(255, 255, 255, .65);
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
}
.advent-gold-btn:hover:not(:disabled) {
    color: #2a1d00;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 190, 40, .5), inset 0 1px 0 rgba(255, 255, 255, .65);
}
.advent-gold-btn:active:not(:disabled) { transform: translateY(0); }
.advent-gold-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.advent-gold-btn:disabled { opacity: .65; cursor: not-allowed; }

.advent-thumb {
    width: 64px;
    height: 44px;
    flex: 0 0 64px;
    display: grid;
    place-items: center;
    border-radius: .45rem;
    background: radial-gradient(circle at 50% 60%, rgba(var(--rc), .32), rgba(0, 0, 0, .25) 72%);
    border: 1px solid rgba(var(--rc), .4);
    color: rgb(var(--advent-cyan));
}
.advent-thumb img { max-width: 92%; max-height: 40px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }

.advent-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .6rem;
    border-radius: .6rem;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
}
.advent-row.is-new { border-color: rgba(25, 238, 25, .35); background: rgba(25, 238, 25, .06); }
.advent-newpill { padding: .1rem .5rem; border-radius: 999px; background: rgba(25, 238, 25, .15); color: rgb(25, 238, 25); font-weight: 700; }
.advent-got {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .6rem;
    border-radius: .6rem;
    background: rgba(var(--rc), .08);
    border: 1px solid rgba(var(--rc), .35);
}

.advent-rays {
    position: absolute;
    inset: -30%;
    background: repeating-conic-gradient(from 0deg, rgba(var(--rc, 255, 203, 49), .32) 0deg 6deg, transparent 6deg 18deg);
    -webkit-mask: radial-gradient(circle, #000 0%, transparent 60%);
    mask: radial-gradient(circle, #000 0%, transparent 60%);
    animation: advent-spin 30s linear infinite;
    pointer-events: none;
}

@keyframes advent-spin { to { transform: rotate(360deg); } }
@keyframes advent-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes advent-ping {
    0% { transform: translate(-50%, -50%) scale(.7); opacity: .9; }
    100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}
@keyframes advent-twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes advent-fade { from { opacity: 0; } }

/* ---------- scene ---------- */
.advent-scene {
    container: advent / inline-size;
    position: relative;
    /* clip, not hidden: hidden would make the scene the scroll box and stop the phone CTA sticking. */
    overflow: clip;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, .1);
    padding: 1.5rem 1.25rem 0;
    background:
        radial-gradient(ellipse at 50% 78%, rgba(255, 186, 90, .18), transparent 42%),
        radial-gradient(ellipse at 50% -10%, rgba(56, 96, 168, .55), transparent 55%),
        linear-gradient(180deg, rgba(6, 12, 28, .95), rgba(10, 20, 38, .96));
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.advent.is-done .advent-scene {
    background:
        radial-gradient(ellipse at 50% 64%, rgba(255, 186, 90, .3), transparent 48%),
        radial-gradient(ellipse at 50% -10%, rgba(56, 96, 168, .5), transparent 55%),
        linear-gradient(180deg, rgba(10, 14, 30, .95), rgba(16, 22, 40, .96));
}
.advent-sky-star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: advent-twinkle 3s ease-in-out infinite; }
.advent-moon {
    position: absolute;
    top: 30px;
    right: 56px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: -12px 7px 0 0 #f5f0d4;
    transform: rotate(-18deg);
    filter: drop-shadow(0 0 14px rgba(245, 240, 212, .45));
}
.advent-hills {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 210px;
    background:
        radial-gradient(ellipse 34% 100% at 12% 100%, #1a2b45 0 60%, transparent 61%),
        radial-gradient(ellipse 40% 90% at 90% 100%, #15233a 0 60%, transparent 61%);
}
.advent-sound { position: absolute; z-index: 3; top: .75rem; right: .75rem; }

.advent-grid { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 1rem; }
.advent-hud { display: flex; flex-direction: column; gap: 1rem; }
.advent-card { padding: 1rem 1.1rem; border-radius: .9rem; }
/* Above the HUD cards, so a bauble's hover tip near the edge is never painted under them. */
.advent-treecol { position: relative; z-index: 2; width: 100%; max-width: 680px; margin: 1.5rem auto 0; }
.advent-cta { display: none; }

/* Narrow: one column — title, tree, the action under the thumb, then the cards. */
@container advent (max-width: 47.99rem) {
    .advent-grid { padding-bottom: 1.5rem; }
    .advent-hud { display: contents; }
    .advent-head { order: 1; }
    .advent-treecol { order: 2; margin-top: .5rem; }
    .advent-cta {
        order: 3;
        display: block;
        position: sticky;
        bottom: 0;
        z-index: 5;
        margin: -1rem -1.25rem 0;
        padding: 1.4rem 1rem 1rem;
        background: linear-gradient(180deg, rgba(7, 11, 20, 0), rgba(7, 11, 20, .94) 30%);
    }
    .advent-progress { order: 4; }
    .advent-top { order: 5; }
    .advent-aside { order: 6; }
    .advent-haul { order: 7; }
}

/* Medium: title, the tree across the width, then the two card columns. */
@container advent (min-width: 48rem) {
    .advent-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas: "head head" "tree tree" "left right";
    }
    .advent-head { grid-area: head; }
    .advent-treecol { grid-area: tree; }
    .advent-hud.is-left { grid-area: left; }
    .advent-hud.is-right { grid-area: right; }
    .advent-hud { padding-bottom: 1.5rem; }
}

/* Wide: the prototype's three columns, the tree standing on the hills between the two HUDs. */
@container advent (min-width: 68rem) {
    .advent-grid {
        grid-template-columns: 290px minmax(0, 1fr) 290px;
        grid-template-rows: auto 1fr;
        grid-template-areas: "head tree right" "left tree right";
    }
    .advent-treecol { align-self: end; margin-top: 2.75rem; }
    /* Clear of the right HUD, which owns the top-right corner here: scene padding + column + gap. */
    .advent-sound { right: calc(2.75rem + 290px); }
}

/* ---------- the tree ---------- */
.advent-tree {
    container: advent-tree / inline-size;
    --u: calc(100cqw / 680);
    position: relative;
    width: 100%;
    aspect-ratio: 680 / 800;
}
/* fir.svg is drawn 40 units wider on each side for the snow bank, hence the offset. */
.advent-fir {
    position: absolute;
    top: 0;
    left: -5.8824%;
    width: 111.7647%;
    max-width: none;
    height: 100%;
    pointer-events: none;
    user-select: none;
}
.advent-cold {
    position: absolute;
    inset: 0;
    pointer-events: none;
    filter: saturate(.22) brightness(.45) hue-rotate(30deg);
    -webkit-mask-image: linear-gradient(180deg, #000 calc(var(--lit) - 4%), transparent calc(var(--lit) + 3%));
    mask-image: linear-gradient(180deg, #000 calc(var(--lit) - 4%), transparent calc(var(--lit) + 3%));
}
.advent-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.advent-warm {
    position: absolute;
    left: -16%;
    right: -16%;
    top: calc(var(--lit) - 14%);
    bottom: -4%;
    pointer-events: none;
    background: radial-gradient(ellipse 50% 80% at 50% 100%, rgba(255, 176, 74, .36), rgba(255, 176, 74, .1) 58%, transparent 76%);
}
.advent-tree.is-done .advent-warm { top: -6%; background: radial-gradient(ellipse 54% 72% at 50% 60%, rgba(255, 186, 90, .4), rgba(255, 186, 90, .1) 60%, transparent 78%); }
.advent-fl { animation: advent-fl 2.8s ease-in-out infinite; }
@keyframes advent-fl { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.advent-frost { position: absolute; z-index: 1; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: #eef7ff; box-shadow: 0 0 6px 1px rgba(190, 225, 255, .85); animation: advent-twinkle 3.2s ease-in-out infinite; pointer-events: none; }

.advent-wire { fill: none; stroke: #26302b; stroke-width: 2.2; }
.advent-wire.is-back { stroke-dasharray: 3 5; opacity: .5; }
.advent-wire.is-back.is-on { stroke: #ffd36b; opacity: .45; }
.advent-wire.is-lit { stroke: #ffd36b; stroke-width: 2.6; stroke-dasharray: 9 5; animation: advent-flow 1.2s linear infinite; }
.advent-wire.is-pending { stroke: #ffd36b; stroke-width: 2.6; stroke-dasharray: 1 8; stroke-linecap: round; animation: advent-flow 1.2s linear infinite; }
@keyframes advent-flow { to { stroke-dashoffset: -28; } }
.advent-blink { animation: advent-blink 1.2s ease-in-out infinite; }
@keyframes advent-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.advent-starburst {
    position: absolute;
    left: 50%;
    top: 7.75%;
    width: 60%;
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    pointer-events: none;
    background: repeating-conic-gradient(rgba(255, 214, 90, .42) 0 5deg, transparent 5deg 15deg);
    -webkit-mask: radial-gradient(circle, #000 0 12%, transparent 62%);
    mask: radial-gradient(circle, #000 0 12%, transparent 62%);
    animation: advent-spin 40s linear infinite;
}
.advent-star-glow { transform-box: fill-box; transform-origin: center; animation: advent-glow-pulse 1.6s ease-in-out infinite; }
@keyframes advent-glow-pulse { 0%, 100% { opacity: .3; } 50% { opacity: .7; } }
.advent-starlab {
    position: absolute;
    z-index: 3;
    top: 4%;
    left: calc(50% + 46 * var(--u));
    padding: .3rem .7rem;
    border-radius: .7rem;
    line-height: 1.3;
    white-space: nowrap;
    font-weight: 700;
    color: rgb(var(--advent-gold));
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(var(--advent-gold), .5);
    pointer-events: none;
}
.advent-starlab.is-today { background: rgba(30, 22, 0, .75); border-color: rgba(var(--advent-gold), .9); box-shadow: 0 0 18px rgba(var(--advent-gold), .35); }
.advent-star-btn {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 7.75%;
    width: calc(104 * var(--u));
    aspect-ratio: 1;
    translate: -50% -50%;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.advent-star-btn:hover { background: radial-gradient(circle, rgba(255, 214, 90, .25), transparent 70%); }
.advent-star-btn:focus-visible { outline: 2px solid rgba(var(--advent-gold), .9); outline-offset: 2px; }
.advent-star-btn.is-taken { visibility: hidden; }

.advent-spot {
    position: absolute;
    z-index: 1;
    left: var(--x);
    top: calc(var(--y) + 72 * var(--u));
    width: calc(230 * var(--u));
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 214, 90, .5), rgba(255, 214, 90, .14) 42%, transparent 68%);
    animation: advent-breathe 2.6s ease-in-out infinite;
}
.advent-spot.is-star { left: 50%; top: 7.75%; }
@keyframes advent-breathe { 0%, 100% { opacity: .75; scale: .92; } 50% { opacity: 1; scale: 1.05; } }

/* Narrow tree: the day badges and the star's label would only crowd it. */
@container advent-tree (max-width: 30rem) {
    .advent-tree .advent-gb-day,
    .advent-tree .advent-starlab { display: none; }
}

/* ---------- glass baubles ---------- */
.advent-gb {
    --s: 46px;
    --str: 16px;
    --b1: #e04355;
    --b2: #5e0a16;
    position: relative;
    width: var(--s);
    height: var(--s);
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: calc(var(--s) * .36);
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 3.5%, rgba(255, 255, 255, .3) 8%, transparent 19%),
        radial-gradient(circle at 66% 82%, rgba(255, 255, 255, .2), transparent 30%),
        radial-gradient(circle at 42% 38%, var(--b1) 0%, var(--b2) 76%, #05060a 120%);
    box-shadow: inset -5px -8px 14px rgba(0, 0, 0, .38), inset 3px 4px 8px rgba(255, 255, 255, .14), 0 10px 18px rgba(0, 0, 0, .45);
}
/* The cap. */
.advent-gb::before {
    content: '';
    position: absolute;
    z-index: 3;
    left: 50%;
    top: -14%;
    width: 30%;
    height: 17%;
    translate: -50% 0;
    border-radius: 3px 3px 2px 2px;
    background: linear-gradient(90deg, #6e500c, #ffe9a8 38%, #d1a23a 62%, #6e500c);
    box-shadow: 0 2px 2px rgba(0, 0, 0, .35);
}
/* The string up to the hang point. */
.advent-gb::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 114%;
    width: 1.5px;
    height: var(--str);
    translate: -50% 0;
    background: rgba(255, 236, 190, .75);
}
.advent-gb-n { position: relative; z-index: 1; }

/* --x/--y is the hang point; the ball hangs below it on a --str string. */
.advent-ball {
    --s: calc(46 * var(--u));
    position: absolute;
    z-index: 2;
    left: var(--x);
    top: calc(var(--y) + var(--str) + var(--s) * .14);
    translate: -50% 0;
    transition: scale .2s ease, filter .2s ease;
}
button.advent-ball { cursor: pointer; }
button.advent-ball:hover { scale: 1.06; filter: brightness(1.12); }
button.advent-ball:focus-visible { outline: 2px solid rgba(var(--advent-gold), .9); outline-offset: 3px; }
.advent-ball.is-taken { visibility: hidden; }

.advent-gb.is-frost {
    color: rgba(255, 255, 255, .78);
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .9) 0 3.5%, rgba(255, 255, 255, .25) 8%, transparent 19%),
        radial-gradient(circle, rgba(255, 255, 255, .5) 0 .7px, transparent 1.3px) 0 0 / 6px 6px,
        radial-gradient(circle at 42% 38%, #b4c6dc 0%, #2a3b54 78%, #05060a 120%);
    box-shadow: inset -5px -8px 14px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255, 255, 255, .22), 0 8px 14px rgba(0, 0, 0, .4);
}
.advent-gb.is-frost::after { background: rgba(200, 220, 240, .4); }
/* Lit from inside in the prize colour: the opened bauble in the reveal. */
.advent-gb.is-lit {
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95) 0 4%, rgba(255, 255, 255, .35) 9%, transparent 20%),
        radial-gradient(circle at 50% 56%, #fff 0 8%, rgba(var(--rc), .95) 32%, rgba(var(--rc), .55) 66%, rgba(var(--rc), .32));
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3), inset -6px -10px 22px rgba(0, 0, 0, .2),
        0 0 calc(var(--s) * .4) rgba(var(--rc), .9), 0 0 var(--s) rgba(var(--rc), .5);
    animation: advent-light-up .6s ease-out both;
}
@keyframes advent-light-up { from { filter: brightness(.3) saturate(.5); } 40% { filter: brightness(1.8); } to { filter: none; } }
.advent-gb.is-open {
    background: radial-gradient(circle at 50% 56%, rgba(var(--rc), .62), rgba(var(--rc), .16) 54%, rgba(6, 10, 18, .9) 82%);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .38), inset -4px -6px 12px rgba(0, 0, 0, .45), 0 0 18px rgba(var(--rc), .8), 0 10px 16px rgba(0, 0, 0, .4);
}
.advent-gb.is-open img { position: relative; width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.advent-gb-gem { color: rgb(var(--advent-cyan)); filter: drop-shadow(0 0 8px rgba(var(--advent-cyan), .9)); }
.advent-gb-glass {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .92) 0 3.5%, rgba(255, 255, 255, .25) 8%, transparent 19%),
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, .18), transparent 28%);
    pointer-events: none;
}
.advent-gb-day {
    position: absolute;
    z-index: 4;
    right: calc(-5 * var(--u));
    bottom: calc(-4 * var(--u));
    min-width: calc(18 * var(--u));
    height: calc(18 * var(--u));
    padding: 0 calc(4 * var(--u));
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(8, 12, 20, .92);
    box-shadow: inset 0 0 0 1px rgba(var(--rc), .95);
    color: #fff;
    font-size: calc(10.5 * var(--u));
    font-weight: 800;
    text-shadow: none;
}
.advent-gb.is-missed { --b1: #5d6573; --b2: #15181e; opacity: .75; color: rgba(255, 255, 255, .55); }
.advent-gb-crack {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M22 2 L19 13 L25 18 L17 26 L23 32 L20 42 M19 13 L11 16 M25 18 L33 15 M23 32 L31 35' fill='none' stroke='%23e3e9f2' stroke-width='1.4' opacity='.75'/%3E%3C/svg%3E") center / 100% 100%;
}
.advent-gb.is-today {
    z-index: 6;
    --b1: #ffdb70;
    --b2: #a86a00;
    color: #5a0d14;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
    box-shadow: inset -5px -8px 14px rgba(0, 0, 0, .28), 0 0 0 3px rgba(255, 255, 255, .78), 0 0 36px rgba(var(--advent-gold), .95);
    transform-origin: 50% calc(-1 * (var(--str) + var(--s) * .14));
    animation: advent-sway 3.4s ease-in-out infinite;
}
@keyframes advent-sway { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
.advent-ball.is-today { --s: calc(72 * var(--u)); }
.advent-ball.is-fresh {
    --s: calc(58 * var(--u));
    z-index: 7;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5), inset -4px -6px 12px rgba(0, 0, 0, .45), 0 0 0 3px rgba(25, 238, 25, .75), 0 0 30px rgba(var(--rc), .95);
}
.advent-gb-ping {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(var(--advent-gold), .85);
    transform: translate(-50%, -50%);
    animation: advent-ping 2s ease-out infinite;
    pointer-events: none;
}
.advent-gb-tag {
    position: absolute;
    top: calc(100% + 8 * var(--u));
    left: 50%;
    translate: -50% 0;
    white-space: nowrap;
    padding: .14rem .55rem;
    border-radius: 999px;
    background: rgba(var(--advent-gold), .96);
    color: #3a2600;
    font-size: max(.58rem, calc(11.2 * var(--u)));
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: none;
}
.advent-newtag { background: rgb(25, 238, 25); color: #04210a; }

/* Desktop hover tip on an opened bauble; touch devices get the prize sheet on tap instead. */
.advent-tip {
    position: absolute;
    z-index: 30;
    left: 50%;
    bottom: calc(100% + var(--str) + var(--s) * .14 + 12px);
    translate: -50% 0;
    display: none;
    width: 220px;
    padding: .65rem .75rem;
    text-align: left;
    font-weight: 400;
    line-height: 1.35;
    text-shadow: none;
    border-radius: .75rem;
    background: rgba(10, 16, 28, .96);
    border: 1px solid rgba(var(--rc), .6);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .55), 0 0 24px rgba(var(--rc), .25);
    pointer-events: none;
}
.advent-tip::after { content: ''; position: absolute; left: 50%; top: 100%; translate: -50% 0; border: 7px solid transparent; border-top-color: rgba(var(--rc), .6); }
.advent-tip-img { display: grid; place-items: center; height: 70px; margin-bottom: .45rem; border-radius: .5rem; background: radial-gradient(circle, rgba(var(--rc), .35), transparent 70%); color: rgb(var(--advent-cyan)); }
.advent-tip-img img { max-width: 90%; max-height: 64px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
@media (hover: hover) {
    .advent-ball.is-open:is(:hover, :focus-visible) { z-index: 20; }
    .advent-ball.is-open:is(:hover, :focus-visible) .advent-tip { display: block; }
}

/* ---------- 24-bulb light strip ---------- */
.advent-strip {
    --wire: rgba(190, 215, 200, .3);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    justify-items: center;
    row-gap: 12px;
    background:
        linear-gradient(var(--wire), var(--wire)) 0 2px / 100% 1.5px no-repeat,
        linear-gradient(var(--wire), var(--wire)) 0 32px / 100% 1.5px no-repeat;
}
.advent-strip i { position: relative; display: block; width: 10px; height: 18px; }
.advent-strip i::before { content: ''; position: absolute; left: 2.5px; top: 0; width: 5px; height: 5px; border-radius: 1px; background: #2a3530; }
.advent-strip i::after {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 10px;
    height: 14px;
    border-radius: 45% 45% 50% 50% / 35% 35% 65% 65%;
    background: #252e3b;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.advent-strip i.is-on::after { background: radial-gradient(circle at 38% 32%, rgba(255, 255, 255, .95) 0 14%, var(--c) 48%); box-shadow: 0 0 9px var(--c); }
.advent-strip i.is-today::after { background: radial-gradient(circle at 38% 32%, #fff 0 14%, #ffd34d 48%, #c98a00); animation: advent-bulb-glow 1.6s ease-in-out infinite; }
.advent-strip i.is-broken::after { background: linear-gradient(118deg, transparent 44%, rgba(235, 75, 75, .95) 45% 55%, transparent 56%), #3a3f48; }
/* The bulb just won: dark, a flash, then lit — after the card has landed. */
.advent-strip i.is-ignite::after { animation: advent-ignite .7s .5s ease-out both; }
@keyframes advent-bulb-glow { 0%, 100% { box-shadow: 0 0 4px rgba(255, 211, 77, .6); } 50% { box-shadow: 0 0 14px rgba(255, 211, 77, 1), 0 0 0 3px rgba(255, 211, 77, .25); } }
@keyframes advent-ignite {
    0% { filter: brightness(.15); box-shadow: none; }
    60% { filter: brightness(1.8); box-shadow: 0 0 18px var(--c), 0 0 0 4px rgba(255, 255, 255, .25); }
    100% { filter: none; box-shadow: 0 0 9px var(--c); }
}
.advent-strip.is-wide,
.advent-strip.is-mini { grid-template-columns: repeat(24, minmax(0, 1fr)); background: linear-gradient(var(--wire), var(--wire)) 0 2px / 100% 1.5px no-repeat; }
.advent-strip.is-mini i { width: 7px; height: 13px; }
.advent-strip.is-mini i::before { left: 1.5px; width: 4px; height: 4px; }
.advent-strip.is-mini i::after { top: 3px; width: 7px; height: 10px; }

.advent-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .75rem; }
.advent-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.advent-key { display: inline-block; width: 8px; height: 11px; border-radius: 45% 45% 50% 50% / 35% 35% 65% 65%; background: #252e3b; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.advent-key.is-on { background: conic-gradient(#ffd34d 0 25%, #ff4d5e 0 50%, #38d9f5 0 75%, #54e38a 0); box-shadow: 0 0 6px rgba(255, 211, 77, .6); }
.advent-key.is-today { background: #ffd34d; box-shadow: 0 0 6px rgba(255, 211, 77, .9); }
.advent-key.is-broken { background: linear-gradient(118deg, transparent 40%, rgba(235, 75, 75, .95) 41% 59%, transparent 60%), #3a3f48; }

/* ---------- HUD cards ---------- */
.advent-stats { display: flex; justify-content: space-between; gap: .5rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .55); }
.advent-stats span { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }

.advent-odds { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .3rem .5rem; }
.advent-odds b { grid-row: 1; grid-column: 2; text-align: right; }
.advent-odds-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.advent-odds-bar i { display: block; height: 100%; border-radius: inherit; background: rgb(var(--rc)); box-shadow: 0 0 10px rgba(var(--rc), .7); }
.advent-note { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .7rem; border-radius: .6rem; color: rgba(255, 255, 255, .65); background: rgba(var(--advent-gold), .08); border: 1px solid rgba(var(--advent-gold), .25); }

/* Compound selectors so the accent border outranks .glass-card:hover. */
.advent-card.advent-todaycard { border-color: rgba(var(--advent-gold), .45); box-shadow: 0 0 0 1px rgba(var(--advent-gold), .12), 0 14px 40px rgba(255, 190, 40, .12); }
.advent-card.advent-todaycard.is-done { border-color: rgba(25, 238, 25, .4); box-shadow: 0 0 0 1px rgba(25, 238, 25, .1), 0 14px 40px rgba(25, 238, 25, .08); }
.advent-card.advent-starcard { border-color: rgba(var(--advent-gold), .45); box-shadow: 0 14px 40px rgba(255, 190, 40, .14); }
.advent-warn { color: rgb(var(--advent-gold)); font-weight: 700; letter-spacing: 1px; }
.advent-hr { margin: 1rem 0 .85rem; border-color: rgba(255, 255, 255, .14); opacity: 1; }
.advent-remind { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; }
.advent-remind .form-check-input { width: 2.3em; height: 1.25em; margin-top: .15rem; cursor: pointer; background-color: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); }
.advent-remind .form-check-input:checked { background-color: #0dcaf0; border-color: #0dcaf0; }
.advent-mini { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; border-radius: 50%; color: #5a0d14; background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .7) 0 7%, #ffd34d 24%, #9a6200 82%); box-shadow: 0 0 22px rgba(var(--advent-gold), .6); }
.advent-ok { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; border-radius: 50%; color: #04210a; background: radial-gradient(circle at 34% 30%, #e2ffe2 0 8%, rgb(25, 238, 25) 42%, #0b7a0b); box-shadow: 0 0 22px rgba(25, 238, 25, .4); }
.advent-more { display: inline-flex; align-items: center; margin-top: .9rem; color: #0dcaf0; font-weight: 600; text-decoration: none; }
.advent-more:hover { color: #fff; }
.advent-kv { display: flex; justify-content: space-between; gap: .75rem; padding: .5rem 0; color: rgba(255, 255, 255, .6); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.advent-kv:last-child { border-bottom: 0; padding-bottom: 0; }
.advent-kv b { color: #fff; text-align: right; }
.advent-starprize {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 140px;
    margin: .75rem 0 .6rem;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: .75rem;
    background: radial-gradient(circle at 50% 55%, rgba(var(--rc), .35), transparent 70%);
    color: rgb(var(--advent-cyan));
    cursor: pointer;
    transition: filter .2s ease;
}
.advent-starprize:hover { filter: brightness(1.12); }
.advent-starprize:focus-visible { outline: 2px solid rgba(var(--advent-gold), .9); outline-offset: 2px; }
.advent-starprize .advent-rays { inset: -60%; }
.advent-starprize img { position: relative; width: 86%; max-height: 118px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); animation: advent-float 3s ease-in-out infinite; }

/* ---------- modals (reveal, prize, haul) ---------- */
/* The card draws the surface, so the confetti layer can sit between Blazored's backdrop and the card.
   Viewport-based width: Blazored's focus-trap wrapper shrinks to content, so a % width resolves
   against the 1200px garland image and leaves the card off-centre. */
.bm-container .blazored-modal.advent-modal {
    width: min(600px, calc(100vw - 2rem)) !important;
    max-width: min(600px, calc(100vw - 2rem)) !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.advent-modal-card {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 0 2rem 1.75rem;
    text-align: center;
    color: #fff;
    border-radius: 1.25rem;
    background: rgba(15, 22, 33, .92);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(var(--rc, var(--advent-gold)), .25), 0 0 70px rgba(var(--rc, var(--advent-gold)), .2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.advent-modal-card.is-compact { padding: 1.5rem; }
/* Fixed against .bm-container, whose backdrop-filter makes it the containing block: the whole screen. */
.advent-confetti-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.advent-confetti { position: absolute; display: block; opacity: .85; animation: advent-confetti 7s linear infinite; }
@keyframes advent-confetti { from { translate: 0 -30px; } to { translate: 12px 60px; } }
.advent-garland { display: block; width: calc(100% + 4rem); max-width: none; height: auto; margin: 0 -2rem; pointer-events: none; }

/* Glow, bulb and prize share one grid cell, so the prize sits on the bulb's centre whatever its height. */
.advent-rv-stage { position: relative; display: grid; place-items: center; height: 290px; margin: -4px -2rem .25rem; }
.advent-rv-stage > * { grid-area: 1 / 1; }
.advent-rv-stage .advent-rays { inset: -25% 0; }
.advent-rv-glow { width: 340px; height: 230px; border-radius: 50%; pointer-events: none; background: radial-gradient(ellipse, rgba(var(--rc), .6), rgba(var(--rc), .15) 45%, transparent 70%); }
.advent-rv-bulb { --s: 190px; --str: 0px; z-index: 1; }
/* Day 24: a gold star and gold rays, whatever the prize's rarity. */
.advent-rv-stage.is-star { --rc: var(--advent-gold); }
.advent-rv-star { position: relative; z-index: 1; width: 230px; height: 230px; overflow: visible; animation: advent-light-up .6s ease-out both; }
.advent-rv-item {
    position: relative;
    z-index: 2;
    width: 260px;
    filter: drop-shadow(0 0 22px rgba(var(--rc), .75)) drop-shadow(0 12px 16px rgba(0, 0, 0, .6));
    animation: advent-rise .6s cubic-bezier(.2, .9, .3, 1.2) both, advent-float 3s .6s ease-in-out infinite;
}
/* White with a faint dark rim: a jewels bulb glows cyan, and a cyan gem disappears into it. */
.advent-rv-gem {
    position: relative;
    z-index: 2;
    color: #fff;
    filter: drop-shadow(0 0 1px rgba(4, 18, 31, .5)) drop-shadow(0 3px 6px rgba(0, 0, 0, .25));
    animation: advent-rise .6s cubic-bezier(.2, .9, .3, 1.2) both, advent-float 3s .6s ease-in-out infinite;
}
@keyframes advent-rise { from { translate: 0 60px; scale: .7; opacity: 0; } to { translate: 0 0; scale: 1; opacity: 1; } }
.advent-rv-prog { width: min(420px, 100%); margin: 1.25rem auto; text-align: left; }

.advent-prize-shot { position: relative; height: 150px; display: grid; place-items: center; margin: .75rem 0 1rem; overflow: hidden; border-radius: .75rem; background: radial-gradient(circle at 50% 55%, rgba(var(--rc), .35), transparent 70%); color: rgb(var(--advent-cyan)); }
.advent-prize-shot .advent-rays { inset: -60%; }
.advent-prize-shot img { position: relative; width: 70%; max-height: 130px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); animation: advent-float 3s ease-in-out infinite; }
.advent-prize-shot i { position: relative; filter: drop-shadow(0 0 16px rgba(var(--rc), .9)); }
.advent-haul-list { max-height: min(60vh, 520px); overflow-y: auto; }

/* Phones: every advent modal becomes a bottom sheet under the thumb. */
@media (max-width: 575.98px) {
    .bm-container:has(.advent-modal) { align-items: flex-end !important; padding: 0 !important; }
    .bm-container .blazored-modal.advent-modal { width: 100vw !important; max-width: 100vw !important; }
    .advent-modal-card,
    .advent-modal-card.is-compact { padding: .55rem 1.1rem 2rem; border-bottom: 0; border-radius: 28px 28px 0 0; }
    .advent-modal-card::before { content: ''; display: block; width: 44px; height: 5px; margin: 0 auto .75rem; border-radius: 3px; background: rgba(255, 255, 255, .25); }
    .advent-garland { display: none; }
    .advent-rv-stage { height: 200px; margin: 0 -1.1rem; }
    .advent-rv-bulb { --s: 136px; }
    .advent-rv-star { width: 165px; height: 165px; }
    .advent-rv-item { width: 190px; }
    .advent-rv-glow { width: 240px; height: 170px; }
}

/* ---------- reveal overlay: the bauble leaves the tree, then lights up ---------- */
.advent-fx {
    position: fixed;
    inset: 0;
    z-index: 90;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 50% 45%, rgba(10, 16, 28, .45), rgba(2, 4, 10, .88));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: advent-fade .25s ease-out both;
}
.advent-fx .advent-fx-ball {
    --s: 104px;
    --str: 0px;
    position: absolute;
    left: 50%;
    top: 45%;
    margin: calc(var(--s) * -.5) 0 0 calc(var(--s) * -.5);
    animation: advent-detach .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes advent-detach { from { translate: var(--dx, 0) var(--dy, 40vh); scale: var(--from, .45); } to { translate: 0 0; scale: 1; } }
/* Same element as the detach, so this has to outrank the rule above to swap its animation. */
.advent-fx .advent-fx-ball.is-lit { animation: advent-light-up .55s ease-out both; }
.advent-fx-stage { position: absolute; left: 50%; top: 45%; width: min(400px, 90vw); aspect-ratio: 4 / 3; translate: -50% -50%; }
.advent-fx-stage .advent-rays { inset: -45% -10%; }
.advent-fx-flash {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 70%;
    aspect-ratio: 1;
    margin: -35% 0 0 -35%;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0 7%, rgba(var(--rc), .9) 17%, rgba(var(--rc), .28) 40%, transparent 66%);
    animation: advent-flash .55s ease-out both;
}
@keyframes advent-flash { from { scale: .2; } 40% { scale: 1.1; } to { scale: 1.25; opacity: .55; } }
.advent-fx-dzin {
    position: absolute;
    left: 50%;
    top: calc(45% - 110px);
    margin: 0;
    translate: -50% -50%;
    rotate: -7deg;
    font-weight: 900;
    font-style: italic;
    color: #fff;
    text-shadow: 0 0 18px rgba(var(--rc), .95), 0 3px 0 rgba(0, 0, 0, .35);
    animation: advent-pop .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes advent-pop { from { scale: .5; opacity: 0; } to { scale: 1; opacity: 1; } }
/* Phones get the shorter cut (about 1 s in total). */
.advent-fx.is-short .advent-fx-ball { animation-duration: .35s; }
.advent-fx.is-short .advent-fx-flash { animation-duration: .45s; }

@media (prefers-reduced-motion: reduce) {
    :is(.advent, .advent-modal-card, .advent-confetti-layer) *,
    :is(.advent, .advent-modal-card, .advent-confetti-layer) *::before,
    :is(.advent, .advent-modal-card, .advent-confetti-layer) *::after,
    .advent-gold-btn { animation: none !important; transition: none !important; }
    .advent-gb-ping { display: none; }
}
