/* =====================================
      FONTS
      ===================================== */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('/static/webfonts/fa-solid-900.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    src: url('/static/fonts/poppins-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/static/fonts/poppins-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/static/fonts/montserrat-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/static/fonts/montserrat-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* =====================================
      CSS VARIABLES & BASE STYLES
      ===================================== */
:root {
    --primary-blue: var(--yellow);
    --neon-pink: var(--yellow);
    --highlight: var(--yellow);
    --success-green: var(--brand-success-green);
    --danger-red: var(--yellow);
    --gold-accent: var(--yellow);
    --text-primary: var(--white);
    --text-secondary: rgba(var(--white-rgb), 0.78);
    --text-muted: rgba(var(--white-rgb), 0.62);
    --dark-bg: var(--black);
    --darker-bg: var(--black);
    --glass-bg: rgba(var(--white-rgb), 0.05);
    --transition-speed: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --glow-shadow: 0 0 20px rgba(var(--yellow-rgb), 0.45);
    --neon-glow: 0 0 30px rgba(var(--yellow-rgb), 0.55);
    --gutter-x: 1.5rem;
    --gutter-y: 1rem;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #0a0a0a;
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 50px,
            rgba(255, 204, 0, 0.06) 50px,
            rgba(255, 204, 0, 0.06) 51px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 50px,
            rgba(255, 204, 0, 0.06) 50px,
            rgba(255, 204, 0, 0.06) 51px);
    background-attachment: scroll;
    background-size: auto;
    animation: none;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* =====================================
      ANIMATIONS
      ===================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 10px var(--primary-blue));
    }

    to {
        filter: drop-shadow(0 0 20px var(--neon-pink));
    }
}

/* =====================================
      CORE COMPONENTS
      ===================================== */
.clash-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 2rem 1rem;
    z-index: 1;
}

.clash-overlay {
    display: none;
}

#particle-canvas {
    display: none;
}

.btn-clash-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--neon-pink));
    border: none;
    color: var(--black);
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: var(--glow-shadow), inset 0 0 20px rgba(var(--white-rgb), 0.1);
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-clash-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--white-rgb), .2), transparent);
    transition: left .6s;
}

.btn-clash-primary:hover::before {
    left: 100%;
}

.btn-clash-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 40px rgba(var(--yellow-rgb), .6), inset 0 0 20px rgba(var(--white-rgb), .2);
    background: linear-gradient(135deg, var(--neon-pink), var(--primary-blue));
}

.btn-clash-secondary {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    transition: all var(--transition-speed);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-clash-secondary:hover {
    background: var(--primary-blue);
    color: var(--text-primary);
    transform: translateY(-3px);
    box-shadow: var(--glow-shadow);
}

.battle-cta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    animation: fadeInUp 1s ease-out .4s both;
}

/* ===================================== */
/* CLEAN FINAL REEL STYLING – JS DOES THE HEAVY LIFTING NOW */
/* ===================================== */
.reel-card .video-thumbnail-clickable,
.reel-card .player-container {
    margin: 0 auto;
    background: var(--black);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.reel-card .video-thumbnail-clickable img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.reel-card .video-thumbnail-clickable:hover img {
    transform: scale(1.05);
}

/* Everything else (size, aspect-ratio, max-width) is now 100% controlled safely in JS */
/* No more CSS wars — clean, simple, future-proof */
.choice-btn,
.reel-card .vote-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--neon-pink));
    border: none;
    font-weight: 700;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
    max-width: 100%;
    width: fit-content;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
}

.choice-btn::before,
.reel-card .vote-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--white-rgb), 0.2), transparent);
    transition: left 0.6s;
}

.choice-btn:hover::before,
.reel-card .vote-btn:hover::before {
    left: 100%;
}

.choice-btn:hover,
.reel-card .vote-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-shadow);
}

.reel-card .vote-btn {
    background: linear-gradient(135deg, var(--success-green), var(--neon-pink));
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 50px;
}

.reel-card .vote-btn:hover {
    box-shadow: 0 0 30px rgba(29, 185, 84, 0.6);
    transform: scale(1.05);
}

.reel-card .vote-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.result-card {
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
    padding: 0.5rem 1.2rem !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(var(--black-rgb), 0.3) !important;
    transition: transform 0.3s ease !important;
    position: relative !important;
    z-index: 1 !important;
}

