﻿/* =============================================================================
   Profile (Public View) — Stylesheet
   -----------------------------------------------------------------------------
   Goals:
   • Small, predictable visual system with clear "knobs" (CSS variables).
   • Public profile card + optional banner + social icons.
   • Brand theme handling (brand-colored SVGs) and link glow gate.

   Notes:
   • No functional changes—only organization, clarifying comments, and tidy docs.
   • The small ".social-editor" bits are kept so the Options preview matches.
============================================================================= */


/* ============================================================================
   1) DESIGN TOKENS / CSS CUSTOM PROPERTIES
   ----------------------------------------------------------------------------
   These are the “knobs” the app and Options page tweak (via inline styles/JS).
============================================================================= */

:root {
    /* Core colors */
    --accent: #8b8b8b; /* Accent hue for pills/links (when brand is OFF) */
    --accent-glow: rgba(236,72,153,.50);
    --border: rgba(255,255,255,.12); /* Subtle borders on dark bg */
    --text: #e5e7eb; /* Primary text */
    /* Profile card sizing (dashboard/user pages may update these) */
    --profile-cap: 980px; /* Max card width */
    --profile-gutters: 0px; /* no side gutters on phones */
    --profile-min-h: 82vh; /* Minimum card height */
    /* Background video controls (full-bleed) */
    --bg-blur: 0px;
    --bg-opacity: 1;
    /* Banner strip controls (when a banner image exists) */
    --banner-blur: 0px;
    --banner-tint: transparent;
    --banner-height: 140px;
    /* Avatar */
    --avatar-border-color: rgba(255,255,255,.7);
    --avatar-size: 96px;
    --avatar-radius: 50%;
    /* Typography & sparkle overlay */
    --display-name-size: 1.4rem;
    --bio-size: 1rem; /* default bio size */
    --bio-leading: 1.45;
    --sparkle-gif-url: url('/assets/sparkles/white.gif');
    /* Scale & layout offsets (tweaked by sliders) */
    --tag-scale: 1;
    --links-scale: 1;
    --avatar-offset-y: 0vh;
    --name-offset-y: 0vh;
    --tags-offset-y: 0vh;
    --bio-offset-y: 0vh;
    --links-offset-y: 0vh;
    /* Per-section colors (can be overridden) */
    --name-color: var(--text);
    --tags-color: var(--accent);
    --links-color: var(--accent);
    --bio-color: #b8b8b8;
    /* Icon/link cosmetics */
    --link-glow-strength: 30; /* 0–100 (only used when brand is OFF) */
    --icon-size: 28px; /* Social icon visual size */
    --bio-glow-color: var(--accent-glow);
    --bio-glow-blur: 0px; /* try 6–12 */
    /* NEW: name & link glow knobs + a shared dark outline */
    --name-glow-color: var(--accent-glow);
    --name-glow-blur: 0px; /* try 8–14 */
    /* subtle dark outline so light text still “reads” */
    --glow-outline: 0 1px 1px rgba(0,0,0,.38);
    --tag-glow-color: var(--accent-glow);
    --tag-glow-blur: 6px; /* try 8–14 */

}
}


/* ============================================================================
   2) GLOBAL RESET / PAGE LAYOUT
============================================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100vh;
    background: transparent !important; /* Let background video show through */
    color: var(--text);
    display: grid; /* Center the profile card area */
    place-items: start center; /* Start vertically, center horizontally */
    padding: 28px 14px; /* Small breathing room on small screens */
}

    /* Center the whole profile vertically (opt-in via <html class="center-container">) */
    html.center-container,
    html.center-container body {
        place-items: center center;
    }


/* ============================================================================
   3) PROFILE CARD CONTAINER
============================================================================= */

.profile-shell {
    width: min(var(--profile-cap), calc(100vw - var(--profile-gutters)));
    min-height: var(--profile-min-h, 82vh);
    background: var(--card-bg, rgba(15,15,16,.55)); /* App can override via --card-bg */
    backdrop-filter: blur(var(--card-blur, 8px));
    -webkit-backdrop-filter: blur(var(--card-blur, 8px));
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 25px 80px var(--card-shadow-color, rgba(0,0,0,.5));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 0;
    /* Smoother tilt animation (when enabled) */
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
}

/* Optional header banner is OFF by default (toggle in markup/JS if desired) */
.profile-banner {
    display: none
}


/* ============================================================================
   4) AVATAR
============================================================================= */

/* Base avatar (no banner) */
.profile-avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    margin: 24px auto 12px !important; /* Constant spacing in non-banner layout */
    border-radius: var(--avatar-radius);
    border: none;
    background: #222;
    object-fit: cover;
    display: block; /* Avoid inline-baseline quirks */
    position: relative;
    z-index: 2;
    /* Paint-only vertical offset (no reflow) */
    transform: translateY(var(--avatar-offset-y, 0vh));
    will-change: transform;
}

/* Avatar placement when a banner exists (legacy compatible) */
.profile-shell.has-banner .profile-avatar {
    margin: calc(-0.5 * var(--avatar-size)) auto 12px !important; /* Overlap banner */
    background: #111;
    border: 2px solid rgba(0,0,0,.35);
    transform: translateY(var(--avatar-offset-y, 0vh));
}

/* Avatar border variants */
.profile-avatar.avatar-border-full {
    border: 3px solid var(--avatar-border-color) !important;
}

.profile-avatar.avatar-border-thin {
    border: 1.5px solid var(--avatar-border-color) !important;
}

.profile-avatar.avatar-border-none {
    border: none !important;
}


/* ============================================================================
   5) CARD BODY / TEXT
============================================================================= */

.profile-body {
    flex: 1 1 auto;
    padding: 0 22px 24px;
    text-align: center;
}

/* Display name */
.profile-name {
    font-size: var(--display-name-size);
    font-weight: 800;
    color: var(--name-color, var(--text));
    font-family: var(--display-name-font, inherit);
    display: inline-block;
    margin: 6px 0;
    position: relative; /* for sparkle overlay stacking */
    z-index: 2;
    transform: translateY(var(--name-offset-y, 0));
    will-change: transform;
    white-space: pre-line;
}

