/* ===== PAGE HERO (stats header) — fan portal / home-adjacent ===== */

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --accent: #EC4899;
    --dark: #0F172A;
    --light: #F8FAFC;
    --gray: #64748B;
    --card-bg: #FFFFFF;
    --card-text: #1E293B;
    --card-border: #E2E8F0;
    --card-shadow: 0 0.4vw 1.2vw rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success: #10B981;
    --danger: #EF4444;
}

/* ── Full-bleed hero band ─────────────────────────────────────────── */
.stats-header-container {
    position: relative;
    width: 100%;
    margin: 0;
    padding: clamp(1.1rem, 2vw, 1.85rem) clamp(1rem, 3.5vw, 3rem) clamp(0.62rem, 1vw, 0.9rem);
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 80% at 100% -20%, rgba(124, 58, 237, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 60% at 0% 110%, rgba(236, 72, 153, 0.1), transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    box-sizing: border-box;
}

.stats-header-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath fill='%236366f1' fill-opacity='0.04' d='M0 0h60v60H0zm60 60h60v60H60z'/%3E%3C/svg%3E");
    opacity: 0.9;
    pointer-events: none;
}

.stats-header-container.stats-header-no-strip::before {
    opacity: 0.65;
}

.stats-header-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.45) 20%, rgba(236, 72, 153, 0.5) 55%, rgba(99, 102, 241, 0.4) 80%, transparent);
    pointer-events: none;
}

.stats-header-container.stats-header-no-strip::after {
    opacity: 0.55;
}

.stats-header-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17.4rem, 19.1rem) 17vw;
    grid-template-rows: auto;
    align-items: start;
    column-gap: clamp(0.95rem, 1.55vw, 1.45rem);
    row-gap: clamp(0.75rem, 1.2vw, 1rem);
    max-width: 100%;
}

.stats-header-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: none;
    /* Title block slightly to the right */
    padding-left: clamp(1rem, 2.6vw, 2.25rem);
    padding-right: 0.35rem;
    grid-column: 1;
    grid-row: 1;
}

.stats-header-kicker {
    margin: 0 0 0.45rem;
    font-size: clamp(10px, 0.62vw, 12px);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7c3aed;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.stats-header-kicker::before {
    content: "";
    width: 3px;
    height: 1em;
    border-radius: 2px;
    background: linear-gradient(180deg, #d946ef 0%, #7c3aed 100%);
}

.stats-title {
    font-family: "Space Grotesk", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: clamp(26px, 2.2vw, 42px);
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.028em;
    line-height: 1.12;
}

.stats-subtitle {
    font-size: clamp(13px, 0.88vw, 15px);
    line-height: 1.55;
    color: rgba(51, 65, 85, 0.92);
    max-width: 36rem;
    margin: 0.55rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="light"] .stats-subtitle {
    color: rgba(71, 85, 105, 0.95);
}

/* ── Glass panel: share + stats (pulled slightly left, room for wiki column) ── */
.stats-header-right {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
    align-items: stretch;
    padding: 0.45rem 0.55rem;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    box-shadow:
        0 14px 36px rgba(15, 23, 42, 0.07),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    min-width: min(100%, 19.1rem);
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-right: clamp(1rem, 1.8vw, 1.65rem);
    align-self: start;
    height: auto;
}

/* ── Wiki mini-rail: "You might be interested" ────────────────────── */
.stats-header-wiki-suggest {
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    align-self: start;
    height: auto;
}

.stats-header-wiki-suggest__head {
    margin: 0 0 0.35rem;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #7c3aed;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.stats-header-wiki-suggest__head::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d946ef, #6366f1);
    flex-shrink: 0;
}

.stats-header-wiki-suggest__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
}

.stats-header-wiki-suggest__item {
    margin: 0;
    padding: 0;
    line-height: 1.25;
}

.stats-header-wiki-suggest__link {
    font-size: clamp(12px, 0.78vw, 13px);
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    padding: 0.2rem 0.25rem;
    margin: 0 -0.2rem;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stats-header-wiki-suggest__link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
}

.share-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.share-btn {
    width: clamp(32px, 2.1vw, 38px);
    height: clamp(32px, 2.1vw, 38px);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    font-size: 14px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.share-btn .icon-x {
    display: inline-flex;
    width: 14px;
    height: 14px;
}
.share-btn .icon-x svg {
    width: 100%;
    height: 100%;
}

.share-btn .lucide-icon,
.share-btn [data-lucide],
.share-btn .fab {
    width: 15px;
    height: 15px;
    font-size: 15px;
}

.share-btn.copy-link {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.28);
    background: rgba(99, 102, 241, 0.06);
}
.share-btn.copy-link:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
}

.share-btn.twitter {
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.03);
}
.share-btn.twitter:hover {
    border-color: rgba(15, 23, 42, 0.35);
    background: rgba(15, 23, 42, 0.06);
}