.card-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.75rem !important;
    gap: 0.25rem !important;
}

.card-header .badge {
    margin: 0 !important;
    align-self: center !important;
}

.platform-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(var(--black-rgb), 0.3);
    transition: transform 0.3s ease;
    color: var(--white);
}

.platform-badge:hover {
    transform: scale(1.05);
}

.platform-badge.youtube {
    background: linear-gradient(135deg, var(--youtube-red), var(--youtube-red-light));
}

.platform-badge.twitch {
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-purple-light));
}

.platform-badge.tiktok {
    background: var(--tiktok-gradient);
}

.teaser-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.teaser-card {
    padding: 2rem 1rem;
    text-align: center;
    height: 100%;
}

/* =====================================
      UTILITY CLASSES (Bootstrap Overrides)
      ===================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--gutter-x, 0.75rem));
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 var(--gutter-x, 0.75rem);
    box-sizing: border-box;
}

.col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 var(--gutter-x, 0.75rem);
    box-sizing: border-box;
}

.col-lg-9 {
    flex: 0 0 75%;
    max-width: 75%;
    padding: 0 var(--gutter-x, 0.75rem);
    box-sizing: border-box;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--gutter-x, 0.75rem);
    width: 100%;
    box-sizing: border-box;
}

.g-4 {
    --gutter-x: 1.5rem;
    --gutter-y: 1.5rem;
    margin: calc(-1 * var(--gutter-y)) calc(-1 * var(--gutter-x));
}

.mb-3 {
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

.btn-outline-light {
    border: 1px solid var(--white);
    color: var(--white);
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--black);
}

.card {
    background: transparent;
    border: none;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.small {
    font-size: 0.875em;
}

h1,
h5 {
    font-family: 'Montserrat', sans-serif;
}

h1 {
    font-weight: 800;
    margin-bottom: 1rem;
}

h5 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Force readable branding/title on clash event pages (loaded after welcome bundle). */
.logo-text {
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: var(--white) !important;
    color: var(--white) !important;
    text-shadow: none !important;
    filter: none !important;
}

.platform-title_2 {
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: var(--yellow) !important;
    color: var(--yellow) !important;
    text-shadow: none !important;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    margin-top: 3rem;
}