/* Bio */
.profile-bio {
    font-size: var(--bio-size);
    line-height: var(--bio-leading, 1.45); 
    color: var(--bio-color, #b8b8b8);
    font-family: var(--bio-font, inherit);
    margin-bottom: 14px;
    position: relative;
    z-index: 2;
    transform: translateY(var(--bio-offset-y, 0));
    will-change: transform;
    white-space: pre-line;
}


/* ============================================================================
   6) TAGS (chips under the name)
============================================================================= */

.profile-tags {
    margin: 2px 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    font-family: var(--profile-tag-font, inherit);
    position: relative;
    z-index: 2;
    transform: translateY(var(--tags-offset-y, 0));
    will-change: transform;
}

    .profile-tags .tag-pill {
        display: inline-flex;
        align-items: center;
        padding: calc(6px * var(--tag-scale, 1)) calc(10px * var(--tag-scale, 1));
        border: 1px solid var(--tags-color, var(--accent));
        color: var(--tags-color, var(--accent));
        border-radius: 999px;
        font-size: calc(.9rem * var(--tag-scale, 1));
        user-select: none;
        white-space: nowrap;
    }


/* ============================================================================
   7) LINKS (pills row under the bio)
============================================================================= */

.profile-links {
    margin-top: auto; /* Push to the bottom of the card */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding-bottom: 10px;
}

.pill {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: .92rem;
    color: #fff;
    background: var(--accent);
    text-decoration: none;
    border: 1px solid color-mix(in srgb, var(--accent) 60%, #000 40%);
}

/* Canonical URL is hidden on public view (toggle in markup if needed) */
.profile-url {
    display: none;
}


/* ============================================================================
   8) BACKGROUND VIDEO (full-bleed) + AUDIO TOGGLE
============================================================================= */

/* Full-bleed, behind everything; pointer-events disabled to avoid blocking */
.bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
    filter: blur(var(--bg-blur, 0px)) brightness(.95);
    opacity: var(--bg-opacity, 1);
}

/* Overlay tint above video (disabled by default) */
.bg-tint {
    position: fixed;
    inset: 0;
    background: var(--bg-tint, transparent);
    pointer-events: none;
    z-index: -1;
}

/* Audio toggle chip (only shows when autoplay is blocked) */
.audio-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    border: 1px solid var(--border);
    color: #fff;
    font-size: .9rem;
    cursor: pointer;
    z-index: 5; /* Above the card */
}


/* ============================================================================
   9) BANNER STRIP (only when profile has a banner)
============================================================================= */

.profile-shell.has-banner .profile-banner {
    display: block;
    height: var(--banner-height, 140px);
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
    position: relative; /* Anchor for ::after tint */
    filter: blur(var(--banner-blur));
    z-index: 0;
    opacity: var(--banner-opacity, 1);
    transition: opacity .2s ease;
}

    /* Tint overlay on top of the banner image */
    .profile-shell.has-banner .profile-banner::after {
        content: "";
        position: absolute;
        inset: 0;
        background: var(--banner-tint, transparent);
        pointer-events: none;
        z-index: 0;
    }


/* ============================================================================
   10) DISPLAY NAME SPARKLES (GIF overlay — color variants just swap the gif)
============================================================================= */

.profile-name.sparkle {
    position: relative;
    display: inline-block; /* Limit overlay to text width */
    color: var(--name-color, #fff);
}

    .profile-name.sparkle::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        mix-blend-mode: screen;
        background-image: var(--sparkle-gif-url);
        background-repeat: repeat;
        /* Scales pattern with font size */
        background-size: calc(var(--sparkle-scale) * 1em) calc(var(--sparkle-scale) * 1em);
    }

/* Simple color variant swaps */
.profile-name.sparkle-white {
    --sparkle-gif-url: url('/assets/sparkles/white.gif');
}

.profile-name.sparkle-red {
    --sparkle-gif-url: url('/assets/sparkles/red.gif');
}

.profile-name.sparkle-yellow {
    --sparkle-gif-url: url('/assets/sparkles/yellow.gif');
}

.profile-name.sparkle-purple {
    --sparkle-gif-url: url('/assets/sparkles/purple.gif');
}

.profile-name.sparkle-pink {
    --sparkle-gif-url: url('/assets/sparkles/pink.gif');
}

.profile-name.sparkle-green {
    --sparkle-gif-url: url('/assets/sparkles/green.gif');
}

.profile-name.sparkle-blue {
    --sparkle-gif-url: url('/assets/sparkles/blue.gif');
}

.profile-name.sparkle-lightblue {
    --sparkle-gif-url: url('/assets/sparkles/lightblue.gif');
}

.profile-name.sparkle-orange {
    --sparkle-gif-url: url('/assets/sparkles/orange.gif');
}

.profile-name.sparkle-rainbow {
    --sparkle-gif-url: url('/assets/sparkles/rainbow.gif');
}

.profile-name.sparkle-black {
    --sparkle-gif-url: url('/assets/sparkles/black.gif');
}


/* ============================================================================
   11) SOCIAL ICONS (row under the name, above the bio)
============================================================================= */

.profile-socials {
    margin: 4px 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* Base gap; next rule scales it */
    justify-content: center;
    position: relative;
    z-index: 2;
    transform: translateY(var(--links-offset-y, 0));
    will-change: transform;
}

/* Scaleable spacing knobs (sliders change --links-scale) */
.profile-socials {
    gap: calc(12px * var(--links-scale, 1));
}

    .profile-socials .social-item {
        display: flex;
        align-items: center;
        gap: calc(8px * var(--links-scale, 1));
    }

    /* Hide inline text labels (tooltips provide names) */
    .profile-socials .social-label {
        display: none;
    }

    /* Icon frame: no background—SVG carries the color */
    .profile-socials .icon-circle {
        position: relative; /* tooltip anchor */
        display: block;
        align-items: center;
        justify-content: center;
        width: var(--icon-size);
        height: var(--icon-size);
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--links-color, var(--accent)); /* When brand is OFF, this tints SVGs via currentColor */
    }

        /* Scale SVG to the icon frame */
        .profile-socials .icon-circle svg {
            width: var(--icon-size);
            height: var(--icon-size);
            display: block;
            overflow: visible;
        }

        /* Tooltip bubble */
        .profile-socials .icon-circle::after {
            content: attr(aria-label);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translate(-50%, -6px);
            background: rgba(0,0,0,.9);
            color: #fff;
            font-size: 12px;
            line-height: 1;
            padding: 6px 8px;
            border-radius: 8px;
            white-space: nowrap;
            box-shadow: 0 4px 16px rgba(0,0,0,.25);
            opacity: 0;
            pointer-events: none;
            transition: opacity .15s ease, transform .15s ease;
            z-index: 10;
        }

        /* Tooltip arrow */
        .profile-socials .icon-circle::before {
            content: "";
            position: absolute;
            bottom: calc(100% - 2px);
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: rgba(0,0,0,.9);
            opacity: 0;
            transition: opacity .15s ease;
            z-index: 10;
        }

        /* Tooltip show on hover/focus */
        .profile-socials .icon-circle:hover::after,
        .profile-socials .icon-circle:focus-visible::after,
        .profile-socials .icon-circle:hover::before,
        .profile-socials .icon-circle:focus-visible::before {
            opacity: 1;
            transform: translate(-50%, -8px);
        }


/* ============================================================================
   12) LINK GLOW (soft halo around icons)
   ----------------------------------------------------------------------------
   • Applies ONLY when brand theme is OFF, so brand SVG colors don’t get halos.
   • The strength is controlled by --link-glow-strength (0 disables).
============================================================================= */

