/* ===== Design tokens (redesign) ===== */
:root {
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Nunito', -apple-system, 'Segoe UI', sans-serif;
    --pastel-rainbow: linear-gradient(90deg, #f7c6c7, #f9e2b8, #cdeccd, #c3dff2, #d9c8ef);
    --pastel-rainbow-diag: linear-gradient(135deg, #f7c6c7, #f9e2b8, #cdeccd, #c3dff2, #d9c8ef);
    --ink-on-pastel: #2a2238;
    --smoky-glass: rgba(14, 12, 28, 0.82);
    --frost-glass: rgba(255, 255, 255, 0.12);
    --gold: #ffd75a;
    --gold-glow: rgba(255, 215, 90, 0.6);
    --reward-green: rgba(0, 190, 90, 0.92);
    --radius-pill: 999px;
    --radius-card: 28px;
    --radius-image: 18px;
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.3);
    --shadow-float: 0 18px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 28px 56px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Apple Liquid Glass CSS Variables */
:root {
    --glass-bg-light: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.20);
    --blur-primary: 20px;
    --refraction-scale: 40;
    --edge-glow-size: 140px;
    --edge-glow-opacity: 0.75;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff;
    padding: 20px;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.rarity {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.rarity.legendary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    box-shadow: 0 4px 20px rgba(240, 147, 251, 0.5);
}

.rarity.exotic {
    background: linear-gradient(135deg, #fa709a, #fee140);
    box-shadow: 0 4px 20px rgba(250, 112, 154, 0.5);
}

.rarity.epic {
    background: linear-gradient(135deg, #a18cd1, #fbc2eb);
    box-shadow: 0 4px 20px rgba(161, 140, 209, 0.5);
}

.rarity.rare {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.5);
}

.rarity.uncommon {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    box-shadow: 0 4px 20px rgba(67, 233, 123, 0.5);
}

.rarity.common {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

/* ====== 3D CARD MODAL ====== */
/* ====== 3D CARD MODAL — DRAG ROTATION ====== */
.card-3d-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    background: radial-gradient(circle at center, rgba(0,0,0,0.82), rgba(0,0,0,0.97));
    backdrop-filter: blur(12px);
    animation: modalFadeIn 0.3s ease;
}

.card-3d-modal.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Perspective scene — drag rotates this */
.card-3d-scene {
    perspective: 1400px;
}

.card-3d-card {
    width: 400px;
    height: 600px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.08s ease-out;
    cursor: grab;
    user-select: none;
}

.card-3d-card:active { cursor: grabbing; }

/* ---- Rainbow thickness edges ---- */
.card-edge {
    position: absolute;
    background: linear-gradient(180deg,
        #ff0000 0%, #ff6600 16%, #ffee00 33%,
        #00ee00 50%, #0066ff 66%, #8800ff 83%, #ff0080 100%);
    z-index: 0;
}
.card-edge.edge-top    { width: 400px; height: 12px; top: 0;    left: 0; transform-origin: top center;    transform: rotateX(90deg);  border-radius: 20px 20px 0 0; }
.card-edge.edge-bottom { width: 400px; height: 12px; bottom: 0; left: 0; transform-origin: bottom center; transform: rotateX(-90deg); border-radius: 0 0 20px 20px; }
.card-edge.edge-left   { width: 12px; height: 600px; top: 0; left: 0;  transform-origin: left center;   transform: rotateY(-90deg); border-radius: 20px 0 0 20px; }
.card-edge.edge-right  { width: 12px; height: 600px; top: 0; right: 0; transform-origin: right center;  transform: rotateY(90deg);  border-radius: 0 20px 20px 0; }

/* ---- Card faces ---- */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0,0,0,0.6);
}

.card-face.card-front {
    background: linear-gradient(145deg, #1e1e30 0%, #13131f 100%);
    border: 2px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
}

.card-face.card-back {
    background: linear-gradient(145deg, #2a1a3e 0%, #1a0f2e 100%);
    border: 2px solid rgba(255,255,255,0.18);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

/* ---- Front face layout ---- */
.card-front-header {
    padding: 14px 18px;
    background: rgba(0,0,0,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    flex-shrink: 0;
}

.card-front-title {
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff006e, #ff8c00, #ffe000, #00f5d4, #00bbf9, #7209b7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-front-rarity {
    font-size: 0.75em;
    color: rgba(255,255,255,0.45);
    margin-top: 4px;
    letter-spacing: 1px;
}

.card-front-image-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    padding: 12px;
}

.card-front-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    image-rendering: pixelated;
}

.card-front-footer {
    padding: 12px 18px;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.8em;
    color: rgba(255,255,255,0.55);
    flex-shrink: 0;
}

/* ---- Back face ---- */
.card-3d-back {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: space-between;
    width: 100%;
}

.card-3d-back-title {
    font-size: 1.2em;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    text-align: center;
    margin-bottom: 10px;
}

.card-rewards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.card-reward-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.card-reward-token  { font-size: 0.9em; color: rgba(255,255,255,0.7); margin-bottom: 8px; }
.card-reward-amount { font-size: 1.4em; font-weight: 700; color: rgba(255,255,255,0.9); }

.card-3d-message {
    font-size: 1.2em;
    text-align: center;
    color: rgba(255, 100, 100, 0.9);
    font-weight: 600;
    padding: 40px;
}

/* ---- Modal bottom controls ---- */
.card-3d-modal-controls {
    display: flex;
    gap: 12px;
}

.card-3d-ctrl-btn {
    padding: 10px 28px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(6px);
}
.card-3d-ctrl-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.04); }
.card-3d-ctrl-btn.close  { background: rgba(255,80,80,0.5); border-color: rgba(255,80,80,0.5); }
.card-3d-ctrl-btn.close:hover { background: rgba(255,80,80,0.8); }

/* drag hint */
.card-3d-drag-hint {
    position: absolute;
    bottom: -52px;
    left: 0; right: 0;
    text-align: center;
    font-size: 0.75em;
    color: rgba(255,255,255,0.3);
    pointer-events: none;
}

/* keep claim btn style */
.card-3d-claim-btn {
    flex: 1;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    background: rgba(0,255,100,0.8);
    color: white;
}
.card-3d-claim-btn:hover { background: rgba(0,255,100,1); transform: scale(1.05); }

.card-3d-face:first-of-type {
    z-index: 2;
}

.card-3d-face:last-of-type {
    transform: rotateY(180deg);
    z-index: 1;
}

.card-3d-front {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-3d-front img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 16px;
}

.card-3d-front-title {
    font-size: 1.8em;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #ff006e, #ff4d00, #ffb700, #00f5d4, #00bbf9, #5e60ce, #7209b7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-3d-front-subtitle {
    font-size: 1em;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* ====== ANIMATIONS ====== */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SVG Filter positioning */
.svg-filter {
    position: absolute;
}

/* Hidden utility class */
.hidden {
    display: none;
}

/* ====== REWARDS: gallery badge + card-back states ====== */
.reward-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 3;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--reward-green);
    color: #fff;
    font-size: 0.85em;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}
.card-3d-claim-btn:disabled,
.card-3d-claim-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    cursor: default;
    transform: none;
}
.card-3d-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    padding: 24px 12px;
}
.card-3d-note .amount {
    display: block;
    font-size: 1.6em;
    font-weight: 800;
    color: #3dff8f;
    margin: 6px 0 10px;
}
.card-3d-note a { color: #9fd8ff; }

/* ===== Header + sticky bar (redesign) ===== */
.bubble {
    background: var(--smoky-glass);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-float);
}
.site-header { text-align: center; margin: 4px auto 36px; position: relative; z-index: 3; }
.header-pills { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }
.wordmark-bubble { display: inline-block; padding: 18px 40px 16px; }
.wordmark {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.7rem, 4.6vw, 3.4rem);
    letter-spacing: 0.03em;
    line-height: 1.1;
    color: #fff;
}
.vol-pill {
    display: inline-block;
    vertical-align: middle;
    margin-left: 12px;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 0.32em;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--ink-on-pastel);
    background: var(--pastel-rainbow);
}
.tagline {
    margin: 12px auto 0;
    max-width: 46rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(0.78rem, 1.4vw, 0.95rem);
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.tagline + .tagline { margin-top: 4px; }
.filter-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.pill-btn, .pill-select, .pill-search {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.92rem;
    color: #fff;
    background: var(--smoky-glass);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    padding: 10px 18px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}
.pill-search { min-width: min(320px, 100%); cursor: text; }
.pill-search::placeholder { color: rgba(255, 255, 255, 0.6); }
.pill-select option { background: #1a1630; color: #fff; }
.pill-btn.pastel { color: var(--ink-on-pastel); background: var(--pastel-rainbow); border-color: transparent; }
.pill-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--gold), var(--shadow-soft); }
.pill-btn:disabled { opacity: 0.7; cursor: wait; }
.pill-btn:focus-visible, .pill-select:focus-visible, .pill-search:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.sticky-bar {
    position: fixed;
    top: 12px;
    left: 50%;
    z-index: 40;
    width: min(1100px, calc(100% - 24px));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 20px;
    transform: translate(-50%, -160%);
    transition: transform 0.35s ease;
}
.sticky-bar.is-visible { transform: translate(-50%, 0); }
/* the • between ORDINAL and RAINBOWS drawn as a rainbow color-wheel dot (the bullet stays in the text for screen readers / copy) */
.wm-rainbow {
    display: inline-block;
    width: 0.32em;
    height: 0.32em;
    margin: 0 0.12em;
    vertical-align: 0.22em;
    border-radius: 50%;
    color: transparent;
    overflow: hidden;
    background: conic-gradient(#ff3b3b, #ff9a00, #ffe600, #2ee66b, #2bb8ff, #7a5cff, #e94bff, #ff3b3b);
}
.sticky-bar .wordmark-small {
    margin-right: auto;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.sticky-bar .pill-search { min-width: 0; flex: 0 1 220px; }
@media (max-width: 700px) {
    .header-pills { justify-content: center; }
    .sticky-bar .wordmark-small { display: none; }
    .sticky-bar .pill-search { flex: 1 1 auto; }
}
/* Phones: search on its own row, controls below, nothing clipped (a long wallet pill truncates) */
@media (max-width: 520px) {
    .sticky-bar { flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px; border-radius: 22px; }
    .sticky-bar .pill-search { flex: 1 1 100%; }
    .sticky-bar .pill-btn, .sticky-bar .pill-select { padding: 8px 12px; font-size: 0.85rem; white-space: nowrap; }
    .sticky-bar [data-action="wallet"] { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { .sticky-bar { transition: none; } }

/* ===== Gallery cards (redesign) ===== */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 28px; padding: 8px 4px 80px; }
@media (max-width: 1200px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }
.nft-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-radius: var(--radius-card);
    color: #fff;
    background: var(--frost-glass);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    box-shadow: var(--shadow-float);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.nft-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: var(--pastel-rainbow-diag);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.nft-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.nft-card.is-owned { box-shadow: 0 0 0 2px var(--gold), 0 0 30px var(--gold-glow), var(--shadow-float); }
.nft-image {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-image);
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.nft-open {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-image);
}
.nft-open:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.card-text { padding: 12px 4px 0; }
.nft-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: 0.02em; line-height: 1.25; }
.nft-subtitle { margin: 3px 0 0; font-family: var(--font-body); font-style: italic; font-size: 0.86rem; opacity: 0.85; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 4px 14px; font-size: 0.8rem; }
.card-id { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; opacity: 0.9; }
.card-id.muted { font-family: var(--font-body); opacity: 0.65; }
.icon-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px 5px; border-radius: 6px; text-decoration: none; font-size: 0.95em; }
.icon-btn:hover, .icon-btn:focus-visible { background: rgba(255, 255, 255, 0.15); outline: none; color: inherit; }
.prints-btn {
    display: block;
    margin-top: auto;
    padding: 11px 16px;
    text-align: center;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 800;
    color: var(--ink-on-pastel);
    background: var(--pastel-rainbow);
    text-decoration: none;
    box-shadow: var(--shadow-soft);
}
.prints-btn:hover { filter: brightness(1.06); color: var(--ink-on-pastel); }
.prints-btn.unavailable { opacity: 0.6; cursor: default; }
.owned-star {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 16px var(--gold-glow);
    pointer-events: none;
}
.gallery-empty {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    font-family: var(--font-body);
    font-size: 1.1rem;
    border-radius: var(--radius-card);
    background: var(--smoky-glass);
}
@media (prefers-reduced-motion: reduce) {
    .nft-card { transition: none; }
    .nft-card:hover { transform: none; }
}