.footer a {
    color: var(--primary-blue);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* =====================================
      EVENT/REEL-SPECIFIC STYLES
      ===================================== */
.event-join-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.event-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.battle-grid-row {
    margin-bottom: 3rem;
}

.battle-grid-pair {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.stats-bar {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stats-bar.revealed,
.reel-card .stats-bar {
    display: flex;
    opacity: 1;
}

.reel-card .stats-bar {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    max-width: 300px;
    margin: 1rem 0;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    justify-content: center;
}

.stats-icon {
    font-size: 0.75rem;
    opacity: 0.8;
}

.channel-link {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s;
    margin-top: 0.25rem;
    display: inline-block;
}

.channel-link:hover,
.reel-card .channel-link {
    background: var(--text-muted);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.reel-card .channel-link {
    margin-top: 0.5rem;
}

.comment-section {
    margin-top: 1rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.comment-textarea {
    width: 100%;
    max-width: 100%;
    min-height: 60px;
    max-height: 120px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(var(--white-rgb), 0.2);
    border-radius: 10px;
    background: rgba(var(--white-rgb), 0.05);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    display: block;
    /* ← NEW: Allows block-level centering */
}

.comment-textarea::placeholder {
    color: var(--text-muted);
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 10px rgba(var(--yellow-rgb), 0.3);
}

.reel-card .comment-section {
    margin-top: 1rem;
    width: fit-content;
    max-width: 300px;
    margin: 0 auto;
}

.reel-card .comment-section * {
    max-width: inherit;
}

.swipe-hint {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    z-index: 5;
    animation: fadeInUp 1s ease-out;
}

/* ── Drag-to-scroll cursor ───────────────────────────────────────── */
.reel-container {
    cursor: grab;
}
.reel-container.is-dragging {
    cursor: grabbing;
    user-select: none;
    scroll-snap-type: none !important;
}

/* ── Sticky scrollbar ────────────────────────────────────────────── */
.reel-scrollbar-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 9999;
    display: none;
    cursor: pointer;
}
.reel-scrollbar-wrap.visible {
    display: block;
}
.reel-scrollbar-thumb {
    position: absolute;
    top: 1px;
    height: 8px;
    background: var(--primary-blue, #4a9eff);
    border-radius: 4px;
    min-width: 40px;
    transition: background 0.2s;
}
.reel-scrollbar-thumb:hover,
.reel-scrollbar-thumb.active {
    background: var(--neon-pink, #ff2d78);
}

.reel-container {
    display: flex !important;
    flex-direction: row !important;
    height: auto !important;
    min-height: 100% !important;
    width: 100%;
    max-width: 100vw;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 3rem;
    padding: 2rem 1.5rem 2rem 3rem;
    scroll-padding-left: 3rem;
    align-items: stretch;
    justify-content: safe center;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Wrapper to center items if there are fewer than 4 */
.clash-section.reel-mode .container {
    display: flex;
    justify-content: center;
    max-width: 100% !important;
}

.reel-container::-webkit-scrollbar {
    height: 8px;
}

.reel-container::-webkit-scrollbar {
    display: none;
}

.clash-section.reel-mode .reel-card,
.clash-section.reel-mode .video-choice-card {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem 1rem;
    position: relative;
    background: var(--glass-bg);
    border-radius: 20px;
    margin: 0;
    backdrop-filter: blur(10px);
    box-shadow: var(--glow-shadow);
    transition: all var(--transition-speed);
    align-self: stretch;
    /*
     * Width set dynamically via --reel-card-width JS property on first load.
     * Fallback vw formula used before JS runs.
     * Zoom-out naturally reveals more cards; real resize recalculates to 3.
     */
    flex: 0 0 var(--reel-card-width, clamp(280px, calc((100vw - 6rem) / 4.3), 800px));
    min-width: 0;
}

/* ── Edge case: exactly 2 cards — center them, each takes ~half viewport ── */
.reel-container:has(.video-choice-card:nth-child(2):last-child) {
    justify-content: center;
    overflow-x: hidden;
}
.reel-container:has(.video-choice-card:nth-child(2):last-child) .video-choice-card {
    flex: 0 0 clamp(280px, calc((100vw - 5rem) / 2), 480px);
}

/* ── Edge case: exactly 1 card — center it ─────────────────────── */
.reel-container:has(.video-choice-card:only-child) {
    justify-content: center;
    overflow-x: hidden;
}
.reel-container:has(.video-choice-card:only-child) .video-choice-card {
    flex: 0 0 clamp(280px, 60vw, 480px);
}

.clash-section.reel-mode .reel-card *,
.clash-section.reel-mode .video-choice-card * {
    max-width: inherit;
}

.clash-section.reel-mode .video-choice-card .card-body {
    width: 100%;
    margin: 0 auto;
    max-width: 400px;
}

/* Force portrait 9:16 on the video thumbnail in desktop reel mode */
.clash-section.reel-mode .video-choice-card .video-thumbnail-clickable {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.clash-section.reel-mode .video-choice-card .video-thumbnail-clickable img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.clash-section.reel-mode .reel-card .battle-cta {
    max-width: fit-content;
    align-self: center;
    margin: 0 auto;
}

/* =====================================
      REEL MODE OVERRIDES
      ===================================== */
.clash-section.reel-mode {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    min-height: 100vh !important;
    padding: 1rem;
}

/* Force the direct wrapper div to fill the section width so align-items: center
   doesn't center a max-content-wide div off to the left of the viewport */
.clash-section.reel-mode > div {
    width: 100%;
    align-self: stretch;
}

.clash-section.reel-mode .container {
    height: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

.clash-section.reel-mode .row {
    height: 100% !important;
    margin: 0 !important;
}

.clash-section.reel-mode .col-lg-9,
.clash-section.reel-mode .col-12 {
    height: 100% !important;
    padding: 0 !important;
}

.reel-container .video-thumbnail-clickable:hover img {
    transform: none !important;
}

.reel-container .platform-badge:hover {
    transform: none !important;
}

/* =====================================
      RESPONSIVE OVERRIDES
      ===================================== */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

@media (max-width: 1199px) {

    .col-lg-3,
    .col-lg-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .clash-section {
        padding: 1rem;
        min-height: 90vh;
    }

    .clash-section.reel-mode {
        padding: 0.5rem;
    }

    .battle-title {
        font-size: 2.5rem;
    }

    .battle-subtitle {
        font-size: 1.1rem;
    }

    .btn-clash-primary,
    .btn-clash-secondary {
        padding: .8rem 2rem;
        font-size: 1rem;
    }

    .result-card .platform-badge {
        font-size: 0.8rem !important;
        padding: 0.4rem 1rem !important;
    }

    .card-header {
        padding: 0.75rem !important;
        gap: 0.25rem !important;
    }

    .platform-badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    .teaser-title {
        font-size: 1.3rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .row {
        margin: 0 -0.25rem;
    }

    .col-12,
    .col-lg-3,
    .col-lg-9 {
        padding: 0 0.25rem;
    }

    .event-stats {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 1rem;
    }

    .battle-grid-pair {
        flex-direction: column;
        gap: 1rem;
    }

    .stats-bar {
        gap: 0.75rem;
        font-size: 0.75rem;
    }

    .comment-textarea {
        font-size: 0.85rem;
        min-height: 50px;
    }

    .clash-section.reel-mode .reel-card,
    .clash-section.reel-mode .video-choice-card {
        flex: none;
        height: auto;
        min-height: 80vh;
        margin: 0.5rem auto;
        /* Centers the card horizontally */

        /* FIX STARTS HERE */
        width: 95% !important;
        /* Forces cards to a consistent width */
        min-width: 0 !important;
        /* Overrides desktop clamp */
        max-width: 500px;
        /* Prevents cards from getting too wide on tablets */
        align-self: center;
        scroll-snap-align: start;
        /* FIX ENDS HERE */
    }

    /* Ensure internal elements like the bio and comments expand to the card width */
    .rich-profile-wrapper,
    .comment-section,
    .video-thumbnail-clickable {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 1. Force the card body to fill the entire card width */
    .clash-section.reel-mode .video-choice-card .card-body {
        width: 100% !important;
        min-width: 0 !important;
        /* Resets any previous min-width */
        padding: 1rem !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* 2. Force all internal containers to take up 100% of that width */
    .clash-section.reel-mode .rich-profile-wrapper,
    .clash-section.reel-mode .profile-vibe-container,
    .clash-section.reel-mode .bio-accordion-container,
    .clash-section.reel-mode .video-thumbnail-clickable,
    .clash-section.reel-mode .player-container,
    .clash-section.reel-mode .comment-section,
    .clash-section.reel-mode .comment-textarea,
    .clash-section.reel-mode .interaction-row {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 3. Ensure the video keeps a consistent shape and size */
    .clash-section.reel-mode .video-thumbnail-clickable img,
    .clash-section.reel-mode .player-container iframe,
    .clash-section.reel-mode .player-container {
        width: 100% !important;
        border-radius: 12px;
    }

    /* 4. Force the Vote button to be full width */
    .clash-section.reel-mode .choice-btn {
        width: 100% !important;
        display: flex !important;
        justify-content: center;
        margin-top: 1rem !important;
    }

    .reel-container {
        height: auto !important;
        min-height: calc(100vh - 120px) !important;
        flex-direction: column !important;
        scroll-snap-type: y mandatory !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        gap: 0 !important;
        padding: 0 !important;
    }

    .swipe-hint {
        display: none;
    }

    .creator-rail {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        mask-image: none;
        padding: 0.25rem;
        gap: 0.75rem;
    }
}

@media (max-width: 767px) {
    .result-card .platform-badge {
        font-size: 0.8rem !important;
        padding: 0.4rem 1rem !important;
    }

    .result-card .card-header {
        padding: 0.75rem !important;
        gap: 0.25rem !important;
    }
}

/* =====================================
	   CREATOR RAIL (Center Aligned Update)
	   ===================================== */
.creator-rail-container {
    width: 100%;
    margin: 1.5rem 0 2rem 0;
    text-align: center;
    /* UPDATED: Changed from left to center */
}

.creator-rail-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    margin-left: 0;
    /* UPDATED: Removed the left margin */
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.creator-rail {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.5rem 0.5rem 1.5rem 0.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent, var(--black) 10%, var(--black) 90%, transparent);
    /* Optional: Fades edges for centered look */
    justify-content: center;
    /* UPDATED: Centers the avatars */
}

.creator-rail::-webkit-scrollbar {
    display: none;
}

/* Chrome/Safari */
.creator-item {
    flex: 0 0 auto;
    /* Prevents shrinking */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.creator-item:hover {
    transform: translateY(-5px) scale(1.05);
}

.creator-avatar-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 2px;
    /* Uses your existing variables for the gradient ring */
    background: linear-gradient(135deg, var(--primary-blue), var(--neon-pink));
    margin-bottom: 0.5rem;
    box-shadow: 0 5px 15px rgba(var(--black-rgb), 0.3);
}

.creator-avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--dark-bg);
    /* Creates the gap effect */
    background-color: #1a1a2e;
}

.creator-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-weight: 600;
    transition: color 0.3s;
}

.creator-item:hover .creator-name {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(var(--white-rgb), 0.3);
}

@media (max-width: 768px) {
    .creator-rail-container {
        margin: 1rem 0 1.5rem 0;
    }

    .creator-rail-title {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .creator-rail {
        gap: 0.75rem;
        padding: 0.25rem 0.25rem 1rem 0.25rem;
    }

    .creator-item {
        width: 50px;
    }

    .creator-avatar-wrapper {
        width: 48px;
        height: 48px;
    }

    .creator-name {
        font-size: 0.65rem;
    }
}

/* =====================================
      RICH PROFILE ENGINE (Archetypes & Accordions)
      ===================================== */
.rich-profile-wrapper {
    width: 100%;
    max-width: 450px;
    margin: 0.5rem auto 1.5rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- 1. THE VIBE SECTION (Archetype + Tags) --- */
.profile-vibe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInUp 0.5s ease-out;
}

.archetype-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, rgba(var(--yellow-rgb), 0.15), rgba(var(--yellow-rgb), 0.15));
    border: 1px solid var(--primary-blue);
    border-radius: 50px;
    color: var(--primary-blue);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(var(--yellow-rgb), 0.2);
    text-shadow: 0 0 10px rgba(var(--yellow-rgb), 0.4);
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.vibe-pill {
    padding: 0.3rem 0.8rem;
    background: rgba(var(--white-rgb), 0.05);
    border: 1px solid rgba(var(--white-rgb), 0.1);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.vibe-pill:hover {
    background: rgba(var(--white-rgb), 0.1);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

/* --- 2. THE BIO ACCORDION --- */
.bio-accordion-container {
    background: rgba(10, 10, 14, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(var(--white-rgb), 0.05);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(var(--black-rgb), 0.3);
}

.bio-accordion-item {
    border-bottom: 1px solid rgba(var(--white-rgb), 0.05);
    transition: background 0.3s ease;
}

.bio-accordion-item:last-child {
    border-bottom: none;
}

.bio-accordion-item[open] {
    background: rgba(var(--white-rgb), 0.03);
}

/* The Clickable Header (Summary) */
.bio-accordion-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    /* Hides default triangle */
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Hide webkit default marker */
.bio-accordion-header::-webkit-details-marker {
    display: none;
}

.bio-accordion-header:hover {
    color: var(--primary-blue);
}

/* The Chevron Icon Rotation */
.bio-accordion-header .chevron {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bio-accordion-item[open] .bio-accordion-header .chevron {
    transform: rotate(180deg);
    color: var(--primary-blue);
}

.bio-accordion-item[open] .bio-accordion-header {
    color: var(--primary-blue);
    text-shadow: 0 0 10px rgba(var(--yellow-rgb), 0.3);
}

/* The Body Content */
.bio-accordion-body {
    padding: 0 1rem 1rem 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: left;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- LEGACY FALLBACK (For older bios without Parts) --- */
.bio-legacy-container {
    background: rgba(10, 10, 14, 0.6);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(var(--white-rgb), 0.05);
}

.bio-legacy-container .bio-hook {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--white), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* =====================================
      BATTLE CTA OVERRIDE FOR NARROW WIDTH
      ===================================== */
.battle-cta .choice-btn {
    max-width: 100%;
    width: fit-content;
    margin: 0 auto;
}

.clash-section.reel-mode .reel-card .battle-cta,
.clash-section.reel-mode .video-choice-card .battle-cta {
    max-width: fit-content;
    align-self: center;
    margin: 0 auto;
}