/* Public brochure ("/welcome") - linked from the Patreon welcome message.
   Uses general.css tokens. The mockups here are static recreations of the real
   pages, not screenshots and not live data: nothing on this page comes from the
   database, so no member name, avatar or score can leak onto a public URL. */

:root {
    /* Rarity tones: the shared card frame colours from general.css. */
    --wel-r5: var(--rarity-5);
    --wel-r4: var(--rarity-4);
    --wel-r4-text: #bfaaff;
    --wel-r3: var(--rarity-3);

    --wel-maxw: 1080px;
}

/* general.css makes the body a non-scrolling flex viewport because the app's
   scroll container is #content_container. This page has no app shell and is a
   long document, so the body goes back to being the scroller: the mobile URL
   bar then collapses on scroll, html{scroll-behavior:smooth} applies to the
   in-page anchor, and position:sticky works on the top bar.
   The background-* properties are deliberately untouched - the fixed ambient
   light pools from general.css survive display:block and give the page depth. */
body {
    display: block;
    /* The rotated hero wall is wider than the viewport by design. */
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
}

/* ---------------------------------------------------------------- Top bar */
.wel-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    padding-top: calc(10px + var(--safe-top));
    padding-left: calc(20px + var(--safe-left));
    padding-right: calc(20px + var(--safe-right));
    background: color-mix(in srgb, var(--color-dark-bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.wel-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: var(--fs-h3);
    letter-spacing: 0.03em;
    color: var(--color-text-light);
}

.wel-brand-mark {
    width: 26px;
    height: 26px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border);
}

.wel-topbar-cta {
    padding: 6px 13px;
}

/* ---------------------------------------------------------------- Hero */
.wel-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 44px;
    padding-left: calc(20px + var(--safe-left));
    padding-right: calc(20px + var(--safe-right));
    /* Sized to the three art rows plus a little breathing room. Taller than
       that and the bottom of the hero is just empty black. */
    min-height: min(72dvh, 660px);
}

/* Scoped to the hero, not fixed like the landing wall, or it would sit behind
   every section below. */
.wel-hero-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background-color: var(--color-dark-bg);
    transition: filter 700ms ease;
}

html:not(.age-ok) .wel-hero-art {
    filter: blur(15px) saturate(1.15) brightness(0.7);
}

/* Diagonal wall of vertical tracks, same as the landing page. Sized in
   percentages of the hero rather than the viewport, because unlike the landing
   backdrop this one is scoped to the hero and not fixed to the screen. The
   oversize is what keeps the rotated corners covered. */
.wel-wall {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 190%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 14px;
    transform: translate(-50%, -50%) rotate(-14deg);
}

.wel-track {
    flex: 0 0 clamp(120px, 14vw, 200px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: wel-track-scroll 60s linear infinite;
    will-change: transform;
}

/* -50% minus half a gap keeps the duplicated half aligned on loop. */
@keyframes wel-track-scroll {
    from { transform: translateY(0); }
    to   { transform: translateY(calc(-50% - 7px)); }
}

.wel-track:nth-child(even) {
    animation-direction: reverse;
}

.wel-track:nth-child(1) { animation-duration: 58s; animation-delay: -12s; }
.wel-track:nth-child(2) { animation-duration: 72s; animation-delay: -40s; }
.wel-track:nth-child(3) { animation-duration: 64s; animation-delay: -5s; }
.wel-track:nth-child(4) { animation-duration: 80s; animation-delay: -55s; }
.wel-track:nth-child(5) { animation-duration: 54s; animation-delay: -22s; }
.wel-track:nth-child(6) { animation-duration: 76s; animation-delay: -33s; }
.wel-track:nth-child(7) { animation-duration: 68s; animation-delay: -60s; }

.wel-tile {
    width: 100%;
    aspect-ratio: 180 / 255;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    display: block;
}

.wel-art-fallback {
    position: absolute;
    inset: 0;
    background-color: var(--color-dark-bg);
    background-image:
        radial-gradient(circle at 20% 15%, rgba(116, 195, 255, 0.18), transparent 55%),
        radial-gradient(circle at 80% 85%, rgba(216, 137, 238, 0.16), transparent 55%);
}

.wel-hero-scrim {
    position: absolute;
    inset: 0;
    /* Light enough that the art still reads: the copy gets its legibility from
       the pool behind .wel-hero-body, not from drowning the whole wall. */
    background:
        radial-gradient(ellipse at 50% 50%,
            color-mix(in srgb, var(--color-dark-bg) 20%, transparent) 0%,
            color-mix(in srgb, var(--color-dark-bg) 56%, transparent) 55%,
            color-mix(in srgb, var(--color-dark-bg) 92%, transparent) 100%),
        linear-gradient(to bottom,
            color-mix(in srgb, var(--color-dark-bg) 60%, transparent) 0%,
            color-mix(in srgb, var(--color-dark-bg) 26%, transparent) 24%,
            color-mix(in srgb, var(--color-dark-bg) 42%, transparent) 64%,
            var(--color-dark-bg) 100%);
}

.wel-hero-body {
    position: relative;
    z-index: 1;
    padding: 26px 24px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    max-width: 620px;
}

/* A pool of dark behind the copy rather than a hard card: the artwork still
   runs edge to edge, but the headline never has to compete with whichever tile
   happens to scroll behind it. */
/* Wide and very gradual: an ellipse that reaches full opacity early reads as a
   dark rectangle sitting on the artwork, because the tiles behind it visibly
   cut out along its edge. Spreading the falloff over the whole hero hides
   where it starts and stops. */
.wel-hero-body::before {
    content: '';
    position: absolute;
    inset: -70% -85%;
    z-index: -1;
    background: radial-gradient(ellipse at center,
        color-mix(in srgb, var(--color-dark-bg) 90%, transparent) 0%,
        color-mix(in srgb, var(--color-dark-bg) 82%, transparent) 22%,
        color-mix(in srgb, var(--color-dark-bg) 58%, transparent) 40%,
        color-mix(in srgb, var(--color-dark-bg) 26%, transparent) 58%,
        transparent 78%);
}

/* Bare, no plate behind it. height:auto keeps the gif's 320x293 aspect, so
   nothing is cropped. The pool of dark behind .wel-hero-body is what separates
   her from the art wall. */
.wel-mascot {
    width: 156px;
    height: auto;
    margin-bottom: 4px;
}

.wel-h1 {
    margin: 0;
    font-size: clamp(30px, 5.2vw, 44px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text-light);
}

.wel-hero-lead {
    margin: 0;
    max-width: 46ch;
    font-size: var(--fs-h3);
    line-height: 1.55;
    color: var(--color-text-muted);
}

.wel-cta-btn {
    margin-top: 8px;
    padding: 11px 22px;
    font-size: var(--fs-h3);
    box-shadow: var(--shadow-lift);
}

.wel-secondary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    transition: color var(--dur) var(--ease-out);
}

