/* ============================================================
   INDEX PAGE — LAYOUT
   Sections stack VERTICALLY. Cards scroll HORIZONTALLY.
   No inline styles needed. CSS handles everything.
   ============================================================ */

/* ── PAGE WRAPPER ─────────────────────────────────────────── */
.stories-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
}

/* ── SECTION SHELL (vertical: header above, scroll-row below) */
.hscroll-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.5rem 1.5rem 1rem 1.5rem;  /* enough bottom room for scrollbar */
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    /* NO overflow:hidden — it clips scrollbars and hover shadows */
}

/* Section used outside .stories-sections (clubs, merch) */
.hscroll-clubs,
.hscroll-merch {
    margin: 2rem 0;
}

/* ── SECTION HEADER ───────────────────────────────────────── */
.hscroll-section .section-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.hscroll-section .section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.25rem 0;
}

.hscroll-section .section-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Featured sections: header is a row (title left, button right) */
.featured-section-header {
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
}

.featured-section-header h2 {
    margin: 0 !important;
}

/* ── HORIZONTAL SCROLL CONTAINER ─────────────────────────── */
.card-scroll-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.75rem 0.25rem 1rem 0.25rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

.card-scroll-container::-webkit-scrollbar {
    height: 6px;
}
.card-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}
.card-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* ── STORY CARDS inside horizontal scroll ─────────────────── */
.card-scroll-container .story-card {
    flex: 0 0 auto;
    width: 300px;
    min-width: 280px;
    scroll-snap-align: start;
}

/* ── PLACEHOLDER (while loading) ─────────────────────────── */
.card-placeholder {
    flex: 0 0 auto;
    min-width: 280px;
    padding: 2rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

/* ── CTA STRIPS (between sections) ───────────────────────── */
.hscroll-cta {
    width: 100%;
    text-align: center;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.hscroll-cta .cta-container i {
    font-size: 2.5rem;
    color: var(--accent-primary);
    display: block;
    margin-bottom: 1rem;
}

.hscroll-cta .cta-container h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.hscroll-cta .cta-container p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ── WHY JOIN SECTION ─────────────────────────────────────── */
.why-join-section {
    padding: 2rem 1.5rem 1rem;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.why-join-section .section-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.why-join-section .section-header h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 0.25rem 0;
}

.why-join-section .section-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Feature cards in horizontal scroll */
.hscroll-feature-card {
    flex: 0 0 auto;
    width: 280px;
    min-width: 260px;
    background: var(--bg-card);
    padding: 2rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    scroll-snap-align: start;
}

.hscroll-feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px var(--shadow-color);
}

.hscroll-feature-card .feature-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.hscroll-feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.hscroll-feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ── STORY CARD DESIGN ────────────────────────────────────── */
.story-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 20px var(--shadow-color);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px var(--shadow-color);
    border-color: var(--accent-primary);
}

.story-card.has-frame {
    border: none;
}

/* Card image */
.card-image {
    height: 200px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0;
}

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    pointer-events: none;
    z-index: 1;
}

.card-image .badge,
.play-fab {
    position: relative;
    z-index: 2;
}

/* Genre badge on card image */
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, rgba(138,86,172,0.9), rgba(155,107,192,0.85));
    backdrop-filter: blur(4px);
    color: white;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Floating play button — kept INSIDE card-image so overflow:hidden on story-card doesn't clip it */
.play-fab {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease, background 0.2s ease;
}

.play-fab:hover {
    transform: scale(1.12);
    background: var(--accent-hover);
}

.play-fab i {
    color: white;
    font-size: 16px;
    margin-left: 2px; /* optical centering for play icon */
}

/* Card body */
.card-content2 {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding:1.5rem 1rem 1rem 1rem ;   /* 1rem bottom so footer sits away from edge */
    gap: 0.4rem;
}

/* Meta row */
.card-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.card-id {
    font-family: monospace;
    font-size: 0.8em;
    opacity: 0.6;
}

/* Title */
.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.3rem 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Description */
.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

/* Author row */
.card-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(138,86,172,0.12);
    border-radius: 20px;
    width: fit-content;
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: background 0.2s;
    max-width: 100%;
}

.card-author:hover {
    background: rgba(138,86,172,0.25);
}

.card-author .author-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.card-author .author-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-prefix {
    color: var(--text-secondary);
    font-weight: normal;
}

/* Card footer */
.card-footer {
    display: inline-block;
    padding: 0.7rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    width: 100%;
}

.stats-group {
     display:flex;
     align-items: center; /* Keeps text and buttons aligned vertically */
    justify-content: space-between; /* Spreads them out to the edges */
    gap: 5px;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.stats-group .stat-item {
    display: flex;
    align-items: center;
    width:34px;
    height: 34px;;
    gap: 5px;
    border-radius: 50%;
}



.stats-group .stat-item:hover {

    background: var(--bg-secondary);
    color: var(--accent-primary);
}



.stats-group .stat-item.rating {
    color: #f59e0b;
    font-weight: 600;
}

.action-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Icon buttons in card footer */
.card-footer .icon-btn {
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s, color 0.2s;
}

.card-footer .icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

.card-footer .icon-btn.active {
    color: #8cb180;
}

/* ── SKIN / FRAME SUPPORT ─────────────────────────────────── */
.story-card.has-skin {
    background-size: cover;
    background-position: center;
}

.story-card.has-skin .card-content2 {
    background: var(--card-overlay-color);
    backdrop-filter: blur(4px);
}

.story-card.has-skin .card-footer {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    border-top-color: rgba(255,255,255,0.1);
}

/* Skin badge */
.skin-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 15;
    border: 1px solid rgba(255,255,255,0.15);
}

