/* ============================================================
   Galaxyz Discover — Full-screen Tinder-style music feed
   v2.2.0
   ============================================================ */

/* ── Reset / Root ── */
#gxz-discover-root *,
#gxz-discover-root *::before,
#gxz-discover-root *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

/* ── Root container — covers the full viewport ── */
#gxz-discover-root {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, 'Inter', BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    z-index: 9999;
    /* iOS safe areas */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Top bar ── */
.gxz-disc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    flex-shrink: 0;
    z-index: 10;
}

.gxz-disc-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition: background 0.2s;
}
.gxz-disc-nav-btn:hover { background: rgba(255,255,255,0.15); }
.gxz-disc-nav-btn:active { transform: scale(0.93); }

.gxz-disc-wordmark {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex: 1;
    max-width: 180px;
    margin: 0 8px;
}
.gxz-disc-wordmark img {
    height: 28px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.gxz-disc-liked-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff2d78;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.gxz-disc-liked-count:empty,
.gxz-disc-liked-count[data-count="0"] { display: none; }

/* ── Card stack area ── */
.gxz-disc-stack {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Individual card ── */
.gxz-disc-card {
    position: absolute;
    width: calc(100% - 32px);
    max-width: 420px;
    /* Height: stack area minus action bar space */
    height: calc(100% - 16px);
    border-radius: 20px;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    transition: box-shadow 0.2s;
}
.gxz-disc-card:active { cursor: grabbing; }

/* Stack depth: cards behind the top card */
.gxz-disc-card:nth-child(2) {
    transform: scale(0.95) translateY(12px);
    z-index: 1;
}
.gxz-disc-card:nth-child(3) {
    transform: scale(0.90) translateY(24px);
    z-index: 0;
}
/* Top card: highest z-index + compositor layer for smooth dragging */
.gxz-disc-card.is-top {
    z-index: 5;
    will-change: transform;
}

/* ── Card artwork (full bleed background) ── */
.gxz-disc-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #111;
    transition: filter 0.3s;
}

/* Gradient overlay so text is readable */
.gxz-disc-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 30%,
        rgba(0,0,0,0.3) 55%,
        rgba(0,0,0,0.85) 80%,
        rgba(0,0,0,0.95) 100%
    );
}

/* ── YouTube / SoundCloud embed iframe ── */
.gxz-disc-card-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none; /* let swipe gestures pass through */
    opacity: 0;
    transition: opacity 0.4s;
}
.gxz-disc-card-video.is-ready { opacity: 1; }

/* ── Card info overlay ── */
.gxz-disc-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 20px 24px;
    z-index: 2;
}

.gxz-disc-card-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 4px;
    text-shadow: 0 1px 8px rgba(0,0,0,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gxz-disc-card-artist {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin: 0 0 10px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}

a.gxz-disc-card-artist {
    /* Underline on hover to signal it's tappable */
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.35);
    text-underline-offset: 3px;
    cursor: pointer;
}
a.gxz-disc-card-artist:active {
    color: #fff;
    text-decoration-color: rgba(255,255,255,0.7);
}

.gxz-disc-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gxz-disc-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 100px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}
.gxz-disc-card-badge svg { flex-shrink: 0; }

.gxz-disc-card-badge.badge-type {
    background: rgba(255,45,120,0.25);
    border-color: rgba(255,45,120,0.4);
    color: #ff8ab5;
}

/* ── Audio progress bar ── */
.gxz-disc-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.15);
    z-index: 3;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}
.gxz-disc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff2d78, #9b59b6);
    width: 0%;
    transition: width 0.5s linear;
}

/* ── Swipe hint labels ── */
.gxz-disc-hint {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 3px;
    border: 4px solid;
    border-radius: 8px;
    padding: 8px 16px;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    transition: opacity 0.1s;
}
.gxz-disc-hint-like {
    left: 24px;
    color: #2ecc71;
    border-color: #2ecc71;
    transform: translateY(-50%) rotate(-15deg);
}
.gxz-disc-hint-skip {
    right: 24px;
    color: #ff2d78;
    border-color: #ff2d78;
    transform: translateY(-50%) rotate(15deg);
}

