:root {
    --cosmic-deep: #0c0618;
    --cosmic-mid: #1a0f2e;
    --cosmic-purple: #2d1b4e;
    --cosmic-magenta: #c026d3;
    --cosmic-orange: #f59e0b;
    --cosmic-cyan: #22d3ee;
    --cosmic-pink: #ec4899;
    --bg: var(--cosmic-deep);
    --panel: rgba(45, 27, 78, 0.45);
    --panel-solid: #24183d;
    --text: #f4eefc;
    --muted: #b8a8d8;
    --line: rgba(255, 255, 255, 0.14);
    --brand: #c4b5fd;
    --accent: #fbbf24;
    --good: #4ade80;
    --shadow: 0 16px 48px rgba(8, 0, 24, 0.55);
    --glow-magenta: 0 0 32px rgba(192, 38, 211, 0.35);
    --glow-orange: 0 0 28px rgba(245, 158, 11, 0.35);
    --glow-cyan: 0 0 28px rgba(34, 211, 238, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #07030f;
    /* Let the SVG read through — lighter wash = richer nebula (still readable for text) */
    background-image:
        url("images/cosmic-backdrop.svg"),
        radial-gradient(ellipse 90% 70% at 50% 20%, rgba(124, 58, 237, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, rgba(8, 4, 18, 0.2) 0%, rgba(5, 2, 12, 0.45) 55%, #05020a 100%);
    background-size: cover, 100% 100%, 100% 100%;
    background-position: center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-attachment: fixed, fixed, fixed;
    color: var(--text);
    min-height: 100vh;
}

/* Tiled starfield — extra sparkle layer on top of SVG stars */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("images/starfield.svg");
    background-size: 384px 384px;
    background-repeat: repeat;
    pointer-events: none;
    opacity: 0.52;
    mix-blend-mode: screen;
    z-index: 0;
}

/* Fine grain (helps break up flat colour on large monitors) */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.09;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

.page-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.1rem;
    background: rgba(6, 3, 14, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(124, 58, 237, 0.08);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.topbar__burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.12);
}

.topbar__burger:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(192, 38, 211, 0.25);
}

