:root {
    --container-bg: rgba(26, 13, 13, 0.4);
    --card-bg: rgba(38, 23, 20, 0.35);
    --border-color: rgba(255, 255, 255, 0.05);
    --accent-color: #f94b16;
    --accent-hover: #ea9c0c;
    --accent-glow: rgba(249, 115, 22, 0.15);
    --text-main: #f3f4f6;
    --text-muted: #afa79c;
    --font-stack: 'Inter', sans-serif;
    --transition-speed: 0.2s;
}

/* Two large radial blobs — orange top-left, purple bottom-right */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.05) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.03) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background: linear-gradient(165deg, hsl(10, 100%, 10%), hsl(10, 100%, 6%), hsl(30, 100%, 10%));
    color: var(--text-main);
    min-height: 100vh;
    padding: 40px 16px;
    overflow-x: hidden;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Scrollbar — WebKit only (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, hsl(10, 100%, 15%), hsl(30, 100%, 15%));
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, hsl(10, 100%, 30%), hsl(30, 100%, 30%));
    border-radius: 999px;
    box-shadow: 0 0 20px 10px color-mix(in srgb, var(--accent-color) 20%, transparent);
    border: 2px solid color-mix(in srgb, var(--accent-color) 15%, transparent);
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, hsl(10, 100%, 45%), hsl(30, 100%, 45%));
    box-shadow: 0 0 20px 20px color-mix(in srgb, var(--accent-color) 30%, transparent);
    border: 2px solid color-mix(in srgb, var(--accent-color) 25%, transparent);
    background-clip: padding-box;
}

/* ── HEADER ────────────────────────────────── */

.profile-header {
    background: var(--container-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.profile-info-block {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.avatar-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

/* Glowing ring behind the avatar — animated via breathe and spin-gradient keyframes */
@property --angle {
    syntax: "<angle>";
    initial-value: 135deg;
    inherits: false;
}

.avatar-outline {
    position: absolute;
    inset: -3px;
    background: linear-gradient(var(--angle), var(--accent-color), #f6be5c);
    border-radius: 50%;
    opacity: 0.6;
    filter: blur(3px);
    animation: breathe 4s ease-in-out infinite alternate,
               spin-gradient 20s linear infinite;
}
@keyframes breathe {
    0%   { transform: scale(1);    opacity: 0.4; filter: blur(2px); }
    100% { transform: scale(1.02); opacity: 0.7; filter: blur(4px); }
}
@keyframes spin-gradient {
    to { --angle: 495deg; } /* 135 + 360 */
}

.avatar-pic {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: #0f172a;
}

.profile-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.display-title {
    font-size: 1.4rem;
    font-weight: 850;
    letter-spacing: -0.03em;
    color: #fff;
}

.verified-star {
    color: var(--accent-color);
    font-size: 1rem;
}

.discord-copy-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.discord-copy-pill:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.discord-copy-pill i {
    color: #5865F2;
}

.casual-bio {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.4;
}

.discord-widget-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 320px;
    width: 100%;
}

.discord-widget-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* ── LINKS ─────────────────────────────────── */

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.social-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--container-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    color: var(--text-main);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.social-link-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px var(--accent-glow);
    background: rgba(255, 255, 255, 0.04);
}

.link-icon-box {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent-color);
    transition: all var(--transition-speed) ease;
}

.social-link-item:hover .link-icon-box {
    background: var(--accent-color);
    color: var(--bg-color);
}

.link-details {
    flex-grow: 1;
    margin-left: 14px;
    text-align: left;
}

.link-main-title {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
}

.link-sub-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.arrow-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform var(--transition-speed) ease;
}

.social-link-item:hover .arrow-indicator {
    transform: translateX(3px);
    color: var(--accent-color);
}

/* ── GALLERY ────────────────────────────────── */