/* ── Action buttons ── */
.gxz-disc-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 0 16px;
    flex-shrink: 0;
    z-index: 10;
    transition: opacity 0.3s;
}

.gxz-disc-btn {
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}
.gxz-disc-btn:active { transform: scale(0.88) !important; }

.gxz-disc-btn-skip {
    width: 60px;
    height: 60px;
    background: #1a1a1a;
    border: 2px solid #333;
    color: #ff2d78;
    box-shadow: 0 4px 20px rgba(255,45,120,0.2);
}
.gxz-disc-btn-skip:hover { box-shadow: 0 4px 24px rgba(255,45,120,0.4); transform: scale(1.05); }

.gxz-disc-btn-play {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #ff2d78, #9b59b6);
    color: #fff;
    box-shadow: 0 6px 28px rgba(255,45,120,0.45);
}
.gxz-disc-btn-play:hover { transform: scale(1.07); box-shadow: 0 8px 32px rgba(255,45,120,0.6); }

.gxz-disc-btn-like {
    width: 60px;
    height: 60px;
    background: #1a1a1a;
    border: 2px solid #333;
    color: #2ecc71;
    box-shadow: 0 4px 20px rgba(46,204,113,0.2);
}
.gxz-disc-btn-like:hover { box-shadow: 0 4px 24px rgba(46,204,113,0.4); transform: scale(1.05); }

.gxz-disc-btn-share {
    width: 50px;
    height: 50px;
    background: #1a1a1a;
    border: 2px solid #333;
    color: rgba(255,255,255,0.75);
    box-shadow: 0 4px 16px rgba(255,255,255,0.06);
}
.gxz-disc-btn-share:hover { color: #fff; box-shadow: 0 4px 20px rgba(255,255,255,0.15); transform: scale(1.05); }

/* Liked heart fill animation */
.gxz-disc-btn-like.is-liked svg {
    fill: #2ecc71;
    stroke: #2ecc71;
}

/* ── Loading state ── */
.gxz-disc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}
.gxz-disc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #ff2d78;
    border-radius: 50%;
    animation: gxz-spin 0.8s linear infinite;
}
@keyframes gxz-spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.gxz-disc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    padding: 32px;
    color: #fff;
}
.gxz-disc-empty p {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}
.gxz-disc-empty span {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}
.gxz-disc-reload-btn {
    margin-top: 8px;
    background: linear-gradient(135deg, #ff2d78, #9b59b6);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.gxz-disc-reload-btn:hover { opacity: 0.9; transform: scale(1.03); }

/* ── Toast ── */
.gxz-disc-toast {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20,20,20,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.12);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 100;
}
.gxz-disc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.gxz-toast-link {
    color: #ff6eb4;
    text-decoration: none;
    font-weight: 700;
}
.gxz-toast-link:hover { text-decoration: underline; }
.gxz-toast-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 10px;
    margin: 0;
    vertical-align: middle;
}
.gxz-toast-dismiss:hover { color: #fff; }

/* ── Liked panel (bottom sheet) ── */
.gxz-disc-liked-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #111;
    border-radius: 24px 24px 0 0;
    padding: 0 0 env(safe-area-inset-bottom, 16px);
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
    z-index: 50;
    border-top: 1px solid #222;
}
.gxz-disc-liked-panel.is-open { transform: translateY(0); }