.wel-secondary:hover {
    color: var(--color-text-secondary-hover);
}

.wel-secondary .material-symbols-outlined {
    font-size: 18px;
}

/* ---------------------------------------------------------------- Bands */
.wel-band {
    padding: 60px 20px;
    padding-left: calc(20px + var(--safe-left));
    padding-right: calc(20px + var(--safe-right));
    scroll-margin-top: 64px;
}

/* Alternating tint so twelve sections do not read as one wall. */
.wel-band:nth-of-type(even) {
    background: color-mix(in srgb, var(--color-card-bg) 45%, transparent);
    border-block: 1px solid var(--color-border);
}

.wel-band-inner {
    max-width: var(--wel-maxw);
    margin: 0 auto;
}

.wel-center {
    text-align: center;
}

.wel-h2 {
    margin: 6px 0 12px;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: -0.018em;
    color: var(--color-text-light);
}

.wel-lead {
    margin: 0 0 12px;
    max-width: 60ch;
    font-size: var(--fs-h3);
    line-height: 1.65;
    color: var(--color-text-muted);
}

.wel-lead b {
    color: var(--color-text-light);
    font-weight: 700;
}

.wel-lead-center {
    margin-left: auto;
    margin-right: auto;
}

.wel-points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 9px;
}

.wel-points li {
    position: relative;
    padding-left: 24px;
    font-size: var(--fs-body);
    line-height: 1.55;
    color: var(--color-text-muted);
}

.wel-points li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: var(--border-radius-pill);
    background: var(--color-text-secondary);
}

.wel-points b {
    color: var(--color-text-light);
}

/* Copy on one side, mockup on the other. .is-flipped puts the mockup first so
   the eye zig-zags down the page instead of running in one column. */
.wel-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
}

.wel-split.is-flipped > *:first-child { order: 2; }
.wel-split.is-flipped > *:last-child  { order: 1; }

/* ---------------------------------------------------------------- Mockups */
.wel-mock {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.wel-mock-cap {
    font-size: var(--fs-caps);
    color: var(--color-text-faint);
    text-align: center;
}

/* Nothing inside a mockup is a real control, so nothing is a button or a link.
   This stops the fake ones from looking clickable on hover too. */
.wel-mock * {
    cursor: default;
}

/* ---------------------------------------------------------------- Card tile */
/* Mirrors .card in collection.css, but aspect-ratio instead of a fixed
   180x255 so the tiles scale down with the layout. */
.wel-card {
    --art-filter: none;
    position: relative;
    width: var(--w, 128px);
    aspect-ratio: 180 / 255;
    flex-shrink: 0;
    border: 2px solid var(--glow, var(--color-border));
    border-radius: 12px;
    background-color: var(--color-card-bg-secondary);
    box-shadow: 0 2px 12px #0002, 0 0 18px -6px var(--glow, transparent);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
}

/* The art lives on a pseudo-element so the 18+ blur and the locked-card
   greyscale can both use filter without one clobbering the other. */
.wel-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--front) center / cover no-repeat;
    filter: var(--art-filter);
    transition: filter 700ms ease;
}

.wel-card.r5 { --glow: var(--wel-r5); }
.wel-card.r4 { --glow: var(--wel-r4); }
.wel-card.r3 { --glow: var(--wel-r3); }

.wel-card.is-locked {
    --art-filter: grayscale(1) brightness(0.4);
    border-style: dashed;
    border-color: var(--color-border);
    box-shadow: none;
}

