/* static/css/profile.css - Prosty layout jak na zdjęciu */

html {
    outline: none !important;
    border: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none !important;
}

*::before,
*::after {
    outline: none !important;
}

body {
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-color, #0a0a0a);
    color: var(--text-color, #ffffff);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Hide scrollbar */
    outline: none !important;
    border: none !important;
}

/* Preset font classes for username/description selection */
.font-arial { font-family: Arial, Helvetica, sans-serif; }
.font-times { font-family: "Times New Roman", Times, serif; }
.font-courier { font-family: "Courier New", Courier, monospace; }
.font-georgia { font-family: Georgia, serif; }
.font-verdana { font-family: Verdana, Geneva, sans-serif; }
.font-comic { font-family: "Comic Sans MS", "Comic Sans", cursive; }
.font-impact { font-family: Impact, Charcoal, sans-serif; }
.font-trebuchet { font-family: "Trebuchet MS", Helvetica, sans-serif; }
.font-palatino { font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; }
.font-lucida { font-family: "Lucida Console", Monaco, monospace; }

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(2px 2px at 20% 30%, white, transparent),
                radial-gradient(2px 2px at 60% 70%, white, transparent),
                radial-gradient(1px 1px at 50% 50%, white, transparent);
    background-size: 200% 200%;
    animation: twinkle 5s ease-in-out infinite;
    opacity: 0.2;
    z-index: 0;
}

/* Cursor trail GIFs */
.cursor-trail-container {
    pointer-events: none;
}
.cursor-trail {
    image-rendering: -webkit-optimize-contrast;
    mix-blend-mode: screen;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    border-radius: 999px;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.3; }
}

/* Gdy profile opacity jest 0 - transparentny background */
:root:has(.profile-card) {
    /* Backwards compatible: support both unitless decimals (0..1) and percentages (0%..100%)
       --profile-opacity    : 0..1 (existing default)
       --profile-opacity-percent: 0%..100% (new fallback used by dashboard slider)

       Compute internal decimals with fallbacks so other rules can reliably use --card-bg-opacity
    */
    /* Properly convert percentage like "50%" to "0.5" by dividing by 100% (unit-preserving calc) */
    --profile-opacity-decimal: var(--profile-opacity, calc(var(--profile-opacity-percent, 95%) / 100%));
    --profile-bg-opacity-decimal: var(--profile-bg-opacity, var(--profile-opacity-decimal));
    --profile-fg-opacity-decimal: var(--profile-fg-opacity, var(--profile-opacity-decimal));
    --audio-bg-opacity-decimal: var(--audio-bg-opacity, var(--profile-bg-opacity-decimal));

    --card-bg-opacity: var(--profile-bg-opacity-decimal);
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 750px;
    padding: 20px;
}