.gxz-disc-liked-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
}
.gxz-disc-liked-header span {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}
.gxz-disc-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #222;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gxz-disc-liked-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
    flex: 1;
}
.gxz-disc-liked-empty {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    padding: 32px 20px;
    margin: 0;
}
/* Auth CTA inside liked panel for logged-out users */
.gxz-disc-panel-auth {
    margin: 12px 16px;
    padding: 16px;
    background: rgba(255,45,120,0.08);
    border: 1px solid rgba(255,45,120,0.2);
    border-radius: 16px;
    text-align: center;
}
.gxz-disc-panel-auth-msg {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin: 0 0 12px;
    line-height: 1.4;
}
.gxz-disc-panel-auth-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.gxz-disc-panel-auth-signup {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 100px;
    background: linear-gradient(135deg,#ff2d78,#a855f7);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
}
.gxz-disc-panel-auth-signup:hover { opacity: 0.85; }
.gxz-disc-panel-auth-login {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 100px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.gxz-disc-panel-auth-login:hover { background: rgba(255,255,255,0.14); }

.gxz-disc-liked-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    text-decoration: none;
    transition: background 0.15s;
}
.gxz-disc-liked-item:hover { background: rgba(255,255,255,0.04); }
.gxz-disc-liked-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #222;
    object-fit: cover;
    flex-shrink: 0;
}
.gxz-disc-liked-info { flex: 1; min-width: 0; }
.gxz-disc-liked-track {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gxz-disc-liked-artist {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.gxz-disc-liked-heart {
    color: #ff2d78;
    flex-shrink: 0;
}

/* ── Panel overlay ── */
.gxz-disc-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.gxz-disc-panel-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Swipe-out animations ── */
@keyframes gxz-swipe-right {
    to { transform: translateX(150%) rotate(25deg); opacity: 0; }
}
@keyframes gxz-swipe-left {
    to { transform: translateX(-150%) rotate(-25deg); opacity: 0; }
}
/* Swipe animations are applied to the outer .gxz-disc-card.
   The inner wrapper (gxz-disc-card-inner) must NOT have its own
   transform during a swipe — reset it so the outer animation wins. */
.gxz-disc-card.swipe-right {
    animation: gxz-swipe-right 0.4s cubic-bezier(0.4,0,0.8,1) forwards;
}
.gxz-disc-card.swipe-left {
    animation: gxz-swipe-left 0.4s cubic-bezier(0.4,0,0.8,1) forwards;
}
/* No inner-wrapper freeze needed — crossfade approach has no 3D context */

/* ── Like / skip burst ── */
@keyframes gxz-burst {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}
.gxz-disc-btn.burst { animation: gxz-burst 0.35s ease; }

/* ── Floating heart animation ── */
@keyframes gxz-float-heart {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    60%  { opacity: 1; transform: translate(-50%, -120%) scale(1.4); }
    100% { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}
.gxz-disc-float-heart {
    position: fixed;
    pointer-events: none;
    z-index: 200;
    animation: gxz-float-heart 0.7s ease forwards;
    color: #ff2d78;
}

/* ── Tap to Play overlay (YouTube cards only) ── */
.gxz-tap-to-play {
    position: absolute;
    /* Sit just above the card info text, close to the bottom edge near the play button */
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
}

.gxz-ttp-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 40px;
    padding: 10px 18px 10px 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.gxz-ttp-label {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Hand icon bounces downward toward the play button */
.gxz-ttp-arrow {
    color: #FF2D78;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gxz-ttp-bounce 1.1s ease-in-out infinite;
}

@keyframes gxz-ttp-bounce {
    0%, 100% { transform: translateY(0);   opacity: 1; }
    50%       { transform: translateY(5px); opacity: 0.7; }
}


/* ════════════════════════════════════════════════════════
   TAP-TO-BEGIN OVERLAY
════════════════════════════════════════════════════════ */
.gxz-disc-begin-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    transition: opacity 0.35s ease;
    opacity: 1;
}

.gxz-disc-begin-overlay--gone {
    opacity: 0;
    pointer-events: none;
}

.gxz-disc-begin-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    padding: 0 32px;
}

.gxz-disc-begin-finger {
    animation: gxz-begin-bounce 1.2s ease-in-out infinite;
}

@keyframes gxz-begin-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

.gxz-disc-begin-label {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.gxz-disc-begin-hint {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    margin: 0;
    letter-spacing: 0.03em;
}

/* ── Play button loading spinner (YouTube loading state) ── */
@keyframes gxz-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

#gxz-disc-play.is-loading {
    position: relative;
}

#gxz-disc-play.is-loading::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    animation: gxz-spin 0.7s linear infinite;
    pointer-events: none;
}

/* ── YT.Player container — fill the card video area ── */
.gxz-disc-yt-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gxz-disc-yt-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ── YouTube tap-arrow cue ──────────────────────────────────────────────────
   Shown on YouTube-only cards to guide the user to tap the play button.
   Positioned just above the card info area so the arrow points down
   toward the play button below the card.
   ───────────────────────────────────────────────────────────────────────── */
.gxz-disc-yt-arrow {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    z-index: 10;
    animation: gxz-yt-arrow-bounce 1.1s ease-in-out infinite;
}
.gxz-disc-yt-arrow-svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
}
.gxz-disc-yt-arrow-label {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    white-space: nowrap;
}
@keyframes gxz-yt-arrow-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 1; }
    50%       { transform: translateX(-50%) translateY(7px); opacity: 0.75; }
}
.gxz-disc-yt-arrow--hidden {
    display: none;
}