.topbar__burger-line {
    display: block;
    height: 2px;
    width: 1.1rem;
    margin: 0 auto;
    border-radius: 2px;
    background: linear-gradient(90deg, #fde68a, #f0abfc);
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
}

.topbar__link {
    color: #fff;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

.topbar__link:hover {
    color: var(--accent);
    text-shadow: var(--glow-orange);
}

.topbar__muted {
    color: rgba(255, 255, 255, 0.55);
}

.topbar__sep {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar__wallet {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.topbar__wallet:hover {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: var(--glow-magenta);
}

.topbar__icon {
    flex-shrink: 0;
    opacity: 0.9;
}

.topbar__link--active {
    color: var(--accent);
    text-shadow: var(--glow-orange);
}

.topbar__drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 24;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.topbar__drawer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    width: min(17.5rem, 88vw);
    height: 100vh;
    margin: 0;
    padding: 4.75rem 1.15rem 1.5rem;
    background: rgba(10, 5, 22, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 8px 0 36px rgba(0, 0, 0, 0.55);
    z-index: 25;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    box-sizing: border-box;
}

.topbar__drawer--open {
    transform: translateX(0);
}

@media (max-width: 767.98px) {
    .topbar__drawer:not(.topbar__drawer--open) {
        visibility: hidden;
        pointer-events: none;
    }

    .topbar__drawer--open {
        visibility: visible;
        pointer-events: auto;
    }
}

.topbar__drawer-label {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.topbar__drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.topbar__drawer-link {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.topbar__drawer-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(196, 181, 253, 0.35);
}

.topbar__drawer-link.topbar__link--active {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.1);
}

@media (min-width: 768px) {
    .topbar__burger {
        display: none;
    }

    .topbar__drawer,
    .topbar__drawer-backdrop {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .topbar__nav--inline {
        display: none !important;
    }
}

.content-shell {
    flex: 1;
    width: min(1100px, calc(100% - 2rem));
    margin: 1.5rem auto 2rem;
}

.progress-loading {
    text-align: center;
    color: var(--muted);
}

.card-panel {
    background: var(--panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.hero h1,
h1,
h2 {
    margin-top: 0;
}

.hero {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1.6fr 1fr;
    margin-bottom: 1.25rem;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-top: 1rem;
    width: min(100%, 20rem);
    margin-inline: auto;
}

.hero-actions .button {
    width: 100%;
    justify-content: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    font-weight: 700;
}

.button.primary {
    background: linear-gradient(90deg, var(--cosmic-orange), #fbbf24);
    color: #1a0f0a;
    border: none;
    box-shadow: var(--glow-orange);
}

.button.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-soft {
    background: rgba(196, 181, 253, 0.2);
    color: #e9d5ff;
    border: 1px solid rgba(196, 181, 253, 0.35);
}

.badge-accent {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.hero-stat-grid,
.grid {
    display: grid;
    gap: 1rem;
}

.hero-stat-grid {
    grid-template-columns: 1fr;
}

.stat-card {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    padding: 1rem;
}

.stat-card strong {
    display: block;
    font-size: 1.7rem;
    margin-bottom: 0.25rem;
    color: #fff;
}

.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guardian-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mission-brief {
    margin-bottom: 1.75rem;
}

.mission-brief .badge-soft {
    margin-bottom: 0.85rem;
}

.mission-brief__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
    margin-bottom: 0.15rem;
}

.mission-defaults-note {
    margin-top: 0.85rem;
    font-size: 0.92rem;
    max-width: 44rem;
    line-height: 1.45;
}

.steps {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
}

.wallet-page {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.wallet-intro .badge-soft {
    margin-bottom: 0.85rem;
}

.wallet-intro h1 {
    margin-bottom: 0.5rem;
}

.wallet-intro__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
    margin-bottom: 1.15rem;
}

.sample-list,
.wallet-list {
    display: grid;
    gap: 0.75rem;
}

.sample-item,
.wallet-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    background: rgba(0, 0, 0, 0.2);
}

a.wallet-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

a.wallet-card--link:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(196, 181, 253, 0.4);
}

a.wallet-card--link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.wallet-card__info {
    min-width: 0;
    flex: 1 1 auto;
}

.wallet-card__action {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand);
}

.wallet-card__badge {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.15);
}

.wallet-card__badge:is(video) {
    display: block;
}

.wallet-card__badge--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.35);
}

.home-sample__thumb {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.home-sample__thumb:is(video) {
    display: block;
}

.guardian-preview {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.guardian-preview__visual-wrap {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.guardian-preview__unlocked-mark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
}

.guardian-preview__tick-icon {
    width: min(48%, 5.5rem);
    height: auto;
    max-width: 100%;
    aspect-ratio: 1;
    filter: drop-shadow(0 4px 0 rgba(107, 83, 64, 0.45)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 20px rgba(201, 162, 39, 0.25));
    overflow: visible;
}

.guardian-preview__seal-hex {
    stroke-linejoin: round;
}

.guardian-preview__seal-hex--outer {
    fill: none;
    stroke: #6b5340;
    stroke-width: 1.25;
    opacity: 0.85;
}

.guardian-preview__seal-hex--rim {
    fill: none;
    stroke: #c9a227;
    stroke-width: 2.25;
    opacity: 0.95;
}

.guardian-preview__seal-hex--face {
    fill: rgba(22, 18, 42, 0.88);
    stroke: rgba(232, 212, 154, 0.35);
    stroke-width: 0.75;
}

.guardian-preview__seal-dot {
    fill: #d4a84b;
    opacity: 0.9;
}

.guardian-preview__seal-check {
    stroke: #f5ecd4;
    stroke-width: 5.5;
    paint-order: stroke fill;
}

@media (prefers-reduced-motion: no-preference) {
    .guardian-preview__unlocked-mark .guardian-preview__tick-icon {
        animation: guardian-seal-reveal 0.85s cubic-bezier(0.34, 1.2, 0.64, 1) both;
    }
}

@keyframes guardian-seal-reveal {
    from {
        opacity: 0;
        transform: scale(0.82) rotate(-8deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .guardian-preview__unlocked-mark .guardian-preview__tick-icon {
        animation: none;
    }
}

.guardian-preview__badge-wrap {
    display: flex;
    justify-content: center;
    margin: 0.15rem 0 0.35rem;
}

.guardian-preview__badge {
    width: 5.5rem;
    height: 5.5rem;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.2);
}

.guardian-preview h2,
.guardian-preview .muted {
    color: var(--text);
}

.guardian-preview__object {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.5rem;
    margin: 0;
    line-height: 1.45;
}

.guardian-preview__emoji {
    font-size: 1.35em;
    line-height: 1;
}

.preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
}

.rarity-tag {
    align-self: flex-start;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.rarity-common {
    background: rgba(74, 222, 128, 0.2);
    color: #bbf7d0;
}

.rarity-rare {
    background: rgba(96, 165, 250, 0.2);
    color: #bfdbfe;
}

.rarity-epic {
    background: rgba(192, 132, 252, 0.25);
    color: #e9d5ff;
}

.unlock-banner {
    margin-bottom: 1.35rem;
}

.unlock-banner--success {
    border-color: rgba(74, 222, 128, 0.4);
    background: linear-gradient(145deg, rgba(45, 27, 78, 0.55) 0%, rgba(22, 60, 45, 0.22) 55%, rgba(45, 27, 78, 0.48) 100%);
    box-shadow:
        0 0 0 1px rgba(74, 222, 128, 0.12),
        var(--shadow);
}

.unlock-banner__success-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.unlock-banner__check-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.2);
    border: 2px solid rgba(74, 222, 128, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86efac;
}

.unlock-banner__check-icon svg {
    display: block;
}

.unlock-banner__success-copy {
    min-width: 0;
}

.unlock-banner__success-copy .badge-accent {
    display: inline-block;
    margin-bottom: 0.55rem;
}

.unlock-banner__msg {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.45;
    font-weight: 600;
    color: #bbf7d0;
    max-width: 36rem;
}

.unlock-banner h1 {
    margin-bottom: 0.5rem;
}

.unlock-banner > p:last-of-type {
    margin-bottom: 0;
}

.unlock-in-collection-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    align-self: stretch;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: -1.25rem -1.25rem 1rem -1.25rem;
    padding: 0.55rem 1rem;
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.18), rgba(34, 197, 94, 0.12));
    border-bottom: 1px solid rgba(74, 222, 128, 0.35);
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #bbf7d0;
}

/* Full-bleed print cards use align-items: center — stretch unlock/footer rows to full panel width */
.collectible-card--print > .unlock-card-meta,
.collectible-card--print > .unlock-viewer-qr,
.collectible-card--print > .unlock-layered-warning {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.unlock-in-collection-bar__icon {
    flex-shrink: 0;
    color: #86efac;
}

.unlock-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.collectible-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(55, 40, 90, 0.6) 0%, rgba(30, 20, 55, 0.85) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.collectible-card--tcg {
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.collectible-card--print {
    background: rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.collectible-card--layered {
    background: rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

/* One-shot celebration when a guardian card is unlocked (Unlock.razor): jump out → spin → settle */
@keyframes unlock-card-celebrate {
    0% {
        transform: translateY(0.85rem) scale(0.82) rotate(0deg);
        filter: brightness(0.9) drop-shadow(0 0 0 transparent);
    }

    /* Pop toward the viewer */
    16% {
        transform: translateY(-1.35rem) scale(1.2) rotate(0deg);
        filter: brightness(1.22) drop-shadow(0 0 1.5rem rgba(251, 191, 36, 0.75));
    }

    /* Full spin while “out” (360° ends same as 0° so no unwinding snap) */
    48% {
        transform: translateY(-1.1rem) scale(1.12) rotate(360deg);
        filter: brightness(1.12) drop-shadow(0 0 1rem rgba(196, 181, 253, 0.6));
    }

    /* Return to rest */
    78% {
        transform: translateY(0.2rem) scale(1.02) rotate(360deg);
        filter: brightness(1.03) drop-shadow(0 0 0.35rem rgba(196, 181, 253, 0.2));
    }

    100% {
        transform: translateY(0) scale(1) rotate(360deg);
        filter: brightness(1) drop-shadow(0 0 0 transparent);
    }
}

@keyframes unlock-card-celebrate-subtle {
    from {
        opacity: 0.88;
        filter: brightness(0.96);
    }

    to {
        opacity: 1;
        filter: brightness(1);
    }
}

.collectible-card--celebrate {
    overflow: visible;
    animation: unlock-card-celebrate 1.5s cubic-bezier(0.34, 1.02, 0.68, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .collectible-card--celebrate {
        animation: unlock-card-celebrate-subtle 0.45s ease-out both;
    }
}

.guardian-print-card {
    margin: 0;
    width: 100%;
    max-width: 22rem;
}

.guardian-print-card img,
.guardian-print-card video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow:
        0 4px 0 rgba(212, 160, 18, 0.35),
        0 20px 48px rgba(0, 0, 0, 0.55);
}

.guardian-print-card--compact {
    max-width: 15rem;
    margin-inline: auto;
}

.guardian-print-card--compact img,
.guardian-print-card--compact video {
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.unlock-viewer-qr {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(196, 181, 253, 0.35);
    background: rgba(0, 0, 0, 0.25);
    margin-top: 0.25rem;
}

.unlock-viewer-qr__img {
    width: 5.5rem;
    height: 5.5rem;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #fff;
    padding: 4px;
    object-fit: contain;
}

.unlock-viewer-qr__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.88rem;
    line-height: 1.35;
}

.unlock-viewer-qr__link {
    margin-top: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent, #c4b5fd);
    text-decoration: underline;
}

/* Layered art: image behind fixed chrome (name bar, HP, border) + holo shine */
.layered-card {
    --tilt-x: 0;
    --tilt-y: 0;
    --shine-x: 50%;
    --shine-y: 50%;
    max-width: 22rem;
    margin-inline: auto;
    perspective: 960px;
}

.layered-card--parallax .layered-card__stage {
    transform: rotateX(calc(var(--tilt-x) * 13deg)) rotateY(calc(var(--tilt-y) * -13deg));
    transform-style: preserve-3d;
    will-change: transform;
}

.layered-card__stage {
    transition: transform 0.08s ease-out;
}

.layered-card__bezel {
    border-radius: 14px;
    border: 4px solid #c9a012;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.55),
        0 18px 42px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    background: #0f172a;
}

/* Teal banner is in normal document flow above the art so the strip stays solid (no overlay/stacking glitches). */
.layered-card__mast {
    display: flex;
    flex-direction: column;
}

.layered-card__namebar {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    margin: 0;
    padding: 0.45rem 0.65rem 0.5rem;
    background: linear-gradient(180deg, #2dd4bf 0%, #0f766e 100%);
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.layered-card__art-wrap {
    position: relative;
    min-height: 10rem;
    background: #020617;
}

.layered-card__series {
    margin: 0;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.55);
    text-align: center;
}

.layered-card__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
}

.layered-card__name {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.15;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.layered-card__type-badge {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    background: radial-gradient(circle at 30% 30%, #86efac, #16a34a);
}

.layered-card.tcg-card--rarity-rare .layered-card__type-badge {
    background: radial-gradient(circle at 30% 30%, #93c5fd, #2563eb);
}

.layered-card.tcg-card--rarity-epic .layered-card__type-badge {
    background: radial-gradient(circle at 30% 30%, #e9d5ff, #9333ea);
}

.layered-card__art-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center center;
}

.layered-card__art-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 11rem;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    color: rgba(255, 255, 255, 0.22);
    background: radial-gradient(circle at 50% 40%, rgba(250, 204, 21, 0.12), transparent 60%);
}

.layered-card__shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse 90% 80% at var(--shine-x, 50%) var(--shine-y, 50%),
        rgba(255, 255, 255, 0.55),
        rgba(255, 255, 255, 0.08) 38%,
        transparent 62%
    );
    mix-blend-mode: soft-light;
    opacity: 0.42;
    animation: layered-holo-breathe 4.2s ease-in-out infinite;
}

@keyframes layered-holo-breathe {
    0%,
    100% {
        opacity: 0.32;
    }

    50% {
        opacity: 0.52;
    }
}

@media (prefers-reduced-motion: reduce) {
    .layered-card__shine {
        animation: none;
        opacity: 0.28;
    }

    .layered-card--parallax .layered-card__stage {
        transform: none;
    }
}

.layered-card__hpbox {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.76rem;
    font-weight: 800;
    border-bottom: 1px solid #cbd5e1;
}

.layered-card__hpbox-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    min-width: 0;
}

.layered-card__icon-cluster {
    display: flex;
    align-items: center;
    gap: 0.22rem;
    flex-shrink: 0;
}

.layered-card__stars {
    letter-spacing: 0.06em;
}

.layered-card__hp strong {
    font-size: 0.95rem;
}

.layered-card__panel-line {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.42rem 0.65rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.layered-card__panel-line .layered-card__origin,
.layered-card__panel-line .layered-card__ability {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
}

.layered-card__energy {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    border: 2px solid rgba(15, 23, 42, 0.35);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.layered-card__energy--colorless {
    position: relative;
    background: radial-gradient(circle at 35% 35%, #fff 0%, #e2e8f0 55%, #cbd5e1 100%);
}

.layered-card__energy--colorless::after {
    content: "★";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.48rem;
    line-height: 1;
    color: #0f172a;
    font-weight: 900;
}

.layered-card__energy--fire {
    background: radial-gradient(circle at 30% 30%, #fb923c, #dc2626);
}

.layered-card__energy--grass {
    background: radial-gradient(circle at 30% 30%, #86efac, #16a34a);
}

.layered-card__energy--water {
    background: radial-gradient(circle at 30% 30%, #7dd3fc, #2563eb);
}

.layered-card__origin {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

.layered-card__ability {
    margin: 0;
    font-size: 0.8rem;
    color: #0f172a;
    line-height: 1.4;
}

.layered-card__ability-q {
    font-weight: 500;
}

.layered-card__flavor {
    margin: 0;
    padding: 0.45rem 0.65rem 0.55rem;
    font-size: 0.78rem;
    font-style: italic;
    color: #475569;
    background: #f8fafc;
    line-height: 1.4;
}

.layered-card__foot {
    padding: 0.4rem 0.55rem;
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    text-align: center;
    color: #e2e8f0;
    background: #0f172a;
    line-height: 1.35;
}

.layered-card--compact {
    max-width: 14rem;
}

.layered-card--compact .layered-card__name {
    font-size: 0.62rem;
}

.layered-card--compact .layered-card__series {
    font-size: 0.52rem;
}

.layered-card--compact .layered-card__type-badge {
    width: 1.1rem;
    height: 1.1rem;
    border-width: 1.5px;
}

.layered-card--compact .layered-card__art-wrap {
    min-height: 6.5rem;
}

.layered-card--compact .layered-card__art-img {
    max-height: 12rem;
    object-fit: contain;
}

.layered-card--compact .layered-card__art-img:is(video) {
    width: 100%;
}

.layered-card--compact .layered-card__art-placeholder {
    min-height: 6.5rem;
    font-size: 2.75rem;
}

.layered-card--compact .layered-card__hpbox,
.layered-card--compact .layered-card__panel-line,
.layered-card--compact .layered-card__flavor {
    font-size: 0.62rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.unlock-card-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin: 0;
}

.unlock-card-meta__facts {
    margin: 0 0 0.65rem;
    line-height: 1.5;
}

.unlock-card-meta__funny {
    margin: 0 0 0.65rem;
    line-height: 1.45;
}

.unlock-card-meta__points {
    margin: 0;
}

.unlock-layered-warning {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(250, 204, 21, 0.35);
    background: rgba(250, 204, 21, 0.08);
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--muted);
}

.unlock-layered-warning strong {
    color: var(--text);
}

/* —— Trading-card (TCG) guardian face —— */
.tcg-card {
    --tcg-teal: #14b8a6;
    --tcg-teal-deep: #0f766e;
    --tcg-gold: #d4a012;
    --tcg-gold-light: #f5e6a6;
    max-width: 22rem;
    margin: 0 auto;
}

.tcg-card__frame {
    border-radius: 14px;
    border: 4px solid var(--tcg-gold);
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.55),
        0 12px 32px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: #1a1528;
    overflow: hidden;
}

.tcg-card__header {
    background: linear-gradient(180deg, #2dd4bf 0%, var(--tcg-teal-deep) 100%);
    padding: 0.5rem 0.75rem 0.65rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.tcg-card__series {
    margin: 0 0 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.55);
    text-align: center;
}

.tcg-card__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.tcg-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1.2;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex: 1;
    min-width: 0;
}

.tcg-card__type-badge {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    background: radial-gradient(circle at 30% 30%, #86efac, #16a34a);
}

.tcg-card--rarity-rare .tcg-card__type-badge {
    background: radial-gradient(circle at 30% 30%, #93c5fd, #2563eb);
}

.tcg-card--rarity-epic .tcg-card__type-badge {
    background: radial-gradient(circle at 30% 30%, #e9d5ff, #9333ea);
}

.tcg-card__art {
    position: relative;
    min-height: 11rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(250, 204, 21, 0.18), transparent 55%),
        linear-gradient(180deg, #0f172a 0%, #1e293b 45%, #0c4a6e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.tcg-card__art-img {
    width: 100%;
    height: auto;
    max-height: 14rem;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(250, 204, 21, 0.25));
}

.tcg-card__art-img:is(video) {
    display: block;
}

.tcg-card__art-placeholder {
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.25);
}

.tcg-card__panel {
    background: #f8fafc;
    color: #0f172a;
    padding: 0.65rem 0.75rem 0.85rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.tcg-card__stat-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding-bottom: 0.45rem;
    margin-bottom: 0.45rem;
    border-bottom: 1px solid #cbd5e1;
    font-weight: 700;
    font-size: 0.78rem;
}

.tcg-card__rarity-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tcg-card__stars {
    letter-spacing: 0.05em;
}

.tcg-card__hp strong {
    font-size: 0.95rem;
}

.tcg-card__origin {
    margin: 0 0 0.4rem;
    font-weight: 600;
    color: #334155;
}

.tcg-card__ability {
    margin: 0 0 0.45rem;
    color: #0f172a;
}

.tcg-card__ability-quote {
    font-weight: 500;
}

.tcg-card__flavor {
    margin: 0;
    font-style: italic;
    color: #475569;
    font-size: 0.8rem;
}

.tcg-card__footer {
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    text-align: center;
    padding: 0.4rem 0.6rem;
    line-height: 1.35;
}

/* Compact variant (mission grid) */
.tcg-card--compact {
    max-width: 100%;
}

.tcg-card--compact .tcg-card__frame {
    border-radius: 12px;
    border-width: 3px;
}

.tcg-card--compact .tcg-card__header {
    padding: 0.35rem 0.5rem 0.45rem;
}

.tcg-card--compact .tcg-card__series {
    font-size: 0.58rem;
}

.tcg-card--compact .tcg-card__title {
    font-size: 0.72rem;
}

.tcg-card--compact .tcg-card__type-badge {
    width: 1.1rem;
    height: 1.1rem;
}

.tcg-card--compact .tcg-card__art {
    min-height: 7.5rem;
}

.tcg-card--compact .tcg-card__art-img {
    max-height: 9rem;
}

.tcg-card--compact .tcg-card__art-img:is(video) {
    margin-inline: auto;
}

.tcg-card--compact .tcg-card__art-placeholder {
    font-size: 2.25rem;
}

.tcg-card--compact .tcg-card__panel {
    padding: 0.45rem 0.55rem 0.55rem;
    font-size: 0.68rem;
}

.tcg-card--compact .tcg-card__stat-line {
    font-size: 0.65rem;
}

.tcg-card--compact .tcg-card__flavor {
    font-size: 0.65rem;
}

.tcg-card--compact .tcg-card__footer {
    font-size: 0.55rem;
    padding: 0.3rem 0.45rem;
}

.guardian-preview--tcg {
    gap: 0.75rem;
}

.guardian-preview__teaser {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--muted);
}

.card-art {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    min-height: 5rem;
}

.card-art--emoji-only {
    font-size: 5rem;
    line-height: 1;
}

.card-art__badge {
    width: 7.5rem;
    height: 7.5rem;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.2);
}

.card-art__emoji {
    font-size: 5rem;
    line-height: 1;
}

.card-art--with-badge .card-art__emoji {
    font-size: 3rem;
}

.points {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
}

.muted {
    color: var(--muted);
}

.progress-shell {
    width: 100%;
    height: 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    margin: 0.75rem 0 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, var(--cosmic-orange), var(--cosmic-cyan));
}

.wallet-quest-badges {
    margin-top: 0;
}

.wallet-quest-badges__heading {
    margin: 0;
    font-size: 1.1rem;
    font-family: Fredoka, Inter, system-ui, sans-serif;
}

.wallet-quest-badges__sub {
    margin: 0.35rem 0 1rem;
    font-size: 0.88rem;
}

.wallet-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 0.85rem;
}

.wallet-badge-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.65rem 0.5rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.22);
}

.wallet-badge-slot--locked {
    opacity: 0.52;
    filter: grayscale(0.88);
}

.wallet-badge-slot__img-wrap img,
.wallet-badge-slot__img-wrap video {
    width: 5rem;
    height: 5rem;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.wallet-badge-slot__placeholder {
    width: 5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 12px;
}

.wallet-badge-slot__name {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
}

.wallet-badge-slot__state {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.wallet-badge-slot__card-link {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wallet-badge-slot__card-link:hover {
    color: #e9d5ff;
}

.wallet-badge-slot__card-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

.wallet-group-badge-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.wallet-group-badge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 0;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(196, 181, 253, 0.35);
    background: rgba(196, 181, 253, 0.08);
}

.wallet-group-badge--locked {
    opacity: 0.48;
    filter: grayscale(0.92);
}

.wallet-group-badge__img-wrap img,
.wallet-group-badge__img-wrap video {
    width: 7.5rem;
    height: 7.5rem;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.2);
}

.wallet-group-badge__text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 12rem;
}

.wallet-group-badge__text strong {
    font-size: 1rem;
}

.reward-strip--points {
    margin-top: 1.5rem;
}

.reward-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.reward-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 18px;
    padding: 1rem 0.85rem;
}

.reward-box__copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.reward-box__points {
    font-size: 0.82rem;
    color: rgba(244, 238, 252, 0.88);
}

.reward-box__locked-label {
    margin-top: 0.15rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(184, 168, 216, 0.75);
}

.reward-box--locked {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.38);
    opacity: 0.92;
}

.reward-box--bronze.reward-box--locked {
    border-color: rgba(251, 146, 60, 0.28);
}

.reward-box--silver.reward-box--locked {
    border-color: rgba(148, 163, 184, 0.3);
}

.reward-box--gold.reward-box--locked {
    border-color: rgba(250, 204, 21, 0.28);
}

.reward-box__trophy--pending svg {
    stroke-dasharray: 4.5 3.5;
    opacity: 0.92;
}

.reward-box--bronze .reward-box__trophy--pending {
    color: rgba(251, 146, 60, 0.38);
}

.reward-box--silver .reward-box__trophy--pending {
    color: rgba(203, 213, 225, 0.38);
}

.reward-box--gold .reward-box__trophy--pending {
    color: rgba(250, 204, 21, 0.36);
}

.reward-box__trophy-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    line-height: 0;
}

.reward-box__trophy {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.reward-box__trophy svg {
    width: 2.65rem;
    height: 2.65rem;
}

.reward-box--bronze.active {
    border-color: rgba(234, 88, 12, 0.55);
    background: rgba(234, 88, 12, 0.1);
    box-shadow: 0 0 22px rgba(234, 88, 12, 0.22);
}

.reward-box--bronze.active .reward-box__trophy--bronze {
    color: #fb923c;
    filter: drop-shadow(0 0 10px rgba(251, 146, 60, 0.45));
}

.reward-box--silver.active {
    border-color: rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.1);
    box-shadow: 0 0 22px rgba(186, 230, 253, 0.18);
}

.reward-box--silver.active .reward-box__trophy--silver {
    color: #e2e8f0;
    filter: drop-shadow(0 0 12px rgba(226, 232, 240, 0.45));
}

.reward-box--gold.active {
    border-color: rgba(234, 179, 8, 0.6);
    background: rgba(234, 179, 8, 0.11);
    box-shadow: 0 0 26px rgba(250, 204, 21, 0.28);
}

.reward-box--gold.active .reward-box__trophy--gold {
    color: #facc15;
    filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.5));
}