/* Wins over .is-locked on specificity, so a gated visitor sees every card
   blurred, locked or not. */
html:not(.age-ok) .wel-card {
    --art-filter: blur(10px);
}

.wel-card-stars {
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
    color: gold;
    font-size: 17px;
    line-height: 0.7;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px #000, 0 2px 2px #000;
}

.wel-card.is-locked .wel-card-stars {
    color: var(--color-text-faint);
    text-shadow: none;
}

/* ---------------------------------------------------------------- Chips */
/* Reproduces .home-bounty-chip from home.css, including its --chip-tone hook. */
.wel-chip {
    --chip-tone: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid color-mix(in srgb, var(--chip-tone) 45%, transparent);
    border-radius: var(--border-radius-pill);
    background: color-mix(in srgb, var(--color-dark-bg) 55%, transparent);
    color: var(--chip-tone);
    font-size: var(--fs-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wel-chip .material-symbols-outlined {
    font-size: 18px;
}

.wel-chip.is-reward { --chip-tone: var(--color-warning); }
.wel-chip.is-timer  { --chip-tone: var(--color-info); }

.wel-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------------------------------------------------------------- Stats + flow */
.wel-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0 26px;
}

/* .card_container sets height: fit-content, which beats the grid/flex stretch
   and leaves the tiles and steps at ragged heights. */
.wel-stat,
.wel-flow-step {
    height: auto;
}

.wel-stat {
    padding: 18px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wel-stat-val {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

.wel-stat-lab {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: 1.45;
}

.wel-flow {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.wel-flow-step {
    flex: 1 1 0;
    min-width: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wel-flow-step b {
    font-size: var(--fs-h3);
    color: var(--color-text-light);
}

.wel-flow-step span:not(.material-symbols-outlined) {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.wel-flow-icon {
    font-size: 26px;
    color: var(--color-text-secondary);
    margin-bottom: 2px;
}

.wel-flow-arrow {
    align-self: center;
    font-size: 22px;
    color: var(--color-border-bright);
    flex-shrink: 0;
}

/* ---------------------------------------------------------------- Banner mock */
/* The panel is drawn on ::before, starting --pop below the top, and nothing
   clips: the cards rise out over its top edge. The height leaves room for
   the whole card (187px at the front) plus its float, so nothing below
   covers it. */
.wel-banner-clip {
    --pop: 46px;
    position: relative;
    height: 226px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wel-banner-clip::before {
    content: '';
    position: absolute;
    inset: var(--pop) 0 0;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    background: linear-gradient(160deg, var(--color-card-bg-secondary), var(--color-dark-bg));
    border: 1px solid var(--color-border);
    border-bottom: 0;
}

.wel-fan {
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 900px;
    transform: translateY(-4px);
}

.wel-fan-slot {
    position: relative;
}

.wel-fan-slot.is-front {
    z-index: 2;
}

/* Sits right under the fan rather than overlapping it, so the holo cards
   stay fully visible while they sway and float. */
.wel-banner-card {
    position: relative;
    z-index: 3;
    margin-top: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wel-banner-title {
    margin: 0;
    font-size: var(--fs-h3);
    color: var(--color-text-light);
}

.wel-pull-actions {
    display: flex;
    gap: 10px;
}

.wel-pull-btn {
    position: relative;
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: var(--fs-body);
    color: var(--color-dark-bg);
    box-shadow: var(--highlight-top), var(--shadow-soft);
}

.wel-pull-btn .material-symbols-outlined {
    font-size: 19px;
}

.wel-pull-btn.is-blue {
    background-image: linear-gradient(180deg, var(--color-text-secondary-hover), var(--color-text-secondary));
}

.wel-pull-btn.is-purple {
    background-image: linear-gradient(180deg,
        color-mix(in srgb, var(--wel-r4) 78%, white),
        var(--wel-r4));
    color: var(--color-dark-bg);
}

.wel-free-badge {
    position: absolute;
    top: -9px;
    right: -6px;
    padding: 2px 8px 1px;
    border-radius: var(--border-radius-pill);
    background: var(--color-success);
    color: var(--color-dark-bg);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Structure lifted from .rate-chip in collection.css. */
.wel-rate-chips {
    display: flex;
    gap: 6px;
}

.wel-rate-chip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border: 1px solid;
    border-radius: 8px;
}

.wel-rate-stars {
    font-size: 9px;
    letter-spacing: -1px;
    line-height: 1;
}

.wel-rate-val {
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.wel-rate-chip.r5 {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--wel-r5);
}

.wel-rate-chip.r4 {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--wel-r4-text);
}

.wel-rate-chip.r3 {
    background: rgba(116, 195, 255, 0.1);
    border-color: rgba(116, 195, 255, 0.3);
    color: var(--wel-r3);
}

/* ---------------------------------------------------------------- Pity meters */
.wel-meters {
    padding: 18px;
    display: grid;
    gap: 20px;
}

.wel-meter-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: var(--fs-body);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.wel-meter-head b {
    color: var(--color-text-light);
}

.wel-meter-track {
    position: relative;
    height: 12px;
    border-radius: var(--border-radius-pill);
    background: var(--color-card-bg-secondary);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.wel-meter-fill {
    height: 100%;
    width: var(--pct);
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--tone) 50%, transparent), var(--tone));
    box-shadow: 0 0 12px -2px var(--tone);
}

/* One hairline per pull, so the bar reads as "18 of 25" rather than as a
   generic percentage. */
.wel-meter-ticks {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(90deg,
        transparent 0,
        transparent calc(100% / var(--seg) - 1px),
        rgba(0, 0, 0, 0.55) calc(100% / var(--seg) - 1px),
        rgba(0, 0, 0, 0.55) calc(100% / var(--seg)));
}

.wel-meter-note {
    margin: 7px 0 0;
    font-size: var(--fs-sm);
    color: var(--color-text-faint);
}

/* ---------------------------------------------------------------- Set mock */
.wel-set {
    padding: 14px;
}

.wel-set-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.wel-set-header-left {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.wel-set-name {
    font-size: var(--fs-h3);
    font-weight: 700;
    color: var(--color-text-light);
}

.wel-set-progress {
    padding: 2px 9px;
    border-radius: var(--border-radius-pill);
    background: var(--color-card-bg-secondary);
    border: 1px solid var(--color-border);
    font-size: var(--fs-caps);
    font-weight: 800;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.wel-set-reward {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--color-warning);
    font-variant-numeric: tabular-nums;
}

.wel-set-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.wel-score-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.wel-score-chip {
    padding: 5px 12px;
    border: 1px solid;
    border-radius: var(--border-radius-pill);
    font-size: var(--fs-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wel-score-chip.r5 { color: var(--wel-r5);      border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); }
.wel-score-chip.r4 { color: var(--wel-r4-text); border-color: rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.08); }
.wel-score-chip.r3 { color: var(--wel-r3);      border-color: rgba(116, 195, 255, 0.35); background: rgba(116, 195, 255, 0.08); }

/* ---------------------------------------------------------------- Craft table */
.wel-craft {
    padding: 14px 16px;
}

.wel-craft-head,
.wel-craft-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px 4px;
    font-variant-numeric: tabular-nums;
}

.wel-craft-head {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--fs-caps);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-faint);
}

.wel-craft-row {
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
    font-size: var(--fs-h3);
    font-weight: 700;
    color: var(--color-text-light);
}

.wel-craft-row:last-of-type {
    border-bottom: 0;
}

.wel-craft-stars {
    letter-spacing: -1px;
    font-size: var(--fs-body);
}

.wel-craft-row.r5 .wel-craft-stars { color: var(--wel-r5); }
.wel-craft-row.r4 .wel-craft-stars { color: var(--wel-r4-text); }
.wel-craft-row.r3 .wel-craft-stars { color: var(--wel-r3); }

.wel-craft-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    font-size: var(--fs-sm);
    color: var(--color-text-faint);
}

.wel-craft-note .material-symbols-outlined {
    font-size: 18px;
}

/* ---------------------------------------------------------------- Missions */
.wel-missions {
    padding: 12px 14px;
}

.wel-missions-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-light);
}