/* ════════════════════════════════════════════════════════
   RESULTS SCREEN — Artist Discovery Mode
   ════════════════════════════════════════════════════════ */
#gxz-disc-results {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001; /* above gxz-discover-root (9999) */
    background: linear-gradient(160deg, #0d0d0d 0%, #1a1a2e 100%);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* Back button on results screen — upper-left corner */
.gxz-res-back-btn {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top, 0px));
    left: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.gxz-res-back-btn:hover  { background: rgba(255,255,255,0.15); }
.gxz-res-back-btn:active { transform: scale(0.93); }

/* ── Floating background bubbles ── */
.gxz-res-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.gxz-res-bubble {
    position: absolute;
    border-radius: 50%;
    overflow: hidden;
    opacity: 0.22;
    filter: blur(1px);
    will-change: transform;
}
.gxz-res-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* PFP bubble: large, bottom-left, drifts up */
.gxz-res-bubble-pfp {
    width: clamp(200px, 60vw, 340px);
    height: clamp(200px, 60vw, 340px);
    bottom: -80px;
    left: -70px;
    animation: gxz-bubble-pfp 10s ease-in-out infinite alternate;
}
/* Art bubble: smaller, top-right, drifts down */
.gxz-res-bubble-art {
    width: clamp(130px, 40vw, 240px);
    height: clamp(130px, 40vw, 240px);
    top: -50px;
    right: -50px;
    animation: gxz-bubble-art 13s ease-in-out infinite alternate;
}
@keyframes gxz-bubble-pfp {
    0%   { transform: translate(0, 0)       scale(1);    }
    50%  { transform: translate(24px, -28px) scale(1.06); }
    100% { transform: translate(12px, -16px) scale(0.97); }
}
@keyframes gxz-bubble-art {
    0%   { transform: translate(0, 0)        scale(1);    }
    50%  { transform: translate(-20px, 26px) scale(1.09); }
    100% { transform: translate(-12px, 14px) scale(0.94); }
}

.gxz-res-inner {
    position: relative;
    z-index: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 24px 24px env(safe-area-inset-bottom, 20px);
    text-align: center;
    gap: 0;
}

/* ── Emoji / mascot ── */
.gxz-res-emoji {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 10px;
    display: block;
}

