/* ==========================================
        GOOGLE FONT & RESET
========================================== */

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

html{
    scroll-behavior:smooth;
}

body{

    font-family:'Montserrat',sans-serif;

    background:#07090F;

    color:white;

    overflow-x:hidden;

    min-height:100vh;

    position:relative;

}


/* ==========================================
            BACKGROUND
========================================== */

.background{

    position:fixed;

    inset:0;

    z-index:-5;

    overflow:hidden;

    background:
    linear-gradient(
    145deg,
    #07090F 0%,
    #0D1324 35%,
    #111827 65%,
    #090B10 100%);

}


/* Floating Neon Circles */

.circle{

    position:absolute;

    border-radius:50%;

    filter:blur(120px);

    opacity:.35;

    animation:float 12s ease-in-out infinite;

}

.one{

    width:450px;
    height:450px;

    background:#7B2EFF;

    top:-120px;
    left:-120px;

}

.two{

    width:350px;
    height:350px;

    background:#00B7FF;

    bottom:-80px;
    right:-80px;

    animation-delay:3s;

}

.three{

    width:300px;
    height:300px;

    background:#FF3CAC;

    top:45%;
    left:45%;

    animation-delay:6s;

}


/* ==========================================
                NAVBAR
========================================== */

nav{

    width:96%;

    max-width:1680px;

    margin:14px auto;

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:14px;

    padding:10px 24px;

    background:rgba(10,13,22,.82);

    backdrop-filter:blur(20px);

    -webkit-backdrop-filter:blur(20px);

    border:1px solid rgba(255,255,255,.09);

    border-radius:18px;

    box-shadow:

    0 0 30px rgba(0,0,0,.45);

    position:sticky;

    top:12px;

    z-index:1500;

}


/* LOGO */

.logo{

    display:flex;

    align-items:center;

    font-size:28px;

    font-weight:800;

    white-space:nowrap;

    flex-shrink:0;

    text-decoration:none;

    color:inherit;

}

.logo-anime{

    color:#27d07d;

}

.logo-chat{

    color:#ffffff;

    margin-left:2px;

}


/* NAV LINKS */

.nav-links{

    display:flex;

    align-items:center;

    justify-content:center;

    gap:2px;

    flex:1;

    min-width:0;

}

.nav-links a{

    text-decoration:none;

    color:#D8D8D8;

    font-size:13.5px;

    font-weight:600;

    transition:.3s;

    padding:6px 10px;

    border-radius:8px;

    white-space:nowrap;

}

.nav-links a:hover{

    color:white;

    background:rgba(143,91,255,.14);

    box-shadow:0 0 14px rgba(143,91,255,.35);

}

/* NAV RIGHT (auth + mood) */

.nav-right{

    display:flex;

    align-items:center;

    gap:10px;

    flex-shrink:0;

    white-space:nowrap;

}

.nav-user-menu-divider{

    height:1px;

    background:rgba(255,255,255,.08);

    margin:6px 0;

}

.lang-toggle-row{

    display:flex;

    align-items:center;

    gap:10px;

    padding:10px 14px;

    font-size:13px;

    color:#9ca3af;

}

.lang-toggle-row i{

    font-size:14px;

    color:#6b7280;

}

.lang-toggle-row .lang-toggle-label{

    flex:1;

    font-weight:600;

    color:#d1d5db;

}

.lang-toggle{

    display:inline-flex;

    align-items:center;

    gap:4px;

    background:rgba(255,255,255,.06);

    border:1px solid rgba(255,255,255,.12);

    border-radius:20px;

    padding:5px 10px;

    cursor:pointer;

    font-size:12px;

    font-weight:700;

    color:#9ca3af;

    transition:.25s;

    white-space:nowrap;

}

.lang-toggle:hover{

    border-color:#8F5BFF;

    background:rgba(143,91,255,.12);

}

.lang-toggle .lang-en,
.lang-toggle .lang-ja{

    padding:2px 6px;

    border-radius:20px;

    opacity:.55;

    transition:.2s;

}

.lang-toggle .lang-en.active,
.lang-toggle .lang-ja.active{

    opacity:1;

    background:#8F5BFF;

    color:#fff;

}

.lang-toggle .lang-divider{

    opacity:.4;

    font-size:10px;

}

.mood-btn{

    display:inline-flex;

    align-items:center;

    gap:8px;

    color:#D8D8D8;

    text-decoration:none;

    font-size:13px;

    font-weight:700;

    padding:7px 13px;

    border-radius:40px;

    border:1px solid rgba(255,255,255,.12);

    background:rgba(255,255,255,.04);

    transition:.3s;

}

.mood-btn:hover{

    color:white;

    border-color:#8F5BFF;

    background:rgba(143,91,255,.12);

}


/* LOGIN BUTTON */

.login-btn{

    padding:9px 22px;

    border:none;

    border-radius:40px;

    cursor:pointer;

    color:white;

    font-size:13.5px;

    background:linear-gradient(
    135deg,
    #7B2EFF,
    #3F8CFF);

    font-weight:700;

    transition:.35s;

}

.login-btn:hover{

    transform:translateY(-3px);

    box-shadow:

    0 0 25px rgba(123,46,255,.7);

}


/* ==========================================
            HERO
========================================== */

.hero{
    width:90%;
    margin:72px auto 70px;
    text-align:center;
    position:relative;
    z-index:1000;
}

/* Manga-run hero: a short, stocky, faceless & colourless ink silhouette
   (Vegeta-style) sprints along the heading from "Find", jumps over "Your",
   lands screaming near "You" with an electrifying burst. Loops. */

.hero h1{

    font-size:70px;

    font-weight:800;

    line-height:1.2;

}

.hero h1 .hero-words span{
    display:inline-block;
}

/* Chill living effect on the heading: gentle float, slow iridescent
   shimmer across "Anime Community", soft breathing glow. All slow + subtle. */
.hero h1{
    animation:h1Float 8s ease-in-out infinite;
}
@keyframes h1Float{
    0%,100%{transform:translateY(0)}
    50%{transform:translateY(-6px)}
}
.hero h1 .hero-words{
    background:linear-gradient(100deg,#9b6bff,#c9a6ff 30%,#79e0ff 55%,#c9a6ff 80%,#9b6bff);
    background-size:280% 100%;
    -webkit-background-clip:text;
    background-clip:text;
    -webkit-text-fill-color:transparent;
    color:transparent;
    animation:wordShimmer 9s linear infinite;
    filter:drop-shadow(0 0 16px rgba(150,105,235,.55)) drop-shadow(0 0 44px rgba(120,80,235,.35));
}
@keyframes wordShimmer{
    0%{background-position:0% 50%}
    100%{background-position:280% 50%}
}
@media (prefers-reduced-motion:reduce){
    .hero h1{animation:none}
    .hero h1 .hero-words{animation:none}
}

.hero p{

    width:70%;

    margin:30px auto;

    color:#BFBFBF;

    font-size:20px;

    line-height:1.8;

}


/* SEARCH BAR */

.search-box{

    width:650px;

    max-width:90%;

    margin:50px auto;

    display:flex;

    align-items:center;

    padding:18px 25px;

    background:rgba(255,255,255,.06);

    border-radius:60px;

    border:1px solid rgba(255,255,255,.08);

    backdrop-filter:blur(20px);

}

.search-box i{

    color:#8F5BFF;

    font-size:20px;

}

.search-box input{

    flex:1;

    margin-left:18px;

    border:none;

    outline:none;

    background:none;

    color:white;

    font-size:18px;

    font-family:Montserrat;

}

.search-box input::placeholder{

    color:#A8A8A8;

}


/* ==========================================
            SECTION TITLE
========================================== */

.section-title{

    width:90%;

    margin:70px auto 30px;

}

.section-title h2{

    font-size:40px;

    font-weight:800;

    color:white;

    letter-spacing:1px;

}


/* ==========================================
        FLOAT ANIMATION
========================================== */

.page-leaving{animation:pageFadeOut .11s ease forwards;pointer-events:none}
@keyframes pageFadeOut{to{opacity:.35;transform:translateY(3px)}}

@keyframes float{

    0%{

        transform:
        translateY(0px)
        translateX(0px);

    }

    50%{

        transform:
        translateY(-40px)
        translateX(35px);

    }

    100%{

        transform:
        translateY(0px)
        translateX(0px);

    }

}

/* ============================
        ANIME GRID
============================ */

.anime-grid{

    width:90%;

    margin:40px auto 80px;

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:30px;

}


/* ============================
        CARD
============================ */

.anime-card{

    background:#151A2D;

    border-radius:20px;

    overflow:hidden;

    transition:.35s;

    cursor:pointer;

    box-shadow:0 15px 35px rgba(0,0,0,.45);

}

.anime-card:hover{

    transform:translateY(-12px);

    box-shadow:
    0 0 25px rgba(123,46,255,.5),
    0 20px 40px rgba(0,0,0,.5);

}


/* ============================
        IMAGE
============================ */

.image-box{

    position:relative;

    width:100%;

    height:370px;

    overflow:hidden;

}

.image-box img{

    width:100%;

    height:100%;

    object-fit:cover;

    transition:.4s;

}

.anime-card:hover img{

    transform:scale(1.08);

}


/* ============================
        BADGES
============================ */

.anime-badge{

    position:absolute;

    top:15px;

    left:15px;

    background:#ff3b6b;

    color:white;

    padding:6px 14px;

    border-radius:30px;

    font-size:12px;

    font-weight:700;

}

.badge-foryou {
    background:#27d07d !important;
    color:#fff !important;
}
.badge-new {
    background:#ff3b6b !important;
    color:#fff !important;
}
.badge-airing {
    background:#3b82f6 !important;
    color:#fff !important;
}

.rating-badge{

    top:15px;
    left:auto;
    right:15px;
    background:#171f29;
    border:1px solid rgba(255,213,74,.5);
    color:#ffd54a;
    display:flex;
    align-items:center;
    gap:6px;

}

.anime-rating{

    position:absolute;

    top:15px;

    right:15px;

    background:rgba(0,0,0,.7);

    padding:6px 12px;

    border-radius:30px;

    font-size:13px;

}


/* ============================
        OVERLAY
============================ */

.overlay{

    position:absolute;

    inset:0;

    background:rgba(0,0,0,.55);

    display:flex;

    justify-content:center;

    align-items:center;

    opacity:0;

    transition:.35s;

}

.anime-card:hover .overlay{

    opacity:1;

}

.chat-btn{

    padding:14px 28px;

    border:none;

    border-radius:40px;

    background:#7B2EFF;

    color:white;

    font-weight:700;

    cursor:pointer;

}


/* ============================
        CONTENT
============================ */

.card-content{

    padding:18px;

}

.card-content h3{

    font-size:22px;

    margin-bottom:10px;

}

.anime-description{

    color:#B8B8B8;

    font-size:14px;

    line-height:1.6;

    margin-bottom:18px;

}

/* ============================
        SUB / DUB / EPISODE / ARC CHIPS
============================ */

.card-meta{

    display:flex;

    flex-wrap:wrap;

    gap:8px;

    margin:0 0 16px;

}

.chip{

    display:inline-flex;

    align-items:center;

    gap:6px;

    padding:5px 12px;

    border-radius:30px;

    font-size:11px;

    font-weight:700;

    letter-spacing:.4px;

    transition:.25s;

}

.chip-episodes{

    background:rgba(123,46,255,.14);

    color:#b78cff;

    border:1px solid rgba(123,46,255,.35);

}

.chip-sub{

    background:rgba(255,213,74,.1);

    color:#ffd54a;

    border:1px solid rgba(255,213,74,.35);

}

.chip-dub{

    background:rgba(255,59,107,.12);

    color:#ff8fae;

    border:1px solid rgba(255,59,107,.4);

}

.chip-arcs{

    background:rgba(56,189,248,.1);

    color:#7dd3fc;

    border:1px solid rgba(56,189,248,.35);

}

.anime-card:hover .chip{

    transform:translateY(-2px);

}

.card-bottom{

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.members{

    color:#CFCFCF;

    font-size:14px;

}

.online{

    color:#39ff88;

    font-weight:600;

}

.heart{

    color:white;

    font-size:18px;

}


/* ============================
        RESPONSIVE
============================ */

@media(max-width:1200px){

.anime-grid{

grid-template-columns:repeat(3,1fr);

}

}

@media(max-width:900px){

.anime-grid{

grid-template-columns:repeat(2,1fr);

}

}

@media(max-width:600px){

.anime-grid{

grid-template-columns:1fr;

}

}
.search-box{
    position:relative;
}

.search-box{
    position:relative;
    z-index:1000;
}

.search-box{

    position:relative;

}

#searchResults{

    position:absolute;

    top:78px;

    left:50%;

    transform:translateX(-50%);

    width:720px;

    max-width:95vw;

    background:#151C2D;

    border-radius:18px;

    overflow:hidden;

    display:none;

    z-index:99999;

    box-shadow:0 20px 60px rgba(0,0,0,.45);

}

.search-card{

    display:flex;

    align-items:center;

    gap:16px;

    padding:12px 18px;

    cursor:pointer;

    transition:.25s;

    border-bottom:1px solid rgba(255,255,255,.05);

}

.search-card:last-child{

    border:none;

}

.search-card:hover{

    background:#202742;

}

.search-card img{

    width:60px;

    height:80px;

    object-fit:cover;

    border-radius:8px;

    flex-shrink:0;

}

.search-info{

    display:flex;

    flex-direction:column;

}

.search-info h4{

    margin:0;

    color:white;

    font-size:18px;

}

.search-info p{

    margin-top:6px;

    color:#8FA2C2;

    font-size:14px;

}

.search-item span{

    margin-top:5px;

    color:#9b9b9b;

}

.card-bottom{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-top:18px;
}

.enter-chat{
    color:#7dd3fc;
    text-decoration:none;
    font-weight:700;
    font-size:15px;
    display:flex;
    align-items:center;
    gap:8px;
    transition:.25s;
}

.enter-chat:hover{
    color:#ffffff;
    transform:translateX(4px);
}

.heart{
    cursor:pointer;
    font-size:18px;
    transition:.25s;
}

.heart:hover{
    color:#ff5f8a;
}

/* ============================
        CATEGORIES DROPDOWN
============================ */

.nav-cat{
    position:relative;
}

.category-menu{
    position:absolute;
    top:calc(100% + 20px);
    left:-160px;
    background:#131827;
    border:1px solid rgba(143,91,255,.35);
    border-radius:16px;
    padding:24px 28px;
    min-width:620px;
    display:none;
    z-index:10000;
    box-shadow:0 26px 70px rgba(0,0,0,.6),0 0 30px rgba(123,46,255,.15);
}

.nav-cat.open .category-menu{
    display:flex;
    gap:34px;
}
.nav-cat.open .cat-toggle{
    color:white;
    background:rgba(143,91,255,.14);
    box-shadow:0 0 14px rgba(143,91,255,.35);
}

@keyframes catIn{
    from{
        opacity:0;
        transform:translateY(-8px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.category-menu::before{
    content:"";
    position:absolute;
    top:-20px;
    left:0;
    right:0;
    height:20px;
}

.cat-col{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.cat-browse{
    min-width:180px;
    border-right:1px solid rgba(255,255,255,.08);
    padding-right:30px;
}

.cat-col a{
    color:#cfd3e3;
    text-decoration:none;
    font-size:15px;
    font-weight:600;
    padding:8px 10px;
    border-radius:8px;
    transition:.25s;
    white-space:nowrap;
}

.cat-col a:hover{
    color:#fff;
    background:linear-gradient(135deg,rgba(143,91,255,.3),rgba(63,140,255,.18));
    box-shadow:0 0 16px rgba(143,91,255,.45);
    transform:translateX(3px);
    text-shadow:0 0 10px rgba(201,168,255,.7);
}

.cat-heading{
    color:#8F5BFF;
    font-size:12px;
    letter-spacing:2px;
    font-weight:800;
    text-transform:uppercase;
    margin:0 0 8px 10px;
    text-shadow:0 0 10px rgba(143,91,255,.5);
}

.cat-genre-cols{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:4px 22px;
}

/* ============================
        BROWSE PAGE
============================ */

.browse-head{
    width:90%;
    margin:70px auto 10px;
}

.browse-head h1{
    font-size:40px;
    font-weight:800;
    color:white;
    letter-spacing:1px;
}

.browse-sub{
    color:#8f94b0;
    margin-top:10px;
    font-size:16px;
}

.sort-tabs{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:26px;
}

.sort-tab{
    background:#151A2D;
    border:1px solid rgba(255,255,255,.09);
    color:#cfd3e3;
    padding:10px 22px;
    border-radius:999px;
    font-size:14px;
    font-weight:700;
    text-decoration:none;
    transition:.3s;
}

.sort-tab:hover{
    border-color:#8F5BFF;
    color:white;
    transform:translateY(-2px);
}

.sort-tab.active{
    background:linear-gradient(135deg,#8F5BFF,#5B2FD6);
    color:white;
    border-color:transparent;
    box-shadow:0 10px 26px rgba(143,91,255,.35);
}

.genre-chips{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:22px;
}

.genre-chip{
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.1);
    color:#cfd3e3;
    padding:8px 16px;
    border-radius:999px;
    font-size:13px;
    font-weight:600;
    text-decoration:none;
    transition:.3s;
}

.genre-chip:hover{
    border-color:#8F5BFF;
    color:white;
}

.genre-chip.active{
    background:linear-gradient(135deg,#8F5BFF,#5B2FD6);
    color:white;
    border-color:transparent;
}

.search-meta{
    color:#8f94b0;
    font-size:12px;
    margin-top:3px;
    letter-spacing:.4px;
}

@media(max-width:900px){
    .category-menu{
        left:-100px;
        min-width:460px;
        padding:18px 20px;
    }
    .cat-genre-cols{
        grid-template-columns:repeat(2,1fr);
    }
}

/* ============================
        NAVBAR RESPONSIVE
============================ */

@media(max-width:1150px){

    nav{
        flex-wrap:wrap;
        row-gap:10px;
    }

    .nav-links{
        order:3;
        flex-basis:100%;
        justify-content:center;
        flex-wrap:wrap;
        row-gap:6px;
    }

    .nav-right{
        margin-left:auto;
    }

}

@media(max-width:640px){

    nav{
        padding:12px 18px;
    }

    .nav-right .mood-btn span,
    .mood-btn{
        font-size:13px;
        padding:8px 12px;
    }

    .logo{
        font-size:22px;
    }

}
/* ===============================================
   RANK BADGES — ELEMENT-THEMED ANIMATIONS
   S+ cosmic, S fire, A lightning, B water bowl,
   C earth, D wind, F poop
========================================== */

/* --- shared base --- */
.rank-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 18px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 2px;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.rank-badge::before,
.rank-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
}

/* ---- Review XP badge (filled box matching rank) ---- */
.xp-bar {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 4px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
    min-width: 80px;
    height: 24px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
}
.xp-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.7;
    animation: elixirFlow 4s ease-in-out infinite;
}
.xp-bar-fill::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -5%;
    width: 110%;
    height: 8px;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    background: inherit;
    animation: elixirWave 2.5s ease-in-out infinite;
}
.xp-bar-fill::after {
    content: '';
    position: absolute;
    top: -2px;
    right: 10%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    animation: elixirBubble 3s ease-in-out infinite;
}
@keyframes elixirFlow {
    0%, 100% { filter: brightness(1) saturate(1.1); }
    50% { filter: brightness(1.2) saturate(1.3); }
}
@keyframes elixirWave {
    0%, 100% { transform: translateX(-2%) scaleY(1); }
    25% { transform: translateX(1%) scaleY(1.3); }
    50% { transform: translateX(-1%) scaleY(0.8); }
    75% { transform: translateX(2%) scaleY(1.2); }
}
@keyframes elixirBubble {
    0% { opacity: 0; transform: translateY(4px) scale(0.5); }
    20% { opacity: 0.6; transform: translateY(0px) scale(1); }
    100% { opacity: 0; transform: translateY(-12px) scale(0.3); }
}
.xp-bar-text {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
/* F rank */
.xp-bar.rank-F { border-color: rgba(239,68,68,.25); }
.xp-bar.rank-F .xp-bar-fill { background: linear-gradient(90deg, #991b1b, #dc2626, #ef4444); }
.xp-bar.rank-F .xp-bar-text { color: #ef4444; }
/* D rank */
.xp-bar.rank-D { border-color: rgba(255,255,255,.08); }
.xp-bar.rank-D .xp-bar-fill { background: linear-gradient(90deg, #475569, #64748b, #94a3b8); }
.xp-bar.rank-D .xp-bar-text { color: rgba(255,255,255,.4); }
/* C rank */
.xp-bar.rank-C { border-color: rgba(56,189,248,.2); }
.xp-bar.rank-C .xp-bar-fill { background: linear-gradient(90deg, #0369a1, #0ea5e9, #38bdf8); }
.xp-bar.rank-C .xp-bar-text { color: #38bdf8; }
/* B rank */
.xp-bar.rank-B { border-color: rgba(167,139,250,.2); }
.xp-bar.rank-B .xp-bar-fill { background: linear-gradient(90deg, #6d28d9, #8b5cf6, #a78bfa); }
.xp-bar.rank-B .xp-bar-text { color: #a78bfa; }
/* A rank */
.xp-bar.rank-A { border-color: rgba(232,212,77,.2); }
.xp-bar.rank-A .xp-bar-fill { background: linear-gradient(90deg, #a16207, #eab308, #facc15); }
.xp-bar.rank-A .xp-bar-text { color: #e8d44d; }
/* S rank */
.xp-bar.rank-S { border-color: rgba(39,208,125,.25); }
.xp-bar.rank-S .xp-bar-fill { background: linear-gradient(90deg, #15803d, #16a34a, #22c55e); }
.xp-bar.rank-S .xp-bar-text { color: #27d07d; }
/* S+ rank */
.xp-bar.rank-S\+ { border-color: rgba(39,208,125,.35); }
.xp-bar.rank-S\+ .xp-bar-fill { background: linear-gradient(90deg, #27d07d, #22c55e); }
.xp-bar.rank-S\+ .xp-bar-text { color: #27d07d; }

/* ===============================================
   S+ COSMIC — Milky Way galaxy inside the badge
========================================== */
@keyframes galaxySpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes cosmicBreathe {
    0%,100% { box-shadow: 0 0 14px rgba(100,80,200,0.4), 0 0 30px rgba(255,215,0,0.2); }
    50%     { box-shadow: 0 0 28px rgba(100,80,200,0.7), 0 0 50px rgba(255,215,0,0.35), 0 0 70px rgba(168,139,250,0.15); }
}
@keyframes starDrift {
    0%   { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}
.rank-S\+ {
    /* Deep space background */
    background: radial-gradient(ellipse at 50% 50%, #1a1033 0%, #0d0a1a 40%, #050310 100%);
    animation: cosmicBreathe 2.5s ease-in-out infinite;
    color: #e8d5ff;
    text-shadow: 0 0 8px rgba(168,139,250,0.9), 0 0 16px rgba(255,215,0,0.5);
    border: 1px solid rgba(168,139,250,0.3);
}
/* Galaxy spiral arm layer */
.rank-S\+::before {
    background:
        /* Spiral arm 1 */
        conic-gradient(from 0deg at 50% 50%,
            transparent 0deg, rgba(168,139,250,0.25) 30deg, transparent 60deg,
            transparent 90deg, rgba(255,180,100,0.15) 120deg, transparent 150deg,
            transparent 180deg, rgba(168,139,250,0.2) 210deg, transparent 240deg,
            transparent 270deg, rgba(255,215,0,0.15) 300deg, transparent 330deg
        ),
        /* Nebula glow */
        radial-gradient(ellipse at 45% 55%, rgba(168,139,250,0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 55% 45%, rgba(255,180,100,0.15) 0%, transparent 45%);
    animation: galaxySpin 20s linear infinite;
}
/* Star field */
.rank-S\+::after {
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.9) 0.8px, transparent 1.2px),
        radial-gradient(circle at 80% 15%, rgba(255,255,255,0.7) 0.6px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255,255,255,0.8) 0.7px, transparent 1.1px),
        radial-gradient(circle at 70% 65%, rgba(255,215,0,0.7) 0.5px, transparent 0.8px),
        radial-gradient(circle at 25% 55%, rgba(168,139,250,0.6) 0.5px, transparent 0.8px),
        radial-gradient(circle at 60% 30%, rgba(255,255,255,0.6) 0.4px, transparent 0.7px),
        radial-gradient(circle at 90% 80%, rgba(255,255,255,0.5) 0.4px, transparent 0.7px),
        radial-gradient(circle at 10% 70%, rgba(255,255,255,0.5) 0.5px, transparent 0.8px),
        radial-gradient(circle at 50% 50%, rgba(255,215,0,0.8) 1px, transparent 1.5px);
    animation: starDrift 15s linear infinite;
    background-size: 100% 100%;
}

/* ===============================================
   S FIRE — badge is literally burning from outside edges
========================================== */
@keyframes flameEdge {
    0%   { background-position: 50% 100%; filter: brightness(0.9); }
    25%  { background-position: 30% 60%; filter: brightness(1.15); }
    50%  { background-position: 70% 30%; filter: brightness(1.25); }
    75%  { background-position: 40% 70%; filter: brightness(1.05); }
    100% { background-position: 50% 100%; filter: brightness(0.9); }
}
@keyframes fireBorder {
    0%,100% {
        box-shadow:
            /* blue fire on ALL edges */
            0 -4px 8px rgba(56,189,248,0.6), 0 -8px 16px rgba(59,130,246,0.4), 0 -12px 24px rgba(34,211,238,0.2),
            0 4px 8px rgba(56,189,248,0.6), 0 8px 16px rgba(59,130,246,0.4), 0 12px 24px rgba(34,211,238,0.2),
            -4px 0 8px rgba(96,165,250,0.5), -8px 0 16px rgba(56,189,248,0.3),
            4px 0 8px rgba(96,165,250,0.5), 8px 0 16px rgba(56,189,248,0.3);
    }
    33% {
        box-shadow:
            0 -6px 12px rgba(34,211,238,0.8), 0 -10px 20px rgba(56,189,248,0.5), 0 -16px 30px rgba(96,165,250,0.3),
            0 3px 6px rgba(56,189,248,0.5), 0 6px 12px rgba(59,130,246,0.35),
            -6px 0 12px rgba(96,165,250,0.7), -10px 0 20px rgba(56,189,248,0.4),
            5px 0 10px rgba(96,165,250,0.6), 8px 0 18px rgba(34,211,238,0.35);
    }
    66% {
        box-shadow:
            0 -5px 10px rgba(34,211,238,0.7), 0 -12px 22px rgba(56,189,248,0.5), 0 -18px 35px rgba(96,165,250,0.25),
            0 5px 10px rgba(56,189,248,0.6), 0 10px 20px rgba(59,130,246,0.4),
            -5px 0 10px rgba(96,165,250,0.6), -8px 0 16px rgba(34,211,238,0.35),
            6px 0 12px rgba(96,165,250,0.7), 10px 0 20px rgba(56,189,248,0.3);
    }
}
@keyframes flameLick {
    0%,100% { transform: translateY(0) scaleY(1); opacity: 0.6; }
    50%     { transform: translateY(-4px) scaleY(1.3); opacity: 1; }
}
.rank-S {
    /* Dark interior — fire is ONLY on the border edges */
    background: linear-gradient(135deg, #0a0a1a 0%, #111827 50%, #0a0a1a 100%);
    animation: fireBorder 0.7s ease-in-out infinite;
    color: #93c5fd;
    text-shadow: 0 0 8px rgba(59,130,246,0.9), 0 0 16px rgba(96,165,250,0.6);
    border: none;
}
/* Inner soft glow — no fire inside, just subtle blue ambient */
.rank-S::before {
    background: radial-gradient(ellipse at 50% 50%, rgba(59,130,246,0.08) 0%, transparent 70%);
    animation: flameLick 1.5s ease-in-out infinite;
}
/* Blue flame tips licking upward from the top border */
.rank-S::after {
    background:
        radial-gradient(ellipse at 20% -8%, rgba(56,189,248,0.7) 0%, rgba(59,130,246,0.3) 25%, transparent 55%),
        radial-gradient(ellipse at 50% -10%, rgba(96,165,250,0.6) 0%, rgba(34,211,238,0.25) 20%, transparent 50%),
        radial-gradient(ellipse at 78% -6%, rgba(56,189,248,0.5) 0%, rgba(59,130,246,0.2) 20%, transparent 45%),
        radial-gradient(ellipse at 35% calc(100% + 8px), rgba(56,189,248,0.5) 0%, rgba(59,130,246,0.2) 25%, transparent 50%),
        radial-gradient(ellipse at 65% calc(100% + 10px), rgba(96,165,250,0.4) 0%, rgba(34,211,238,0.15) 20%, transparent 45%);
    animation: flameLick 0.5s ease-in-out infinite alternate;
}

/* ===============================================
   A LIGHTNING — real lightning bolt strike
========================================== */
@keyframes boltFlash {
    0%,78%,100% { opacity: 0; }
    80%  { opacity: 1; }
    82%  { opacity: 0.05; }
    84%  { opacity: 0.95; }
    86%  { opacity: 0; }
    88%  { opacity: 0.6; }
}
@keyframes boltStrike {
    0%   { transform: translateY(-100%) scaleY(0.5); opacity: 0; }
    10%  { transform: translateY(0%) scaleY(1); opacity: 1; }
    12%  { opacity: 0.1; }
    14%  { opacity: 0.9; }
    20%  { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes skyGlow {
    0%,100% { box-shadow: 0 0 4px rgba(254,202,87,0.2); }
    50%     { box-shadow: 0 0 20px rgba(254,202,87,0.8), 0 0 40px rgba(139,92,246,0.4), 0 0 60px rgba(255,255,255,0.15); }
}
.rank-A {
    /* Dark stormy sky */
    background: linear-gradient(180deg, #070710 0%, #0f0f2e 30%, #1a1a3e 60%, #111827 100%);
    animation: skyGlow 2.5s ease-in-out infinite;
    color: #fde68a;
    text-shadow: 0 0 8px rgba(254,202,87,0.95);
    border: 1px solid rgba(254,202,87,0.15);
}
/* Lightning bolt from RIGHT to LEFT */
.rank-A::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(254,202,87,0.9) 40%, rgba(139,92,246,0.8) 100%);
    clip-path: polygon(
        90% 0%, 98% 0%,
        75% 18%, 82% 20%,
        55% 38%, 65% 42%,
        35% 55%, 45% 58%,
        20% 72%, 30% 78%,
        8% 100%, 25% 82%,
        18% 78%, 42% 60%,
        32% 56%, 60% 40%,
        50% 36%, 80% 16%
    );
    animation: boltStrike 3s ease-in-out infinite;
}
/* Border glow AFTER lightning strike */
.rank-A::after {
    background: transparent;
    animation: boltFlash 4s infinite;
    border: 2px solid transparent;
}
@keyframes boltFlash {
    0%,78%,100% { opacity: 0; border-color: transparent; box-shadow: none; }
    80%  { opacity: 1; border-color: rgba(254,202,87,0.9); box-shadow: 0 0 12px rgba(254,202,87,0.6), inset 0 0 8px rgba(254,202,87,0.15); }
    82%  { opacity: 0.1; border-color: rgba(139,92,246,0.2); box-shadow: none; }
    84%  { opacity: 0.95; border-color: rgba(254,202,87,0.8); box-shadow: 0 0 14px rgba(254,202,87,0.7), inset 0 0 6px rgba(139,92,246,0.2); }
    86%  { opacity: 0; border-color: transparent; box-shadow: none; }
    88%  { opacity: 0.6; border-color: rgba(254,202,87,0.4); box-shadow: 0 0 8px rgba(254,202,87,0.3); }
    92%  { opacity: 0; border-color: transparent; box-shadow: none; }
}

/* ===============================================
   B WATER — water inside a bowl, visible waterline
========================================== */
@keyframes waterDeep {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}
@keyframes waveSurface {
    0%   { clip-path: polygon(0% 42%, 8% 36%, 18% 46%, 28% 34%, 40% 44%, 52% 32%, 64% 42%, 76% 30%, 88% 40%, 96% 34%, 100% 42%, 100% 100%, 0% 100%); }
    50%  { clip-path: polygon(0% 38%, 10% 48%, 20% 36%, 32% 46%, 44% 34%, 56% 44%, 68% 32%, 80% 42%, 90% 36%, 96% 46%, 100% 38%, 100% 100%, 0% 100%); }
    100% { clip-path: polygon(0% 42%, 8% 36%, 18% 46%, 28% 34%, 40% 44%, 52% 32%, 64% 42%, 76% 30%, 88% 40%, 96% 34%, 100% 42%, 100% 100%, 0% 100%); }
}
@keyframes waterShimmer {
    0%,100% { box-shadow: 0 0 6px rgba(84,160,255,0.4), inset 0 -2px 6px rgba(125,211,252,0.2); }
    50%     { box-shadow: 0 0 16px rgba(84,160,255,0.7), 0 0 28px rgba(59,130,246,0.3), inset 0 -4px 10px rgba(125,211,252,0.35); }
}
@keyframes bubbleRise {
    0%   { transform: translateY(80%) translateX(0) scale(0.3); opacity: 0; }
    15%  { opacity: 0.8; transform: translateY(50%) translateX(1px) scale(0.6); }
    40%  { opacity: 0.6; transform: translateY(20%) translateX(-2px) scale(0.8); }
    70%  { opacity: 0.4; transform: translateY(-10%) translateX(3px) scale(0.9); }
    100% { transform: translateY(-15%) translateX(0) scale(0.7); opacity: 0; }
}
.rank-B {
    /* Bowl: empty transparent top, deep water below waterline at ~40% */
    background: linear-gradient(180deg, rgba(6,182,212,0.06) 0%, rgba(6,182,212,0.03) 30%, rgba(14,116,144,0.35) 42%, #0369a1 55%, #075985 70%, #0c4a6e 85%, #082f49 100%);
    animation: waterDeep 3s ease-in-out infinite, waterShimmer 2s ease-in-out infinite;
    color: #bae6fd;
    text-shadow: 0 0 6px rgba(56,189,248,0.9), 0 0 12px rgba(84,160,255,0.5);
    border: 1.5px solid rgba(56,189,248,0.3);
    border-top-color: rgba(56,189,248,0.12);
}
/* Animated wave surface at the waterline */
.rank-B::before {
    background: linear-gradient(180deg, rgba(125,211,252,0.4) 0%, rgba(56,189,248,0.15) 100%);
    animation: waveSurface 2.2s ease-in-out infinite;
    border-radius: inherit;
}
/* More bubbles from the deep — fast and lively */
.rank-B::after {
    background:
        radial-gradient(circle at 20% 78%, rgba(255,255,255,0.5) 2px, transparent 2.5px),
        radial-gradient(circle at 45% 88%, rgba(255,255,255,0.35) 1.5px, transparent 2px),
        radial-gradient(circle at 65% 72%, rgba(255,255,255,0.45) 1.5px, transparent 2px),
        radial-gradient(circle at 82% 82%, rgba(255,255,255,0.3) 1px, transparent 1.5px),
        radial-gradient(circle at 35% 68%, rgba(125,211,252,0.35) 1px, transparent 1.5px);
    animation: bubbleRise 1.8s ease-in-out infinite;
}

/* ===============================================
   C EARTH — realistic rock with cracks + falling debris
========================================== */
@keyframes rockImpact {
    0%,100% { transform: translateY(0) rotate(0deg); filter: brightness(1); }
    20%     { transform: translateY(4px) rotate(0.5deg); filter: brightness(0.8); }
    40%     { transform: translateY(-1px) rotate(-0.3deg); filter: brightness(1.05); }
    60%     { transform: translateY(2px) rotate(0.2deg); filter: brightness(0.9); }
}
@keyframes earthRumble {
    0%,100% { box-shadow: 0 0 3px rgba(120,80,30,0.3); }
    20%     { box-shadow: 2px 0 5px rgba(120,80,30,0.4); }
    40%     { box-shadow: -1px 1px 6px rgba(90,60,20,0.5); }
    60%     { box-shadow: 1px -1px 4px rgba(120,80,30,0.4); }
    80%     { box-shadow: -2px 0 5px rgba(90,60,20,0.3); }
}
@keyframes crackPulse {
    0%,100% { opacity: 0.15; }
    50%     { opacity: 0.5; }
}
@keyframes debrisFall {
    0%   { transform: translateY(-2px) rotate(0deg); opacity: 0.6; }
    100% { transform: translateY(6px) rotate(45deg); opacity: 0; }
}
.rank-C {
    background:
        repeating-conic-gradient(rgba(120,80,30,0.08) 0deg, transparent 3deg, transparent 12deg),
        linear-gradient(160deg, #1c1108 0%, #3d2b1f 15%, #5c3a1a 25%, #78592e 40%, #8B6914 50%, #a0723c 55%, #7c5a30 65%, #5c3a1a 80%, #2d1f14 95%);
    background-size: 20px 20px, 100% 100%;
    animation: rockImpact 2s ease-in-out infinite, earthRumble 1s ease-in-out infinite;
    color: #d4a76a;
    text-shadow: 0 0 4px rgba(180,140,80,0.6), 1px 1px 0 rgba(60,40,10,0.5);
    border: 1px solid rgba(120,80,30,0.5);
}
.rank-C::before {
    background:
        linear-gradient(50deg, transparent 42%, rgba(60,40,10,0.4) 49%, rgba(80,55,15,0.3) 51%, transparent 58%),
        linear-gradient(-25deg, transparent 38%, rgba(40,25,5,0.3) 49%, rgba(60,40,10,0.25) 51%, transparent 62%);
    animation: crackPulse 3s ease-in-out infinite;
}
.rank-C::after {
    background: radial-gradient(circle at 25% 80%, rgba(180,140,80,0.3) 1px, transparent 1.5px),
                radial-gradient(circle at 60% 75%, rgba(120,80,30,0.25) 1px, transparent 1.5px),
                radial-gradient(circle at 80% 85%, rgba(140,100,40,0.2) 1px, transparent 1.5px);
    animation: debrisFall 1.8s ease-in infinite;
}

/* ===============================================
   D AIR/WIND — transparent + fast wind streaks + mist
========================================== */
@keyframes windFast {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes windStreak1 {
    0%   { background-position: -200% 0; opacity: 0; }
    30%  { opacity: 0.8; }
    100% { background-position: 300% 0; opacity: 0; }
}
@keyframes windStreak2 {
    0%   { background-position: -150% 0; opacity: 0; }
    40%  { opacity: 0.5; }
    100% { background-position: 250% 0; opacity: 0; }
}
@keyframes mistDrift {
    0%,100% { opacity: 0.15; transform: translateX(0) scaleX(1); }
    50%     { opacity: 0.4;  transform: translateX(5px) scaleX(1.15); }
}
@keyframes airBreathe {
    0%,100% { box-shadow: 0 0 4px rgba(45,212,191,0.2); }
    50%     { box-shadow: 0 0 12px rgba(45,212,191,0.4), 0 0 20px rgba(45,212,191,0.15); }
}
.rank-D {
    background: linear-gradient(135deg, rgba(4,47,46,0.7) 0%, rgba(15,118,110,0.5) 25%, rgba(20,184,166,0.35) 50%, rgba(15,118,110,0.5) 75%, rgba(4,47,46,0.7) 100%);
    background-size: 400% 100%;
    animation: windFast 2s ease-in-out infinite, airBreathe 1.8s ease-in-out infinite;
    color: #99f6e4;
    text-shadow: 0 0 6px rgba(45,212,191,0.7);
    border: 1px solid rgba(45,212,191,0.25);
}
.rank-D::before {
    background:
        linear-gradient(100deg, transparent 15%, rgba(255,255,255,0.35) 30%, rgba(200,245,240,0.5) 40%, rgba(255,255,255,0.35) 50%, transparent 65%),
        linear-gradient(95deg, transparent 20%, rgba(255,255,255,0.2) 45%, rgba(200,245,240,0.3) 55%, transparent 80%);
    background-size: 250% 100%, 300% 100%;
    animation: windStreak1 0.8s linear infinite, windStreak2 1.2s linear infinite;
}
.rank-D::after {
    background: linear-gradient(120deg, transparent 30%, rgba(150,235,225,0.08) 50%, transparent 70%);
    background-size: 300% 100%;
    animation: mistDrift 3s ease-in-out infinite;
}

/* ===============================================
   F POOP
========================================== */
@keyframes poopWobble {
    0%,100% { transform: rotate(0deg); }
    25%     { transform: rotate(-3deg); }
    75%     { transform: rotate(3deg); }
}
@keyframes poopPulse {
    0%,100% { box-shadow: 0 0 4px rgba(139,69,19,0.3); }
    50%     { box-shadow: 0 0 12px rgba(139,69,19,0.5), 0 0 20px rgba(120,80,20,0.2); }
}
.rank-F {
    background: linear-gradient(135deg, #4a2c0a, #7c4a1c, #a0652c, #7c4a1c, #4a2c0a);
    animation: poopWobble 2s ease-in-out infinite, poopPulse 3s ease-in-out infinite;
    color: #fef3c7;
    text-shadow: 0 0 4px rgba(160,101,44,0.7);
    padding-left: 6px;
}
.rank-F::before {
    content: '\1f4a9';
    font-size: 0.9rem;
    position: relative;
    margin-right: 3px;
    animation: poopWobble 1.5s ease-in-out infinite;
}

/* ===============================================
   VOTE BUTTONS (global)
========================================== */
@keyframes btnBounce { 0%,100%{transform:scale(1)} 50%{transform:scale(1.25)} }
.vote-btn-wrap { display:flex; gap:10px; margin-top:14px; align-items:center; }
.vote-btn,
.review-vote-btn {
    background: linear-gradient(135deg,#111827,#0d1420);
    border: 1px solid #1f2937;
    border-radius: 24px;
    padding: 7px 16px;
    cursor: pointer;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    color: #6b7280;
}
.vote-btn:hover,
.review-vote-btn:hover {
    border-color: #374151;
    transform: translateY(-1px);
}
.vote-btn.voted-like,
.review-vote-btn.vote-active.voted-like,
.review-vote-btn.vote-active[data-kind="like"] {
    background: linear-gradient(135deg,#052e16,#064e3b);
    border-color: #22c55e;
    color: #22c55e;
    box-shadow: 0 0 12px rgba(34,197,94,0.35), inset 0 0 8px rgba(34,197,94,0.1);
}
.vote-btn.voted-dislike,
.review-vote-btn.vote-active.voted-dislike,
.review-vote-btn.vote-active[data-kind="dislike"] {
    background: linear-gradient(135deg,#2a0a0a,#3b0d0d);
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 12px rgba(239,68,68,0.35), inset 0 0 8px rgba(239,68,68,0.1);
}
.vote-btn:active,
.review-vote-btn:active {
    animation: btnBounce 0.3s ease;
}
.vote-count {
    font-weight: 700;
    min-width: 10px;
    text-align: center;
}

/* ============================
        LOAD MORE
============================ */

.load-more-wrap{
    width:90%;
    margin:-30px auto 90px;
    text-align:center;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
}

.load-more-btn{
    background:linear-gradient(135deg,#7b2eff,#4f46e5);
    color:#fff;
    border:none;
    border-radius:14px;
    padding:14px 38px;
    font-size:0.98rem;
    font-weight:700;
    font-family:inherit;
    cursor:pointer;
    transition:.25s;
    box-shadow:0 10px 26px rgba(123,46,255,.35);
}

.load-more-btn:hover{
    transform:translateY(-3px);
    box-shadow:0 14px 34px rgba(123,46,255,.5);
}

.load-more-btn:disabled{
    opacity:.75;
    cursor:wait;
    transform:none;
}

.load-more-info{
    font-size:0.8rem;
    color:#8b93b8;
}


/* =====================================================
   Cinematic outline duel intro (wide shot, no faces)
   5s CSS-only timeline above the hero heading.
   Timeline: 0-1s stand+wind | 1-2s lunge+sword swing |
   2-2.3s flash+slash burst | 2.3-3.5s opponent splits+
   petals | 3.5-4.5s sheathe | 4.5-5s breath+wind.
   Every animation shares the same 5s clock so the
   whole scene stays in sync (loop replays it).
===================================================== */
.duel{
    position:relative;
    width:min(560px, 90%);
    height:200px;
    margin:8px auto 2px;
    color:#d7dcff;
    pointer-events:none;
    animation:duelBreath 5s linear infinite;
}
.duel-svg{
    width:100%;
    height:100%;
    display:block;
    overflow:visible;
    filter:drop-shadow(0 0 9px rgba(130,150,255,.20));
}
.duel-svg path,
.duel-svg circle{
    stroke:currentColor;
    stroke-linecap:round;
    stroke-linejoin:round;
}
/* master slow breath of the whole scene (4.5-5s) */
@keyframes duelBreath{0%,86%{transform:scale(1)}93%{transform:scale(1.015)}100%{transform:scale(1)}}

/* --- figures --- */
.duel-svg .swordsman{
    transform-origin:190px 150px;
    animation:swLunge 5s cubic-bezier(.3,.8,.2,1) infinite;
}
@keyframes swLunge{
    0%,20%{transform:translate(0,0) rotate(0)}
    30%{transform:translate(64px,-4px) rotate(-2deg);animation-timing-function:ease-in}
    44%{transform:translate(72px,-3px) rotate(-2deg)}
    56%{transform:translate(10px,0) rotate(0);animation-timing-function:cubic-bezier(.6,.05,.7,.4)}
    72%,100%{transform:translate(0,0) rotate(0)}
}

.duel-svg .sword-arm{
    transform-box:fill-box;
    transform-origin:0% 50%;
    animation:swordSwing 5s ease-in-out infinite;
}
@keyframes swordSwing{
    0%,20%{transform:rotate(-40deg)}
    22%{transform:rotate(-40deg);animation-timing-function:ease-in}
    34%{transform:rotate(28deg)}
    46%{transform:rotate(30deg)}
    60%{transform:rotate(30deg)}
    70%{transform:rotate(14deg);animation-timing-function:ease-out}
    80%{transform:rotate(0deg) translateY(1px)}
    88%{transform:rotate(0deg) translateY(4px)}
    92%,100%{transform:rotate(0deg) translateY(0)}
}

.duel-svg .opp-top{
    transform-box:fill-box;
    transform-origin:50% 100%;
    animation:oppTop 5s cubic-bezier(.3,.6,.7,1) infinite;
}
@keyframes oppTop{
    0%,46%{transform:translate(0,0) rotate(0);opacity:1}
    54%{transform:translate(-16px,-26px) rotate(18deg);animation-timing-function:cubic-bezier(.3,.6,.7,1)}
    66%{transform:translate(-20px,-6px) rotate(32deg)}
    80%{transform:translate(-28px,44px) rotate(50deg)}
    100%{transform:translate(-32px,150px) rotate(58deg);opacity:0}
}
.duel-svg .opp-bottom{
    transform-box:fill-box;
    transform-origin:50% 0%;
    animation:oppBottom 5s cubic-bezier(.3,.6,.7,1) infinite;
}
@keyframes oppBottom{
    0%,46%{transform:translate(0,0) rotate(0);opacity:1}
    54%{transform:translate(10px,6px) rotate(-16deg);animation-timing-function:cubic-bezier(.3,.6,.7,1)}
    70%{transform:translate(14px,40px) rotate(-26deg)}
    82%{transform:translate(18px,92px) rotate(-32deg)}
    100%{transform:translate(20px,160px) rotate(-38deg);opacity:0}
}

/* --- wind lines (drift always, opacity gated by the 5s clock) --- */
.wl{
    position:absolute;
    left:6%;
    top:50%;
    width:44px;
    height:1px;
    background:rgba(165,185,255,.28);
    border-radius:2px;
    animation:windDrift 3s linear infinite,
               wind 5s ease-in-out infinite;
}
.wl-b{top:30%;width:30px;animation:windDrift 3s .3s linear infinite,wind 5s ease-in-out infinite}
.wl-c{top:72%;width:38px;animation:windDrift 3s .6s linear infinite,wind 5s ease-in-out infinite}
@keyframes windDrift{to{transform:translateX(96px)}}
@keyframes wind{
    0%{opacity:0}
    9%{opacity:.55}
    19%{opacity:.45}
    27%{opacity:0}
    88%{opacity:0}
    95%{opacity:.5}
    100%{opacity:.4}
}

/* --- impact: white flash + radial slash burst --- */
.duel-flash{
    position:absolute;
    inset:0;
    background:#fff;
    opacity:0;
    animation:duelFlash 5s steps(1,end) infinite;
}
@keyframes duelFlash{
    0%,40%{opacity:0}
    41%{opacity:.85}
    43%{opacity:.35}
    45%{opacity:0}
    100%{opacity:0}
}

.br{
    position:absolute;
    left:52%;
    top:70%;
    width:0;
    height:0;
    transform-origin:0 0;
}
.br .slash{
    position:absolute;
    left:0;
    top:-1px;
    width:34px;
    height:2px;
    background:#f2f6ff;
    border-radius:2px;
    opacity:0;
    transform-origin:0 50%;
    animation:slashOut 5s steps(1,end) infinite;
}
.br-a{transform:rotate(-165deg)}
.br-b{transform:rotate(-132deg)}
.br-c{transform:rotate(-100deg)}
.br-d{transform:rotate(-68deg)}
.br-e{transform:rotate(-35deg)}
@keyframes slashOut{
    0%,40%{opacity:0;transform:scaleX(0)}
    41.5%{opacity:1;transform:scaleX(.7)}
    43%{opacity:.9;transform:scaleX(1)}
    45%{opacity:0;transform:scaleX(1.3)}
    100%{opacity:0;transform:scaleX(0)}
}

/* --- petals / leaves drifting up as the opponent falls --- */
.petal{
    position:absolute;
    width:4px;
    height:4px;
    border-radius:50%;
    background:#ffe7a3;
    box-shadow:0 0 6px rgba(255,220,140,.5);
    opacity:0;
    animation:petal 5s linear infinite;
}
.pt-a{left:53%;top:64%}
.pt-b{left:57%;top:70%;animation-delay:.25s}
.pt-c{left:50%;top:74%;animation-delay:.5s}
.pt-d{left:55%;top:67%;animation-delay:.75s}
@keyframes petal{
    0%,46%{opacity:0;transform:translate(0,0)}
    55%{opacity:1;transform:translate(6px,-14px)}
    70%{opacity:.85;transform:translate(18px,-34px)}
    82%{opacity:0;transform:translate(26px,-50px)}
    100%{opacity:0;transform:translate(30px,-62px)}
}
@media (prefers-reduced-motion:reduce){
    .duel .duel-svg path,
    .duel .duel-svg circle{stroke-width:2.4}
    .duel{animation:none}
    .duel-svg .swordsman,.duel-svg .sword-arm,
    .duel-svg .opp-top,.duel-svg .opp-bottom{animation:none;transform:none}
    .wl{animation:none;opacity:.5}
    .duel-flash,.br,.petal{animation:none;opacity:0}
}

/* ============================================================
   MOBILE POLISH — navbar + homepage on phones
   ============================================================ */
@media(max-width:640px){

    nav{
        padding:10px 14px;
        row-gap:8px;
    }

    .nav-links{
        flex-wrap:nowrap;
        justify-content:flex-start;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
        scrollbar-width:none;
        padding:2px 0 6px;
    }

    .nav-links::-webkit-scrollbar{ display:none; }

    .nav-links a{
        flex-shrink:0;
        padding:9px 11px;
        font-size:13.5px;
        white-space:nowrap;
    }

    .nav-right{
        gap:8px;
        flex-wrap:wrap;
        justify-content:flex-end;
    }

    .category-menu{
        position:fixed;
        left:12px;
        right:12px;
        top:58px;
        min-width:0;
        max-height:68vh;
        overflow-y:auto;
    }

    .cat-genre-cols{
        grid-template-columns:repeat(2,1fr);
    }

    .hero{
        padding:34px 18px 26px;
    }

    .hero h1{
        font-size:clamp(26px,8vw,42px);
    }

    .hero p{
        font-size:14.5px;
        max-width:100%;
    }

    .search-box{
        width:100%;
        max-width:100%;
    }

}

/* ============================================================
   HOMEPAGE — compact “app-like” first screen on phones.
   Tight hero + section header so the first cards are visible
   immediately, single-column cards with shorter art.
   ============================================================ */
@media(max-width:640px){

    .hero{
        margin:10px auto 4px;
        padding:4px 14px 0;
    }

    .hero h1{
        font-size:clamp(18px,5.6vw,24px);
        line-height:1.15;
        margin-bottom:3px;
    }

    .hero p{
        font-size:11.5px;
        line-height:1.4;
        margin:0 auto 8px;
        max-width:330px;
        display:-webkit-box;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
        overflow:hidden;
    }

    .search-box{
        height:auto;
    }

    .search-box input{
        height:40px;
        font-size:14px;
        margin-left:10px;
    }

    .section-title{
        margin:2px auto 8px;
    }

    .section-title h2{
        font-size:24px;
    }

    .section-title .browse-sub{
        font-size:12.5px;
        margin-top:4px;
    }

    .anime-grid{
        grid-template-columns:1fr;
        width:92%;
        margin:16px auto 40px;
        gap:18px;
    }

    .anime-card{
        border-radius:16px;
    }

    .anime-card:hover{
        transform:none;
    }

    .image-box{
        height:250px;
    }

}

/* ============================================================
   MOBILE NAV — one clean row with a hamburger drawer (≤640px),
   plus card sizing tuned so ~3 anime cards fit one phone screen
   ============================================================ */
.nav-burger{
    display:none;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    width:42px;
    height:42px;
    margin-left:auto;
    border:none;
    background:rgba(255,255,255,.06);
    border:1px solid rgba(255,255,255,.12);
    border-radius:11px;
    cursor:pointer;
    flex-shrink:0;
    order:2;
    padding:0;
}
.nav-burger-bar{
    display:block;
    width:18px;
    height:2px;
    border-radius:2px;
    background:#fff;
    transition:transform .18s ease, opacity .18s ease;
}
nav.nav-mobile-open .nav-burger-bar:nth-child(1){ transform:translateY(6px) rotate(45deg); }
nav.nav-mobile-open .nav-burger-bar:nth-child(2){ opacity:0; }
nav.nav-mobile-open .nav-burger-bar:nth-child(3){ transform:translateY(-6px) rotate(-45deg); }
.nav-burger:hover{ background:rgba(255,255,255,.13); }

@media(max-width:640px){

    nav{
        row-gap:0;
        padding:10px 14px;
    }

    .nav-burger{
        display:inline-flex;
    }

    .nav-links,
    .nav-right{
        display:none;
    }

    nav.nav-mobile-open .nav-links,
    nav.nav-mobile-open .nav-right{
        display:flex;
    }

    nav.nav-mobile-open .nav-links{
        order:3;
        flex-basis:100%;
        flex-direction:column;
        align-items:stretch;
        overflow:visible;
        padding:8px 0 4px;
    }

    nav.nav-mobile-open .nav-links a{
        padding:12px 8px;
        font-size:15px;
        border-bottom:1px solid rgba(255,255,255,.06);
    }

    nav.nav-mobile-open .nav-right{
        order:4;
        flex-basis:100%;
        justify-content:flex-start;
        gap:10px;
        padding:10px 4px 4px;
        flex-wrap:wrap;
    }

    .category-menu{
        position:fixed;
        left:12px;
        right:12px;
        top:56px;
        min-width:0;
        max-height:62vh;
        overflow-y:auto;
    }

    /* ---- phone grid: compact 2-across boxes like the desktop ---- */
    .anime-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        width:94%;
        margin:14px auto 34px;
        gap:12px;
    }

    .anime-card{
        border-radius:14px;
    }

    .anime-card:hover{
        transform:none;
    }

    .image-box{
        height:auto;
        aspect-ratio:4/5;
    }

    .card-content{
        padding:8px 8px 10px;
    }

    .card-content h3{
        font-size:12.5px;
        line-height:1.3;
        margin:0 0 3px;
        display:-webkit-box;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
        overflow:hidden;
    }

    .card-content .anime-description{
        font-size:11px;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
        margin:0 0 6px;
    }

    .card-meta{
        gap:4px;
        margin-bottom:4px;
    }

    .anime-card .chip{
        font-size:9.5px;
        padding:2px 7px;
    }

    .card-bottom{
        flex-direction:column;
        align-items:stretch;
        gap:6px;
    }

    .members{
        font-size:10.5px;
    }

    .heart{
        display:none;
    }

    .card-list-btn{
        width:30px;
        height:30px;
        padding:0;
        justify-content:center;
        flex-shrink:0;
    }

    .card-list-btn span{
        display:none;
    }

    .enter-chat{
        font-size:10.5px;
        padding:7px 8px;
    }

}

/* ============================================================
   CRUNCHYROLL-STYLE MOBILE APP SHELL
   - Persistent 5-tab bottom bar on phones
   - Home feed sections become swipeable poster rails
============================================================ */

.tabbar-spacer{ display:none; }
/* Desktop: the phone dock must never render - without this the generic
   nav{...} rule styles .mob-tabbar as a giant sticky card after the footer. */
.mob-tabbar{ display:none; }

@media (max-width: 820px){
    .tabbar-spacer{
        display:block;
        height:96px;
    }
    .mob-tabbar{
        display:flex;
        align-items:stretch;
        justify-content:space-around;
        position:fixed;
        left:0;
        right:0;
        bottom:0;
        top:auto;                  /* kill the shared nav top:12px -> full-height slab */
        width:100%;                /* kill shared nav width:96% + margins */
        max-width:none;
        margin:0;
        flex-wrap:nowrap;          /* fixed 5-tab dock, never wraps */
        border-radius:0;           /* flush to screen edges */
        height:auto;               /* content-sized dock (~64px) */
        min-height:0;
        z-index:2000;
        background:rgba(9,12,19,.94);
        -webkit-backdrop-filter:blur(18px);
        backdrop-filter:blur(18px);
        border-top:1px solid rgba(255,255,255,.09);
        padding:6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        box-shadow:0 -10px 34px rgba(0,0,0,.45);
    }
    .mob-tabbar .mtb-item{
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:3px;
        flex:1 1 0;
        min-width:0;
        color:#7e8a9d;
        font-size:10px;
        font-weight:700;
        letter-spacing:.02em;
        text-decoration:none;
        padding:5px 2px 3px;
        border-radius:14px;
        transition:color .18s, transform .18s;
        -webkit-tap-highlight-color:transparent;
    }
    .mob-tabbar .mtb-item i{
        font-size:18px;
        line-height:1;
        transition:transform .18s;
    }
    .mob-tabbar .mtb-item:active{
        transform:scale(.92);
    }
    .mob-tabbar .mtb-item.active{
        color:#4ade80;
        text-shadow:0 0 12px rgba(74,222,128,.35);
    }
    .mob-tabbar .mtb-item.active i{
        filter:drop-shadow(0 0 8px rgba(74,222,128,.55));
    }
    .mob-tabbar .mtb-avatar{
        width:21px;
        height:21px;
        border-radius:50%;
        object-fit:cover;
        border:2px solid transparent;
    }
    .mob-tabbar .mtb-item.active .mtb-avatar{
        border-color:#4ade80;
    }
    /* account pill when logged in is a circular accent avatar */
    .mob-tabbar .mtb-item .fas.fa-user{
        font-size:19px;
    }
}

/* ---------- home feed: full 2-across app grid (approved phone layout) ---------- */
/* Rail experiments are removed: on phones, For You / New use the generic
   .anime-grid 2-column grid (below), so every row fills the screen. */
@media (max-width: 640px){
    .anime-grid.for-you-grid,
    .anime-grid.new-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        overflow:visible;
        width:94%;
        margin:14px auto 30px;
        padding:0;
        gap:12px;
    }
}

/* compact feed titles read like app section headers */
@media (max-width: 640px){
    .section-title{
        width:calc(100% - 24px);
        margin:14px auto 4px;
    }
    .section-title h2{
        font-size:19px;
        letter-spacing:-.01em;
    }
    .section-title .browse-sub{
        font-size:11px;
        margin-top:2px;
    }
}

/* ============================================================
   MOBILE-ONLY HOME — spotlight hero card + genre chip rail
   (desktop neutral: everything below is display:none by default)
============================================================ */

.mob-spotlight,
.mob-genres{
    display:none;
}

@media (max-width: 820px){
    .mob-spotlight{
        display:block;
        position:relative;
        width:calc(100% - 24px);
        margin:14px auto 8px;
        border-radius:20px;
        overflow:hidden;
        border:1px solid rgba(255,255,255,.08);
        box-shadow:0 20px 44px rgba(0,0,0,.55);
    }
    .mob-spot-link{
        display:block;
        position:relative;
        text-decoration:none;
        color:#fff;
    }
    .mob-spot-art{
        height:250px;
        background-size:cover;
        background-position:center 22%;
    }
    .mob-spot-veil{
        position:absolute;
        inset:0;
        background:linear-gradient(to top, rgba(5,8,14,.97) 8%, rgba(5,8,14,.55) 46%, rgba(5,8,14,.06) 78%);
    }
    .mob-spot-body{
        position:absolute;
        left:0;
        right:0;
        bottom:0;
        padding:14px 16px 14px;
        display:flex;
        flex-direction:column;
        align-items:flex-start;
        gap:7px;
    }
    .mob-spot-chip{
        display:inline-flex;
        align-items:center;
        gap:5px;
        font-size:9px;
        font-weight:800;
        letter-spacing:.1em;
        text-transform:uppercase;
        color:#4ade80;
        background:rgba(34,197,94,.14);
        border:1px solid rgba(74,222,128,.4);
        padding:4px 11px;
        border-radius:999px;
    }
    .mob-spot-body h2{
        margin:0;
        font-size:22px;
        font-weight:800;
        line-height:1.14;
        display:-webkit-box;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
        overflow:hidden;
    }
    .mob-spot-meta{
        display:flex;
        gap:14px;
        font-size:11.5px;
        font-weight:600;
        color:#b9c5d6;
    }
    .mob-spot-rating i{ color:#ffd54a; margin-right:3px; }
    .mob-spot-members i{ color:#8b98ab; margin-right:3px; }
    .mob-spot-cta{
        margin-top:4px;
        display:inline-flex;
        align-items:center;
        gap:8px;
        background:linear-gradient(135deg,#00c16a,#00995a);
        padding:10px 20px;
        border-radius:999px;
        font-size:12.5px;
        font-weight:800;
        letter-spacing:.02em;
        box-shadow:0 10px 26px rgba(0,193,106,.45);
    }
    .mob-spot-cta i{
        font-size:10px;
    }

    /* ---- genre chips: swipeable discovery rail ---- */
    .mob-genres{
        display:flex;
        flex-wrap:nowrap;
        align-items:center;
        gap:8px;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
        padding:6px 12px 14px;
        width:100%;
        max-width:none;
        margin:0 auto;
        box-sizing:border-box;
        scrollbar-width:none;
        /* the generic nav rule (sticky, wrap, centered) must never
           turn this rail into a floating multi-row panel */
        position:static !important;
        justify-content:flex-start !important;
        z-index:auto !important;
    }
    .mob-genres::-webkit-scrollbar{ display:none; }
    .mob-genres a{
        flex:0 0 auto;
        font-size:11.5px;
        font-weight:700;
        color:#c7d2e0;
        background:rgba(255,255,255,.06);
        border:1px solid rgba(255,255,255,.1);
        padding:7px 14px;
        border-radius:999px;
        text-decoration:none;
        white-space:nowrap;
        -webkit-tap-highlight-color:transparent;
        transition:background .18s, border-color .18s, color .18s;
    }
    .mob-genres a:active{
        background:rgba(143,91,255,.22);
        border-color:#8f5bff;
        color:#fff;
    }

    /* spotlight sits between hero + content; tighten hero on phones */
    .hero{
        margin-bottom:2px;
    }
}

/* ---- cinematic edge fade on poster rails ---- */
@media (max-width: 640px){
    .anime-grid.for-you-grid,
    .anime-grid.new-grid{
        -webkit-mask-image:linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 12px), transparent 100%);
        mask-image:linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 12px), transparent 100%);
        scroll-padding-left:14px;
    }
}

/* ============================================================
   SPOTLIGHT V2 — slim strip, not a billboard.
   The v1 full-bleed card ate the whole phone screen; this is a
   compact horizontal row (~100px) that keeps the identity without
   pushing the feed off-screen.
============================================================ */

@media (max-width: 820px){
    .mob-spotlight{
        width:calc(100% - 24px);
        margin:8px auto 2px;
        border-radius:16px;
        overflow:hidden;
        border:1px solid rgba(255,255,255,.08);
        background:linear-gradient(135deg, rgba(34,197,94,.07), rgba(255,255,255,.02));
        box-shadow:0 12px 26px rgba(0,0,0,.35);
    }
    .mob-spot-link{
        display:flex;
        align-items:center;
        gap:12px;
        padding:10px 14px;
        text-decoration:none;
        color:#fff;
    }
    .mob-spot-link::after{
        content:"";
        flex:0 0 auto;
        width:8px;
        height:8px;
        margin-left:auto;
        border-right:2px solid #4ade80;
        border-bottom:2px solid #4ade80;
        transform:rotate(-45deg);
        filter:drop-shadow(0 0 4px rgba(74,222,128,.5));
    }
    .mob-spot-art{
        flex:0 0 60px;
        width:60px;
        height:84px;
        border-radius:10px;
        background-size:cover;
        background-position:center top;
        box-shadow:0 8px 18px rgba(0,0,0,.45);
    }
    .mob-spot-veil{ display:none; }
    .mob-spot-body{
        position:static;
        left:auto;
        right:auto;
        bottom:auto;
        padding:0;
        min-width:0;
        display:flex;
        flex-direction:column;
        align-items:flex-start;
        gap:3px;
    }
    .mob-spot-chip{
        font-size:8px;
        padding:2px 8px;
        letter-spacing:.08em;
    }
    .mob-spot-chip i{ font-size:7px; }
    .mob-spot-body h2{
        font-size:15px;
        line-height:1.2;
        margin:0;
        width:100%;
        -webkit-line-clamp:1;
    }
    .mob-spot-meta{
        font-size:10px;
        gap:10px;
    }
    .mob-spot-cta{ display:none; }

    /* genre chips: leaner */
    .mob-genres{
        padding:4px 12px 10px;
        gap:7px;
    }
    .mob-genres a{
        font-size:10.5px;
        padding:6px 12px;
    }
}

/* hero: one line of brand + the search, nothing more */
@media (max-width: 640px){
    .hero p{
        display:none;
    }
    .hero h1{
        font-size:clamp(15px, 4.6vw, 19px);
        margin:0 0 6px;
    }
    .hero{
        margin:6px auto 2px;
        padding:4px 14px 0;
    }
    .hero .search-box{
        max-width:420px;
        margin:0 auto;
    }
}

/* ============================================================
   PHONE HOME FIXUP — v3
   - Remove the rail edge-fade mask (it can blank whole shelves)
   - Give cards soft placeholder tiles so rails never look empty
     while poster images load
   - Bring back the hero line so the first screen has text
============================================================ */
@media (max-width: 640px){
    /* neutralize any mask so rails can never go invisible */
    .anime-grid.for-you-grid,
    .anime-grid.new-grid{
        -webkit-mask-image:none;
        mask-image:none;
    }

    /* placeholder tiles under lazy posters */
    .anime-grid.for-you-grid .anime-card .image-box,
    .anime-grid.new-grid .anime-card .image-box{
        background:rgba(255,255,255,.06);
    }
    .anime-grid .anime-card .image-box{
        background:rgba(255,255,255,.05);
    }

    /* hero: one readable line + the search */
    .hero p{
        display:-webkit-box;
        -webkit-line-clamp:1;
        -webkit-box-orient:vertical;
        overflow:hidden;
        font-size:11.5px;
        margin:0 auto 8px;
        max-width:420px;
    }
    .hero h1{
        font-size:clamp(17px, 5vw, 21px);
        margin:0 0 4px;
    }
    .hero{
        margin:8px auto 4px;
    }
    .hero .search-box{
        height:46px;
        border-radius:16px;
        background:rgba(255,255,255,.07);
        border:1px solid rgba(255,255,255,.1);
    }
    .hero .search-box input{
        font-size:14px;
    }
}

/* ============================================================
   NAVBAR — FINAL MOBILE GUARANTEE
   On phones & tablets all nav links live inside the ☰ drawer.
   These !important rules out-rank every earlier rule on every page.
============================================================ */
@media (max-width: 820px){
    .main-nav .nav-burger{
        display:inline-flex !important;
    }
    .main-nav .nav-links,
    .main-nav .nav-right{
        display:none !important;
    }
    .main-nav.nav-mobile-open .nav-links,
    .main-nav.nav-mobile-open .nav-right{
        display:flex !important;
    }
    .main-nav.nav-mobile-open .nav-links{
        order:3;
        flex-basis:100%;
        flex-direction:column;
        align-items:stretch;
        overflow:visible;
        padding:8px 0 4px;
    }
    .main-nav.nav-mobile-open .nav-links a{
        padding:12px 8px;
        font-size:15px;
        border-bottom:1px solid rgba(255,255,255,.06);
    }
    .main-nav.nav-mobile-open .nav-right{
        order:4;
        flex-basis:100%;
        justify-content:flex-start;
        gap:10px;
        padding:10px 4px 4px;
        flex-wrap:wrap;
    }
}

/* Tall pixel-art avatars (gyaru / fantasy7, 300x600 full-body art)
   are cropped to the face + upper body EVERYWHERE, matching the
   homepage. Position only - never size. */
img[src*="gyaru"],
img[src*="fantasy7"]{
    object-position: top center;
}