.wel-missions-head .material-symbols-outlined {
    font-size: 20px;
    color: var(--color-text-secondary);
}

.wel-claim-badge {
    min-width: 18px;
    padding: 1px 6px;
    border-radius: var(--border-radius-pill);
    background: var(--color-success);
    color: var(--color-dark-bg);
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.wel-missions-timers {
    display: flex;
    gap: 10px;
    margin-left: auto;
    font-size: var(--fs-caps);
    color: var(--color-text-faint);
    font-variant-numeric: tabular-nums;
}

.wel-missions-timers span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.wel-missions-timers .material-symbols-outlined {
    font-size: 15px;
    color: var(--color-text-faint);
}

.wel-mission-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 4px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 55%, transparent);
}

.wel-mission-row:last-child {
    border-bottom: 0;
}

.wel-mission-row.is-claimed {
    opacity: 0.55;
}

.wel-mission-icon {
    font-size: 22px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.wel-mission-info {
    flex: 1;
    min-width: 0;
}

.wel-mission-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 6px;
}

.wel-mission-cadence {
    padding: 1px 7px;
    border-radius: var(--border-radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-card-bg-secondary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.wel-mission-bar {
    height: 5px;
    border-radius: 3px;
    background: var(--color-border);
    overflow: hidden;
}

.wel-mission-fill {
    height: 100%;
    background: var(--color-info);
}

.wel-mission-text {
    margin-top: 4px;
    font-size: var(--fs-caps);
    color: var(--color-text-faint);
    font-variant-numeric: tabular-nums;
}

.wel-mission-claim,
.wel-mission-reward,
.wel-mission-done {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    padding: 6px 11px;
    border-radius: var(--border-radius-sm);
    font-size: var(--fs-sm);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.wel-mission-claim {
    background: var(--color-success);
    color: var(--color-dark-bg);
    box-shadow: var(--highlight-top), var(--shadow-soft);
}

.wel-mission-reward {
    border: 1px solid var(--color-border);
    background: var(--color-card-bg-secondary);
    color: var(--color-text-muted);
}

.wel-mission-done {
    padding: 6px;
    color: var(--color-success);
}

.wel-mission-claim .material-symbols-outlined,
.wel-mission-reward .material-symbols-outlined,
.wel-mission-done .material-symbols-outlined {
    font-size: 18px;
}

/* ---------------------------------------------------------------- Avatars */
/* Drawn in CSS, never an <img>. /img/default-avatar.png does not exist, and a
   real avatar URL has no business on a public page. */
.wel-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border-bright);
    background: linear-gradient(140deg, var(--color-card-bg-secondary), var(--color-dark-bg));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--color-text-muted);
}