/* Tier-specific emoji animations */
.gxz-res-tier-rocket .gxz-res-emoji  { animation: gxz-rocket-launch 1.2s cubic-bezier(.17,.67,.35,1.2) forwards; }
.gxz-res-tier-fire   .gxz-res-emoji  { animation: gxz-fire-pulse 0.9s ease-in-out infinite alternate; }
.gxz-res-tier-spark  .gxz-res-emoji  { animation: gxz-sparkle-drift 2s ease-in-out infinite; }
.gxz-res-tier-meh    .gxz-res-emoji  { animation: gxz-meh-wobble 2.5s ease-in-out infinite; }
.gxz-res-tier-puff   .gxz-res-emoji  { animation: gxz-puff-sputter 1.8s ease-in-out infinite; }
.gxz-res-tier-skull  .gxz-res-emoji  { animation: gxz-skull-tip 0.6s ease-out 0.3s forwards; }

@keyframes gxz-rocket-launch {
    0%   { transform: translateY(0)    scale(1);    opacity: 1; }
    60%  { transform: translateY(-30px) scale(1.15); opacity: 1; }
    100% { transform: translateY(-80px) scale(0.9);  opacity: 0.85; }
}
@keyframes gxz-fire-pulse {
    0%   { transform: scale(1);    filter: brightness(1); }
    100% { transform: scale(1.18); filter: brightness(1.3); }
}
@keyframes gxz-sparkle-drift {
    0%, 100% { transform: translateY(0)    rotate(0deg);   opacity: 1; }
    50%       { transform: translateY(-8px) rotate(15deg);  opacity: 0.8; }
}
@keyframes gxz-meh-wobble {
    0%, 100% { transform: rotate(0deg); }
    25%       { transform: rotate(-4deg); }
    75%       { transform: rotate(4deg); }
}
@keyframes gxz-puff-sputter {
    0%   { transform: translateX(0)    rotate(0deg);   opacity: 1; }
    20%  { transform: translateX(-3px) rotate(-5deg);  opacity: 0.9; }
    40%  { transform: translateX(3px)  rotate(5deg);   opacity: 0.85; }
    60%  { transform: translateX(-2px) rotate(-3deg);  opacity: 0.9; }
    80%  { transform: translateX(2px)  rotate(3deg);   opacity: 0.95; }
    100% { transform: translateX(0)    rotate(0deg);   opacity: 1; }
}
@keyframes gxz-skull-tip {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(-45deg) translateX(-10px); }
}

/* ── Score counter ── */
.gxz-res-score-wrap {
    margin-bottom: 8px;
}
.gxz-res-score {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ff2d78 0%, #ff8c42 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gxz-score-pop 0.4s cubic-bezier(.17,.67,.35,1.5) 1.5s both;
}
@keyframes gxz-score-pop {
    0%   { transform: scale(1); }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* ── Text ── */
.gxz-res-headline {
    font-size: clamp(17px, 4.5vw, 22px);
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.3;
}
.gxz-res-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin: 0 0 16px;
    line-height: 1.4;
}