@media (prefers-reduced-motion: reduce) {
    .reward-box--bronze.active .reward-box__trophy--bronze,
    .reward-box--silver.active .reward-box__trophy--silver,
    .reward-box--gold.active .reward-box__trophy--gold {
        filter: none;
    }
}

.claim-screen {
    margin-top: 1rem;
    border: 1px dashed rgba(245, 158, 11, 0.45);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.08);
}

.staff-code {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    background: #0c0618;
    color: #fde68a;
    font-weight: 800;
    letter-spacing: 0.06em;
}

@media (max-width: 820px) {
    .hero,
    .two-up,
    .unlock-layout,
    .reward-strip {
        grid-template-columns: 1fr;
    }

    .content-shell {
        width: min(100% - 1rem, 1100px);
    }
}

/* ——— Landing page (Home) ——— */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.home-page {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 2rem;
}

/* Edge darkening — extra depth over the SVG backdrop */
.home-page__vignette {
    pointer-events: none;
    position: absolute;
    inset: -2rem -1rem auto -1rem;
    height: min(120vh, 1400px);
    /* Lighter vignette so the nebula stays visible behind the hero */
    /*background: radial-gradient(ellipse 90% 75% at 50% 40%, transparent 42%, rgba(3, 1, 8, 0.38) 100%);*/
    z-index: 0;
}