.wel-avatar::after {
    content: attr(data-i);
}

.wel-avatar.is-lg {
    width: 60px;
    height: 60px;
    font-size: 22px;
}

/* ---------------------------------------------------------------- Bounty mock */
.wel-bounty {
    overflow: hidden;
}

.wel-bounty-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.wel-bounty-title {
    margin: 0;
    font-size: var(--fs-h3);
    color: var(--color-text-light);
}

.wel-bounty-roll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--color-dark-bg) 55%, transparent);
    border-top: 1px solid var(--color-border);
}

/* Same grid as .home-bounty-winner-row in home.css. */
.wel-lead-row {
    display: grid;
    grid-template-columns: 28px 40px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-card-bg);
    color: var(--color-text-light);
}

.wel-lead-row.is-you {
    border-color: var(--color-text-secondary);
    background: var(--color-accent-soft);
}

.wel-lead-rank {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}

.wel-lead-rank.rank-1 { color: var(--medal-gold); }
.wel-lead-rank.rank-2 { color: var(--medal-silver); }
.wel-lead-rank.rank-3 { color: var(--medal-bronze); }

.wel-lead-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.wel-lead-score {
    font-variant-numeric: tabular-nums;
    color: var(--color-text-secondary);
}

.wel-roll-btn {
    align-self: flex-start;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--border-radius-sm);
    background-image: linear-gradient(180deg, var(--color-text-secondary-hover), var(--color-text-secondary));
    color: var(--color-dark-bg);
    font-weight: 700;
    box-shadow: var(--highlight-top), var(--shadow-soft);
}

.wel-roll-btn .material-symbols-outlined {
    font-size: 19px;
}

/* ---------------------------------------------------------------- Leaderboard */
.wel-board {
    padding: 14px;
}

.wel-board-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.wel-board-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-card-bg-secondary);
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.wel-board-tab .material-symbols-outlined {
    font-size: 18px;
}

.wel-board-tab.is-active {
    border-color: var(--color-text-secondary);
    background: var(--color-accent-soft);
    color: var(--color-text-secondary);
}

.wel-lb-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 6px 10px;
    background: var(--color-card-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
}

.wel-lb-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-light);
}

.wel-lb-rank {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}

.wel-lb-score {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--medal-gold);
}

/* Podium: three columns, the winner raised and slightly larger. */
.wel-lb-podium {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

.wel-lb-podium .wel-lb-entry {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    padding: 14px 8px;
    text-align: center;
}

.wel-lb-podium .wel-lb-entry.top1 {
    padding-block: 22px 14px;
    border-color: color-mix(in srgb, var(--medal-gold) 55%, transparent);
}

.wel-lb-podium .wel-lb-name {
    flex: 0 0 auto;
    max-width: 100%;
}

.wel-lb-entry.top1 .wel-lb-rank { color: var(--medal-gold); }
.wel-lb-entry.top2 .wel-lb-rank { color: var(--medal-silver); }
.wel-lb-entry.top3 .wel-lb-rank { color: var(--medal-bronze); }

.wel-lb-podium .wel-lb-entry.top1 .wel-avatar { border-color: var(--medal-gold); }
.wel-lb-podium .wel-lb-entry.top2 .wel-avatar { border-color: var(--medal-silver); }
.wel-lb-podium .wel-lb-entry.top3 .wel-avatar { border-color: var(--medal-bronze); }

.wel-lb-list {
    display: grid;
    gap: 6px;
}

.wel-lb-sep {
    height: 1px;
    background: var(--color-border);
    margin: 10px 0;
}

.wel-lb-entry.is-you {
    border-color: var(--color-text-secondary);
    background: var(--color-accent-soft);
}

/* ---------------------------------------------------------------- Timeline */
.wel-timeline {
    padding: 14px 16px;
    display: grid;
    gap: 10px;
}

.wel-tl-event {
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-card-bg-secondary);
}

.wel-tl-note {
    margin-top: 9px;
    padding: 8px 10px;
    border: 1px dashed var(--color-border-bright);
    border-radius: var(--border-radius-sm);
    background: var(--color-card-bg);
    font-size: var(--fs-sm);
    color: var(--color-text-faint);
}

/* ---------------------------------------------------------------- Slideshow */
.wel-slide {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    background: var(--color-card-bg-secondary);
    box-shadow: var(--shadow-elevated);
}

.wel-slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 700ms ease;
}

html:not(.age-ok) .wel-slide-img {
    filter: blur(14px);
}