/* ── Platform save buttons ── */
.gxz-res-platforms {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 12px;
}
.gxz-res-platform-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s;
}
.gxz-res-platform-btn:active { transform: scale(0.96); opacity: 0.85; }
.gxz-res-platform-spotify { background: #1DB954; color: #000; }
.gxz-res-platform-apple   { background: #fc3c44; color: #fff; }
.gxz-res-platform-youtube { background: #FF0000; color: #fff; }

/* ── Share / actions ── */
.gxz-res-actions {
    width: 100%;
    max-width: 300px;
    margin-bottom: 10px;
}
.gxz-res-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px;
    border: 2px solid rgba(255,255,255,0.25);
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.gxz-res-share-btn:hover  { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.45); }
.gxz-res-share-btn:active { transform: scale(0.96); }
.gxz-res-share-gate       { border-color: #ff2d78; color: #ff2d78; }

/* ── Replay button ── */
.gxz-res-replay-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.15s;
}
.gxz-res-replay-btn:hover { color: rgba(255,255,255,0.75); }

/* Auth CTA on results screen for logged-out users */
.gxz-res-auth-cta {
    margin: 24px auto 0;
    padding: 20px;
    max-width: 320px;
    background: rgba(255,45,120,0.08);
    border: 1px solid rgba(255,45,120,0.2);
    border-radius: 20px;
    text-align: center;
}
.gxz-res-auth-msg {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    margin: 0 0 14px;
    line-height: 1.4;
}
.gxz-res-auth-signup {
    display: block;
    padding: 12px 24px;
    border-radius: 100px;
    background: linear-gradient(135deg,#ff2d78,#a855f7);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 10px;
    transition: opacity 0.2s;
}
.gxz-res-auth-signup:hover { opacity: 0.85; }
.gxz-res-auth-login {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: color 0.2s;
}
.gxz-res-auth-login:hover { color: rgba(255,255,255,0.8); }

/* Finger pulse — signals audio is ready on the begin overlay */
@keyframes gxz-finger-pulse {
    0%   { transform: scale(1);    opacity: 1; }
    40%  { transform: scale(1.18); opacity: 0.85; }
    70%  { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}


/* ══════════════════════════════════════════════════════════════
   YOU MAY ALSO LIKE — results screen artist bubbles
   ══════════════════════════════════════════════════════════════ */
.gxz-res-also-like {
  width: 100%;
  max-width: 360px;
  margin-top: 12px;
  text-align: center;
  flex-shrink: 0;
}
.gxz-res-also-like-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 8px;
}
.gxz-res-also-bubbles {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 22px;
  overflow: visible;
}
.gxz-res-also-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: gxz-also-float 3.5s ease-in-out infinite alternate;
  flex-shrink: 0;
}
.gxz-res-also-bubble:nth-child(2) { animation-delay: 0.6s; }
.gxz-res-also-bubble:nth-child(3) { animation-delay: 1.2s; }
@keyframes gxz-also-float {
  0%   { transform: translateY(0px); }
  100% { transform: translateY(-9px); }
}
.gxz-res-also-bubble:active { transform: scale(0.92) translateY(-4px); }
.gxz-res-also-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s, box-shadow 0.25s;
  flex-shrink: 0;
  box-shadow: 0 6px 24px rgba(0,0,0,0.55);
}
.gxz-res-also-bubble:hover .gxz-res-also-avatar,
.gxz-res-also-bubble:active .gxz-res-also-avatar {
  border-color: rgba(255,45,120,0.7);
  box-shadow: 0 0 20px rgba(255,45,120,0.4), 0 6px 24px rgba(0,0,0,0.55);
}
.gxz-res-also-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gxz-res-also-avatar-placeholder {
  font-size: 24px;
  line-height: 1;
}
.gxz-res-also-name {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ── Card counter (e.g. "3 / 15") in the topbar ── */
.gxz-disc-card-counter {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
  min-width: 44px;
  text-align: center;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
}

/* ── Claim Profile banner (unclaimed artist, logged-out) ── */
.gxz-disc-claim-bar {
    /* Upper-left notification badge — sits inside the card, never over controls */
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 20;
    pointer-events: none;
    /* no full-width gradient overlay */
}

.gxz-disc-claim-text {
    /* hidden — label is baked into the button */
    display: none;
}

.gxz-disc-claim-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* compact pill — not a full-width blob */
    padding: 7px 14px 7px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255,45,120,0.45);
    background: rgba(10, 4, 18, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ff6aab;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(255,45,120,0.25), inset 0 1px 0 rgba(255,255,255,0.06);
    transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
    white-space: nowrap;
    /* subtle pulse on the border glow only */
    animation: gxz-claim-pulse 3s ease-in-out infinite;
}
.gxz-disc-claim-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    stroke: #ff6aab;
}
.gxz-disc-claim-btn:hover  {
    background: rgba(255,45,120,0.18);
    border-color: rgba(255,45,120,0.7);
    color: #fff;
    transform: scale(1.03);
}
.gxz-disc-claim-btn:active { transform: scale(0.97); }