.profile-card {
    background: rgba(17, 17, 17, var(--card-bg-opacity, var(--profile-opacity-decimal, 0.95)));
    backdrop-filter: blur(calc(20px * var(--card-bg-opacity, var(--profile-opacity-decimal, 0.95))));
    border-radius: var(--profile-border-radius, 16px);
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, calc(0.6 * var(--card-bg-opacity, var(--profile-opacity-decimal, 0.95))));
    /* Use user border when enabled (width becomes 0px when disabled) */
    --profile-border-width-calc: calc(var(--profile-border-enabled, 0) * var(--profile-border-width, 2px));
    border: var(--profile-border-width-calc, 0px) solid var(--profile-border-color, #2b2b2b);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: none;
    /* Allow full-profile opacity control (foreground elements) through --profile-fg-opacity */
     /* Keep foreground fully visible by default; control background with --card-bg-opacity.
         If you want to also fade foreground, there are specific selectors that use
         --profile-fg-opacity-decimal. Removing card-level opacity ensures children stay opaque. */
     opacity: 1;
    transform: scale(1) translateY(0);
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

    /* Corner stats (top-left/top-right/bottom-left/bottom-right) */
    .stats-corners {
        position: absolute;
        inset: 0; /* fill the profile-card so corners are positioned relative to it */
        pointer-events: none;
        z-index: 3;
    }
    .stats-corner {
        position: absolute;
        display: flex;
        gap: 8px;
        align-items: center;
        padding: 10px 14px;
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(10px);
        color: var(--text-color, #fff);
        font-size: 0.9rem;
        pointer-events: auto; /* allow hover interactions on the container (if desired) */
    }
    .stats-corner .stat-item {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .stats-corner.top-left { top: 12px; left: 12px; }
    .stats-corner.top-right { top: 12px; right: 12px; }
    .stats-corner.bottom-left { bottom: 12px; left: 12px; }
    .stats-corner.bottom-right { bottom: 12px; right: 12px; }

/* Gdy opacity jest na 0 - usuń wszystko */
:root[style*="--profile-opacity: 0;"] .profile-card, body[style*="--profile-opacity: 0;"] .profile-card {
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
}

:root[style*="--profile-opacity: 0;"] .profile-card .profile-banner, body[style*="--profile-opacity: 0;"] .profile-card .profile-banner {
    border-radius: 0 !important;
}

@keyframes profileEntryGate {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(40px);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Volume Control - Fixed to Top Left of Screen */
.volume-control-fixed {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10000; /* Musi być nad Entry Gate (9999) */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1.3rem;
    box-shadow: none !important;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.volume-icon-btn:hover {
    background: transparent !important;
    border: none !important;
    color: var(--accent-color, #5865f2);
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(0 0 12px var(--accent-color, #5865f2));
}

.volume-slider-popup {
    background: rgba(20, 20, 25, 0.98);
    backdrop-filter: blur(20px);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                visibility 0s linear 0.3s, 
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 180px;
    pointer-events: none;
}

.volume-slider-popup.show,
.volume-control-fixed:hover .volume-slider-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: all;
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                visibility 0s linear 0s, 
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.volume-slider-popup:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.volume-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

/* ==================== AUDIO PLAYER WIDGET ==================== */
.audio-player-widget {
    /* Use audio-bg-opacity to only alter the background blur/color while keeping icons readable */
    background: rgba(30, 30, 35, var(--audio-bg-opacity-decimal, var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    backdrop-filter: blur(calc(10px * var(--audio-bg-opacity-decimal, var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95)))));
    border-radius: 0;
    padding: 1rem 1.5rem;
    margin: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-top: 1px solid rgba(150, 150, 160, calc(0.2 * var(--audio-bg-opacity-decimal, var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95)))));
    border-bottom: 1px solid rgba(150, 150, 160, calc(0.2 * var(--audio-bg-opacity-decimal, var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95)))));
    pointer-events: all;
    position: relative;
    z-index: 10;
    transform-style: flat;
    transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

/* Control the audio widget BACKGROUND opacity separately from the controls/icons.
   Buttons and text should remain fully opaque while the background can fade with the profile.
   Use --audio-bg-opacity to allow only the background/backdrop to change. */
.audio-player-widget {
    transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

/* Gdy profile opacity jest 0 - music widget też jak discord */
:root[style*="--profile-opacity: 0;"] .audio-player-widget, body[style*="--profile-opacity: 0;"] .audio-player-widget {
    background: transparent !important;
    border: none !important;
    border-color: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

/* When profile is fully hidden (0%) disable and hide the audio widget */
body.profile-faded .audio-player-widget,
:root.profile-faded .audio-player-widget {
    background: transparent !important;
    border: none !important;
    border-color: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.audio-player-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.audio-cover {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--icon-color, #fff);
}

.audio-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.audio-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color, #fff);
}

/* Always keep icons / controls opaque even when background is faded (except when hidden by profile-faded) */
.audio-player-widget .audio-player-controls,
.audio-player-widget .audio-player-left .audio-info,
.audio-player-widget .audio-player-left .audio-cover,
.audio-player-widget .audio-player-left .audio-time {
    opacity: 1 !important; /* keep foreground fully opaque while background fades */
}

.audio-time {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 0.25rem;
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 6px; /* smaller spacing so prev / play / next sit tighter together */
    justify-content: flex-end; /* keep controls on the right side of the widget */
}

/* Force equal button sizing so icons are visually aligned */
.audio-player-controls .audio-control-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.audio-control-btn.play-btn {
    width: 44px; /* ensure play button same size */
    height: 44px;
}

/* Avatar decoration overlay: ensure decoration GIF/PNG overlays avatar correctly */
.avatar-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.avatar-wrapper .avatar {
    display: block;
    width: var(--profile-avatar-size, 112px);
    height: var(--profile-avatar-size, 112px);
    border-radius: 50%;
    object-fit: cover;
}
.avatar-wrapper .avatar {
    display: block;
    width: var(--profile-avatar-size, 112px);
    height: var(--profile-avatar-size, 112px);
    border-radius: 50%;
    object-fit: cover;
    /* ensure avatar participates in stacking; keep below decorations */
    position: relative;
    z-index: 5;
}
.avatar-wrapper .avatar-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* default: render behind avatar; add .front class to bring forward */
    z-index: 2;
    object-fit: contain;
    mix-blend-mode: normal;
}

/* If the decoration portal is moved inside the wrapper (server-side markup),
   make it fill the wrapper so the decoration covers the avatar fully. */
.avatar-wrapper > .decoration-portal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100020; /* sits above border by default; adjust if needed */
}
.avatar-wrapper > .decoration-portal .avatar-decoration-portal {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Utility class: force decoration in front of avatar when needed */
.avatar-wrapper .avatar-decoration.front {
    z-index: 70; /* decoration now above border */
}

/* Draw avatar border above decorations using a pseudo-element on the wrapper when enabled */
.avatar-wrapper.with-border::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--profile-avatar-size, 112px);
    height: var(--profile-avatar-size, 112px);
    border-radius: 50%;
    pointer-events: none;
    box-sizing: border-box;
    /* Use CSS custom properties set inline from template */
    border: var(--profile-border-width, 2px) solid var(--profile-border-color, #2b2b2b);
    z-index: 10; /* keep border below decoration/front */
}

/* If decoration image has transparent padding, allow it to overflow slightly for nicer framing */
.avatar-wrapper .avatar-decoration.overflow {
    width: calc(100% + 24px);
    height: calc(100% + 24px);
    left: -12px;
    top: -12px;
    z-index: 2; /* keep overflowed decoration behind avatar by default */
}

.audio-control-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    pointer-events: all;
    position: relative;
    z-index: 100;
}

.audio-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.audio-control-btn.play-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    color: #fff;
    font-size: 1rem;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Final override: ensure all three controls are identical in size and icons centered.
   Placed late in the file to override earlier, conflicting rules. */
.audio-player-controls .audio-control-btn,
.audio-player-controls .audio-control-btn.play-btn {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important; /* keeps icons similar visual weight */
}

.audio-player-controls .audio-control-btn i,
.audio-player-controls .audio-control-btn .play-icon,
.audio-player-controls .audio-control-btn .pause-icon {
    display: inline-block !important;
    width: auto !important;
    text-align: center !important;
    line-height: 1 !important;
}

/* Strong centering: make icon elements use flex centering and occupy full button height
   This prevents optical misalignment caused by glyph metrics differences. */
.audio-player-controls .audio-control-btn i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    width: 16px !important;
    line-height: normal !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important; /* remove any residual transform */
    font-size: 16px !important; /* unify icon visual size */
}

/* Minor visual centering: FontAwesome play triangle often reads slightly to the right.
   Nudge the play icon a hair left and slightly down so it appears centered between prev/next. */
.audio-control-btn.play-btn .play-icon {
    transform: none !important;
}

/* Position play/pause icons absolutely inside the play button so toggling opacity
   doesn't change layout or cause the icons to jump. They are centered with transforms. */
.audio-control-btn.play-btn {
    position: relative !important;
}
.audio-control-btn.play-btn .play-icon,
.audio-control-btn.play-btn .pause-icon {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, calc(-50% - 2px)) !important; /* base: nudge icons 2px higher */
    font-size: 16px !important;
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    line-height: 1 !important;
    transition: opacity 0.12s linear, transform 0.12s linear !important;
    color: inherit !important;
}

/* Nudge play icon slightly lower so it visually centers beneath the skip icons */
.audio-control-btn.play-btn .play-icon {
    transform: translate(-50%, calc(-50%)) !important; /* move play back to center */
}

/* Small nudge: move the pause glyph a touch to the right to avoid visual jumping when toggling */
.audio-control-btn.play-btn .pause-icon {
    /* keep pause at center; no horizontal transform so it won't jump when toggled */
    transform: translate(-50%, -50%) !important;
}

/* Ensure skip icons match play icon metrics */
.audio-player-controls #prevBtn i,
.audio-player-controls #nextBtn i {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
}

.audio-control-btn.play-btn .pause-icon {
    opacity: 0;
    visibility: hidden;
}

.audio-control-btn.play-btn .play-icon {
    opacity: 1;
    visibility: visible;
}

/* Keep play button default vertical alignment (no translate) */
.audio-control-btn.play-btn {
    transform: none;
}

.audio-control-btn.play-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.profile-card-hidden {
    opacity: 0 !important;
    transform: translateY(100vh) !important;
    animation: none !important;
}

.profile-card-show {
    animation: profileEntryGate 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes slideUpFadeIn {
    0% {
        opacity: 0;
        transform: translateY(100vh);
    }
        100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) rotateY(0);
    }
}

