/* =====================================================================
   Insignia MU — Home redesign (v2)
   Section-by-section styles for the redesigned landing page.
   Loaded AFTER style.css so it overrides the shared base where needed.
   Figma: Mu-Ricardo / Home (node 31:31)
   ===================================================================== */

:root {
    --v2-gold:      #c89525;   /* button/border gold from the mockup */
    --v2-gold-line: #ddb038;   /* underline / accent gold */
    --v2-red:       #b02828;   /* download button border */
    --v2-red-fill:  #672323;   /* download button fill */
    --v2-green:     #289d39;   /* online indicator */
    --v2-gray:      #a6a6a5;   /* muted text */
    --v2-ink:       #08080c;   /* page background */
}

/* Redesigned home uses the darker mockup background */
body.home-v2 { background: var(--v2-ink); }

/* Shared chevron-flanked call-to-action button (‹ label ›) --------------- */
.cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    /* padding: 0 20px; */
    /* height: 56px; */
    border-radius: 5px; cursor: pointer;
    font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
    text-decoration: none; white-space: nowrap;
    transition: background var(--dur-med) var(--ease-out),
                box-shadow var(--dur-med) var(--ease-out),
                transform var(--dur-fast) var(--ease-out),
                border-color var(--dur-med) var(--ease-out);
}
.cta .chev { font-size: 1.4rem; line-height: 1; opacity: 0.85; }
.cta:active { transform: translateY(1px); }
.cta-gold { color: var(--v2-gold); background: rgba(0, 0, 0, 0.5); border: 1px solid var(--v2-gold); }
.cta-gold:hover { background: rgba(200, 149, 37, 0.16); box-shadow: 0 0 26px rgba(200, 149, 37, 0.4); transform: translateY(-1px); }
.cta-red { color: #fff; background: var(--v2-red-fill); border: 1px solid var(--v2-red); }
.cta-red:hover { background: #7a2a2a; box-shadow: 0 0 26px rgba(176, 40, 40, 0.45); transform: translateY(-1px); }

/* =====================================================================
   1 · HERO
   ===================================================================== */
.hero-v2 {
    position: relative; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; overflow: hidden;
    padding: 140px 24px 80px;
}
.hero-v2-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0; pointer-events: none;
}
/* Darken top (for navbar legibility) and fade the bottom into the page */
.hero-v2-overlay {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(5,5,8,0.55) 0%, rgba(5,5,8,0.05) 22%, rgba(5,5,8,0.05) 55%, rgba(8,8,12,0.85) 88%, var(--v2-ink) 100%);
}
.hero-v2-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 18px;
    max-width: 900px;
}
.hero-v2-logo {
    width: 212px; max-width: 55vw; height: auto;
    filter: drop-shadow(0 0 40px rgba(212, 165, 52, 0.28)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
    animation: v2-logo-breathe 6s ease-in-out infinite;
}
@keyframes v2-logo-breathe {
    0%, 100% { filter: drop-shadow(0 0 34px rgba(212, 165, 52, 0.22)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6)); }
    50%      { filter: drop-shadow(0 0 56px rgba(212, 165, 52, 0.36)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6)); }
}
.hero-v2-kicker {
    font-family: var(--font-display); font-weight: 400; font-size: 1.25rem;
    color: var(--v2-gray); letter-spacing: -0.011em; margin: 0;
}
.hero-v2-title {
    font-family: var(--font-display); font-weight: 900;
    font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.1; color: #fff;
    letter-spacing: -0.011em; margin: 0;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}
.hero-v2-sub {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(1rem, 2.2vw, 1.15rem); line-height: 1.6;
    color: var(--v2-gray); max-width: 640px;
    letter-spacing: -0.011em; margin: 0;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}
.hero-v2-sub em { color: var(--gold-300, #f0d080); font-style: italic; }
.hero-v2-cta { margin-top: 8px; min-width: 295px; }
/* Overlay text inside hero CTA */
.hero-v2-cta { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.hero-v2-cta .hero-cta-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: var(--v2-gold);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    white-space: nowrap;
}

/* Download CTA overlay */
.download-v2-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.download-v2-btn .download-cta-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    white-space: nowrap;
}

/* Ranking CTA overlay (reuses CTA image) */
.ranking-v2-cta .cta { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ranking-v2-cta .ranking-cta-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: var(--v2-gold);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    white-space: nowrap;
}
.hero-v2-social {
    position: absolute; left: clamp(20px, 5vw, 80px); bottom: 40px; z-index: 2;
    display: flex; gap: 14px;
}
.hero-v2-social a { display: inline-flex; transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-med) var(--ease-out); }
.hero-v2-social a:hover { transform: translateY(-2px); filter: drop-shadow(0 0 12px rgba(200, 149, 37, 0.5)); }
.hero-v2-social img { width: 56px; height: 56px; }