.skin-badge i { color: var(--accent-primary); }

.skin-price {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

/* Frame borders via CSS pseudo-elements */
.story-card[class*="frame-"] { position: relative; }
.story-card[class*="frame-"]::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    border-radius: 20px;
    box-sizing: border-box;
}

.frame-silver::after { border: 4px solid silver; box-shadow: inset 0 0 20px rgba(192,192,192,0.5), 0 0 8px rgba(192,192,192,0.3); }
.frame-neon::after   { border: 4px solid #0ff; box-shadow: 0 0 15px #0ff, inset 0 0 15px rgba(0,255,255,0.2); }
.frame-floral::after { border: 4px double #ff69b4; box-shadow: inset 0 0 12px rgba(255,105,180,0.3); }
.frame-fire::after   { border: 4px solid #ff4500; box-shadow: 0 0 20px #ff2200, inset 0 0 20px rgba(255,34,0,0.3); animation: pulse-fire 1.5s infinite alternate; }
.frame-ice::after    { border: 4px solid #a5f3fc; box-shadow: 0 0 15px #a5f3fc, inset 0 0 15px rgba(165,243,252,0.2); }
.frame-glitch::after { border: 4px solid #f0f; border-left-color: #0ff; border-right-color: #ff0; box-shadow: 0 0 8px rgba(255,0,255,0.4); }
.frame-wooden::after { border: 4px ridge #8b4513; box-shadow: inset 0 0 8px rgba(139,69,19,0.4); }
.frame-rainbow::after { border: 4px solid red; animation: rainbow-border 3s linear infinite; }
.frame-shadow::after { border: 4px solid #444; box-shadow: inset 0 0 30px black, 0 4px 12px rgba(0,0,0,0.6); }
.frame-starlight::after { border: 4px dashed gold; box-shadow: 0 0 12px gold, inset 0 0 8px rgba(255,215,0,0.25); }
.frame-gold::after   { border: 4px solid gold; box-shadow: 0 0 16px rgba(255,215,0,0.5), inset 0 0 12px rgba(255,215,0,0.3); }

@keyframes pulse-fire {
    from { box-shadow: 0 0 12px #ff0000, inset 0 0 12px rgba(255,0,0,0.3); border-color: #ff4500; }
    to   { box-shadow: 0 0 24px #ff0000, inset 0 0 24px rgba(255,0,0,0.5); border-color: #ff0000; }
}
@keyframes rainbow-border {
    0%   { border-color: red; }
    16%  { border-color: orange; }
    33%  { border-color: yellow; }
    50%  { border-color: green; }
    66%  { border-color: blue; }
    83%  { border-color: indigo; }
    100% { border-color: violet; }
}

/* ── TESTIMONIALS ─────────────────────────────────────────── */
.testimonials-section {
    padding: 2rem 1.5rem 1rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.testimonials-section .section-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.testimonials-section .section-header h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    margin: 0 0 0.25rem 0;
}

.testimonials-section .section-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}


.testimonials-container {
    position: relative;
    overflow: hidden;
}

.testimonials-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testimonial-card {
    flex: 0 0 100%;
    max-width: 440px;
    margin: 0 1rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 4px 12px var(--shadow-color);
    text-align: center;
    border: 1px solid var(--border-color);
}

.testimonial-text { font-style: italic; margin-bottom: 1.25rem; font-size: 1rem; line-height: 1.6; }
.testimonial-stars { color: #ffd700; margin-bottom: 1rem; }
.testimonial-author { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; }
.testimonial-avatar { width: 55px; height: 55px; border-radius: 50%; object-fit: cover; }
.testimonial-author-info h4 { margin: 0 0 0.2rem 0; }
.testimonial-author-info p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }

.testimonial-nav { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; }
.testimonial-nav button { background: var(--accent-primary); color: white; border: none; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; transition: transform 0.2s; }
.testimonial-nav button:hover { transform: scale(1.1); }

/* ── SECTION HEADER (global for why-join etc.) ────────────── */
.section-header h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.5rem;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .hscroll-section {
        padding: 1rem 1rem 0.5rem 1rem;
        border-radius: 15px;
    }

    .card-scroll-container .story-card {
        width: 260px;
        min-width: 240px;
    }

    .hscroll-feature-card {
        width: 240px;
        min-width: 220px;
    }

    .hscroll-cta {
        padding: 2rem 1.25rem;
    }

    .testimonial-card {
        margin: 0 0.5rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .card-scroll-container .story-card {
        width: 240px;
        min-width: 220px;
    }

    .hscroll-feature-card {
        width: 220px;
        min-width: 200px;
    }
}