html:not(.brand-theme-on).link-glow-on .profile-socials .icon-circle svg {
    /* Map 0–100 -> ~10px outer + ~3px inner for a soft halo */
    filter: drop-shadow(0 0 calc(var(--link-glow-strength, 30) * 0.10px) currentColor) drop-shadow(0 0 calc(var(--link-glow-strength, 30) * 0.03px) currentColor);
}

/* Safety override in case something else wins the cascade when brand is ON */
html.brand-theme-on.link-glow-on .profile-socials .icon-circle svg {
    filter: none !important;
}


/* ============================================================================
   13) UNIVERSAL FIXES (SVG cropping & inline spacing)
============================================================================= */

.profile-socials .icon-circle,
.social-editor .icon-circle {
    line-height: 0;
}
    /* Kill line-box clipping */

    .profile-socials .icon-circle svg,
    .social-editor .icon-circle svg {
        display: block; /* No inline descender space */
        overflow: visible; /* Let stroke/shadow extend past viewBox */
    }


/* ============================================================================
   14) OPTIONS PAGE PREVIEW PARITY (kept here on purpose)
   ----------------------------------------------------------------------------
   These keep the Options "social-editor" icons visually consistent with public.
   They do not change public profile behavior.
============================================================================= */

.social-editor .icon-circle {
    width: var(--icon-size);
    height: var(--icon-size);
    color: var(--links-color);
}

    .social-editor .icon-circle svg {
        width: 100%;
        height: 100%;
        display: block;
        overflow: visible;
    }

        /* Safer coloring in the editor: tint fills/strokes via currentColor */
        .social-editor .icon-circle svg [fill]:not([fill="none"]) {
            fill: currentColor;
        }

        .social-editor .icon-circle svg [stroke] {
            stroke: currentColor;
            vector-effect: non-scaling-stroke; /* prevent stroke fattening when scaling */
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* Optional: bump stroke width slightly if an icon feels too light */
        .social-editor .icon-circle svg [stroke] {
            stroke-width: 2;
        }


/* ============================================================================
   15) BRAND THEME COLORING (PUBLIC PROFILE)
   ----------------------------------------------------------------------------
   • Brand ON  → let SVGs show their native fills/strokes (Discord purple, etc.)
   • Brand OFF → tint SVGs via currentColor (Links Color), both fill and stroke.
============================================================================= */

/* Brand ON: native SVG colors */
html.brand-theme-on .profile-socials .icon-circle {
    color: inherit;
}
/* intentionally no [fill]/[stroke] rules here to avoid overriding brand art */

/* Brand OFF: tint via Links Color/currentColor */
html:not(.brand-theme-on) .profile-socials .icon-circle {
    color: var(--links-color, var(--accent));
}

    html:not(.brand-theme-on) .profile-socials .icon-circle svg [fill]:not([fill="none"]) {
        fill: currentColor;
    }

    html:not(.brand-theme-on) .profile-socials .icon-circle svg [stroke] {
        stroke: currentColor;
        vector-effect: non-scaling-stroke;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
/* ============================================================================
   15) EMBEDS!
   ----------------------------------------------------------------------------
============================================================================= */

/* Public embeds area */
.profile-embeds {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

/* Card */
.embed-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding:6px;
    background: hsla(0,0%,100%,.03);
    border: 1px solid rgba(120,113,108,.12);
    border-radius: 12px;
    backdrop-filter: blur(var(--card-blur, 8px));
}


/* Avatar container: don't clip here */
.discord-card .dc-avatar {
    position: relative;
    width: 56px;
    line-height: 0;
    height: 56px;
    flex: 0 0 56px; /* don't let flex stretch it */
    aspect-ratio: 1 / 1;
    border: 0;
    background: transparent;
    overflow: visible; /* was hidden → allows overlay to extend */
}

/* Only clip the BASE image into a circle */
.discord-card .dc-img.base {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    clip-path: circle(50% at 50% 50%);
    position: relative;
    z-index: 1;
}

/* Hide status + ID on public card */
.discord-card .dc-status,
.discord-card .dc-id {
    
}

/* Right chip */
.btn.ghost.small.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 12px;
}

    .btn.ghost.small.tag-chip .at {
        display: grid;
        place-items: center;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--accent,#5865F2);
        color: #fff;
        font-size: 12px;
    }

    .btn.ghost.small.tag-chip .handle {
        font-weight: 600;
        opacity: .95;
    }
/* ---------- Right-side badge: base ghost button (public page) ---------- */
.btn.ghost.small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: hsla(0,0%,100%,.03);
    border: 1px solid rgba(120,113,108,.22);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
    transition: transform .12s ease, filter .12s ease, background-color .2s ease;
    -webkit-tap-highlight-color: transparent;
}

    .btn.ghost.small:hover {
        transform: translateY(-1px);
        filter: brightness(1.05);
    }

    .btn.ghost.small:focus-visible {
        outline: 2px solid var(--accent, #5865F2);
        outline-offset: 2px;
    }

    /* ---------- Make it a round "name chip" like the preview ---------- */
    .btn.ghost.small.tag-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border-radius: 999px; /* pill shape */
        padding: 6px 12px; /* a tad tighter than base if you want */
    }

        /* left bubble with the @ */
        .btn.ghost.small.tag-chip .at {
            display: grid;
            place-items: center;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--accent, #5865F2);
            color: #fff;
            font-size: 12px;
        }

        /* the username text */
        .btn.ghost.small.tag-chip .handle {
            font-weight: 600;
            opacity: .95;
            white-space: nowrap; /* keep on one line */
            max-width: 160px; /* prevent overflow explosions */
            overflow: hidden;
            text-overflow: ellipsis;
        }

/* ensure anchors in the actions area aren't blue/underlined */
.discord-card .dc-actions {
    display: flex;
    align-items: center;
}

    .discord-card .dc-actions a {
        color: inherit;
        text-decoration: none;
    }
.btn.ghost.small.tag-chip .at {
    display: none !important;
}
/* Spotify embed card (public profile, same style as preview) */
.embed-card.spotify-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    background: hsla(0,0%,100%,.03);
    border: 1px solid rgba(120,113,108,.12);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(var(--card-blur, 8px));
}

    .embed-card.spotify-card iframe {
        width: 100%;
        height: 80px; /* adjust as needed */
        border: 0;
    }

/* Discord Server (guild) card */
.guild-card .g-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.guild-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(120,113,108,.22);
    background: #1a1a1a;
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--text);
    overflow: hidden;
}

.guild-info {
    display: grid;
    gap: 4px;
}

.guild-name-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.guild-name {
    color: var(--text);
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

.guild-stats {
    display: inline-flex;
    gap: 12px;
    color: #a8a29e;
    font-size: 12px;
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #9ca3af; /* total members (grey) */
}

    .dot.online {
        background: #4ade80;
    }
/* green online */

.join-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(120,113,108,.22);
    background: hsla(0,0%,100%,.03);
    color: var(--text);
    text-decoration: none;
    line-height: 1;
    transition: transform .12s ease, filter .12s ease;
}

    .join-button:hover {
        transform: translateY(-1px);
        filter: brightness(1.05);
    }