.wel-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
        color-mix(in srgb, var(--color-dark-bg) 92%, transparent) 12%,
        color-mix(in srgb, var(--color-dark-bg) 55%, transparent) 62%,
        color-mix(in srgb, var(--color-dark-bg) 20%, transparent) 100%);
}

.wel-slide-body {
    position: absolute;
    z-index: 1;
    inset: 0 auto 0 0;
    width: min(62%, 340px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
}

.wel-slide-kicker {
    margin: 0;
    color: var(--color-text-secondary);
}

.wel-slide-title {
    font-size: clamp(16px, 2.4vw, 21px);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text-light);
}

.wel-slide-text {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: 1.45;
}

.wel-slide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.wel-slide-btn {
    padding: 7px 13px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border-bright);
    background: var(--color-card-bg);
    color: var(--color-text-light);
    font-size: var(--fs-sm);
    font-weight: 700;
    white-space: nowrap;
}

.wel-slide-btn.is-primary {
    border-color: transparent;
    background-image: linear-gradient(180deg, var(--color-text-secondary-hover), var(--color-text-secondary));
    color: var(--color-dark-bg);
}

.wel-slide-dots {
    position: absolute;
    z-index: 1;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 7px;
}

.wel-slide-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--border-radius-pill);
    background: color-mix(in srgb, var(--color-text-light) 35%, transparent);
}

.wel-slide-dot.is-active {
    background: var(--color-text-secondary);
    width: 18px;
}

/* ---------------------------------------------------------------- Tiers */
.wel-tiers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-top: 20px;
}