/* TOP SECTION - Avatar (left) + Info (right) */
.profile-top-section {
    display: flex;
    gap: 25px;
    padding: 30px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

/* Wide Profile Banner (like 2nd screenshot) */
.profile-banner-wide {
    width: calc(100% + 60px);
    height: 150px;
    margin: -30px -30px 0 -30px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    position: relative;
    z-index: 0;
    margin-bottom: -100px;
}

/* Banner with less overlap when top stats are present */
.profile-banner-wide.has-top-stats {
    margin-bottom: -70px;
}

.profile-banner-wide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* AVATAR - PO LEWEJ STRONIE */
.avatar-section {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.avatar-wrapper {
    position: relative;
    cursor: pointer;
    z-index: 2;
    /* Decoration sizing/offset controls (can be overridden per-theme or per-user) */
    --decoration-scale: 1.28;
    --decoration-offset-y: -0.12; /* negative = move up */
}

.avatar-wrapper::before {
    content: attr(data-uid);
    position: absolute;
    bottom: -42px;
    left: 50%;
    transform: translateX(-50%);
    background: #000000;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 100000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.avatar-wrapper::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #000000;
    z-index: 100000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.avatar-wrapper:hover::before,
.avatar-wrapper:hover::after {
    opacity: 1;
}

.avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    object-fit: cover;
}

.avatar-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    pointer-events: none;
    object-fit: cover;
}

/* Ensure decoration with .front is above other avatar pseudo elements and avatar image */
.avatar { position: relative; z-index: 5; }
.avatar-decoration.front { z-index: 100010; }

/* Portal decoration positioned above wrapper so it can appear above border/pseudo-elements */
.decoration-portal {
    position: absolute;
    /* position will be computed and set inline by JS for precise alignment */
    top: 0;
    left: 0;
    width: var(--profile-avatar-size, 140px);
    height: var(--profile-avatar-size, 140px);
    pointer-events: none;
    z-index: 200000; /* very high to ensure it sits above borders */
}
.avatar-decoration-portal {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* INFO SECTION - PO PRAWEJ */
.profile-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* USERNAME I BADGES W TYM SAMYM RZĘDZIE */
.username-badges-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-left: 0;
}

.username {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color, #ffffff);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.badges-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: fit-content;
    max-width: none;
    flex-shrink: 0;
    overflow-x: auto;
}

.badges-container:empty {
    display: none;
}

.badges-icons {
    display: inline-flex !important;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.badges-icons:empty {
    display: none !important;
}

.active-badge-container {
    display: inline-flex !important;
    gap: 6px;
    align-items: center;
}

.active-badge-container:empty {
    display: none !important;
}

.verified-badge {
    color: #5865f2;
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 0; /* controlled by container; set to 0 for precise positioning */
    position: relative; /* allow small vertical offset */
    top: 0px; /* moved 2px lower (adjusted) */
    z-index: 100000 !important; /* sit above username effect overlays */
    /* Prevent username effects from affecting the badge */
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transform: none !important;
    background-clip: initial !important;
    -webkit-background-clip: initial !important;
    mix-blend-mode: normal !important;
}

/* Partner badge uses same isolation rules as verified badge, color gold */
.partner-badge {
    color: #f0c419;
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 0;
    position: relative;
    top: 0px;
    z-index: 100000 !important;
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transform: none !important;
    background-clip: initial !important;
    -webkit-background-clip: initial !important;
    mix-blend-mode: normal !important;
}

.partner-badge-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0px;
    margin-right: 6px;
    position: relative;
    top: 0px;
    z-index: 100000 !important;
}

.partner-badge-container .partner-badge {
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transform: none !important;
    background: none !important;
}

/* Ensure badge never inherits username effect styles */
.username .verified-badge,
.username-text + .verified-badge,
.username > .verified-badge {
    color: #5865f2 !important;
    -webkit-text-fill-color: #5865f2 !important;
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transform: none !important;
    background: none !important;
    background-clip: initial !important;
    -webkit-background-clip: initial !important;
    mix-blend-mode: normal !important;
}

/* When badge is rendered in its own container, ensure it stays isolated */
.verified-badge-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* slightly closer spacing */
    margin-left: 0px;
    margin-right: 4px;
    position: relative;
    top: 0px;
    z-index: 100000 !important;
}