/* Make server stats white (or whatever your --text is) */
.guild-stats,
.guild-stats .stat,
.guild-stats .stat span {
    color: var(--text) !important;
    opacity: .95; /* optional: a touch softer than pure white */
}
/* Shared chip height for right-side buttons on embeds */
.embed-card { --chip-h: 38px; }                 /* adjust once, both match */

.btn.ghost.small.tag-chip,
.join-button {
  height: var(--chip-h);
  padding: 0 12px;                              /* vertical size comes from height */
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  line-height: 1;
}
.guild-card .join-button {
    font-size: 13px;
    padding: 0 14px;
}

.btn.ghost.small.tag-chip .at {
  width: 18px;
  height: 18px;
  font-size: 12px;
  border-radius: 999px;
}

/* Visual parity: same border/background/hover as your ghost small */
.join-button {
  border: 1px solid rgba(120,113,108,.22);
  background: hsla(0,0%,100%,.03);
  color: var(--text);
  text-decoration: none;
  transition: transform .12s ease, filter .12s ease;
}
.join-button:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* embeds smaller on narrow phone screens, update this later! */
/* ===================================
    EMBEDS SCREEN SIZE SCALING
  ========================================= */
@media (max-width: 480px) {
    .embed-card {
        flex-direction: column; /* stack if needed */
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
        font-size: 0.9rem; /* shrink text a bit */
    }

    /* Shrink name text so it fits */
    .discord-card .dc-name,
    .guild-card .guild-name {
        font-size: 0.95rem;
    }

    /* Let stats wrap instead of cutting off */
    .guild-stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Make action buttons scale down */
    .btn.ghost.small,
    .join-button {
        font-size: 11px;
        padding: 4px 10px;
        height: auto;
    }

    /* Prevent card from overflowing container */
    .embed-card,
    .profile-embeds {
        max-width: 100%;
        overflow: hidden;
    }
}
/* ===================================
   PHONE TWEAKS (≤ 480px)
=================================== */
@media (max-width: 480px) {
    /* Keep cards compact but don't stack guild rows unless needed */
    .embed-card {
        gap: 10px;
        padding: 10px;
        font-size: .9rem;
    }

    /* Shrink ONLY the Discord *user* avatar on phones */
    .discord-card .dc-avatar {
        width: 40px;
        height: 40px;
    }

    /* 🔒 Keep the Discord *server* icon fixed size on phones */
    .guild-card .guild-avatar {
        width: 48px !important;
        height: 48px !important;
        flex: 0 0 48px; /* prevents flex from squeezing it */
    }

    /* Keep the server name on one line next to the icon */
    .guild-card .guild-name {
        font-size: .95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 70vw; /* guardrail so it doesn’t overflow */
    }

    /* 🫥 Hide the "Members" stat on phones.
     If your order is [Online, Members], this removes the 2nd item. */
    .guild-card .guild-stats .stat:nth-child(2) {
        display: none;
    }

    /* (Optional) Or hide all stats on phones: */
    /* .guild-card .guild-stats { display: none; } */

    /* Buttons a touch smaller on phones */
    .btn.ghost.small,
    .join-button {
        font-size: 11px;
        padding: 4px 10px;
        height: 30px;
    }

    /* Spotify: shorter player so it never gets cut off */
    .spotify-card iframe {
        height: 64px;
    }

    /* Safety: no horizontal overflow */
    .embed-card, .profile-embeds {
        max-width: 100%;
        overflow: hidden;
    }
}
/* Phone layout (≤ 600px) */
@media (max-width: 600px) {
    :root {
        --avatar-size: 84px;
        --display-name-size: 1.25rem;
        --bio-size: .95rem;
        --profile-gutters: 8px; /* small side gutter */
    }

    body {
        /* respect iOS/Android safe areas, slim side padding */
        padding: max(16px, env(safe-area-inset-top)) 8px max(16px, env(safe-area-inset-bottom)) 8px;
    }

    .profile-shell {
        /* full width minus gutter; disable desktop cap */
        width: calc(100vw - (var(--profile-gutters, 0px) * 2)) !important;
        max-width: none !important;
        /* fill phone height accounting for browser UI bars */
        min-height: calc(100svh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)));
        border-radius: 16px !important;
    }

    /* single-column embeds and comfy content padding */
    .profile-embeds {
        grid-template-columns: 1fr;
    }

    .profile-body {
        padding: 0 16px 18px;
    }
}

/* Prefer dynamic viewport height when available (Safari/Chrome modern) */
@supports (height: 100dvh) {
    @media (max-width: 600px) {
        .profile-shell {
            min-height: calc(100dvh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)));
        }
    }
}

/* Very small phones (≤ 480px) – optional tighter tweaks */
@media (max-width: 480px) {
    .embed-card {
        gap: 10px;
        padding: 10px;
        font-size: .9rem;
    }

    .discord-card .dc-avatar {
        width: 40px;
        height: 40px;
    }

    .guild-card .guild-avatar {
        width: 48px !important;
        height: 48px !important;
        flex: 0 0 48px;
    }

    .guild-card .guild-name {
        font-size: .95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 70vw;
    }

    .guild-card .guild-stats .stat:nth-child(2) {
        display: none;
    }
    /* hide "Members" */
    .btn.ghost.small, .join-button {
        font-size: 11px;
        padding: 4px 10px;
        height: 30px;
    }

    .spotify-card iframe {
        height: 64px;
    }

    .embed-card, .profile-embeds {
        max-width: 100%;
        overflow: hidden;
    }
}
/* ================= Reveal Veil ================= */
.reveal-veil {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    padding: 24px;
    /* keep just the blur; remove the dark box */
    backdrop-filter: blur(var(--reveal-blur, 8px));
    -webkit-backdrop-filter: blur(var(--reveal-blur, 8px));
    background: rgba(0,0,0,var(--reveal-dim, .0));
    cursor: pointer; /* communicates click-anywhere */
    user-select: none;
}