.home-page > :not(.home-page__vignette) {
    position: relative;
    z-index: 1;
}

.home-wordmark {
    margin: 0 0 0.5rem;
    font-family: "Fredoka", Inter, sans-serif;
    font-weight: 700;
    font-size: clamp(2.1rem, 5.8vw, 3.2rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* Wordmark: bold white (reference), subtle purple + amber glow — not clip-gradient (cleaner on all zoom levels) */
.home-wordmark__mu,
.home-wordmark__q {
    color: #faf7ff;
    -webkit-text-fill-color: #faf7ff;
    background: none;
    -webkit-text-stroke: 0;
    paint-order: normal;
}

.home-wordmark__mu {
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35),
        0 0 32px rgba(192, 132, 252, 0.55),
        0 0 64px rgba(124, 58, 237, 0.25);
}

.home-wordmark__q {
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 28px rgba(251, 191, 36, 0.45),
        0 0 56px rgba(245, 158, 11, 0.2);
}


.home-hero {
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    /* Glass panel + orange / purple / cyan rim like the reference */
    border: 2px solid transparent;
    background:
        linear-gradient(165deg, rgba(28, 18, 52, 0.82) 0%, rgba(12, 8, 28, 0.88) 55%, rgba(18, 10, 38, 0.9) 100%) padding-box,
        linear-gradient(125deg, rgba(251, 191, 36, 0.95), rgba(192, 38, 211, 0.85), rgba(34, 211, 238, 0.65)) border-box;
    background-origin: border-box;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    color: #f4eefc;
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 80px rgba(124, 58, 237, 0.2),
        0 0 40px rgba(245, 158, 11, 0.08);
}

.home-hero__stars {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    /* Tiled stars only — avoid extra dots that read as “random icons” in the top-left */
    background-image: url("images/starfield.svg");
    background-size: 256px 256px;
    background-repeat: repeat;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 0;
}

.home-hero__glow {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(48px);
}

.home-hero__glow--magenta {
    inset: -20% -10% auto auto;
    width: min(70vw, 420px);
    height: min(70vw, 420px);
    background: radial-gradient(circle, rgba(192, 38, 211, 0.45) 0%, transparent 70%);
    z-index: 0;
}

.home-hero__glow--orange {
    inset: auto auto -30% -15%;
    width: min(60vw, 380px);
    height: min(60vw, 380px);
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 65%);
    z-index: 0;
}