.partner-badge-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px; /* bring partner a bit closer to verified */
    margin-right: 6px;
    position: relative;
    top: 0px;
    z-index: 100000 !important;
}

.verified-badge-container .verified-badge {
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transform: none !important;
    background: none !important;
}

.bio {
    font-size: 0.95rem;
    color: var(--text-color, rgba(255, 255, 255, 0.7));
    line-height: 1.4;
    margin: 0;
    opacity: 0.85;
}

/* CUSTOM TAGS */
.custom-tags {

/* Username sparkle overlay fallback */
.username .username-sparkle-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: cover;
    /* Force visible fallback: ensure overlay is on top and uses normal blending so colors are visible */
    mix-blend-mode: normal !important;
    z-index: 2147483647 !important;
    opacity: 1 !important;
}
.username .username-text { position: relative; z-index: 2; }

/* Global overlay container placed inside .profile-card to avoid clipping */
.profile-card .username-sparkle-overlay-global {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 2147483646;
}
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.custom-tags-vertical {
    margin-top: 12px;
    margin-left: 0;
    justify-content: center;
}

.username-badges-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.custom-tag {
    display: inline-block;
    background: transparent;
    color: var(--text-color, #ffffff);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.custom-tag:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
}

/* LINKS SECTION */
.links-section {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, calc(0.05 * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    transition: border-color 0.3s ease;
}

/* Gdy profile opacity jest 0 */
:root[style*="--profile-opacity: 0;"] .links-section, body[style*="--profile-opacity: 0;"] .links-section {
    border-bottom: none !important;
}

/* SOCIAL ICONS - ROW */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    align-items: center;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--icon-color, rgba(255, 255, 255, 0.9));
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    box-shadow: none !important;
    overflow: visible;
    padding: 0;
    position: relative;
}

/* Custom tooltip for social icons */
.social-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #000000;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
}

.social-icon:hover::after {
    opacity: 1;
}

.social-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    border-radius: 0;
    z-index: -1;
    transition: all 0.3s ease;
}

.social-icon:hover::before {
    background: transparent;
}