@media (max-width: 720px) {
    .hero-v2 { padding: 120px 20px 90px; }
    .hero-v2-social { left: 50%; transform: translateX(-50%); bottom: 24px; }
    .hero-v2-social a:hover { transform: translateX(0) translateY(-2px); }
    .hero-v2-cta { min-width: 0; width: 100%; max-width: 320px; }
}

/* Shared section headings ------------------------------------------------ */
.v2-title {
    font-family: var(--font-display); font-weight: 900;
    font-size: clamp(1.9rem, 4.5vw, 2.75rem); line-height: 1.1; color: #fff;
    letter-spacing: -0.011em; margin: 0;
}
.v2-desc {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(1rem, 2.2vw, 1.25rem); line-height: 1.4; color: var(--v2-gray);
    letter-spacing: -0.011em; margin: 0;
}
.v2-accent { color: var(--v2-gold); }

/* =====================================================================
   2 · CHOOSE YOUR CLASS
   ===================================================================== */
.classes-v2 {
    position: relative; padding: 72px clamp(20px, 5vw, 80px);
    background: linear-gradient(180deg, rgba(8,8,12,0.65), rgba(8,8,12,0.82)),
                url('assets/redesign/backgrounds/clase_bg.png') center/cover no-repeat;
    border-top: 1px solid rgba(200, 149, 37, 0.25);
    border-bottom: 1px solid rgba(200, 149, 37, 0.25);
    overflow: hidden;
}
.classes-v2-inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center; gap: 48px;
}
.classes-v2-left {
    flex: 1 1 auto; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 39px;
}
.classes-v2-head { text-align: center; max-width: 560px; display: flex; flex-direction: column; gap: 20px; }