@keyframes gxz-claim-pulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(255,45,120,0.25), inset 0 1px 0 rgba(255,255,255,0.06); }
    50%       { box-shadow: 0 2px 18px rgba(255,45,120,0.45), inset 0 1px 0 rgba(255,255,255,0.06); }
}


/* ════════════════════════════════════════════════════════
   FLIP CARD — crossfade approach (Safari-safe)
   v2.0  No CSS 3D / preserve-3d — uses opacity + scale
         crossfade driven by JS class toggles.
         Works identically on Safari iOS, Chrome, Firefox.
════════════════════════════════════════════════════════ */

/* Inner wrapper — just a positioning container, no 3D */
.gxz-disc-card-inner {
    position: absolute;
    inset: 0;
    border-radius: 20px;
}

/* Both faces fill the card */
.gxz-disc-card-face {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    overflow: hidden;
    transition:
        opacity  0.38s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

/* Front face — visible by default */
.gxz-disc-card-face--front {
    z-index: 2;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Back face — hidden by default */
.gxz-disc-card-face--back {
    z-index: 3;
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Flipped state ── */
.gxz-disc-card.is-flipped .gxz-disc-card-face--front {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
}
.gxz-disc-card.is-flipped .gxz-disc-card-face--back {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* ── Back face: blurred artwork hero ── */
.gxz-disc-back-hero {
    position: relative;
    flex-shrink: 0;
    height: 52%;
    min-height: 180px;
    overflow: hidden;
}
.gxz-disc-back-hero-blur {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(0.45) saturate(1.3);
    transform: scale(1.08);
}
.gxz-disc-back-hero-art {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}

/* ── Back face: detail body ── */
.gxz-disc-back-body {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(180deg, rgba(13,13,13,0) 0%, #0d0d0d 18%);
}

.gxz-disc-back-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gxz-disc-back-artist {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gxz-disc-back-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.gxz-disc-back-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
}

/* ── DSP link buttons ── */
.gxz-disc-back-dsps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}
.gxz-disc-back-dsp-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s, transform 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.gxz-disc-back-dsp-btn:active {
    background: rgba(255,255,255,0.12);
    transform: scale(0.97);
}
.gxz-disc-back-dsp-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.gxz-disc-back-dsp-btn--spotify {
    background: rgba(30,215,96,0.1);
    border-color: rgba(30,215,96,0.25);
}
.gxz-disc-back-dsp-btn--spotify:active {
    background: rgba(30,215,96,0.2);
}
.gxz-disc-back-dsp-btn--apple {
    background: rgba(252,60,68,0.1);
    border-color: rgba(252,60,68,0.25);
}
.gxz-disc-back-dsp-btn--apple:active {
    background: rgba(252,60,68,0.2);
}
.gxz-disc-back-dsp-btn--tidal {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}

/* ── Subtle flip-back hint (bottom of back face) ── */
.gxz-disc-back-hint {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-top: 14px;
    flex-shrink: 0;
}

/* ── Prevent swipe drag while card is flipped ── */
.gxz-disc-card.is-flipped {
    cursor: default;
}

/* ════════════════════════════════════════════════════════
   FLIP — dim + blur cards below the flipped top card
   When .has-flipped-card is on the stack, all non-top
   cards get a dark overlay so the back face reads clearly.
════════════════════════════════════════════════════════ */
#gxz-disc-stack.has-flipped-card .gxz-disc-card:not(.is-top) {
    filter: blur(4px) brightness(0.45);
    transition: filter 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
#gxz-disc-stack .gxz-disc-card:not(.is-top) {
    transition: filter 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Track pill tap-to-flip affordance ── */
.gxz-disc-card-badge.badge-type--tappable {
    cursor: pointer;
}
.gxz-disc-card-badge.badge-type--tappable:active {
    opacity: 0.75;
    transform: scale(0.96);
}