.home-hero__grid {
    position: relative;
    display: grid;
    gap: 2rem;
    grid-template-columns: 1.35fr 1fr;
    align-items: center;
    padding: clamp(1.75rem, 4vw, 3rem);
    z-index: 1;
}

.home-kicker {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.95);
}

.home-hero h1 {
    font-family: Inter, sans-serif;
    font-weight: 800;
    font-size: clamp(1.85rem, 4vw, 2.65rem);
    line-height: 1.15;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
    color: #fff;
}

.home-lead {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(232, 224, 248, 0.92);
    max-width: 38rem;
}

.home-lead strong {
    color: #fff;
    font-weight: 700;
}

.home-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.button.button-hero-primary {
    background: linear-gradient(92deg, #fb923c 0%, #fbbf24 40%, #fde047 100%);
    color: #1a0f08;
    box-shadow:
        0 4px 20px rgba(251, 146, 60, 0.55),
        0 0 32px rgba(251, 191, 36, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    border: none;
    min-height: 48px;
    padding: 0.85rem 1.35rem;
}

.button.button-hero-primary:hover {
    filter: brightness(1.08);
    box-shadow:
        0 6px 28px rgba(251, 146, 60, 0.65),
        0 0 40px rgba(251, 191, 36, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Rainbow neon rim (reference secondary CTA) */
.button-hero-secondary-wrap {
    display: inline-flex;
    padding: 2px;
    border-radius: 999px;
    background: conic-gradient(from 210deg at 50% 50%, #f97316, #ec4899, #a855f7, #6366f1, #22d3ee, #2dd4bf, #f97316);
    box-shadow:
        0 0 28px rgba(168, 85, 247, 0.45),
        0 0 48px rgba(34, 211, 238, 0.2);
}

.button.button-hero-secondary {
    background: rgba(6, 4, 16, 0.92);
    color: #fff;
    border: none;
    border-radius: 999px;
    min-height: calc(48px - 4px);
    padding: 0.85rem 1.35rem;
    box-shadow: inset 0 0 24px rgba(124, 58, 237, 0.15);
}

.button-hero-secondary-wrap:hover {
    filter: brightness(1.06);
}

.button-hero-secondary-wrap:hover .button-hero-secondary {
    background: rgba(12, 8, 28, 0.95);
}

.home-trust {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 36rem;
}

.home-trust li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.9rem;
    line-height: 1.45;
    color: rgba(200, 190, 230, 0.95);
}

.home-trust__glyph {
    flex-shrink: 0;
    color: rgba(251, 191, 36, 0.9);
    margin-top: 0.1rem;
}

.home-hero__panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.home-showcase {
    position: relative;
    background: linear-gradient(165deg, rgba(35, 20, 65, 0.65) 0%, rgba(12, 6, 28, 0.85) 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 26px;
    padding: 1.35rem;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 48px rgba(236, 72, 153, 0.45),
        0 0 80px rgba(245, 158, 11, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.home-showcase::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(236, 72, 153, 0.9), rgba(124, 58, 237, 0.95), rgba(34, 211, 238, 0.75));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

.home-showcase > * {
    position: relative;
    z-index: 1;
}

.home-showcase__label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.75rem;
}

.home-showcase__card {
    position: relative;
    text-align: center;
    padding: 0;
    overflow: hidden;
    border-radius: 22px;
    background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(99, 102, 241, 0.35) 0%, transparent 55%),
        linear-gradient(175deg, rgba(30, 27, 75, 0.9) 0%, rgba(10, 6, 24, 0.98) 100%);
    border: 1px solid rgba(129, 140, 248, 0.45);
    box-shadow:
        inset 0 0 40px rgba(99, 102, 241, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.45);
}

a.home-showcase__card-hit,
.home-showcase__card-hit--static {
    position: relative;
    display: block;
    text-align: center;
    text-decoration: none;
    color: inherit;
    padding: 1.5rem 1rem 1.65rem;
    border-radius: inherit;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

a.home-showcase__card-hit:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow:
        inset 0 0 48px rgba(99, 102, 241, 0.28),
        0 8px 32px rgba(0, 0, 0, 0.45);
}

a.home-showcase__card-hit:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.home-showcase__ring {
    position: absolute;
    inset: -4px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.75), rgba(99, 102, 241, 0.55), rgba(34, 211, 238, 0.5));
    opacity: 0.55;
    z-index: -1;
    filter: blur(6px);
}

.home-showcase__art {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    min-height: 3.75rem;
}

.home-showcase__art-img {
    display: block;
    max-width: 5.5rem;
    max-height: 5.5rem;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(147, 197, 253, 0.55)) drop-shadow(0 6px 22px rgba(99, 102, 241, 0.5));
}

.home-showcase__art-img:is(video) {
    border-radius: 12px;
}

.home-showcase__art-fallback {
    font-family: Fredoka, Inter, system-ui, sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    color: rgba(255, 255, 255, 0.35);
    filter: drop-shadow(0 0 16px rgba(147, 197, 253, 0.45));
}

.home-showcase__stack-fallback {
    font-family: Fredoka, Inter, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
}

.home-showcase__title {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: #fff;
}

.home-showcase__meta {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: rgba(196, 181, 253, 0.9);
}

.home-showcase__stack {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 1.35rem;
}

.home-showcase__stack-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 25%, rgba(60, 50, 90, 0.9) 0%, rgba(5, 3, 12, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.55),
        0 0 14px rgba(255, 255, 255, 0.06);
    font-size: 1.25rem;
    line-height: 1;
    overflow: hidden;
}