.gallery-section {
    background: var(--container-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.gallery-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gallery-counter {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 99px;
}

.gallery-masonry {
    width: 100%;
}

.gallery-card {
    width: calc(25% - 12px);
    min-height: 120px;
    margin-bottom: 16px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--container-bg);
    transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.gallery-card:hover {
    transform: scale(1.015);
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px var(--accent-glow);
    z-index: 10;
}

.render-thumbnail {
    width: 100%;
    min-height: 120px;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

/* Countdown timer shown on video cards (top-right corner) */
.video-timer {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    z-index: 15;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* Shown on card hover — gradient fades from bottom so title stays readable */
.card-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 25%, transparent 40%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    pointer-events: none; /* clicks pass through to the variation bar below */
}

/* Shorter gradient when there's no variation bar to clear */
.card-hover-overlay.no-variants {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 40px, transparent 40%);
}

.gallery-card:hover .card-hover-overlay {
    opacity: 1;
}

.overlay-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.overlay-variant-count {
    font-size: 0.7rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-top: 1px;
    margin-bottom: 46px; /* clears the variation bar height */
}

.overlay-variant-count.no-variants {
    margin-bottom: 8px;
}

/* ── VARIATION SWAPPER ──────────────────────── */

/* Sits bottom-right of each card, above the hover overlay */
.card-variations-bar {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 20;
}

/* Tiny dot by default, expands to thumbnail on card hover */
.mini-swapper-box {
    position: relative;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                height 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                border-color 0.2s ease,
                opacity 0.2s ease;
}

.mini-swapper-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: block;
}

.gallery-card:hover .mini-swapper-box {
    width: 38px;
    height: 38px;
    border-color: rgba(255, 255, 255, 0.8);
    background: #000;
}

.gallery-card:hover .mini-swapper-box img {
    opacity: 1;
}

.mini-swapper-box.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
}

/* Video indicator icon — only visible on card hover */
.var-video-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.8rem;
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.gallery-card:hover .var-video-badge {
    opacity: 0.95;
}

/* ── LIGHTBOX ───────────────────────────────── */

/* Invisible + non-interactive by default; .active makes it visible */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 5, 4, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 40px;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-window {
    background: rgba(31, 23, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    max-width: 1000px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 300px;
    height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

.lightbox-viewport {
    background: #0d0706;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
}

.lightbox-active-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.2s ease-in-out;
}

.lightbox-deck {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}

/* Override global scrollbar styles for the lightbox panel — no glow inside a contained element */
.lightbox-deck::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
    overflow: hidden;
}

.lightbox-deck::-webkit-scrollbar-thumb {
    border-radius: 999px;
    box-shadow: none;
    border: 2px solid transparent;
}

.lightbox-deck::-webkit-scrollbar-thumb:hover {
    box-shadow: none;
    border: 2px solid transparent;
}

.deck-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deck-title {
    font-size: 1.2rem;
    font-weight: 850;
    letter-spacing: -0.020em;
}

.deck-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* desc can contain raw HTML links (set via innerHTML) */
#lightbox-desc a {
    color: #f97316;
    text-decoration: underline;
}

.variation-wrap {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
}

.variation-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    display: block;
}

.variation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.variation-thumb-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-speed) ease;
}

.variation-thumb-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.variation-thumb-btn.active {
    border-color: var(--accent-color);
    background: rgba(249, 115, 22, 0.05);
}

.variation-preview-img {
    width: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.variation-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.variation-thumb-btn.active .variation-label {
    color: var(--accent-color);
}

.lightbox-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
    z-index: 10;
}

.lightbox-close-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    transform: scale(1.05);
}

/* ── TOAST ──────────────────────────────────── */

/* Slides up from bottom, auto-dismissed after 2.5s via JS */
.toast-msg {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-color);
    /* color: var(--bg-color); */
    font-weight: 700;
    font-size: 0.8rem;
    padding: 10px 20px;
    border-radius: 99px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-msg.show {
    transform: translateX(-50%) translateY(0);
}


/* ── RESPONSIVE ─────────────────────────────── */

@media (max-width: 900px) {
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    .discord-widget-container {
        max-width: 100%;
        justify-content: flex-start;
    }
    .gallery-card {
        width: calc(50% - 8px);
    }
}

@media (max-width: 768px) {
    /* Switch lightbox to single column, split viewport/deck vertically */
    .lightbox-window {
        grid-template-columns: 1fr;
        height: 80vh;
    }
    .lightbox-viewport {
        height: 45vh;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .lightbox-deck {
        height: 35vh;
    }
    .lightbox {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-card {
        width: 100%;
    }
}