.share-btn.reddit {
    color: #ff4500;
    border-color: rgba(255, 69, 0, 0.28);
    background: rgba(255, 69, 0, 0.05);
}
.share-btn.reddit:hover {
    border-color: #ff4500;
    background: rgba(255, 69, 0, 0.1);
}

.share-btn.facebook {
    color: #1877f2;
    border-color: rgba(24, 119, 242, 0.28);
    background: rgba(24, 119, 242, 0.05);
}
.share-btn.facebook:hover {
    border-color: #1877f2;
    background: rgba(24, 119, 242, 0.1);
}

/* ── Stat chips (compact numbers) ─────────────────────────────────── */
.stats-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.stat-item {
    flex: 1 1 0;
    min-width: 6.25rem;
    max-width: none;
    padding: 0.32rem 0.4rem;
    border-radius: 8px;
    text-align: left;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.stat-item:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.28);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.1);
}

.stat-item-content {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.45rem;
    row-gap: 0.06rem;
    align-items: center;
}

.stat-icon-wrapper {
    grid-row: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: clamp(28px, 1.85vw, 34px);
    height: clamp(28px, 1.85vw, 34px);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.1) 100%);
    color: #5b5fef;
    font-size: clamp(12px, 0.75vw, 14px);
}

.stat-icon-wrapper .lucide-icon,
.stat-icon-wrapper [data-lucide] {
    width: 15px;
    height: 15px;
}

.stat-number {
    grid-column: 2;
    grid-row: 1;
    font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
    font-size: clamp(14px, 0.95vw, 17px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    line-height: 1.1;
    white-space: nowrap;
}

.stat-label {
    grid-column: 2;
    grid-row: 2;
    font-size: 9px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .stats-header-content {
        grid-template-columns: minmax(0, 1fr) minmax(17rem, 19.2rem);
        grid-template-rows: auto auto;
    }

    .stats-header-main {
        grid-column: 1;
        grid-row: 1;
    }

    .stats-header-right {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .stats-header-wiki-suggest {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: none;
    }
}

@media (max-width: 82.873vw) {
    .stats-header-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        align-items: stretch;
    }

    .stats-header-main {
        grid-column: 1;
        grid-row: 1;
        padding-left: clamp(0.35rem, 1.5vw, 1rem);
    }

    .stats-header-right {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
        justify-self: stretch;
        margin-right: 0;
    }

    .stats-header-wiki-suggest {
        grid-column: 1;
        grid-row: 3;
    }

    .share-buttons-container {
        align-items: flex-start;
    }

    .share-buttons {
        justify-content: flex-start;
    }

    .stats-grid {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .stat-item {
        max-width: none;
        flex: 1 1 calc(33.333% - 0.45rem);
    }
}

@media (max-width: 53.039vw) {
    .stat-item { flex: 1 1 calc(50% - 0.45rem); }
}

/* Legacy .toast — hidden, notifications now use vice-coins-notification style */
.toast { display: none !important; }

/* Vice-coins notification style for all pages */
#notification-container {
    position: fixed !important;
    bottom: 2vw !important;
    right: 2vw !important;
    z-index: 7000000 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.8vw !important;
    align-items: flex-end !important;
    pointer-events: none !important;
}

.vice-coins-notification {
    min-width: 15vw;
    max-width: 22vw;
    padding: 1vw 1.2vw;
    border-radius: 0.6vw;
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(0.691vw);
    border: 0.069vw solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 0.4vw 1.5vw rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.8vw;
    pointer-events: auto;
    animation: vcNotifIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}
.vice-coins-notification.hiding {
    animation: vcNotifOut 0.3s ease forwards;
}

.vice-coins-notification-icon {
    width: 1.4vw;
    height: 1.4vw;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1vw;
}

.vice-coins-notification-content { flex: 1; }

.vice-coins-notification-message {
    font-size: 0.85vw;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(0, 0, 0, 0.85);
    margin: 0;
}

.vice-coins-notification-close {
    width: 1.2vw;
    height: 1.2vw;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0.3vw;
    background: transparent;
    border: none;
    color: rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 0.7vw;
}
.vice-coins-notification-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.7);
}

.vice-coins-notification.success { border-left: 0.3vw solid #22c55e; }
.vice-coins-notification.success .vice-coins-notification-icon { color: #22c55e; }
.vice-coins-notification.error   { border-left: 0.3vw solid #ef4444; }
.vice-coins-notification.error   .vice-coins-notification-icon { color: #ef4444; }
.vice-coins-notification.warning { border-left: 0.3vw solid #f59e0b; }
.vice-coins-notification.warning .vice-coins-notification-icon { color: #f59e0b; }
.vice-coins-notification.info    { border-left: 0.3vw solid #3b82f6; }
.vice-coins-notification.info    .vice-coins-notification-icon { color: #3b82f6; }

@keyframes vcNotifIn {
    from { transform: translateX(150%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes vcNotifOut {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(150%); opacity: 0; }
}