.home-showcase__stack-img {
    width: 1.85rem;
    height: 1.85rem;
    object-fit: contain;
}

.home-showcase__stack-img:is(video) {
    display: block;
    border-radius: 6px;
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.home-stat {
    text-align: center;
    padding: 0.9rem 0.45rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(25, 15, 45, 0.95) 0%, rgba(8, 4, 16, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 3px 12px rgba(0, 0, 0, 0.65),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.home-stat__value {
    display: block;
    font-family: "Fredoka", Inter, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.home-stat__label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(184, 168, 216, 0.95);
}

.home-strip {
    margin: 0;
}

.home-strip__inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-pill {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.35rem 1.4rem;
    border-radius: 22px;
    background: rgba(22, 14, 48, 0.42);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-pill:hover {
    transform: translateY(-3px);
}

.home-pill--explore {
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.35),
        0 12px 40px rgba(245, 158, 11, 0.2),
        0 0 50px rgba(251, 191, 36, 0.12);
}

.home-pill--scan {
    box-shadow:
        0 0 0 1px rgba(129, 140, 248, 0.45),
        0 12px 40px rgba(99, 102, 241, 0.22),
        0 0 50px rgba(129, 140, 248, 0.12);
}

.home-pill--collect {
    box-shadow:
        0 0 0 1px rgba(244, 114, 182, 0.45),
        0 12px 40px rgba(236, 72, 153, 0.2),
        0 0 50px rgba(244, 114, 182, 0.1);
}

.home-pill__icon-wrap {
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12) 0%, rgba(0, 0, 0, 0.35) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.home-pill__icon {
    font-size: 1.65rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.home-pill__letter {
    font-family: Fredoka, Inter, system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
}

.home-pill__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}

.home-pill p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--muted);
}

.home-how {
    padding: 0 0.25rem;
}

.home-how__header {
    margin-bottom: 1.25rem;
}

.home-how__header h2 {
    font-family: "Fredoka", Inter, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: #fff;
}

.home-how__sub {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.home-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(20, 12, 40, 0.5);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.home-timeline li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.home-timeline li:last-child {
    border-bottom: none;
}

.home-timeline__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.9rem;
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.5), rgba(192, 38, 211, 0.35));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.home-timeline li strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: #fff;
}