/* ---------------------------------------------------------------- Final CTA */
.wel-cta {
    padding: 64px 20px 40px;
    padding-left: calc(20px + var(--safe-left));
    padding-right: calc(20px + var(--safe-right));
    padding-bottom: calc(40px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.wel-cta-card {
    width: min(560px, 100%);
    box-sizing: border-box;
    padding: 32px 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-color: var(--color-border-bright);
}

.wel-cta-title {
    margin: 0;
    font-size: clamp(21px, 3vw, 26px);
    font-weight: 700;
    color: var(--color-text-light);
}

.wel-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
    width: 100%;
}

.wel-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    background-color: var(--color-card-bg-secondary);
    transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.wel-socials a:hover {
    border-color: var(--color-border-bright);
    transform: translateY(-2px);
}

.wel-socials img {
    border-radius: 4px;
}

.wel-footnote {
    margin: 0;
    font-size: var(--fs-caps);
    color: var(--color-scrollbar-thumb);
    text-align: center;
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 900px) {
    .wel-split {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Copy first on every section once they stack: alternating order only
       makes sense while the two columns sit side by side. */
    .wel-split.is-flipped > *:first-child { order: 1; }
    .wel-split.is-flipped > *:last-child  { order: 2; }

    .wel-band {
        padding: 44px 16px;
    }

    .wel-flow {
        flex-direction: column;
    }

    .wel-flow-arrow {
        rotate: 90deg;
    }
}

@media (max-width: 620px) {
    .wel-hero {
        padding: 44px 16px 52px;
        min-height: 0;
    }

    .wel-mascot {
        width: 92px;
    }

    .wel-stats {
        grid-template-columns: 1fr;
    }

    .wel-stat {
        flex-direction: row;
        align-items: baseline;
        justify-content: flex-start;
        gap: 10px;
        text-align: left;
    }

    .wel-stat-val {
        font-size: 26px;
    }

    .wel-set-cards .wel-card {
        --w: 84px;
    }

    .wel-banner-clip {
        --pop: 30px;
        height: 214px;
    }

    .wel-lead-row {
        grid-template-columns: 26px 34px minmax(0, 1fr) auto;
    }

    .wel-avatar.is-lg {
        width: 44px;
        height: 44px;
        font-size: 17px;
    }

    .wel-slide-body {
        width: 72%;
        padding: 14px;
    }

    .wel-missions-timers {
        display: none;
    }

    /* 4 tracks already overflow a phone viewport once rotated. */
    .wel-track:nth-child(n+5) {
        display: none;
    }
}

/* The pledge row is a flex table with fixed column widths from general.css and
   overflows a phone. Scoped to this page so /members and /user/profile keep
   their aligned columns. */
@media (max-width: 560px) {
    .wel-timeline .event-details {
        flex-wrap: wrap;
        --evt-col-date: auto;
        --evt-col-type: auto;
        --evt-col-tier: auto;
        --evt-col-ago: auto;
    }

    .wel-timeline .event-details > * {
        flex: 0 0 auto;
    }
}

/* ---------------------------------------------------------------- Holo banner cards */
/* The collection's holo (holoCard.css) on the three fanned banner cards:
   tilt, foil, glare, sparkles and the spinning 5✦ frame. welcomeCards.js
   injects the layers as child spans, because ::before already holds the art.
   Unlike the collection these play at rest (sway, sheen, sparkles, foil
   drift); the pointer tilts on top of that.

   Layers, bottom to top: art (::before), foil, sheen, sparkles, glare. */

@property --wel-sx { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --wel-sy { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --wel-dx { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --wel-dy { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --wel-frame { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --wel-fy { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --wel-glow { syntax: '<length>'; inherits: false; initial-value: 14px; }
@property --wel-shine { syntax: '<number>'; inherits: false; initial-value: 1; }

/* Spread from a stack the first time the fan scrolls into view. The slots
   carry their fan position inline, hence !important on the stacked state. */
.wel-fan-slot {
    transition: transform 900ms cubic-bezier(0.22, 1.2, 0.36, 1), opacity 450ms ease;
}

.wel-fan-slot:not(.is-front) {
    transition-delay: 140ms;
}

.wel-fan.is-stacked .wel-fan-slot {
    transform: translateY(18px) scale(0.92) !important;
}

.wel-fan.is-stacked .wel-fan-slot:not(.is-front) {
    opacity: 0;
}

.wel-card.wel-holo {
    --rx: 0deg;
    --ry: 0deg;
    --mx: 50%;
    --my: 50%;
    --bgx: 50%;
    --bgy: 50%;
    --hyp: 0;
    --lift: 1;

    transform:
        perspective(700px)
        translateY(var(--wel-fy))
        rotateX(calc(var(--rx) + var(--wel-sx)))
        rotateY(calc(var(--ry) + var(--wel-sy)))
        scale(var(--lift));
    box-shadow: 0 6px 18px #0006, 0 0 var(--wel-glow) -2px var(--glow);
    /* sway + float + pulsing rarity glow */
    animation:
        wel-sway 7s ease-in-out var(--sway-d, 0s) infinite,
        wel-float 3.6s ease-in-out var(--sway-d, 0s) infinite alternate,
        wel-glow 2.4s ease-in-out infinite alternate;
    /* Slow, slightly overshooting return to rest once the pointer leaves. */
    transition:
        transform 650ms cubic-bezier(0.22, 1.25, 0.36, 1),
        box-shadow 300ms ease;
}

.wel-card.wel-holo.is-tilting {
    --lift: 1.06;
    z-index: 5;
    /* Short, so the tilt keeps up with the pointer without jitter. */
    transition: transform 90ms linear, box-shadow 300ms ease;
    box-shadow:
        0 22px 40px -16px rgba(0, 0, 0, 0.85),
        0 0 26px -6px var(--glow);
}

/* The pointer takes over; the idle motion holds where it was. */
.wel-card.wel-holo.is-tilting,
.wel-card.wel-holo.is-tilting > span {
    animation-play-state: paused;
}

@keyframes wel-sway {
    0%, 100% { --wel-sx: 0deg;  --wel-sy: 0deg; }
    25%      { --wel-sx: 9deg;  --wel-sy: -14deg; }
    50%      { --wel-sx: -6deg; --wel-sy: 12deg; }
    75%      { --wel-sx: -9deg; --wel-sy: -10deg; }
}

@keyframes wel-float {
    from { --wel-fy: 4px; }
    to   { --wel-fy: -12px; }
}

@keyframes wel-glow {
    from { --wel-glow: 8px; }
    to   { --wel-glow: 34px; }
}

.wel-holo-foil,
.wel-holo-sheen,
.wel-holo-glare,
.wel-sparkles {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

/* Foil: same recipes as holoCard.css, drifting slowly at rest. */
.wel-holo-foil {
    z-index: 1;
    opacity: 0;
    mix-blend-mode: color-dodge;
    background-position:
        calc(var(--bgx) + var(--wel-dx)) calc(var(--bgy) + var(--wel-dy));
    animation:
        wel-foil-drift 6s ease-in-out infinite alternate,
        wel-shine 2.8s ease-in-out infinite alternate;
    transition: opacity 350ms ease;
}

/* Rest opacity is base * --wel-shine, so the foil breathes; the tilt rules
   below set opacity outright and ignore it. */
.wel-card.r4:not(.is-tilting) .wel-holo-foil { opacity: calc(0.3 * var(--wel-shine)); }
.wel-card.r5:not(.is-tilting) .wel-holo-foil { opacity: calc(0.22 * var(--wel-shine)); }

@keyframes wel-shine {
    from { --wel-shine: 0.5; }
    to   { --wel-shine: 1.7; }
}

/* 4✦ galaxy: sparkle fields over a violet/cyan nebula. */
.wel-card.r4 .wel-holo-foil {
    opacity: 0.26;
    background-image:
        radial-gradient(circle at 23% 31%, rgba(255, 255, 255, 0.95) 0 0.6px, transparent 1.6px),
        radial-gradient(circle at 71% 64%, rgba(255, 255, 255, 0.85) 0 0.8px, transparent 1.8px),
        radial-gradient(circle at 48% 12%, rgba(220, 200, 255, 0.9) 0 0.5px, transparent 1.4px),
        radial-gradient(circle at 87% 89%, rgba(190, 240, 255, 0.9) 0 1px, transparent 2.2px),
        radial-gradient(ellipse at 30% 40%, rgba(167, 139, 250, 0.55), transparent 60%),
        linear-gradient(125deg, #3b0764 0%, #7c3aed 22%, #22d3ee 40%, #a855f7 58%, #f0abfc 74%, #4c1d95 100%);
    background-size: 37px 41px, 53px 47px, 71px 67px, 97px 89px, 200% 200%, 320% 320%;
    filter: brightness(0.75) contrast(1.35) saturate(1.3);
}

/* 5✦ prism: rainbow bands crossed with fine diagonal bars. */
.wel-card.r5 .wel-holo-foil {
    opacity: 0.2;
    background-image:
        repeating-linear-gradient(-45deg,
            rgba(0, 0, 0, 0.32) 0px, rgba(0, 0, 0, 0.32) 2px,
            transparent 2px, transparent 6px),
        repeating-linear-gradient(110deg,
            hsl(0 95% 70%) 0%,
            hsl(45 95% 68%) 4%,
            hsl(110 85% 66%) 8%,
            hsl(185 90% 66%) 12%,
            hsl(235 90% 72%) 16%,
            hsl(290 90% 72%) 20%,
            hsl(360 95% 70%) 24%);
    background-size: 100% 100%, 400% 400%;
    background-blend-mode: overlay;
    filter: brightness(0.6) contrast(1.4) saturate(1.25);
}

/* Kept well below 1: color-dodge over light art blows out to white fast. */
.wel-card.r4.is-tilting .wel-holo-foil { opacity: calc(0.3 + var(--hyp) * 0.3); }
/* Lower than the collection's: the fan art skews bright and the prism
   washed it out to yellow at full strength. */
.wel-card.r5.is-tilting .wel-holo-foil { opacity: calc(0.18 + var(--hyp) * 0.22); }

@keyframes wel-foil-drift {
    0%   { --wel-dx: -35%; --wel-dy: -20%; }
    100% { --wel-dx: 35%;  --wel-dy: 24%; }
}

/* Sheen: a band of light crossing the card every few seconds. */
.wel-holo-sheen {
    z-index: 2;
    background: linear-gradient(105deg,
        transparent 34%,
        rgba(255, 255, 255, 0.8) 48%,
        rgba(255, 255, 255, 0.2) 54%,
        transparent 64%) no-repeat;
    background-size: 260% 100%;
    background-position: 100% 0;
    mix-blend-mode: overlay;
    animation: wel-sheen 3.6s ease-in-out var(--sheen-d, 1s) infinite;
}

@keyframes wel-sheen {
    0%        { background-position: 100% 0; }
    40%, 100% { background-position: 0% 0; }
}

/* Glare: follows the pointer, only while tilting. */
.wel-holo-glare {
    z-index: 4;
    opacity: 0;
    background: radial-gradient(farthest-corner circle at var(--mx) var(--my),
        rgba(255, 255, 255, 0.75) 0%,
        rgba(255, 255, 255, 0.28) 22%,
        rgba(0, 0, 0, 0.35) 90%);
    mix-blend-mode: overlay;
    transition: opacity 350ms ease;
}

.wel-card.r4.is-tilting .wel-holo-glare { opacity: 0.6; }
.wel-card.r5.is-tilting .wel-holo-glare { opacity: 0.5; }

/* Sparkles: four-point glints, more and brighter for higher rarity. */
.wel-sparkles {
    z-index: 3;
    --spark-peak: 0.6;
}

.wel-card.r4 .wel-sparkles { --spark-peak: 0.85; }
.wel-card.r5 .wel-sparkles { --spark-peak: 1; }

.wel-sparkles i {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: var(--s);
    margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, transparent 65%);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    animation: wel-twinkle var(--dur) ease-in-out var(--d) infinite;
}

.wel-sparkles i::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.85) 45%, transparent 75%);
    clip-path: polygon(50% 0%, 57% 43%, 100% 50%, 57% 57%, 50% 100%, 43% 57%, 0% 50%, 43% 43%);
}

@keyframes wel-twinkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    15%      { opacity: var(--spark-peak); transform: scale(1) rotate(45deg); }
    30%      { opacity: 0; transform: scale(0.2) rotate(90deg); }
}

/* 5✦ gold frame: a conic gradient in the border box, always turning here. */
.wel-card.wel-holo.r5 {
    border-color: transparent;
    background: conic-gradient(from var(--wel-frame),
        #fff6c9, #e8bf5c, #9a6b1f, #ffe9a3, #e8bf5c, #b8862b, #fff6c9) border-box;
    animation:
        wel-sway 7s ease-in-out var(--sway-d, 0s) infinite,
        wel-float 3.6s ease-in-out var(--sway-d, 0s) infinite alternate,
        wel-glow 2.4s ease-in-out infinite alternate,
        wel-frame-spin 3s linear infinite;
}

@keyframes wel-frame-spin {
    to { --wel-frame: 360deg; }
}

/* Nothing runs while the fan is scrolled away. */
.wel-fan.is-offscreen .wel-card,
.wel-fan.is-offscreen .wel-card * {
    animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
    .wel-track {
        animation: none;
    }

    .wel-fan-slot {
        transition: none;
    }

    .wel-card.wel-holo,
    .wel-card.wel-holo.is-tilting {
        transform: none;
        transition: none;
    }

    .wel-card.wel-holo,
    .wel-card.wel-holo > span {
        animation: none;
    }

    .wel-sparkles {
        display: none;
    }

    .wel-hero-art,
    .wel-card::before,
    .wel-slide-img,
    .wel-socials a {
        transition: none;
    }
}