.reveal-title {
    margin: 0;
    font-size: var(--reveal-title-size, clamp(1.25rem, 3vw, 2rem));
    color: var(--reveal-title-color, #e5e7eb);
    text-align: center;
    font-family: var(--reveal-font, inherit);
    /* help readability over video without a box */
    text-shadow: 0 2px 18px rgba(0,0,0,.45);
    white-space: pre-line;
}
.reveal-fade {
    opacity: 1;
    transition: opacity .25s ease;
}

    .reveal-fade.is-hiding {
        opacity: 0;
        pointer-events: none;
    }
.reveal-fade {
    opacity: 1;
    transition: opacity .25s ease;
}

    .reveal-fade.is-hiding {
        opacity: 0;
        pointer-events: none;
    }
.dc-badge {
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 4px;
    vertical-align: middle;
    display: inline-block;
}

/* ---------- Discord embed: layout & typography ---------- */
.discord-card .dc-left {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.discord-card .dc-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0; /* enables ellipsis in children */
    margin-left: 2px;
    min-width: 0;
}

.discord-card .dc-name-row {
    margin-bottom: 2px;
    transform: translateY(8px); /* nudge name up a bit */
}

/* Status row sits directly under the name (JS inserts it there) */
.discord-card .dc-status.inline-status {
    margin-top: 4px;
    display: inline-grid !important;
    grid-auto-rows: auto;
    gap: 2px;
    color: #fff;
    line-height: 1.15;
}

/* First line stays on one row; truncate with ellipsis */
.dc-status-title {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dc-status-sub {
    color: #fff;
    opacity: .85;
    font-size: 11px;
}

/* Hide legacy inline dot inside the text row (we use the avatar pill) */
.discord-card .dc-status.inline-status .dc-dot {
    display: none;
}

/* =========================
   Discord embeds – cleaned
   ========================= */

/* --- Avatar: perfect circle + decoration + presence --- */
.dc-avatar {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    aspect-ratio: 1 / 1;
    position: relative;
    background: transparent;
    border: 0;
    overflow: visible;
    z-index: 1; /* sits under text, above card bg */
}

    .dc-avatar .dc-img.base {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        border-radius: 50%;
        position: relative;
        z-index: 1; /* above deco */
    }

    .dc-avatar .dc-deco {
        position: absolute;
        z-index: 0; /* below photo */
        inset: calc(-1 * var(--deco-bleed,6px));
        transform: scale(var(--deco-scale,1.12));
        transform-origin: center;
        object-fit: contain;
        pointer-events: none;
    }

/* Presence pill (JS toggles .online/.idle/.dnd/.offline) */
.dc-presence {
    position: absolute;
    z-index: 2;
    right: -2px;
    bottom: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9ca3af; /* default gray */
    border: 3px solid #18191c; /* Discord-like ring */
    box-sizing: content-box;
}

    .dc-presence.online {
        background: #4ade80;
    }

    .dc-presence.idle {
        background: #facc15;
    }

    .dc-presence.dnd {
        background: #ef4444;
    }

    .dc-presence.offline {
        background: #9ca3af;
    }

/* Activity icon that precedes the title line */
.dc-status-title .act-ico {
    display: inline-block;
    width: 12px;
    height: 12px;
    vertical-align: -1px;
    margin-right: 6px;
    position: relative;
    z-index: 2; /* never hides under avatar */
}

/* --- Left stack (avatar + name + status) --- */
.discord-card .dc-left,
.guild-card .g-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0; /* may shrink, enables ellipsis */
    position: relative; /* z-context for text */
}

.discord-card .dc-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    margin-left: 4px; /* small breathing room */
    position: relative;
    z-index: 10; /* above avatar/deco */
}