.home-timeline li span:last-child {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.45;
}

.home-sample {
    border: 1px dashed rgba(196, 181, 253, 0.35);
    background: linear-gradient(180deg, rgba(45, 27, 78, 0.5) 0%, rgba(20, 12, 40, 0.65) 100%);
}

.home-sample__head {
    margin-bottom: 1.25rem;
    padding-top: 0.2rem;
    position: relative;
    z-index: 1;
}

.home-sample__intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-width: 44rem;
}

.home-sample__badge {
    display: inline-block;
    margin: 0 0 0.85rem;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.home-sample h2 {
    font-family: "Fredoka", Inter, sans-serif;
    font-size: 1.45rem;
    margin: 0 0 0.5rem;
    padding: 0;
    color: #fff;
    width: 100%;
}

.home-sample__hint {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.5;
    max-width: 42rem;
}

.home-sample__list.sample-list {
    gap: 0.65rem;
}

.home-sample__item.sample-item {
    align-items: center;
    color: var(--text);
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-sample__item.sample-item:hover {
    border-color: rgba(192, 38, 211, 0.45);
    box-shadow: var(--glow-magenta);
}

.home-sample__thumb-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
    font-family: Fredoka, Inter, system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
}

.home-sample__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.home-sample__text strong {
    font-size: 1rem;
    color: #fff;
}

.home-sample__text span {
    font-size: 0.88rem;
    color: var(--muted);
}

.home-sample__chev {
    color: #e9d5ff;
    font-weight: 800;
    font-size: 1.1rem;
    opacity: 0.85;
}

@media (max-width: 900px) {
    .home-hero__grid {
        grid-template-columns: 1fr;
    }

    .home-strip__inner {
        grid-template-columns: 1fr;
    }

    .home-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .topbar__nav--inline {
        font-size: 0.72rem;
    }
}

@media (max-width: 520px) {
    .home-stats {
        grid-template-columns: 1fr;
    }

    .home-hero {
        border-radius: 24px;
    }

    .topbar__wallet span {
        display: none;
    }

    .topbar__wallet {
        padding: 0.45rem 0.65rem;
    }
}

.topbar__brand {
    min-width: 0;
    max-width: min(42vw, 14rem);
}

.topbar__establishment {
    display: block;
    font-family: Fredoka, Inter, system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-footer {
    margin-top: auto;
    padding: 2rem 1.25rem 2.5rem;
    border-top: 1px solid var(--line);
    background: rgba(6, 3, 14, 0.35);
    backdrop-filter: blur(12px);
}

.site-footer__inner {
    max-width: 56rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
}

.site-footer__name {
    margin: 0;
    font-family: Fredoka, Inter, system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.site-footer__contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.site-footer__sep {
    opacity: 0.5;
}

.site-footer__link {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.site-footer__link:hover {
    color: var(--accent);
}

.site-footer__address {
    margin: 0;
    white-space: pre-wrap;
    max-width: 36rem;
    margin-inline: auto;
    line-height: 1.45;
}

.site-footer__meta {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    opacity: 0.75;
}

.site-footer__admin {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.site-footer__admin:hover {
    color: var(--text);
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.65rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    font-size: 0.88rem;
}

.admin-nav__link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.admin-nav__link:hover {
    color: var(--text);
}

.admin-nav__link--active {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.admin-nav__sep {
    color: var(--line);
    opacity: 0.8;
}

.admin-nav__signout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.admin-nav__signout {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.admin-nav__signout:hover {
    color: #fecaca;
}

.admin-page {
    max-width: 36rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.admin-page--wide {
    width: 100%;
    max-width: min(52rem, calc(100% - 2rem));
    box-sizing: border-box;
}

.admin-page .admin-form {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.admin-mission__toolbar {
    margin-bottom: 1rem;
}

.admin-mission__btn-add {
    width: 100%;
    max-width: 16rem;
}

/* Mission editor cards: avoid fieldset + position:absolute (breaks background / width in some browsers). */
.admin-mission__card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.admin-form .admin-mission__card {
    overflow: hidden;
    padding: 0;
}

/* Inner header + body so the guardian label reads as inside the panel, not like a fieldset legend on the border. */
.admin-mission__card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.18);
}

.admin-mission__card-title {
    margin: 0;
    flex: 1 1 10rem;
    min-width: 0;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--brand);
}

.admin-mission__card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.admin-mission__card-fields {
    width: 100%;
    min-width: 0;
    padding: 1rem 1.1rem 1.15rem;
}

.admin-mission__qr {
    margin: 0.75rem 0 0.25rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(196, 181, 253, 0.22);
    background: rgba(0, 0, 0, 0.18);
}

.admin-mission__qr--empty {
    padding: 0.65rem 0.95rem;
}

.admin-mission__qr-url {
    margin: 0.35rem 0 0.65rem;
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-all;
}

.admin-mission__qr-url code {
    font-size: 0.78rem;
    color: #e9d5ff;
}

.admin-mission__qr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.admin-mission__qr-btn {
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(196, 181, 253, 0.45);
    background: rgba(196, 181, 253, 0.1);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color 0.12s ease,
        background 0.12s ease;
}

.admin-mission__qr-btn:hover:not(:disabled) {
    border-color: rgba(196, 181, 253, 0.75);
    background: rgba(196, 181, 253, 0.16);
}

.admin-mission__qr-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-mission__qr-preview {
    margin: 0.25rem 0 0.5rem;
}

.admin-mission__qr-preview img {
    display: block;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 6px;
}

.admin-mission__badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0.35rem 0 0.75rem;
}

/* Fieldset must not be display:flex — legend/border layout breaks in several browsers. Flex lives on inner wrapper. */
.admin-mission__group-badges {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

.admin-mission__group-badges-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.35rem;
    min-width: 0;
    max-width: 100%;
}

.admin-mission__group-badges-inner > .admin-form__hint {
    min-width: 0;
    max-width: 100%;
}

.admin-mission__group-badge-block {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.2);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.admin-mission__group-badge-title,
.admin-mission__group-badge-block h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    max-width: 100%;
    overflow-wrap: break-word;
}

.admin-mission__group-badge-block .admin-form__input {
    overflow-wrap: anywhere;
}

.admin-mission__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.admin-mission__file-label {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(196, 181, 253, 0.45);
    background: rgba(196, 181, 253, 0.1);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.admin-mission__file-label:hover {
    border-color: rgba(196, 181, 253, 0.75);
}

.admin-mission__badge-select {
    flex: 1 1 14rem;
    min-width: 0;
}

.admin-mission__badge-preview-wrap {
    margin: 0.5rem 0 0;
}

.admin-mission__badge-preview {
    display: block;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.25);
    object-fit: contain;
}

.admin-mission__badge-preview:is(video):not(.admin-mission__card-art-preview) {
    width: 96px;
    height: 96px;
}

.admin-mission__card-art-preview {
    width: 100%;
    max-width: 20rem;
    max-height: 12rem;
    height: auto;
    object-fit: contain;
}

.admin-mission__card-art-preview:is(video) {
    width: 100%;
}

.admin-mission__icon-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.admin-mission__icon-btn:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--accent);
}

.admin-mission__icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.admin-mission__remove {
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.1);
    color: #fecaca;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.admin-mission__remove:hover {
    background: rgba(248, 113, 113, 0.2);
}

.admin-page__header {
    margin-bottom: 1.5rem;
}

.admin-page__title {
    margin: 0 0 0.5rem;
    font-family: Fredoka, Inter, system-ui, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.admin-page__lede {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.95rem;
}

.admin-page__banner {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: var(--good);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.admin-page__banner--error {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fecaca;
}

.admin-form__fieldset {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem 1.1rem 1.15rem;
    margin: 0 0 1rem;
    background: var(--panel);
    /* Fieldsets default to min-content width — breaks max-width parents when inputs hold long paths. */
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.admin-form__legend {
    padding: 0 0.35rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--brand);
    max-width: 100%;
    box-sizing: border-box;
}

/* Native <legend> sits on the fieldset border — keep styling for /admin etc. that still use it. */
.admin-form__fieldset > .admin-form__legend {
    margin: 0;
    padding: 0 0.45rem;
    background: var(--panel);
    max-width: min(100%, calc(100% - 1.5rem));
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Mission admin: visible title is an <h2> inside the panel (see AdminMission.razor). */
.admin-form__legend--in-panel {
    margin: 0 0 0.45rem;
    padding: 0;
    background: transparent;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--brand);
    line-height: 1.35;
    max-width: 100%;
    overflow-wrap: break-word;
}

.admin-form__label {
    display: block;
    margin: 0.75rem 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.admin-form__label:first-of-type {
    margin-top: 0;
}

.admin-form__input,
.admin-form__textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font: inherit;
}

.admin-form__textarea {
    resize: vertical;
    min-height: 4rem;
}

.admin-form__hint {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
}

.admin-form__themes {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.admin-form__theme {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    cursor: pointer;
    background: rgba(0, 0, 0, 0.15);
}

.admin-form__theme:has(input:checked) {
    border-color: rgba(196, 181, 253, 0.55);
    box-shadow: var(--glow-magenta);
}

.admin-form__theme input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.admin-form__theme-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.admin-form__theme-name {
    font-weight: 700;
    color: var(--text);
    font-size: 0.92rem;
}

.admin-form__theme-desc {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.35;
}

.admin-form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.admin-form__submit {
    padding: 0.65rem 1.25rem;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--cosmic-magenta), var(--cosmic-pink));
    color: #fff;
    box-shadow: var(--glow-magenta);
}

.admin-form__submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.admin-form__cancel {
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: underline;
}

.admin-form__cancel:hover {
    color: var(--text);
}