/* ===== Wallet pill + side panel (redesign) ===== */
.wallet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.45); }
.wallet-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 61;
    width: min(380px, 100%);
    height: 100%;
    padding: 22px 22px 28px;
    overflow-y: auto;
    border-radius: 28px 0 0 28px;
    font-family: var(--font-body);
    animation: wp-in 0.3s ease-out;
}
.wallet-panel[hidden], .wallet-backdrop[hidden], .wallet-toast[hidden] { display: none; }
@keyframes wp-in { from { transform: translateX(100%); } to { transform: none; } }
@media (max-width: 520px) { .wallet-panel { width: 100%; border-radius: 0; } }
.wp-head { display: flex; justify-content: space-between; align-items: center; }
.wp-heading { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; }
.wp-sub { margin: 18px 0 8px; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.wp-row { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.wp-address { margin-left: auto; font-family: ui-monospace, Consolas, monospace; }
.wp-total-row strong { margin-left: auto; color: #7dffb0; }
.wp-pieces { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wp-piece {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background: var(--frost-glass);
    font-size: 0.72rem;
    text-align: center;
    cursor: pointer;
}
.wp-piece img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.wp-piece:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.wp-waiting { color: #7dffb0; font-weight: 800; }
.wp-empty { grid-column: 1 / -1; opacity: 0.8; }
.wp-disconnect { width: 100%; margin-top: 18px; }
.wallet-toast {
    position: fixed;
    top: 74px;
    right: 16px;
    z-index: 10001; /* above the 3D card modal (10000) so connect errors from its back are visible */
    max-width: 320px;
    padding: 12px 16px;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
}
.card-3d-error { color: #ffb4b4; padding: 10px 12px; }
@media (prefers-reduced-motion: reduce) { .wallet-panel { animation: none; } }

/* ===== Screensaver (redesign) ===== */
body.screensaver-on { overflow: hidden; }
body.screensaver-on #mainContainer,
body.screensaver-on .sticky-bar { visibility: hidden; }
.screensaver { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden; perspective: 1200px; }
.screensaver[hidden] { display: none; }
.ss-stage {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(calc(var(--my, 0) * -6deg)) rotateY(calc(var(--mx, 0) * 8deg));
    transition: transform 0.6s ease-out;
}
.ss-card {
    position: absolute;
    width: clamp(110px, 14vw, 190px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--frost-glass) center / cover no-repeat;
    /* sphere shading: dark lower-right limb, soft light upper-left */
    box-shadow: var(--shadow-float),
        inset -18px -22px 40px rgba(0, 0, 0, 0.55),
        inset 10px 12px 26px rgba(255, 255, 255, 0.2);
    opacity: 0.55;
    animation: ss-drift 38s ease-in-out infinite;
    animation-delay: calc(var(--i) * -5.4s);
}
.ss-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: var(--pastel-rainbow-diag);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.ss-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 32%),
        radial-gradient(circle, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.35) 100%);
}
/* grab-and-fling (js/bubble-physics.js): physics owns the transform, so drop the CSS drift and the tilt */
.ss-stage.pool-active { transform: none; transition: none; }
.ss-stage.pool-active .ss-card { animation: none; cursor: grab; touch-action: none; user-select: none; }
.ss-stage.pool-active .ss-card.dragging { cursor: grabbing; opacity: 0.8; }
.ss-card:nth-child(1) { top: 8%; left: 6%; }
.ss-card:nth-child(2) { top: 12%; right: 8%; }
.ss-card:nth-child(3) { bottom: 14%; left: 10%; }
.ss-card:nth-child(4) { bottom: 10%; right: 12%; }
.ss-card:nth-child(5) { top: 40%; left: 2%; }
.ss-card:nth-child(6) { top: 46%; right: 3%; }
.ss-card:nth-child(7) { top: 4%; left: 42%; }
@keyframes ss-drift {
    0%, 100% { transform: translate3d(0, 0, -80px) rotate(-6deg); }
    25% { transform: translate3d(30px, -24px, -40px) rotate(3deg); }
    50% { transform: translate3d(-20px, 30px, -120px) rotate(7deg); }
    75% { transform: translate3d(-36px, -10px, -60px) rotate(-2deg); }
}
.ss-forward {
    position: relative;
    z-index: 2;
    width: min(46vmin, 420px);
    aspect-ratio: 1;
    padding: 14px;
    border: 0;
    border-radius: 30px;
    background: var(--frost-glass);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    box-shadow: var(--shadow-lift);
    transform: translateY(-8vh);
    cursor: pointer;
}
.ss-forward img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.ss-forward:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.ss-placard {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    z-index: 3;
    min-width: min(440px, 90vw);
    padding: 16px 28px 18px;
    border-radius: 24px;
    text-align: center;
    transform: translateX(-50%);
}
.ss-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: 0.02em; }
.ss-subtitle { margin: 2px 0 10px; font-family: var(--font-body); font-style: italic; opacity: 0.85; }
.ss-enter { display: block; margin: 14px auto 0; }
.screensaver.ss-swap .ss-forward { animation: ss-come-forward 1.2s ease-out both; }
.screensaver.ss-swap .ss-title,
.screensaver.ss-swap .ss-subtitle,
.screensaver.ss-swap .ss-rarity { animation: ss-fade-in 1s 0.3s ease-out both; }
@keyframes ss-come-forward {
    from { opacity: 0; transform: translateY(-8vh) translateZ(-260px) rotateY(-18deg); }
    to { opacity: 1; transform: translateY(-8vh) translateZ(0) rotateY(0); }
}
@keyframes ss-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) {
    .ss-card:nth-child(n + 3) { display: none; }
    .ss-forward { width: min(70vw, 340px); transform: translateY(-12vh); }
    .ss-placard { bottom: 4vh; }
}
/* Phones/tablets: no live blur (recomputed every scroll frame) and still spheres — keeps iPhones smooth */
@media (max-width: 768px), (pointer: coarse) {
    .nft-card, .ss-forward { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(22, 19, 38, 0.62); }
    .ss-card { animation: none; }
    .ss-stage { transform: none; transition: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ss-card { animation: none; }
    .ss-stage { transform: none; transition: none; }
    .screensaver.ss-swap .ss-forward { animation: ss-fade-in 1s ease-out both; }
}

/* ===== 3D card popup: new fonts only (behaviour unchanged) ===== */
.card-front-title, .card-3d-back-title, .card-3d-front-title { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; }
.card-face, .card-3d-ctrl-btn, .card-3d-claim-btn, .card-3d-note { font-family: var(--font-body); }