.discord-card .dc-name-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.discord-card .dc-name {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-card .dc-status.inline-status {
    margin-top: 4px;
    display: inline-grid;
    grid-auto-rows: auto;
    gap: 2px;
    color: #fff;
    line-height: 1.15;
}

    .discord-card .dc-status.inline-status .dc-dot {
        display: none;
    }
/* we use the avatar pill */
.dc-status-title {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dc-status-sub {
    color: #fff;
    opacity: .85;
    font-size: 11px;
}

/* --- Card row layout (desktop) --- */
.embed-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.discord-card .dc-actions {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.guild-card .join-button {
    margin-left: auto;
}

.discord-card .dc-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    min-width: auto; /* no mystery extra width */
}

.discord-card .dc-actions {
    padding-right: 0;
    margin-right: 0;
}

/* --- Phones: hide right button, keep left stack pinned LEFT --- */
@media (max-width:520px) {
    /* shrink avatar but keep perfect circle */
    .discord-card .dc-avatar {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        aspect-ratio: 1 / 1;
    }

    .dc-presence {
        width: 12px;
        height: 12px;
        border-width: 2px;
    }

    /* hide right-side actions on small screens */
    .discord-card .dc-actions,
    .guild-card .join-button {
        display: none !important;
    }

    /* IMPORTANT: left-align content when the right side disappears */
    .embed-card {
        justify-content: flex-start;
        gap: 10px;
        padding: 10px;
    }

    /* and allow the left stack to claim the whole row width */
    .discord-card .dc-left,
    .guild-card .g-left {
        flex: 1 1 100%;
        min-width: 0;
    }

    /* tiny type tweaks */
    .discord-card .dc-name {
        font-size: .95rem;
    }

    .dc-status-title {
        font-size: 11.5px;
    }

    .dc-status-sub {
        font-size: 10.5px;
    }
}

/* Optional: ultra-narrow phones */
@media (max-width:380px) {
    .discord-card .dc-avatar {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }
}
/* ===== FORCE LEFT ALIGN FOR SERVER CARD ON PHONES ===== */
@media (max-width:520px) {
    /* Make the card itself and its left stack hug the left edge */
    .guild-card {
        justify-content: flex-start !important;
    }

        .guild-card .g-left {
            flex: 1 1 100% !important;
            min-width: 0;
            margin: 0 !important;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        /* Kill any accidental text centering inside */
        .guild-card,
        .guild-card .guild-info,
        .guild-card .guild-name-row,
        .guild-card .guild-stats {
            text-align: left !important;
            justify-content: flex-start !important;
        }

    /* (Optional) ensure the embed spans the grid width on mobile */
    .profile-embeds {
        justify-items: stretch;
    }

    .embed-card {
        width: 100%;
    }
}
/* ===== Fix server embed centering at ~475px and below ===== */
@media (max-width: 480px) {
    /* Make the grid give each card full width and stop centering */
    .profile-embeds {
        justify-items: stretch !important;
        align-items: start !important;
    }

        .profile-embeds > .embed-card {
            width: 100% !important;
            margin-inline: 0 !important; /* kill auto-centering margins */
        }

    /* Server card: keep the row left-aligned */
    .guild-card {
        justify-content: flex-start !important;
        text-align: left !important;
        margin-inline: 0 !important;
    }

        .guild-card .g-left {
            flex: 1 1 100% !important;
            min-width: 0 !important;
            margin: 0 !important;
            display: flex !important;
            align-items: center !important;
            justify-content: flex-start !important;
            gap: 12px !important;
            align-self: stretch !important; /* prevents vertical centering tricks */
        }

        /* Inner wrappers: never center at this width */
        .guild-card .guild-info,
        .guild-card .guild-name-row,
        .guild-card .guild-stats {
            text-align: left !important;
            justify-content: flex-start !important;
            align-items: flex-start !important;
        }

        /* If you hide the join button on mobile, ensure its absence doesn't recenter the row */
        .guild-card .join-button {
            display: none !important;
        }
}
.discord-card .dc-name-row {
    display: inline-flex;
    align-items: center;
    gap: 6px; /* space between name and first badge */
}

.dc-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dc-badge {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}
/* Discord badge row */
.dc-name-row .dc-badges {
    display: inline-flex;
    align-items: center;
    margin-left: -10px; /* space from the name */
    gap: 0px; /* spacing between badges */
}

/* Each badge */
.dc-badge {
    width: 15px; /* smaller size */
    height: 15px;
    object-fit: contain;
    vertical-align: middle;
}
.guild-name-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.g-verified.icon-circle {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: -2px; /* 👈 pull closer to the name */
}

    .g-verified.icon-circle img {
        width: 16px;
        height: 16px;
        display: block;
    }
/* Generic tooltip for any .icon-circle.tip */
.icon-circle.tip {
    position: relative;
}

    .icon-circle.tip::after {
        content: attr(aria-label);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translate(-50%, -6px);
        background: rgba(0,0,0,.9);
        color: #fff;
        font-size: 12px;
        line-height: 1;
        padding: 6px 8px;
        border-radius: 8px;
        white-space: nowrap;
        box-shadow: 0 4px 16px rgba(0,0,0,.25);
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease;
        z-index: 10;
    }

    .icon-circle.tip::before {
        content: "";
        position: absolute;
        bottom: calc(100% - 2px);
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: rgba(0,0,0,.9);
        opacity: 0;
        transition: opacity .15s ease;
        z-index: 10;
    }

    .icon-circle.tip:hover::after,
    .icon-circle.tip:focus-visible::after,
    .icon-circle.tip:hover::before,
    .icon-circle.tip:focus-visible::before {
        opacity: 1;
        transform: translate(-50%, -8px);
    }
#page-veil {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999; /* above everything */
    opacity: 1;
    transition: opacity 0.23s ease;
}

    #page-veil.hide {
        opacity: 0;
        pointer-events: none;
    }
/* Discord embed: make the "View" button shorter */
.discord-card .dc-actions .btn.small {
    font-size: 12px; /* smaller text */
    padding: 4px 10px; /* ↓ vertical padding = shorter button */
    line-height: 1.1; /* keeps text snug */
    border-radius: 8px; /* optional: slightly tighter corners */
}

/* ensure the actions row centers the shorter button */
.discord-card .dc-actions {
    display: flex;
    align-items: center;
}

.guild-card .join-button {
    font-size: 12px;
    padding: 2px 8px; /* small vertical padding */
    line-height: 1.0; /* tighter line height */
    min-height: 0; /* override any global min-height */
    height: 30px; /* let content define the height */
    border-radius: 6px;
}
.profile-avatar,
.profile-avatar.avatar-border-none {
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* Strip the card chrome but keep the element so transforms (tilt) still apply */
.profile-shell.hide-container .profile-body {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* If your banner/outline adds “container” feel, neutralize those too */
.profile-shell.hide-container .profile-banner {
    filter: var(--banner-blur, none);
}

.profile-shell.hide-container { /* no border/shadow on the outer shell */
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
}

.profile-embeds .guild-name-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Verified server badge + tooltip (clean) */
.profile-embeds .guild-verified {
    position: relative; /* anchor for ::before/::after */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    overflow: visible !important; /* override any earlier hidden */
}

    .profile-embeds .guild-verified img {
        width: 100%;
        height: 100%;
        display: block;
        border-radius: 999px; /* keep the gif circular */
    }

    /* Tooltip bubble */
    .profile-embeds .guild-verified::after {
        content: attr(aria-label);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translate(-50%, -6px);
        background: rgba(0,0,0,.9);
        color: #fff;
        font-size: 12px;
        line-height: 1;
        padding: 6px 8px;
        border-radius: 8px;
        white-space: nowrap;
        box-shadow: 0 4px 16px rgba(0,0,0,.25);
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease;
        z-index: 20; /* above nearby content */
    }

    /* Little arrow */
    .profile-embeds .guild-verified::before {
        content: "";
        position: absolute;
        bottom: calc(100% - 2px);
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: rgba(0,0,0,.9);
        opacity: 0;
        transition: opacity .15s ease;
        z-index: 20;
    }

    /* Show on hover + keyboard focus */
    .profile-embeds .guild-verified:hover::after,
    .profile-embeds .guild-verified:focus-visible::after,
    .profile-embeds .guild-verified:hover::before,
    .profile-embeds .guild-verified:focus-visible::before {
        opacity: 1;
        transform: translate(-50%, -8px);
    }

/* Safety: make sure parent row doesn't clip the tooltip */
.profile-embeds .guild-name-row {
    overflow: visible;
}
/* === Discord avatar layering fix (append at end) ========================= */
.discord-card .dc-avatar,
.dc-avatar {
    position: relative;
    overflow: visible;
    z-index: 1; /* base stacking context under deco & presence */
}

    .discord-card .dc-img.base,
    .dc-avatar .dc-img.base {
        position: relative;
        z-index: 1; /* photo under decoration */
        border-radius: 50%;
        clip-path: circle(50% at 50% 50%);
    }

    .discord-card .dc-deco,
    .dc-avatar .dc-deco {
        position: absolute;
        inset: calc(-1 * var(--deco-bleed, 6px));
        width: calc(100% + var(--deco-bleed, 6px)*2);
        height: calc(100% + var(--deco-bleed, 6px)*2);
        object-fit: contain;
        object-position: center;
        transform: scale(var(--deco-scale, 1.12));
        transform-origin: center;
        pointer-events: none;
        z-index: 2; /* <<< decoration ABOVE the photo */
    }

.dc-presence {
    z-index: 3;
}
/* presence pill above both */

/* Hide any stray native UI if a browser tries to show it anyway */
.no-ui-video::-webkit-media-controls {
    display: none !important;
}

.no-ui-video::-webkit-media-controls-enclosure,
.no-ui-video::-webkit-media-controls-panel {
    display: none !important;
}


/* === Mobile actions: keep on one row & vertically centered, shrink buttons === */
@media (max-width:520px) {
    /* Force row layout only for Discord user & Discord server embeds */
    .embed-card.discord-card,
    .embed-card.guild-card {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
    }

    /* Left side may shrink so actions don't drop */
    .discord-card .dc-left,
    .guild-card .g-left {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        gap: 10px;
    }

    /* Right-side actions visible & centered vertically */
    .discord-card .dc-actions {
        display: flex !important;
        flex: 0 0 auto;
        align-self: center !important;
    }

    .guild-card .join-button {
        display: inline-flex !important;
        flex: 0 0 auto;
        align-self: center !important;
    }

    /* Compact buttons on phones */
    .discord-card .dc-actions .btn,
    .guild-card .join-button {
        font-size: 11px;
        padding: 4px 10px;
        height: 28px;
        line-height: 1.05;
        border-radius: 8px;
    }

    /* Trim status so the right button doesn't get pushed down */
    .discord-card .dc-status-sub {
        display: none !important;
    }

    .discord-card .dc-status-title {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Undo any vertical nudge on the name row */
    .discord-card .dc-name-row {
        transform: none !important;
    }

    /* Server row alignment stays left name / right button */
    .guild-card {
        justify-content: space-between !important;
        align-items: center !important;
        text-align: left !important;
    }
}

/* Ultra-narrow phones: make buttons a touch smaller */
@media (max-width:380px) {
    .discord-card .dc-actions .btn,
    .guild-card .join-button {
        font-size: 10.5px;
        padding: 3px 8px;
        height: 26px;
    }
}
/* === Phone: stack server stats vertically & tighten === */
@media (max-width:480px) {
    .guild-card .guild-info {
        gap: 2px !important;
    }

    .guild-card .guild-stats {
        display: flex !important;
        flex-direction: column !important; /* stack Online above Members */
        gap: 2px !important; /* closer vertically */
        align-items: flex-start !important;
    }

        .guild-card .guild-stats .stat {
            gap: 6px !important;
            line-height: 1.05 !important;
        }

            .guild-card .guild-stats .stat span {
                font-size: 10.5px !important;
                line-height: 1.05 !important;
            }

        .guild-card .guild-stats .dot {
            width: 6px !important;
            height: 6px !important;
        }

        /* If a previous rule hid "Members", ensure it shows */
        .guild-card .guild-stats .stat:nth-child(2) {
            display: inline-flex !important;
        }
}

@media (max-width:380px) {
    .guild-card .guild-stats .stat span {
        font-size: 10px !important;
    }
}

/* ===== Track Player chip (top-right) ===== */
.track-player {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 2000; /* below page veil(9999), above content */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: hsla(0,0%,100%,.03);
    backdrop-filter: blur(var(--card-blur, 8px));
    -webkit-backdrop-filter: blur(var(--card-blur, 8px));
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

    .track-player .tp-title {
        color: var(--text);
        font-weight: 600;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 42vw;
    }

    .track-player .tp-toggle {
        width: 28px;
        height: 28px;
        display: grid;
        place-items: center;
        background: transparent;
        border: 0;
        color: var(--accent);
        cursor: pointer;
        border-radius: 6px;
        -webkit-tap-highlight-color: transparent;
    }

        .track-player .tp-toggle:hover {
            filter: brightness(1.05);
            transform: translateY(-1px);
            transition: .15s;
        }

        .track-player .tp-toggle svg {
            width: 18px;
            height: 18px;
            fill: currentColor;
        }

    .track-player.collapsed .tp-title {
        display: none;
    }

@media (max-width: 600px) {
    .track-player {
        right: 12px;
        top: 12px;
        height: 32px;
        padding: 0 8px;
    }

        .track-player .tp-title {
            font-size: 11px;
            max-width: 60vw;
        }

        .track-player .tp-toggle {
            width: 24px;
            height: 24px;
        }

            .track-player .tp-toggle svg {
                width: 16px;
                height: 16px;
            }
}
.track-player {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 2000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: hsla(0,0%,100%,.03);
    backdrop-filter: blur(var(--card-blur,8px));
    -webkit-backdrop-filter: blur(var(--card-blur,8px));
}

    .track-player .tp-title {
        color: var(--text);
        font-weight: 600;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 42vw;
    }

    .track-player .tp-toggle {
        width: 26px;
        height: 26px;
        display: grid;
        place-items: center;
        background: transparent;
        border: 0;
        color: var(--accent);
        cursor: pointer;
        border-radius: 6px;
    }

        .track-player .tp-toggle svg {
            width: 16px;
            height: 16px;
            fill: currentColor;
        }

    .track-player.collapsed .tp-title {
        display: none;
    }

@media (max-width:600px) {
    .track-player {
        right: 12px;
        top: 12px;
        height: 30px;
        padding: 0 8px;
    }

        .track-player .tp-title {
            font-size: 11px;
            max-width: 60vw;
        }

        .track-player .tp-toggle {
            width: 22px;
            height: 22px;
        }
}
/* ============ Track Player (clean) ============ */
:root {
    --tp-open-h: 56px; /* height when open */
    --tp-gap: 12px;
    --tp-collapsed: 44px; /* square size when collapsed */
    --tp-cover: 36px; /* cover size when open */
    --tp-icon: 28px; /* SVG squiggly size when collapsed */
}

/* Chip container (open state) */
.track-player {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: var(--tp-gap);
    height: var(--tp-open-h);
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.55);
    border: 1px solid rgba(120,113,108,.22);
    box-shadow: 0 10px 30px rgba(0,0,0,.30);
    backdrop-filter: blur(var(--card-blur,8px));
    transition: width .15s ease, height .15s ease, padding .15s ease, gap .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}

    /* Collapsed → invisible square with only the squiggly */
    .track-player.collapsed {
        width: var(--tp-collapsed);
        height: var(--tp-collapsed);
        padding: 0;
        gap: 0;
        justify-content: center;
        background: transparent;
        border-color: transparent;
        box-shadow: none;
        backdrop-filter: none;
        cursor: pointer;
    }

        /* Hide everything except the cover in collapsed */
        .track-player.collapsed .tp-title,
        .track-player.collapsed .tp-controls,
        .track-player.collapsed .tp-vol,
        .track-player.collapsed .tp-btn.tp-toggle { /* ← hide the little right icon */
            display: none !important;
        }

/* Cover (icon holder) */
.tp-cover {
    width: var(--tp-cover);
    height: var(--tp-cover);
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(120,113,108,.22);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    color: #a8a29e; /* not used in open state for the wave; fine for any fallback glyph */
}

/* Collapsed cover becomes transparent + fits the icon exactly */
.track-player.collapsed .tp-cover {
    width: var(--tp-icon);
    height: var(--tp-icon);
    border: 0;
    background: transparent;
    border-radius: 0;
    color: var(--accent, #F97316); /* squiggly uses currentColor */
    filter: drop-shadow(0 0 3.5px var(--accent-glow, rgba(236,72,153,.5)));
    font-size: 0;
    line-height: 0; /* nuke any stray text glyphs */
}

/* Wave: hidden when open; shown when collapsed */
.tp-wave {
    display: none;
}

.track-player.collapsed .tp-wave {
    display: block;
    width: 100%;
    height: 100%;
}

/* Title */
.tp-title {
    color: var(--text, #e5e7eb);
    font-weight: 600;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controls */
.tp-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-btn {
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--accent, #F97316);
    padding: 6px;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

    .tp-btn:hover {
        filter: brightness(1.1);
    }

    .tp-btn svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
        filter: drop-shadow(0 0 3.5px var(--accent-glow, rgba(236,72,153,.5)));
    }

/* Volume */
.tp-vol {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-volbar {
    width: 80px;
    height: 3px;
    background: rgba(255,255,255,.2);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.tp-volfill {
    height: 100%;
    background: var(--accent, #F97316);
    border-radius: 3px;
    width: 30%;
    position: relative;
}

.tp-volhandle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent, #F97316);
    border-radius: 50%;
}

/* bump icon size a touch */
.tp-btn svg {
    width: 22px;
    height: 22px;
}

/* make the triangle feel as big as the pause bars */
.tp-btn .icon-play {
    transform: scale(1.15);
    transform-origin: center;
}

.tp-btn .icon-pause {
    transform: none;
}
/* The left circle */
.track-player .tp-cover {
    position: relative;
    width: 44px;
    height: 44px; /* match your existing size */
    border-radius: 9999px;
    overflow: hidden;
}

/* The uploaded cover image — hidden when collapsed */
.track-player .tp-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
    opacity: 0; /* hidden while collapsed */
    transition: opacity .2s ease;
    pointer-events: none;
}

/* When the player is expanded, show the image and fade out the SVG */
.track-player:not(.collapsed) .tp-cover-img {
    opacity: 1;
}

.track-player:not(.collapsed) .tp-cover .tp-wave {
    opacity: 0;
    transition: opacity .2s ease;
}
@media (max-width: 768px) {
    #trackPlayer,
    .track-player {
        display: none !important;
    }
}
/* smoother dragging on phones: prevent page scroll while sliding */
.tp-volbar {
    touch-action: none;
    user-select: none;
    cursor: pointer;
}

/* FIX: show and stack “Last active …” under the status on phones */
@media (max-width:520px) {
    .discord-card .dc-status.inline-status {
        display: inline-grid !important; /* two-line layout */
        grid-auto-rows: auto;
        gap: 2px;
    }

    .discord-card .dc-status-sub {
        display: block !important; /* make sure it isn’t suppressed */
        font-size: 10.5px; /* your current mobile size */
        line-height: 1.2;
        opacity: .85;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
/* Public profile: hide the numeric Discord ID row */
.profile-shell .discord-card .dc-id {
    display: none !important;
}
/* On phones, let JS add the ellipsis, not the browser */
@media (max-width:520px) {
    .dc-status-title.no-gap-ellipsis {
        text-overflow: clip; /* turn off native ellipsis */
    }
}
/* Mobile: remove the space between name and status */
@media (max-width:520px) {
    .discord-card .dc-name-row {
        margin-bottom: 0 !important;
        /* keep or remove the nudge; desktop uses translateY(8px) */
        transform: none !important;
    }

    .discord-card .dc-status.inline-status {
        margin-top: 0 !important;
    }

    /* (optional) If you still see a hairline gap on some phones: */
    /* .discord-card .dc-status.inline-status { margin-top: -1px !important; } */
}
/* Display name: whisper glow */
.profile-shell .profile-name {
    text-shadow: var(--glow-outline), 0 0 var(--name-glow-blur) var(--name-glow-color), 0 0 calc(var(--name-glow-blur) * 1.6) var(--name-glow-color);
}
/* Social icons: tiny halo even when brand theme is ON */
.profile-shell .profile-socials .icon-circle svg {
    filter: drop-shadow(0 0 3px var(--accent-glow));
}

/* “View” / “Join” pills on embeds: icon/text glow on hover only */
.embed-card .btn.ghost.small:hover,
.embed-card .join-button:hover {
    text-shadow: 0 0 6px var(--accent-glow);
}
.profile-shell .profile-bio {
    text-shadow: var(--glow-outline), 0 0 var(--bio-glow-blur) var(--bio-glow-color), 0 0 calc(var(--bio-glow-blur) * 1.8) var(--bio-glow-color);
}
@media (max-width:480px) {
    .profile-shell .profile-bio {
        text-shadow: var(--glow-outline), 0 0 calc(var(--bio-glow-blur) * .85) var(--bio-glow-color), 0 0 calc(var(--bio-glow-blur) * 1.4) var(--bio-glow-color);
    }
}
.pill:hover,
.pill:focus-visible {
    box-shadow: 0 0 var(--link-glow-blur) var(--link-glow-color), inset 0 0 calc(var(--link-glow-blur) * .6) var(--link-glow-color);
    text-shadow: 0 0 calc(var(--link-glow-blur) * .6) var(--link-glow-color);
}
.profile-socials .icon-circle:hover svg,
.profile-socials .icon-circle:focus-visible svg {
    filter: drop-shadow(0 0 calc(var(--link-glow-blur) * .9) var(--link-glow-color)) drop-shadow(0 0 calc(var(--link-glow-blur) * .5) var(--link-glow-color));
}


/* ============================
   TAG (chip) glow — toggleable
   ============================ */

/* Base: keep layout the same; render glow via a pseudo-layer */
.profile-tags .tag-pill {
    position: relative;
    isolation: isolate; /* stack context so the glow layer sits under text */
}

/* Whisper glow always-on (optional; comment out if you only want hover) */
html.tag-glow-on .profile-tags .tag-pill {
    /* light outer + tiny inner for readability */
    text-shadow: var(--glow-outline), 0 0 calc(var(--tag-glow-blur) * .6) var(--tag-glow-color);
    box-shadow: 0 0 calc(var(--tag-glow-blur) * .7) var(--tag-glow-color) inset;
}

    /* Stronger halo on hover/focus */
    html.tag-glow-on .profile-tags .tag-pill:hover,
    html.tag-glow-on .profile-tags .tag-pill:focus-visible {
        box-shadow: 0 0 var(--tag-glow-blur) var(--tag-glow-color), inset 0 0 calc(var(--tag-glow-blur) * .6) var(--tag-glow-color);
        text-shadow: var(--glow-outline), 0 0 var(--tag-glow-blur) var(--tag-glow-color);
        transition: box-shadow .15s ease, text-shadow .15s ease, transform .15s ease;
        transform: translateY(-1px);
    }

    /* Optional: dedicated halo layer for extra bloom without affecting layout */
    html.tag-glow-on .profile-tags .tag-pill::after {
        content: "";
        position: absolute;
        inset: -2px; /* tiny bleed so the glow peeks around edges */
        border-radius: inherit;
        pointer-events: none;
        z-index: -1; /* behind the chip content */
        box-shadow: 0 0 var(--tag-glow-blur) var(--tag-glow-color), 0 0 calc(var(--tag-glow-blur) * 1.6) var(--tag-glow-color);
        opacity: .55; /* subtle at rest */
        transition: opacity .15s ease;
    }

    html.tag-glow-on .profile-tags .tag-pill:hover::after,
    html.tag-glow-on .profile-tags .tag-pill:focus-visible::after {
        opacity: .9; /* stronger on interaction */
    }

/* Accessibility: tone down glow for users who prefer less motion/intensity */
@media (prefers-reduced-motion: reduce) {
    html.tag-glow-on .profile-tags .tag-pill,
    html.tag-glow-on .profile-tags .tag-pill:hover,
    html.tag-glow-on .profile-tags .tag-pill:focus-visible {
        transition: none;
    }
}