.class-selector { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; }
.class-arrow {
    flex-shrink: 0; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(200, 149, 37, 0.35); border-radius: 8px;
    cursor: pointer; transition: background var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.class-arrow:hover { background: rgba(200, 149, 37, 0.15); border-color: var(--v2-gold); }
.class-arrow img { transform: rotate(-90deg); }          /* triangle up -> points left */
.class-arrow--next img { transform: rotate(90deg); }     /* points right */

.class-badges {
    display: flex; align-items: flex-start; justify-content: center; gap: 14px;
    flex-wrap: nowrap; flex: 1 1 auto;
}
.class-badge {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    cursor: pointer; background: none; border: none; padding: 0; width: 82px;
}
.class-badge-dot {
    width: 12px; height: 10px; margin-bottom: 2px;
    background: url('assets/redesign/icons/Polygon_icon_seleted.png') center/contain no-repeat;
    opacity: 0; transition: opacity var(--dur-med) var(--ease-out);
}
.class-badge.active .class-badge-dot { opacity: 1; }
.class-badge-ring {
    position: relative; width: 70px; height: 70px; border-radius: 50%; overflow: hidden;
    border: 2px solid rgba(166, 166, 165, 0.35);
    background: radial-gradient(circle at 50% 30%, rgba(40,44,52,0.9), rgba(8,8,12,0.95));
    transition: border-color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.class-badge-ring img { width: 100%; height: 100%; object-fit: cover; }
.class-badge:hover .class-badge-ring { border-color: rgba(200, 149, 37, 0.6); transform: translateY(-2px); }
.class-badge.active .class-badge-ring { border-color: var(--v2-gold); box-shadow: 0 0 20px rgba(200, 149, 37, 0.5); }
.class-badge-label {
    font-family: var(--font-display); font-weight: 400; font-size: 1rem; color: var(--v2-gray);
    text-align: center; letter-spacing: -0.011em; transition: color var(--dur-med) var(--ease-out);
}
.class-badge.active .class-badge-label { color: #fff; }

.class-render {
    flex-shrink: 0; width: min(426px, 40vw); height: 568px;
    display: flex; align-items: flex-end; justify-content: center; position: relative;
}
.class-render::before {
    content: ''; position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
    width: 340px; height: 340px; border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 149, 37, 0.16) 0%, transparent 68%);
    pointer-events: none;
}
.class-render img {
    position: relative; max-height: 100%; width: auto; max-width: 100%; object-fit: contain;
    filter: drop-shadow(0 12px 34px rgba(0, 0, 0, 0.7));
    animation: v2-fade-in var(--dur-slow) var(--ease-out);
}
@keyframes v2-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Scroll reveal for section titles ------------------------------- */
/* Hidden state only applies once JS has set up the observer (html.reveal-ready),
   so a JS failure can never leave a title permanently invisible. */
.reveal-ready .v2-reveal {
    opacity: 0;
    transform: translateY(38px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
    will-change: opacity, transform;
}
.reveal-ready .v2-reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal-ready .v2-reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 900px) {
    .classes-v2-inner { flex-direction: column-reverse; gap: 24px; }
    .class-render { width: 260px; height: 400px; }
    .class-selector { width: 100%; max-width: 340px; margin: 0 auto; gap: 8px; }
    /* Show exactly 2 badges; the rest stay clipped until the arrows reveal them 1 by 1. */
    .class-badges {
        flex-wrap: nowrap; justify-content: flex-start; gap: 14px;
        overflow-x: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .class-badges::-webkit-scrollbar { display: none; }
    .class-badge {
        flex: 0 0 calc((100% - 14px) / 2); width: auto; scroll-snap-align: center;
    }
    .class-badge-label { font-size: 0.9rem; }
}

/* =====================================================================
   3 · WHY CHOOSE INSIGNIA MU
   ===================================================================== */
.why-v2 {
    padding: 80px clamp(20px, 5vw, 80px);
    display: flex; flex-direction: column; align-items: center; gap: 32px;
    background: linear-gradient(180deg, rgba(8, 8, 12, 0.65), rgba(8, 8, 12, 0.8)),
                url('assets/redesign/backgrounds/porque_features_background.jpg') center/cover no-repeat;
}
.why-v2-head { text-align: center; max-width: 800px; display: flex; flex-direction: column; gap: 20px; }
.why-v2 .v2-title { line-height: 1.25; }

.why-cards {
    display: flex; gap: 20px; justify-content: flex-start; align-items: stretch;
    width: 100%; max-width: 1160px;
    padding: 8px 0;
    overflow-x: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
}
.why-cards::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.why-card {
    position: relative; flex: 0 0 calc((100% - 40px) / 3); min-width: 0; max-width: calc((100% - 40px) / 3);
    scroll-snap-align: start;
    padding: 30px 26px 24px;
    background: linear-gradient(143deg, rgba(0,0,0,0.35) 0%, rgba(35,39,46,0.35) 60%, rgba(0,0,0,0.35) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 3px;
    outline: none;
    transition: border-color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.why-card:hover, .why-card:focus-visible {
    border-color: rgba(200, 149, 37, 0.5);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(200, 149, 37, 0.1);
    transform: translateY(-3px);
}
/* Decorative gold corner brackets (top-left & top-right) */
.why-card::before, .why-card::after {
    content: ''; position: absolute; top: -1px; width: 18px; height: 18px;
    border-top: 2px solid var(--v2-gold); pointer-events: none;
}
.why-card::before { left: -1px; border-left: 2px solid var(--v2-gold); }
.why-card::after { right: -1px; border-right: 2px solid var(--v2-gold); }
.why-card-num {
    position: absolute; top: 12px; right: 14px;
    font-family: var(--font-display); font-size: 0.56rem; letter-spacing: 0.9px;
    color: rgba(255, 255, 255, 0.4);
}
.why-card-icon { width: 48px; height: 48px; object-fit: contain; margin-bottom: 12px; }
.why-card-title {
    font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
    letter-spacing: 0.06em; color: #e8d9b5; margin: 0; line-height: 1.4;
}
.why-card-divider {
    display: block; height: 1px; width: 100%; margin: 14px 0;
    background: linear-gradient(90deg, rgba(200, 149, 37, 0.33), transparent);
}
.why-card-body {
    font-family: var(--font-heading); font-style: italic; font-weight: 500;
    font-size: 0.92rem; line-height: 1.65; color: #867c6e; margin: 0;
}
.why-card-quote {
    margin: 18px 0 0; padding-left: 10px; border-left: 2px solid rgba(255, 255, 255, 0.65);
    font-family: var(--font-display); font-weight: 400; font-size: 0.6rem;
    letter-spacing: 0.09em; text-transform: uppercase; line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
}

.why-dots { display: flex; gap: 14px; align-items: center; }
.why-dot {
    width: 15px; height: 13px; padding: 0; border: none; cursor: pointer;
    background: url('assets/redesign/icons/Polygon_icon_unseleted.png') center/contain no-repeat;
    opacity: 0.9; transition: transform var(--dur-fast) var(--ease-out);
}
.why-dot:hover { transform: scale(1.15); }
.why-dot.active { background-image: url('assets/redesign/icons/Polygon_icon_seleted.png'); }

@media (max-width: 860px) {
    .why-cards {
        flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px;
    }
    .why-cards::-webkit-scrollbar { display: none; }
    .why-card { flex: 0 0 82%; max-width: 82%; scroll-snap-align: center; }
}

/* =====================================================================
   4 · FEATURES showcase (tabbed)
   ===================================================================== */
.features-v2 {
    padding: 72px clamp(20px, 5vw, 80px);
    background: linear-gradient(180deg, rgba(8, 8, 12, 0.75), rgba(8, 8, 12, 0.9)),
                url('assets/redesign/backgrounds/porque_features_background.jpg') center/cover no-repeat;
}
.features-v2-head { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.features-v2-head .v2-title { line-height: 1.2; }
.features-v2-head .v2-desc { max-width: 720px; }
.features-v2-divider {
    max-width: 1160px; margin: 22px auto 26px; height: 1px;
    background: linear-gradient(90deg, var(--v2-gold) 0%, rgba(200,149,37,0.15) 12%, rgba(255,255,255,0.08) 100%);
    position: relative;
}
.features-v2-divider::before {
    content: ''; position: absolute; left: 0; top: -9px; width: 60px; height: 18px;
    background: url('assets/redesign/icons/exp_icon.png') left center/contain no-repeat; opacity: 0.9;
}

/* Main stage: full pre-composed image with the text overlaid in its empty box.
   The *_image.png assets already include the panel frame, gem and game UI. */
.feature-stage { position: relative; max-width: 1160px; margin: 0 auto; }
.feature-panel { display: none; }
.feature-panel.active {
    display: block; position: relative; container-type: inline-size;
    animation: v2-fade-in var(--dur-slow) var(--ease-out);
}
.feature-img { width: 100%; height: auto; display: block; border-radius: 3px; }
/* Text sits in the empty box baked into the image (left ~6%, top ~26%, ~31% wide). */
.feature-text {
    position: absolute; left: 6.4%; top: 27%; width: 30%; height: 56%;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    text-align: left; overflow: hidden; padding: 0 12px;
}
.feature-title {
    font-family: var(--font-display); font-weight: 700; color: var(--v2-gold);
    font-size: 1.9cqw; letter-spacing: 0.04em; margin: 0 0 1.4cqw;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
.feature-desc {
    padding-left: 8px; border-left: 2px solid #424443;
    font-family: var(--font-display); font-weight: 400; color: #fff;
    font-size: 1.16cqw; line-height: 1.5; letter-spacing: 0.02em; margin: 0; opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

@media (max-width: 537px) {
    /* Stack: reference screenshot on top, description text below (no overlay). */
    .feature-panel.active { display: flex; flex-direction: column; }
    /* The mobile composite bakes an empty text box on TOP and the game screenshot
       on the BOTTOM. Crop to the bottom so only the screenshot shows. */
    .feature-img {
        width: 100%; aspect-ratio: 320 / 265;
        object-fit: cover; object-position: center bottom;
        border-radius: 8px 8px 0 0;
    }
    /* Description becomes a real panel beneath the screenshot. */
    .feature-text {
        position: static; left: auto; top: auto; width: 100%; height: auto;
        display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
        text-align: left; overflow: visible; box-sizing: border-box;
        padding: 16px 18px;
        background: linear-gradient(180deg, rgba(20,22,27,0.94), rgba(8,8,12,0.97));
        border: 1px solid rgba(200,149,37,0.25); border-top: none; border-radius: 0 0 8px 8px;
    }
    .feature-title {
        font-size: 1.05rem; margin: 0 0 8px;
    }
    .feature-desc {
        padding-left: 10px;
        border-left: 2px solid #424443;
        font-family: var(--font-display);
        font-weight: 400;
        color: #fff;
        font-size: 0.85rem;
        line-height: 1.55;
        letter-spacing: 0.02em;
        margin: 0;
        opacity: 0.9;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
    }
}

/* Tab strip */
.feature-tabs {
    max-width: 1160px; margin: 24px auto 0;
    display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; padding: 8px 0 4px;
}
.feature-tabs::-webkit-scrollbar { display: none; }
.feature-tab {
    position: relative;
    width: 150px;
    height: 118px;
    padding: 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.feature-tab-label {
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 10px);
    margin: 0;
    z-index: 2;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    transition: color var(--dur-med) var(--ease-out);
    pointer-events: none;
}
.feature-tab-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    z-index: 1;
}
.feature-tab.active .feature-tab-label,
.feature-tab:hover .feature-tab-label {
    color: #c9c9c9;
}
.feature-tab:hover { transform: translateY(-2px); }
.feature-tab:hover .feature-tab-label { color: #c9c9c9; }
.feature-tab.active {
    box-shadow: none;
}
.feature-tab.active .feature-tab-label { color: var(--v2-gold); }

@media (max-width: 820px) {
    .feature-tab { flex: 0 0 46%; min-width: 140px; }
}

/* =====================================================================
   5 · TOP PLAYERS (ranking)
   ===================================================================== */
.ranking-v2 { padding: 72px clamp(20px, 5vw, 80px); display: flex; flex-direction: column; align-items: center; gap: 28px; }
.ranking-v2-title { text-align: center; }
.rank-search { width: 100%; max-width: 380px; margin: 0 auto 14px; padding: 0; }
.rank-search-input {
    width: 100%; padding: 12px 16px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04); color: #fff;
    font-family: var(--font-body); font-size: 0.95rem;
    outline: none; transition: border-color var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out);
}
.rank-search-input::placeholder { color: rgba(255, 255, 255, 0.55); }
.rank-search-input:focus { border-color: rgba(200, 149, 37, 0.8); background: rgba(255, 255, 255, 0.08); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Class filter badges */
.rank-filter { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.rank-filter-badge {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: none; border: none; cursor: pointer; padding: 6px; border-radius: 10px;
    transition: background var(--dur-med) var(--ease-out);
}
.rank-filter-ring {
    width: 62px; height: 62px; border-radius: 50%; overflow: hidden; display: block;
    border: 2px solid rgba(200, 149, 37, 0.55);
    background: radial-gradient(circle at 50% 30%, rgba(40,44,52,0.9), rgba(8,8,12,0.95));
    transition: border-color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.rank-filter-ring img { width: 100%; height: 100%; object-fit: cover; }
.rank-filter-label { font-family: var(--font-display); font-size: 0.85rem; color: var(--v2-gray); transition: color var(--dur-med) var(--ease-out); }
.rank-filter-badge:hover .rank-filter-ring { border-color: var(--v2-gold); }
.rank-filter-badge.active { background: rgba(255, 255, 255, 0.04); }
.rank-filter-badge.active .rank-filter-ring { border-color: var(--v2-gold); box-shadow: 0 0 18px rgba(200, 149, 37, 0.5); }
.rank-filter-badge.active .rank-filter-label { color: #fff; }

/* Mobile: horizontal, draggable badges (applies to narrow viewports) */
@media (max-width: 574px) {
    .rank-filter {
        gap: 14px;
        padding: 8px 12px;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .rank-filter::-webkit-scrollbar { display: none; height: 8px; }
    .rank-filter-badge {
        flex: 0 0 auto;
        width: 82px;
        scroll-snap-align: start;
        padding: 6px 4px;
        margin-right: 6px;
    }
    .rank-filter-ring { width: 62px; height: 62px; }
    .rank-filter-label { font-size: 0.85rem; }
}

/* Also enable on short/tall narrow viewports if height is the constraint */
@media (max-height: 683px) {
    .rank-filter {
        gap: 14px;
        padding: 8px 12px;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .rank-filter::-webkit-scrollbar { display: none; height: 8px; }
    .rank-filter-badge {
        flex: 0 0 auto;
        width: 82px;
        scroll-snap-align: start;
        padding: 6px 4px;
        margin-right: 6px;
    }
}

/* Ranking card */
.rank-card {
    width: 100%; max-width: 1040px;
    background: rgba(10, 11, 15, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px;
    padding: 8px 20px 16px;
}
.rank-tabs { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.rank-tabs-buttons { display: flex; gap: 26px; justify-content: flex-end; flex-wrap: wrap; }
.rank-search { flex: 1 1 auto; max-width: 320px; padding: 0; margin: 0; }
.rank-search-input { width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); color: #fff; font-family: var(--font-body); font-size: 0.95rem; outline: none; transition: border-color var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out); }
.rank-search-input::placeholder { color: rgba(255, 255, 255, 0.55); }
.rank-search-input:focus { border-color: rgba(200, 149, 37, 0.8); background: rgba(255, 255, 255, 0.08); }
.rank-tab {
    position: relative; background: none; border: none; cursor: pointer; text-decoration: none;
    font-family: var(--font-display); font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--v2-gray); padding: 4px 2px; transition: color var(--dur-med) var(--ease-out);
}
.rank-tab:hover { color: var(--gold-300); }
.rank-tab.active { color: #fff; }
.rank-tab.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -13px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--v2-gold-line), transparent);
}

.rank-table-wrap { overflow-x: auto; scrollbar-width: none; }
.rank-card { --rank-row-height: 52px; --rank-header-height: 64px; }
/* Ensure the table area has a fixed max-height for 10 rows and becomes scrollable */
.rank-table-wrap { height: calc(var(--rank-row-height) * 10 + var(--rank-header-height)); min-height: calc(var(--rank-row-height) * 10 + var(--rank-header-height)); overflow-y: auto; }
.rank-table-wrap::-webkit-scrollbar { display: none; }
.rank-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; min-width: 640px; }
.rank-table thead {
    display: table-header-group;
}
.rank-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(10, 11, 15, 0.96);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--v2-gray);
    text-align: left;
    padding: 12px 14px;
}
.rank-table tbody td {
    font-family: var(--font-display); font-size: 0.95rem; color: #fff; padding: 10px 14px;
    background: rgba(255, 255, 255, 0.015); border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle;
}
.rank-table tbody td:first-child { border-left: 1px solid rgba(255, 255, 255, 0.05); border-radius: 4px 0 0 4px; }
.rank-table tbody td:last-child { border-right: 1px solid rgba(255, 255, 255, 0.05); border-radius: 0 4px 4px 0; }
.rank-table tbody tr:hover td { background: rgba(255, 255, 255, 0.04); }

/* Top-3 highlighted rows */
.rank-table tr.rank-1 td { background: linear-gradient(90deg, rgba(200,149,37,0.22), rgba(200,149,37,0.06)); border-color: rgba(200,149,37,0.4); }
.rank-table tr.rank-2 td { background: linear-gradient(90deg, rgba(180,185,195,0.16), rgba(180,185,195,0.04)); border-color: rgba(180,185,195,0.3); }
.rank-table tr.rank-3 td { background: linear-gradient(90deg, rgba(176,110,60,0.18), rgba(176,110,60,0.05)); border-color: rgba(176,110,60,0.32); }

.rk-col-rank { width: 90px; white-space: nowrap; }
.rk-num { font-weight: 700; margin-right: 8px; }
.rk-badge { display: inline-block; vertical-align: middle; }
.rk-char { display: inline-flex; align-items: center; gap: 10px; min-width: 0; vertical-align: middle; }
.rk-idwrap { display: inline-flex; align-items: center; gap: 10px; position: relative; flex-shrink: 0; }
.rk-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(166,166,165,0.5); flex-shrink: 0; display: inline-flex; }
.rk-dot.on { background: #289d39; box-shadow: 0 0 7px rgba(40,157,57,0.7); }
.rk-dot.off { background: #b23b3b; }
.rk-avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(200,149,37,0.4); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.rk-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rk-name { font-weight: 700; letter-spacing: 0.02em; }
.rk-link { color: inherit; text-decoration: none; transition: color var(--dur-med) var(--ease-out); }
.rk-link:hover { color: var(--v2-gold); text-decoration: underline; }

/* Guild logos (MU marks) in the ranking */
.rk-guild { display: inline-flex; align-items: center; gap: 8px; min-width: 0; vertical-align: middle; }
.rk-guild-logo {
    flex-shrink: 0; display: inline-flex; width: 22px; height: 22px;
    border-radius: 3px; overflow: hidden; background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(200, 149, 37, 0.35);
}
.rk-guild-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rk-guild-avatar {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 4px; overflow: hidden;
    background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(200, 149, 37, 0.4);
}
.rk-guild-avatar img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Standalone ranking page: clear the fixed navbar and fill the viewport. */
.ranking-page-v2 { padding-top: 116px; min-height: 100vh; }
/* Full ranking page: show the whole list (up to #100). Drop the fixed 10-row
   scroll box so the table grows with its rows and the page expands instead. */
.ranking-page-v2 .rank-table-wrap { height: auto; min-height: 0; overflow-y: visible; }
/* The wrap keeps overflow-x:auto (horizontal scroll for the min-width table), which
   makes it a scroll container — so a sticky top offset would mis-pin. Let the header
   scroll away with the list instead of sticking. */
.ranking-page-v2 .rank-table thead th { position: static; }
.rk-col-class, .rk-col-guild { color: #d8d2c6; font-weight: 700; letter-spacing: 0.02em; }
.rk-col-resets, .rk-col-level { font-weight: 700; }
.rank-table .loading { text-align: center; color: var(--v2-gray); padding: 26px; }

.ranking-v2-cta { margin-top: 4px; }

@media (max-width: 700px) {
    .rank-filter { gap: 14px; }
    .rank-filter-ring { width: 52px; height: 52px; }
    /* Stack the header: search on top (full width), tabs below aligned left. */
    .rank-tabs { flex-direction: column; align-items: stretch; gap: 14px; }
    .rank-search { max-width: 100%; width: 100%; }
    .rank-tabs-buttons { justify-content: flex-start; gap: 22px; }
}

/* Ranking as cards on small phones (<=527px):
   Header → rank # + medal + (character avatar) + name, left-aligned.
   Body   → every other column as a label(left)/value(right) row. */
@media (max-width: 527px) {
    .rank-card { padding: 8px 10px 14px; }
    /* Release the desktop table constraints (fixed height, min-width, scroll). */
    .rank-table-wrap { height: auto; min-height: 0; max-height: none; overflow: visible; margin-top: 8px; }
    .rank-table { display: block; min-width: 0; border-spacing: 0; }
    .rank-table thead { display: none; }
    .rank-table tbody { display: block; }

    /* ══ Players / All: everything on ONE compact line ══
       [ dot+# ][ class avatar ] ............ [ R resets ][ Lv level ]
       Name, class text and guild are hidden on mobile. */
    .rank-table tbody[data-view="all"] tr,
    .rank-table tbody[data-view="players"] tr {
        display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
        background: rgba(255, 255, 255, 0.025);
        border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 10px;
        padding: 9px 12px; margin-bottom: 8px;
    }
    .rank-table tbody[data-view="all"] td,
    .rank-table tbody[data-view="players"] td {
        width: auto; padding: 0; font-size: 0.9rem; white-space: nowrap;
        background: none !important; border: none !important; border-radius: 0;
    }
    /* Hidden columns on the single line (name stays, class + guild go) */
    .rank-table tbody[data-view="all"] td.rk-col-class,
    .rank-table tbody[data-view="players"] td.rk-col-class,
    .rank-table tbody[data-view="all"] td.rk-col-guild,
    .rank-table tbody[data-view="players"] td.rk-col-guild { display: none; }
    /* Character name takes the middle space and truncates with ellipsis. */
    .rank-table tbody[data-view="all"] .rk-char,
    .rank-table tbody[data-view="players"] .rk-char { min-width: 0; gap: 8px; }
    .rank-table tbody[data-view="all"] .rk-name,
    .rank-table tbody[data-view="players"] .rk-name {
        min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        font-size: 0.92rem;
    }
    /* Position + medal */
    .rank-table tbody[data-view="all"] td.rk-col-rank,
    .rank-table tbody[data-view="players"] td.rk-col-rank {
        order: 1; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
        white-space: nowrap; font-size: 1rem; font-weight: 700;
    }
    .rank-table tbody[data-view="all"] td.rk-col-rank .rk-num,
    .rank-table tbody[data-view="players"] td.rk-col-rank .rk-num { margin-right: 0; }
    .rank-table tbody[data-view="all"] .rk-badge,
    .rank-table tbody[data-view="players"] .rk-badge { width: 18px; height: 18px; }
    /* Online dot on the class avatar + name (grows, truncates) */
    .rank-table tbody[data-view="all"] td.rk-col-char,
    .rank-table tbody[data-view="players"] td.rk-col-char {
        order: 2; flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center;
    }
    .rank-table tbody[data-view="all"] .rk-idwrap,
    .rank-table tbody[data-view="players"] .rk-idwrap { position: relative; }
    .rank-table tbody[data-view="all"] .rk-avatar,
    .rank-table tbody[data-view="players"] .rk-avatar { width: 30px; height: 30px; }
    .rank-table tbody[data-view="all"] .rk-idwrap .rk-dot,
    .rank-table tbody[data-view="players"] .rk-idwrap .rk-dot {
        position: absolute; bottom: -1px; right: -1px; width: 8px; height: 8px;
        border: 2px solid #14161a; box-sizing: content-box;
    }
    /* Resets pushed right, then level */
    .rank-table tbody[data-view="all"] td.rk-col-resets,
    .rank-table tbody[data-view="players"] td.rk-col-resets { order: 3; margin-left: auto; font-weight: 700; }
    .rank-table tbody[data-view="all"] td.rk-col-level,
    .rank-table tbody[data-view="players"] td.rk-col-level { order: 4; font-weight: 700; }
    .rank-table tbody[data-view="all"] td.rk-col-resets::before,
    .rank-table tbody[data-view="players"] td.rk-col-resets::before,
    .rank-table tbody[data-view="all"] td.rk-col-level::before,
    .rank-table tbody[data-view="players"] td.rk-col-level::before {
        content: attr(data-label); margin-right: 4px;
        font-family: var(--font-display); font-weight: 400; font-size: 0.58rem;
        letter-spacing: 0.05em; text-transform: uppercase; color: var(--v2-gray);
    }
    /* Top-3 accent on the whole row */
    .rank-table tbody[data-view="all"] tr.rank-1,
    .rank-table tbody[data-view="players"] tr.rank-1 { background: linear-gradient(90deg, rgba(200,149,37,0.22), rgba(200,149,37,0.05)); border-color: rgba(200,149,37,0.42); }
    .rank-table tbody[data-view="all"] tr.rank-2,
    .rank-table tbody[data-view="players"] tr.rank-2 { background: linear-gradient(90deg, rgba(180,185,195,0.16), rgba(180,185,195,0.04)); border-color: rgba(180,185,195,0.32); }
    .rank-table tbody[data-view="all"] tr.rank-3,
    .rank-table tbody[data-view="players"] tr.rank-3 { background: linear-gradient(90deg, rgba(176,110,60,0.18), rgba(176,110,60,0.05)); border-color: rgba(176,110,60,0.34); }

    /* ══ Guilds / Killers: keep the label/value card layout ══ */
    .rank-table tbody[data-view="guilds"] tr,
    .rank-table tbody[data-view="killers"] tr {
        display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px;
        background: rgba(255, 255, 255, 0.025);
        border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 12px;
        padding: 12px 16px; margin-bottom: 12px;
    }
    .rank-table tbody[data-view="guilds"] td,
    .rank-table tbody[data-view="killers"] td {
        width: auto; padding: 0; font-size: 0.92rem;
        background: none !important; border: none !important; border-radius: 0;
    }
    .rank-table tbody[data-view="guilds"] td.rk-col-rank,
    .rank-table tbody[data-view="killers"] td.rk-col-rank {
        order: 1; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
        white-space: nowrap; font-size: 1.12rem;
    }
    .rank-table tbody[data-view="guilds"] .rk-badge,
    .rank-table tbody[data-view="killers"] .rk-badge { width: 22px; height: 22px; }
    .rank-table tbody[data-view="guilds"] td.rk-col-char,
    .rank-table tbody[data-view="killers"] td.rk-col-char {
        order: 2; flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-end;
    }
    .rank-table tbody[data-view="guilds"] .rk-avatar,
    .rank-table tbody[data-view="killers"] .rk-avatar { width: 28px; height: 28px; }
    .rank-table tbody[data-view="guilds"] .rk-idwrap .rk-dot,
    .rank-table tbody[data-view="killers"] .rk-idwrap .rk-dot {
        position: absolute; bottom: 0; right: 0; width: 9px; height: 9px;
        border: 2px solid #14161a; box-sizing: content-box;
    }
    .rank-table tbody[data-view="guilds"] td[data-label],
    .rank-table tbody[data-view="killers"] td[data-label] {
        order: 3; flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between;
        padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
        color: #fff; font-weight: 700;
    }
    .rank-table tbody[data-view="guilds"] td[data-label]::before,
    .rank-table tbody[data-view="killers"] td[data-label]::before {
        content: attr(data-label);
        font-family: var(--font-display); font-weight: 400;
        font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--v2-gray);
    }
}

/* =====================================================================
   6 · DOWNLOAD CTA (video background)
   ===================================================================== */
    .rank-filter {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .rank-filter {
        touch-action: pan-y; /* allow vertical page scroll, handle horizontal drag ourselves */
        cursor: grab;
    }
    .rank-filter.dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.download-v2 {
    position: relative; min-height: 620px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    padding: 60px clamp(20px, 5vw, 80px);
}
.download-v2-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.download-v2-overlay {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(180deg, var(--v2-ink) 0%, transparent 20%, transparent 55%, rgba(8,8,12,0.7) 100%);
}
.download-v2-bar {
    position: relative; z-index: 2; width: 100%; max-width: 1160px;
    display: flex; align-items: center; justify-content: space-between; gap: 32px;
    padding: 30px 32px; border-radius: 10px;
    background: rgba(10, 10, 10, 0.8); border: 1px solid #757575;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.download-v2-title {
    font-family: var(--font-display); font-weight: 900; line-height: 1.15;
    font-size: clamp(1.5rem, 3.2vw, 2.5rem); color: #fff; margin: 0; max-width: 600px;
}
.download-v2-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; flex-shrink: 0; }
.download-v2-btn { min-width: 295px; display: inline-flex; padding: 0; background: none; border: none; }
.download-v2-btn img { display: block; width: auto; height: auto; max-width: 100%; }
.hero-v2-cta img { display: block; width: auto; height: auto; max-width: 100%; }
.download-v2-link {
    font-family: var(--font-display); font-size: 0.9rem; color: #fff; text-align: right;
    text-decoration: none; transition: color var(--dur-med) var(--ease-out);
}
.download-v2-link:hover { color: var(--gold-300); text-decoration: underline; }

@media (max-width: 820px) {
    .download-v2 { min-height: 520px; }
    .download-v2-bar { flex-direction: column; align-items: flex-start; }
    .download-v2-actions { align-items: stretch; width: 100%; }
    .download-v2-btn { min-width: 0; width: 100%; }
    .download-v2-link { text-align: left; }
}

/* =====================================================================
   7 · AUTH pages (login / register / forgot / reset / confirm) — v2
   Standalone pages reuse the redesigned modal card (.auth-card + .auth-field
   + .auth-btn from style.css); here we set the v2 background + logo.
   ===================================================================== */
body.home-v2 .auth-page {
    background:
        linear-gradient(180deg, rgba(8,8,12,0.86) 0%, rgba(8,8,12,0.93) 100%),
        url('assets/redesign/backgrounds/porque_features_background.jpg') center/cover no-repeat;
}
body.home-v2 .auth-page-bg { display: none; } /* drop the old red radial layer */
/* Logo sits above the redesigned card form on the standalone pages. */
.auth-card .auth-logo-wrap {
    display: block; text-align: center; margin: 0 auto 2px;
    filter: drop-shadow(0 0 24px rgba(200,149,37,0.22));
}
.auth-card .auth-logo { width: 128px; max-width: 48%; height: auto; }
.auth-card .auth-title { margin-top: 4px; }
/* Status text used by confirm-email while it verifies the token. */
.auth-card .auth-status {
    text-align: center; color: var(--v2-gray);
    font-family: var(--font-display); font-size: 0.9rem; line-height: 1.55;
    margin: 8px 0 16px;
}