.social-icon img {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 45px;
    height: 45px;
    object-fit: contain;
    display: block;
    filter: brightness(1.5) contrast(1.2);
    image-rendering: crisp-edges;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-icon i {
    color: var(--icon-color, rgba(255, 255, 255, 0.9));
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.social-icon:hover {
    background: transparent !important;
    color: var(--accent-color, #5865f2);
    transform: translateY(-5px) scale(1.15);
}

.social-icon:hover i {
    color: var(--accent-color, #5865f2);
    filter: drop-shadow(0 0 12px var(--accent-color, #5865f2));
}

.social-icon:hover img {
    filter: brightness(1.8) contrast(1.3) drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    transform: scale(1.1);
}

/* Decorative links (hover enabled, but no click) */
.social-icon.decorative-link {
    cursor: default;
    pointer-events: all;
}

.social-icon.decorative-link:hover {
    background: transparent !important;
    color: var(--accent-color, #5865f2);
    transform: translateY(-5px) scale(1.15);
}

.social-icon.decorative-link:hover i {
    color: var(--accent-color, #5865f2);
    filter: drop-shadow(0 0 12px var(--accent-color, #5865f2));
}

.social-icon.decorative-link:hover img {
    filter: brightness(1.8) contrast(1.3) drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    transform: scale(1.1);
}

/* Badges tooltip (built-in and custom)
   Uses data-tooltip or title attribute as tooltip text. Appears on hover and focus.
*/
.verified-badge,
.partner-badge,
.badges-icons img[data-tooltip],
.custom-badge-wrap[data-tooltip] {
    position: relative; /* ensure pseudo-element positions relative to badge/wrapper */
}

.verified-badge::after,
.partner-badge::after,
.badges-icons img::after,
.custom-badge-wrap::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #000000;
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
}

/* Show tooltip on hover and when focused (keyboard access) */
.verified-badge:hover::after,
.partner-badge:hover::after,
.badges-icons img:hover::after,
.custom-badge-wrap:hover::after,
.verified-badge:focus::after,
.partner-badge:focus::after,
.badges-icons img:focus::after,
.custom-badge-wrap:focus::after,
.verified-badge:focus-visible::after,
.partner-badge:focus-visible::after,
.badges-icons img:focus-visible::after,
.custom-badge-wrap:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

/* Ensure keyboard users can focus badges that are not naturally focusable (if needed)
   Templates may add tabindex or they can rely on anchors/buttons. This rule only
   gives a visual focus ring when element is focused.
*/
.verified-badge:focus,
.partner-badge:focus,
.badges-icons img:focus,
.custom-badge-wrap:focus {
    outline: 3px solid rgba(88,101,242,0.12);
    outline-offset: 4px;
}

/* DISCORD WIDGET */
.discord-widget {
    margin: 20px 30px;
    background: rgba(30, 30, 35, var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95)));
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(150, 150, 160, calc(0.2 * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    backdrop-filter: blur(calc(10px * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    transition: all 0.3s ease;
}

/* Gdy profile opacity jest 0 */
:root[style*="--profile-opacity: 0;"] .discord-widget, body[style*="--profile-opacity: 0;"] .discord-widget {
    background: rgba(30, 30, 35, 0.5) !important;
    border-color: rgba(150, 150, 160, 0.1) !important;
    backdrop-filter: blur(5px) !important;
}

:root[style*="--profile-opacity: 0;"] .discord-widget-below, body[style*="--profile-opacity: 0;"] .discord-widget-below {
    background: rgba(30, 30, 35, 0.5) !important;
    border-color: rgba(150, 150, 160, 0.1) !important;
    backdrop-filter: blur(5px) !important;
}

/* Discord Widgets Container */
.discord-widgets-container {
    margin: 20px 30px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    animation: none;
    opacity: 1;
    transform: translateY(0);
}

.profile-card-show .discord-widgets-container {
    animation: discordWidgetEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 1.4s forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
}

@keyframes discordWidgetEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.discord-widgets-container.discord-widgets-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* User widget styling */
.discord-widget.discord-widget-below {
    margin: 0;
    padding: 16px;
    background: rgba(30, 30, 35, var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95)));
    width: 100%;
    border: 1px solid rgba(150, 150, 160, calc(0.2 * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    border-radius: 12px;
    height: 104px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    backdrop-filter: blur(calc(10px * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    transition: all 0.3s ease;
}

/* Discord Server Widget - DOKŁADNIE JAK NA SS */
.discord-server-widget-compact {
    background: rgba(30, 30, 35, var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95)));
    border: 1px solid rgba(150, 150, 160, calc(0.2 * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    border-radius: 12px;
    padding: 16px;
    margin: 0;
    height: 104px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    backdrop-filter: blur(calc(10px * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    transition: all 0.3s ease;
}

/* Gdy profile opacity jest 0 */
body[style*="--profile-opacity: 0;"] .discord-server-widget-compact {
    background: rgba(30, 30, 35, 0.5) !important;
    border-color: rgba(150, 150, 160, 0.1) !important;
    backdrop-filter: blur(5px) !important;
}

.server-widget-content {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.server-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(88, 101, 242, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.server-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-info-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.server-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.server-widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.server-widget-subtitle {
    font-size: 0.85rem;
    color: rgba(150, 150, 160, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.server-join-btn {
    background: #248046 !important;
    color: #fff !important;
    padding: 8px 18px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    border: none !important;
    display: inline-block !important;
}

.server-join-btn:hover {
    background: #1a6334 !important;
    transform: translateY(-1px);
}

/* Gdy jest sam (bez server widget) - wyśrodkowany */
.discord-widgets-container:not(.discord-widgets-split) .discord-widget-below {
    max-width: 450px;
    width: fit-content;
    min-width: 320px;
    margin: 0 auto;
}

/* Gdy jest z server widget - pełna szerokość kolumny */
/* Gdy jest z server widget - pełna szerokość kolumny */
.discord-widget-left {
    width: 100%;
    max-width: none;
}

/* Server widget styling */
.discord-server-widget {
    margin: 0;
    display: none;
}

.discord-server-right {
    width: 100%;
}

.discord-widget.compact {
    padding: 12px;
}

.discord-widget-below.compact {
    padding: 12px 14px;
}

.discord-widget-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.discord-widget-loading i {
    font-size: 1.5rem;
    color: #5865f2;
    animation: pulse 2s ease-in-out infinite;
}

.discord-widget-error {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.discord-widget-error i {
    font-size: 1.5rem;
    color: rgba(88, 101, 242, 0.5);
}

.discord-error-text {
    flex: 1;
}

.discord-error-text strong {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.discord-error-text a {
    color: #5865f2;
    text-decoration: none;
}

.discord-error-text a:hover {
    text-decoration: underline;
}

.discord-widget-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.discord-widget-content.compact {
    gap: 12px;
    align-items: center;
}

.discord-avatar {
    position: relative;
    flex-shrink: 0;
}

.discord-widget-content.compact .discord-avatar img {
    width: 60px;
    height: 60px;
}

.discord-widget-below .discord-avatar img {
    width: 64px;
    height: 64px;
    border-width: 3px;
}

.discord-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(150, 150, 160, 0.3);
    transition: border-color 0.3s ease;
}

.discord-avatar:hover img {
    border-color: rgba(150, 150, 160, 0.6);
}

.discord-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid rgba(30, 30, 35, 1);
}

.discord-status-indicator.online {
    background: #23a55a;
}

.discord-status-indicator.idle {
    background: #f0b232;
}

.discord-status-indicator.dnd {
    background: #f23f43;
}

.discord-status-indicator.offline {
    background: #80848e;
}

.discord-info {
    flex: 1;
    min-width: 0;
}

.discord-username {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.discord-widget-content.compact .discord-username {
    font-size: 1rem;
}

.discord-widget-below .discord-username {
    font-size: 1.05rem;
    font-weight: 600;
}

.discord-widget-below .discord-handle {
    font-size: 0.8rem;
}

.discord-widget-below .discord-last-seen {
    font-size: 0.75rem;
}

.discord-badges {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    font-size: 1rem;
}

.discord-handle {
    font-size: 0.85rem;
    color: rgba(150, 150, 160, 0.8);
    margin-bottom: 4px;
}

.discord-widget-content.compact .discord-handle {
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.discord-last-seen {
    font-size: 0.75rem;
    color: rgba(150, 150, 160, 0.7);
    display: flex;
    align-items: center;
    gap: 4px;
    font-style: italic;
}

.discord-last-seen i {
    font-size: 0.7rem;
}

.discord-discriminator {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.discord-status-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    text-transform: capitalize;
}

.discord-activity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-top: 10px;
}

.discord-activity.spotify {
    background: linear-gradient(135deg, rgba(30, 215, 96, 0.15), rgba(0, 0, 0, 0.3));
    border: 1px solid rgba(30, 215, 96, 0.2);
}

.spotify-album,
.activity-image {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.discord-activity-icon {
    font-size: 1.2rem;
    color: #000000;
    flex-shrink: 0;
}

.discord-activity.spotify .discord-activity-icon {
    color: #1db954;
}

.discord-activity-details {
    flex: 1;
    min-width: 0;
}

.discord-activity-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.discord-activity-name i {
    margin-right: 6px;
    font-size: 0.85rem;
}

.discord-activity-state {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* STATS */
.profile-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    border-top: 1px solid rgba(255, 255, 255, calc(0.05 * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    border-bottom: 1px solid rgba(255, 255, 255, calc(0.05 * var(--profile-bg-opacity-decimal, var(--profile-opacity-decimal, 0.95))));
    transition: border-color 0.3s ease;
}

/* Gdy profile opacity jest 0 */
body[style*="--profile-opacity: 0;"] .profile-stats {
    border-top: none !important;
    border-bottom: none !important;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-color, rgba(255, 255, 255, 0.7));
    opacity: 0.85;
}

.stat-item i {
    color: #ff3366;
    font-size: 1rem;
}

.stat-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
}

/* MUSIC PLAYER */
.music-player {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.music-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent-color, #5865f2);
    flex-shrink: 0;
}

.music-info {
    flex: 1;
    min-width: 0;
}

.music-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color, #ffffff);
}

.music-time {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-color, rgba(255, 255, 255, 0.5));
    opacity: 0.7;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color, #5865f2);
    width: 0%;
    transition: width 0.1s linear;
}

.music-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.control-btn.main {
    width: 40px;
    height: 40px;
    background: var(--accent-color, #5865f2);
    color: #ffffff;
    font-size: 1rem;
}

.control-btn.main:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .container {
        max-width: 480px;
    }
    
    /* Banner adjustments for mobile */
    .profile-banner-wide {
        height: 120px;
        margin-bottom: -60px;
    }
    
    .profile-top-section {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        align-items: center;
        text-align: center;
    }
    
    .avatar {
        width: 110px;
        height: 110px;
    }
    
    .avatar-decoration {
        width: 110px;
        height: 110px;
    }
    
    .profile-info-section {
        align-items: center;
    }
    
    .username-badges-row {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Tags vertical mode on mobile */
    .custom-tags-vertical {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .username {
        font-size: 1.6rem;
    }
    
    .links-section,
    .profile-stats {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .music-player-bottom {
        padding: 12px 20px;
    }
    
    /* Hide tooltips on mobile (touch devices) */
    .social-icon::after,
    .badges-icons img::after,
    .avatar-wrapper::before,
    .avatar-wrapper::after {
        display: none;
    }
}

@media (max-width: 600px) {
    /* Bardzo mały ekran - całkowicie vertical layout */
    .profile-top-section {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        align-items: center;
        text-align: center;
    }
    
    .avatar-section {
        flex-shrink: 1;
    }
    
    .profile-info-section {
        align-items: center;
        width: 100%;
    }
    
    .username-badges-row {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        align-items: center;
    }
    
    .username {
        justify-content: center;
    }
    
    .badges-container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    
    /* Smaller banner on very small screens */
    .profile-banner-wide {
        height: 100px;
        margin-bottom: -50px;
    }
    
    .profile-top-section {
        padding: 15px;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .avatar-decoration {
        width: 100px;
        height: 100px;
    }
    
    .username {
        font-size: 1.4rem;
    }
    
    .custom-tag {
        font-size: 0.65rem;
        padding: 3px 10px;
    }
    
    .social-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .social-icon img {
        width: 40px;
        height: 40px;
    }
    
    .music-controls {
        width: 100%;
        justify-content: center;
    }
}

/* USERNAME EFFECTS */
.username.glow-effect {
    text-shadow: 0 0 10px var(--accent-color),
                 0 0 20px var(--accent-color);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.username.rainbow-effect {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-flow 3s linear infinite;
}

@keyframes rainbow-flow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.username.shuffle-effect {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    /* JavaScript handles the shuffle animation */
}

.username.wave-effect span {
    display: inline-block;
    animation: wave-animation 1.5s ease-in-out infinite;
}

@keyframes wave-animation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.username.shadow-effect {
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3),
                 6px 6px 0px rgba(0, 0, 0, 0.2);
}

/* Ensure existing username effect rules also apply when the JS targets the inner .username-text */
.username-text.glow-effect {
    text-shadow: 0 0 10px var(--accent-color),
                 0 0 20px var(--accent-color);
    animation: glow-pulse 2s ease-in-out infinite;
}

.username-text.rainbow-effect {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-flow 3s linear infinite;
}

.username-text.shuffle-effect {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.username-text.wave-effect span {
    display: inline-block;
    animation: wave-animation 1.5s ease-in-out infinite;
}

.username-text.shadow-effect {
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3),
                 6px 6px 0px rgba(0, 0, 0, 0.2);
}

/* Ensure the username text is the layer that receives effects, and keep the badge isolated */
.username-text {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
}

.username .verified-badge,
.username-text + .verified-badge,
.username > .verified-badge {
    /* Strong override to keep badge visually unaffected by parent effects */
    color: #5865f2 !important;
    -webkit-text-fill-color: #5865f2 !important;
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transform: none !important;
    background: none !important;
    background-clip: initial !important;
    -webkit-background-clip: initial !important;
    mix-blend-mode: normal !important;
    z-index: 100000 !important;
    position: relative !important;
}

/* Prevent effect pseudo-elements from overlaying the verified badge */
.username[class*="-effect"]::before,
.username[class*="-effect"]::after,
.username-text[class*="-effect"]::before,
.username-text[class*="-effect"]::after {
    z-index: 0 !important;
    pointer-events: none !important;
    mix-blend-mode: normal !important;
}

/* Specific safeguard for sparkle overlays and other asset-based pseudo-elements */
.sparkle-pink::after, .sparkle-blue::after, .sparkle-yellow::after, .sparkle-green::after,
.sparkle-red::after, .sparkle-white::after, .sparkle-black::after, .sparkle-lightblue::after, .sparkle-orange::after, .sparkle-purple::after, .sparkle-rainbow::after {
    z-index: 0 !important;
    pointer-events: none !important;
}

/* BACKGROUND EFFECTS */
.effect-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10%;
    color: white;
    font-size: 20px;
    animation: fall linear infinite;
}

@keyframes fall {
    to { transform: translateY(105vh) rotate(360deg); }
}

.rain-drop {
    position: absolute;
    top: -10%;
    width: 2px;
    height: 50px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.6));
    animation: rain-fall linear infinite;
}

@keyframes rain-fall {
    to { transform: translateY(105vh); }
}

.firefly {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #ffff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffff00;
    animation: firefly-float ease-in-out infinite;
}

@keyframes firefly-float {
    0%, 100% { transform: translate(0, 0); opacity: 0.3; }
    50% { transform: translate(20px, -20px); opacity: 1; }
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    border-radius: 50%;
    animation: bubble-rise linear infinite;
}

@keyframes bubble-rise {
    to { transform: translateY(-110vh); opacity: 0; }
}

.custom-badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid var(--badge-color, rgba(255, 255, 255, 0.1));
  object-fit: contain;
  vertical-align: middle;
  transition: all 0.3s ease;
  padding: 2px;
  cursor: pointer;
}

.custom-badge-icon:hover {
    transform: translateZ(10px) scale(1.25) translateY(-2px);
    border-color: var(--badge-color, rgba(255, 255, 255, 0.3));
}

/* Active badge container - always visible */
.active-badge-container {
  display: inline-flex;
}

/* BADGES ICONS (obok nicku) */
.badges-icons {
    display: inline-flex !important;
    gap: 6px;
    vertical-align: middle;
}

.badges-icons img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--badge-color, rgba(255, 255, 255, 0.1));
    object-fit: contain;
    padding: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Custom tooltip for badge icons */
.badges-icons img::after,
.custom-badge-icon::after,
.active-badge-container img::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #000000;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
}

.badges-icons img:hover,
.custom-badge-icon:hover,
.active-badge-container img:hover {
    transform: scale(1.2);
    border-color: var(--badge-color, rgba(255, 255, 255, 0.3));
}

.badges-icons img:hover::after,
.custom-badge-icon:hover::after,
.active-badge-container img:hover::after {
    opacity: 1;
}

/* ==================== LINKS SECTION ==================== */
.links-section {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.links-section .social-icons {
    padding: 0;
    margin: 0;
    border: none;
}

/* ==================== MUSIC PLAYER BOTTOM ==================== */
.music-player-bottom {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4));
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
    animation: none;
    opacity: 1;
    transform: translateY(0);
}

.profile-card-show .music-player-bottom {
    animation: musicPlayerSlideFromStats 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 1.6s forwards;
    opacity: 0;
    transform: translateY(-120px);
}

@keyframes musicPlayerSlideFromStats {
    0% {
        opacity: 0;
        transform: translateY(-120px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.music-player-bottom .music-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.music-player-bottom .music-info {
    flex: 1;
    min-width: 0;
}

.music-player-bottom .music-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.9);
}

.music-player-bottom .music-time {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.music-player-bottom .progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.music-player-bottom .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4655, #ff6b6b);
    width: 0%;
    transition: width 0.1s linear;
}

.music-player-bottom .music-controls {
    display: flex;
    gap: 6px;
}

.music-player-bottom .control-btn {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-player-bottom .control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
}

.music-player-bottom .control-btn.main {
    background: linear-gradient(135deg, #ff4655, #ff6b6b);
    color: white;
}

.music-player-bottom .control-btn.main:hover {
    transform: scale(1.05);
}


/* ==================== ENTER PROFILE OVERLAY ==================== */
.enter-profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(10, 10, 10, 0.3), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.4s ease;
    cursor: pointer;
    pointer-events: all; /* Overlay przechwytuje kliknięcia */
}

.enter-profile-overlay.removing {
    animation: fadeOut 0.3s ease forwards;
    pointer-events: none; /* Nie blokuj podczas usuwania */
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.enter-profile-text {
    font-size: 2.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    text-align: center;
    animation: fadeInText 0.6s ease 0.2s both;
    user-select: none;
    pointer-events: none;
}

@keyframes fadeInText {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.8;
    }
}

.enter-profile-overlay:hover .enter-profile-text {
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

/* ==================== BACKGROUND EFFECTS ==================== */

/* Blurred effect - blur only background, not foreground */
body.effect-blurred .background-image {
    filter: blur(20px) !important;
    transition: filter 0.5s ease;
}

/* Nighttime effect */
body.effect-nighttime {
    background-color: #0a0a1a !important;
    filter: brightness(0.7);
    transition: all 0.5s ease;
}

/* Old TV effect */
body.effect-oldtv {
    filter: grayscale(100%) contrast(150%);
    transition: filter 0.5s ease;
}

/* Effect container base */
.effect-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Stars for nighttime */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* TV effect scanlines */
.tv-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    animation: scanlineFlicker 0.15s infinite;
}

@keyframes scanlineFlicker {
    0% { opacity: 0.95; }
    50% { opacity: 1; }
    100% { opacity: 0.95; }
}

/* ==================== USERNAME EFFECTS ==================== */

.glow-effect {
    text-shadow: 0 0 10px rgba(187, 134, 252, 0.8),
                 0 0 20px rgba(187, 134, 252, 0.5),
                 0 0 30px rgba(187, 134, 252, 0.3);
    color: #bb86fc;
}

.rainbow-effect {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowShift 3s linear infinite;
}

@keyframes rainbowShift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.shadow-effect {
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8),
                 2px 2px 4px rgba(0, 0, 0, 0.6);
    color: #ffffff;
}

.wave-effect {
    display: inline-block;
}

.wave-effect span {
    display: inline-block;
    animation: wave 1.2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.shuffle-effect {
    animation: shuffle 0.5s infinite;
}

@keyframes shuffle {
    0%, 100% { opacity: 1; transform: translateX(0); }
    25% { opacity: 0.8; transform: translateX(-2px); }
    50% { opacity: 1; transform: translateX(0); }
    75% { opacity: 0.8; transform: translateX(2px); }
}

/* ==================== PROFILE LAYOUT VARIATIONS ==================== */

/* Horizontal layout (default) */
.profile-top-section[data-layout="horizontal"] {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.profile-top-section[data-layout="horizontal"] .avatar-section {
    flex-shrink: 0;
}

.profile-top-section[data-layout="horizontal"] .profile-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Vertical layout */
.profile-top-section[data-layout="vertical"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-top-section[data-layout="vertical"] .avatar-section {
    margin-bottom: 1rem; /* Closer to username */
}

.profile-top-section[data-layout="vertical"] .profile-info-section {
    width: 100%;
    text-align: center;
}

.profile-top-section[data-layout="vertical"] .username-badges-row {
    /* In vertical layout place username above badges (column)
       — this prevents the badges background from stretching oddly
       when badges are shown below the username. */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.profile-top-section[data-layout="vertical"] .username {
    margin-bottom: 0;
}

.profile-top-section[data-layout="vertical"] .badges-container {
    margin-left: 0 !important;
    display: inline-flex;
    margin-top: 0.25rem; /* small spacing when badges are below username */
    /* Ensure the badges box sizes to its content in vertical layout only
       and doesn't stretch to fill parent width. Remove forced shrink/expand. */
    width: auto;
    min-width: 0;
    max-width: none;
    align-self: center;
    overflow: visible;
    box-sizing: border-box;
    flex-shrink: 1;
}

/* If there are no badges (both icons and active container empty), allow a helper class
   to hide the visual pill completely in vertical layout. JS can add `.no-badges` when needed. */
.profile-top-section[data-layout="vertical"] .badges-container.no-badges {
    display: none;
    background: transparent !important;
    border: none !important;
}

.profile-top-section[data-layout="vertical"] .bio {
    text-align: center;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .profile-top-section[data-layout="horizontal"] {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-top-section[data-layout="horizontal"] .profile-info-section {
        align-items: center;
    }
}

/* ==================== MONOCHROME ICONS ==================== */
body[data-monochrome-icons="true"] .social-icon i {
    color: var(--text-color, #ffffff) !important;
    filter: grayscale(1) brightness(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

/* Nie dodawaj tła - zostaw transparent */
body[data-monochrome-icons="true"] .social-icon {
    background: transparent !important;
    border: none !important;
}

body[data-monochrome-icons="true"] .social-icon:hover {
    background: transparent !important;
    transform: translateY(-5px) scale(1.15);
}

body[data-monochrome-icons="true"] .social-icon:hover i {
    filter: grayscale(1) brightness(1.5) drop-shadow(0 0 12px rgba(255, 255, 255, 0.6));
}
