/* =========================================
   1. BASE VARIABLES & RESET
========================================= */
:root {
    --bg-color: #0f0f13; 
    --text-light: #ffffff;
    --text-dim: #a0a0a5;
    --card-radius: 16px;
    --btn-text: #ffffff;
    /* ADD THESE DEFAULTS */
    --bg-blend: overlay; 
    --bg-opacity: 1;     
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    touch-action: manipulation;
}
/* Removes default button styling for our new semantic navigation buttons */
button.nav-item {
    appearance: none;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    button.nav-item {
        font-size: 0.95rem; 
    }
}
body {
    background-color: var(--bg-color);
    color: var(--text-light);
    min-height: 100vh;
    min-height: 100dvh; 
    overflow-x: hidden;
    overscroll-behavior-y: none; 
}
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
}

/* 🔥 Bulletproof Dynamic Background Layer 🔥 */
body::before {
    content: "";
    position: fixed;
    top: -10vh; 
    left: 0;
    width: 100vw;
    height: 120vh; 
    z-index: -1; 
    
    background-color: var(--bg-color); 
    background-image: var(--dynamic-bg); 
    background-blend-mode: var(--bg-blend); 
    opacity: var(--bg-opacity);
    
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    transform: translateZ(0); 
    will-change: transform;
}

/* =========================================
   2. DASHBOARD LAYOUT
========================================= */
.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.dashboard-header { text-align: center; }
.logo { font-size: 2.5rem; font-weight: 900; letter-spacing: 1px; }
.logo .accent { color: rgb(var(--color-primary)); }

.sub-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 4px;
    margin-top: 5px;
    background: linear-gradient(to right, rgb(var(--color-primary)), rgb(var(--color-tertiary)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tournament-banner {
    background-color: #1a1a20; 
    border: 2px solid rgba(var(--color-special), 0.4);
    border-radius: var(--card-radius);
    padding: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0 30px rgba(var(--color-special), 0.15); 
    position: relative;
    overflow: hidden;
}
.history-round-label {
    color: rgb(var(--color-special)); 
    font-weight: 800; 
    margin-bottom: 15px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    font-size: 0.9rem;
}
.tournament-banner::before {
    content: ''; position: absolute; top: -50%; left: -10%; width: 100%; height: 200%;
    background: radial-gradient(circle, rgba(var(--color-special), 0.15) 0%, transparent 60%);
    z-index: 0; pointer-events: none;
}

.banner-content { position: relative; z-index: 1; }
.live-badge {
    background: rgb(var(--color-primary)); color: white; font-size: 0.8rem; font-weight: bold;
    padding: 5px 12px; border-radius: 20px; display: inline-block; margin-bottom: 12px;
    box-shadow: 0 0 10px rgba(var(--color-primary), 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }

.tournament-banner h2 { font-size: 2rem; font-weight: 900; margin-bottom: 5px; color: rgb(var(--color-special)); text-transform: uppercase; }
.tournament-banner p { color: var(--text-dim); font-size: 1.1rem; }

.banner-btn {
    background: rgb(var(--color-special)); color: #000; font-weight: 800; font-size: 1.1rem;
    padding: 18px 35px; border: none; border-radius: 50px; cursor: pointer;
    transition: 0.3s; z-index: 1; box-shadow: 0 0 15px rgba(var(--color-special), 0.4);
}
.banner-btn:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(var(--color-special), 0.7); }

/* --- Grid Layout (Left/Right Split) --- */
.dashboard-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
}
.section-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 20px; color: #fff; border-left: 4px solid rgb(var(--color-primary)); padding-left: 12px; }

/* --- Mode Cards (Left Side) --- */
.mode-cards { display: flex; flex-direction: column; gap: 15px; }
.mode-card {
    background: rgba(255, 255, 255, 0.03); border: 2px solid rgba(255, 255, 255, 0.05);
    padding: 22px; border-radius: 12px; cursor: pointer; transition: 0.3s ease;
}
.mode-card h3 { font-size: 1.4rem; margin-bottom: 5px; }
.mode-card p { color: var(--text-dim); font-size: 0.95rem; }

.girl-mode:hover { 
    border-color: rgb(var(--color-primary)); 
    background: rgba(var(--color-primary), 0.1); 
    box-shadow: 0 0 20px rgba(var(--color-primary), 0.2); 
    transform: translateX(5px); 
}
.boy-mode:hover { 
    border-color: rgb(var(--color-secondary)); 
    background: rgba(var(--color-secondary), 0.1); 
    box-shadow: 0 0 20px rgba(var(--color-secondary), 0.2); 
    transform: translateX(5px); 
}
.mixed-mode:hover { 
    border-color: rgb(var(--color-tertiary)); 
    background: rgba(var(--color-tertiary), 0.1); 
    box-shadow: 0 0 20px rgba(var(--color-tertiary), 0.2); 
    transform: translateX(5px); 
}

/* --- Leaderboard (Right Side) --- */
.leaderboard-box {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--card-radius); padding: 25px;
    display: flex; flex-direction: column; gap: 15px;
}
.lb-item {
    display: flex; align-items: center; gap: 15px; background: rgba(0, 0, 0, 0.4);
    padding: 15px; border-radius: 10px; transition: 0.3s; border: 1px solid transparent;
}
.lb-item:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); transform: scale(1.02); }

.rank { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem; color: #000; }
.gold { background: linear-gradient(135deg, #ffd700, #daa520); box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.silver { background: linear-gradient(135deg, #e0e0e0, #a0a0a0); box-shadow: 0 0 10px rgba(192, 192, 192, 0.5); }
.bronze { background: linear-gradient(135deg, #cd7f32, #8b4513); box-shadow: 0 0 10px rgba(205, 127, 50, 0.5); }

.lb-info h4 { font-size: 1.1rem; margin-bottom: 2px; }
.lb-info p { font-size: 0.9rem; color: rgb(var(--color-primary)); font-weight: bold; }

.menu-btn { padding: 18px; font-size: 1.1rem; font-weight: 800; border-radius: 12px; cursor: pointer; transition: 0.3s; text-align: center; border: none; }
.secondary-btn { background: rgba(255, 255, 255, 0.05); color: white; border: 1px solid rgba(255, 255, 255, 0.1); }
.secondary-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* =========================================
   3. GAME AREA (Cinematic Mode)
========================================= */
.game-header { width: 100%; margin-bottom: 20px; display: flex; justify-content: flex-start; }
.nav-btn { background: transparent; color: var(--text-dim); border: none; font-size: 1.1rem; cursor: pointer; transition: 0.2s; font-weight: bold; }
.nav-btn:hover { color: white; }

.card-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: var(--card-ratio, 3/4); 
    max-height: 65vh;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    background-color: #1a1a20; 
}

.card-info {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 80px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    pointer-events: none; 
}
.idol-name { 
    /* Dynamically scales between 1.6rem (mobile) and 2.2rem (desktop) */
    font-size: clamp(1.6rem, 6vw, 2.2rem); 
    font-weight: 900; 
    text-transform: uppercase; 
    line-height: 1.1; 
    margin-bottom: 4px; 
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); 
    
    /* Prevents massive names from breaking the card vertically */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.idol-group { 
    font-size: 1.1rem; 
    color: var(--text-dim); 
    font-weight: 700; 
    line-height: 1.3;
    
    /* Forces the group name to max 2 lines, adds "..." if longer */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.action-buttons { display: flex; gap: 15px; margin-top: 30px; width: 100%; justify-content: center; }
.btn { font-size: 1.2rem; font-weight: 800; padding: 20px 0; border-radius: 50px; cursor: pointer; transition: all 0.2s ease; border: none; width: 50%; text-align: center; }

.pass-btn { background: rgba(255, 255, 255, 0.05); color: var(--text-light); border: 2px solid rgba(255, 255, 255, 0.1); }
.pass-btn:hover { background: rgba(255, 255, 255, 0.1); transform: scale(0.95); }
.smash-btn { 
    background: rgb(var(--color-primary)); 
    color: var(--btn-text);
    box-shadow: 0 0 15px rgba(var(--color-primary), 0.4); 
}
.smash-btn:hover { 
    transform: scale(1.05); 
    box-shadow: 0 0 25px rgba(var(--color-primary), 0.7); 
}

/* =========================================
   4. RESPONSIVE DESIGN (Mobile)
========================================= */
.dashboard-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo-container {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 30px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.subtitle-badge {
    background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-tertiary)));
    color: white;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 3px;
    padding: 6px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(var(--color-primary), 0.3);
}

.view-more-btn {
    background: transparent;
    color: var(--text-dim);
    border: none;
    font-size: 1rem;
    font-weight: 800;
    padding: 15px 0 5px 0;
    margin-top: 10px;
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.view-more-btn:hover {
    color: var(--text-light);
    transform: translateY(2px);
}

/* =========================================
   5. GALLERY & RANKINGS SYSTEM
========================================= */
.search-container {
    width: 100%;
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

#searchInput {
    width: 100%;
    max-width: 500px;
    padding: 15px 25px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: rgb(var(--color-primary));
    box-shadow: 0 0 15px rgba(var(--color-primary), 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

.gallery-card {
    background: rgba(20, 20, 25, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.15); 
    border-radius: 12px; 
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    cursor: pointer;
    position: relative;
    aspect-ratio: var(--card-ratio, 3/4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.gallery-card:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: rgb(var(--color-primary));
    box-shadow: 0 15px 30px rgba(var(--color-primary), 0.3), 
                0 0 15px rgba(var(--color-tertiary), 0.2);
    z-index: 2; 
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--img-anchor, center);
    transition: transform 0.5s ease; 
}

.gallery-card:hover img {
    transform: scale(1.08);
}

.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 15px 15px; 
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 40%, transparent 100%);
    text-align: center;
    transition: padding 0.3s ease;
}

.gallery-card:hover .gallery-info {
    padding-bottom: 22px; 
}
.gallery-name {
    font-size: clamp(1rem, 4vw, 1.15rem); /* Slightly scaled down so names fit the grid */
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px; /* Reduced from 1px to save horizontal space */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.9);
    margin-bottom: 4px;
    line-height: 1.2;
    
    /* Strict 1-line truncation: guarantees a clean '...' if the name is too massive */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.gallery-group {
    font-size: 0.85rem;
    color: rgb(var(--color-special));
    font-weight: 800;
    letter-spacing: 1px; /* Reduced from 1.5px to save horizontal space */
    text-transform: uppercase;
    line-height: 1.3;
    
    /* Limit anime names to 2 lines max in the grid */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-card::after {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
    z-index: 3;
    pointer-events: none; 
}

.gallery-card:hover::after {
    left: 200%; 
    transition: all 0.6s ease;
}

/* --- STATS MODAL CSS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center; z-index: 9999;
}

.modal-content {
    background: #1a1a20; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px; padding: 20px; max-width: 400px; width: 90%;
    position: relative; box-shadow: 0 0 40px rgba(var(--color-primary), 0.3);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop { 0% { transform: scale(0.8); opacity: 0;} 100% { transform: scale(1); opacity: 1;} }

.close-btn {
    position: absolute; top: 10px; right: 15px; font-size: 2rem;
    background: none; border: none; color: white; cursor: pointer; z-index: 10;
    text-shadow: 0 2px 5px black; transition: 0.2s;
}
.close-btn:hover { color: rgb(var(--color-primary)); transform: scale(1.1); }

/* 1. Modal Card Image Fix (Restores the 400px limit) */
.modal-card img { 
    width: 100%; 
    border-radius: 12px; 
    max-height: 400px; 
    object-fit: cover; 
    object-position: var(--img-anchor, center);
    border: 1px solid rgba(255,255,255,0.05); 
    display: block;
}

/* 2. Main Game Area Image */
.idol-img { 
    width: 100%; 
    height: 100%;
    object-fit: cover; 
    object-position: var(--img-anchor, center);
    display: block;
}

/* 3. Special Mode v4 Style Fix (Prevents container breakout) */
.special-idol-img { 
    width: 100%; 
    height: auto; /* Overrides any 100% height bugs */
    aspect-ratio: var(--card-ratio, 3/4); 
    object-position: var(--img-anchor, center);
    object-fit: cover; 
    border-bottom: 1px solid rgba(var(--color-special), 0.1); 
    display: block;
}
.modal-info-box { text-align: center; margin-top: 15px; }

.stats-container { display: flex; gap: 10px; }
.stat-box { flex: 1; padding: 15px; border-radius: 12px; background: rgba(0,0,0,0.5); }
.smash-stat { border-bottom: 3px solid rgb(var(--color-primary)); }
.smash-stat .stat-label { color: rgb(var(--color-primary)); font-size: 0.9rem; margin-bottom: 5px; font-weight: 900;}
.pass-stat .stat-label { color: rgb(var(--color-secondary)); font-size: 0.9rem; margin-bottom: 5px; font-weight: 900;}
.pass-stat { border-bottom: 3px solid rgb(var(--color-secondary)); }

.stat-box p { font-size: 1.8rem; font-weight: 900; color: white; }

/* --- NEW TOP NAV HEADER --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-nav .logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-tourney-btn {
    background: linear-gradient(45deg, rgb(var(--color-special)), rgb(var(--color-primary)));
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    color: white;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--color-primary), 0.3);
}

.nav-tourney-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--color-primary), 0.6);
}

.mini-lb-item {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,0.4); padding: 8px 12px; border-radius: 8px;
}
.mini-lb-name { color: white; font-weight: bold; font-size: 0.9rem; }
.mini-lb-score { color: var(--text-light); font-size: 0.8rem; }

.logo-text .accent {
    color: rgb(var(--color-primary));
}

.lang-switcher {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}
.lang-switcher:hover {
    background: rgba(255, 255, 255, 0.2);
}

.live-badge {
    background: rgb(var(--color-primary));
    color: #fff;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}
.pulse {
    animation: pulse-animation 2s infinite;
}
@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(var(--color-primary), 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(var(--color-primary), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--color-primary), 0); }
}

.special-mode-card { 
    border-color: rgba(var(--color-special), 0.5) !important; 
    background: linear-gradient(45deg, rgba(var(--color-special), 0.05), rgba(var(--color-primary), 0.05)) !important; 
}
.special-mode-card:hover { 
    box-shadow: 0 0 20px rgba(var(--color-special), 0.3) !important; 
    transform: translateX(5px); 
}
.special-mode-card h3 { color: rgb(var(--color-special)); }

.navbar {
    background: #0b0b0e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 40px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    transition: transform 0.3s ease-in-out;
}

.navbar-hidden {
    transform: translateY(-100%);
}

.center-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.nav-left img {
    height: 30px;
    width: 30px;
    border-radius: 5px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
}

.logo-text .accent {
    color: rgb(var(--color-primary));
}

.kpop-badge {
    background: rgba(var(--color-primary), 0.2);
    color: rgb(var(--color-primary));
    border: 1px solid rgba(var(--color-primary), 0.5);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.center-nav .nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.center-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.center-nav a:hover,
.center-nav button.nav-item:hover {
    color: rgb(var(--color-primary)) !important;
}

.nav-right {
    display: flex;
    align-items: center;
}

.active-nav {
    color: rgb(var(--color-primary)) !important;
}

.tournament-loading { color: rgb(var(--color-special)); font-size: 1.5rem; text-transform: uppercase; letter-spacing: 2px; animation: pulse 1.5s infinite; }
.battle-wrapper { 
    display: flex; 
    gap: 40px; 
    justify-content: center; 
    margin-top: 20px; 
    width: 100%;
    max-width: 1200px; 
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap; 
}

.battle-side { 
    background: rgba(255,255,255,0.02); 
    padding: 20px; 
    border-radius: 16px; 
    border: 1px solid rgba(255,255,255,0.05); 
    width: 340px; 
    max-width: 100%; 
    text-align: center; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); 
    display: flex;
    flex-direction: column;
}
.battle-img { 
    width: 100%; 
    height: auto; 
    aspect-ratio: var(--card-ratio, 3/4); 
    object-position: var(--img-anchor, center);
    object-fit: cover; 
    border-radius: 12px; 
    margin-bottom: auto; 
    border: 1px solid rgba(255,255,255,0.1); 
}
.battle-votes { font-size: 1.2rem; font-weight: bold; color: rgb(var(--color-special)); margin-bottom: 15px; }

.vote-btn { width: 100%; padding: 12px; font-size: 1.1rem; border-radius: 8px; cursor: pointer; font-weight: 900; transition: 0.2s; text-transform: uppercase; }
.vote-btn.pink { 
    background: rgb(var(--color-primary)); 
    color: white; 
    border: none; 
    box-shadow: 0 0 15px rgba(var(--color-primary), 0.4); 
}
.vote-btn.blue { 
    background: rgb(var(--color-secondary)); 
    color: #000; 
    border: none; 
    box-shadow: 0 0 15px rgba(var(--color-secondary), 0.4); 
}
.vote-btn:hover { transform: scale(1.05); }
.vote-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.tug-arena { margin-top: 40px; max-width: 750px; margin-left: auto; margin-right: auto; text-align: center; }
.tug-total { margin-top: 10px; color: var(--text-dim); font-size: 0.95rem; font-weight: bold; letter-spacing: 1px; text-transform: uppercase; }

.special-card { background: rgba(255,255,255,0.02); padding: 15px; border-radius: 16px; border: 1px solid rgba(var(--color-special), 0.3); width: 180px; transition: 0.3s; box-shadow: 0 8px 15px rgba(0,0,0,0.5); }
.special-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(var(--color-special), 0.2); }
.special-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.special-card h3 { font-size: 1.1rem; margin-bottom: 10px; color: white; text-transform: uppercase; }



.rankings-title {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
    margin: 0;
    color: white;
    text-align: center;
    white-space: nowrap;
}

.header-actions { display: flex; align-items: center; gap: 15px; }
.discord-icon { color: white; transition: 0.2s; display: flex; align-items: center; margin-top: 3px; }
.discord-icon:hover { color: #5865F2; transform: scale(1.1); }

.support-btn { 
    background: #29abe0; color: white; display: flex; align-items: center; gap: 8px; 
    padding: 8px 16px; border-radius: 20px; text-decoration: none; font-weight: bold; font-size: 0.95rem; transition: 0.2s; 
}
.support-btn:hover { background: #228ebc; transform: translateY(-2px); }
.kofi-icon { width: 22px; height: 22px; }

/* --- GLOBAL FOOTER --- */
.global-footer { background: #070709; border-top: 1px solid rgba(255,255,255,0.05); padding: 60px 20px 20px; margin-top: 50px; font-family: 'Inter', sans-serif; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-col h4 { color: white; font-size: 1.2rem; margin-bottom: 20px; border-bottom: 2px solid rgb(var(--color-primary)); padding-bottom: 5px; display: inline-block; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { color: var(--text-dim); text-decoration: none; font-size: 0.95rem; transition: 0.2s; }
.footer-col ul li a:hover { color: rgb(var(--color-primary)); }
.brand-col p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; max-width: 300px; }
.footer-bottom { max-width: 1200px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); font-size: 0.85rem; }
.level-up { color: rgb(var(--color-primary)); font-weight: 900; letter-spacing: 1px; }

@media (max-width: 900px) {
    .footer-container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .footer-container { grid-template-columns: 1fr; text-align: center; }
    .brand-col p { margin: 0 auto; }
    .footer-col h4 { display: block; margin: 0 auto 20px; width: fit-content; }
    .footer-bottom { flex-direction: column; gap: 10px; }
}

.promo-btn { font-weight: 800; font-size: 0.95rem; padding: 12px 25px; border-radius: 30px; transition: all 0.3s ease; cursor: pointer; text-decoration: none; display: inline-block; }
.discord-promo { color: rgb(var(--color-primary)); background: rgba(var(--color-primary), 0.1); border: 1px solid rgba(var(--color-primary), 0.3); }
.discord-promo:hover { background: rgba(var(--color-primary), 0.2); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(var(--color-primary), 0.3); }
.share-promo { color: white; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); }
.share-promo:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2); }

/* =========================================
   SPECIAL MODE PREMIUM UI (CINEMATIC)
========================================= */
.special-mode-wrapper { max-width: 1400px; margin: 0 auto; padding: 40px 20px 80px; }
.special-header-cinematic { text-align: center; margin-bottom: 50px; position: relative; }
.cinematic-title { 
    font-size: clamp(1.4rem, 5vw, 2.5rem); 
    font-weight: 900; 
    text-transform: uppercase; 
    margin-top: 10px; 
    line-height: 1.1; 
    background: linear-gradient(to right, rgb(var(--color-primary)), rgb(var(--color-tertiary)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block; 
}
.cinematic-timer { color: #aaa; font-size: 1.1rem; margin-top: 10px; }

/* --- SPECIAL MODE v4 (Separated Container Style) --- */
.special-chars-flex { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 50px; 
    width: 100%;
}

.special-card-container {
    width: 100%;
    max-width: 340px; /* Locks it to the standard card width */
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 auto;
}

.special-card-v4 { 
    position: relative; 
    width: 100%; 
    aspect-ratio: var(--card-ratio, 3/4); /* Pulls 300/500 from your game themes dynamically */
    border-radius: var(--card-radius); 
    border: 2px solid rgba(var(--color-special), 0.2);
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.8); 
    background-color: #000;
    transition: 0.3s ease;
}

.special-card-v4:hover {
    transform: translateY(-5px); 
    border-color: rgb(var(--color-special)); 
    box-shadow: 0 15px 35px rgba(var(--color-special), 0.2);
}

.special-char-img {
    width: 100%; 
    height: 100%; 
    object-position: var(--img-anchor, center); /* Pulls top center for LoL, center for Kpop */
    object-fit: cover; 
    display: block;
}
.special-idol-info { padding: 20px; text-align: center; }
.special-idol-info .idol-name { font-size: 1.6rem; font-weight: 900; color: white; text-transform: uppercase; margin-bottom: 4px; }
.special-idol-info .idol-group { font-size: 0.95rem; color: rgb(var(--color-special)); font-weight: bold; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }
.special-vote-btn { width: 100%; border-radius: 12px; font-weight: 900; text-transform: uppercase; padding: 12px; }

.special-empty-card { background: #1a1a20; border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 20px; padding: 40px; text-align: center; max-width: 500px; margin: 50px auto; box-shadow: 0 15px 35px rgba(0,0,0,0.7); }
.special-title { font-size: 2.2rem; margin: 10px 0 15px; color: white; font-weight: 900; text-transform: uppercase; }
.divider { height: 2px; width: 60px; background: rgb(var(--color-special)); margin: 0 auto 20px; border-radius: 2px; }
.special-subtext { color: #aaa; margin-bottom: 30px; font-size: 1.1rem; line-height: 1.6; }
.suggest-box { background: rgba(255,255,255,0.02); padding: 15px; border-radius: 10px; margin-bottom: 25px; color: #aaa; font-size: 0.95rem; line-height: 1.5; }

/* =========================================
   🔥 FAQ ACCORDION OVERHAUL 
========================================= */
.faq-details {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid rgb(var(--color-primary));
    transition: all 0.3s ease;
    overflow: hidden;
}

.faq-details:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

.faq-details summary {
    padding: 20px 50px 20px 20px; 
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    cursor: pointer;
    list-style: none;
    position: relative;
    outline: none;
}

.faq-details summary::-webkit-details-marker { display: none; }

.faq-details summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.5rem;
    color: rgb(var(--color-primary));
    top: 50%;
    transform: translateY(-50%);
    transition: 0.3s;
}
.faq-details[open] summary::after { content: '−'; }

.faq-details .faq-content { padding: 0 20px 20px 20px; }
.faq-details .faq-content p { font-size: 0.95rem; line-height: 1.6; color: #bbb; margin-bottom: 10px; }
.faq-details .faq-content p:last-child { margin-bottom: 0; }

/* =========================================
   BOTTOM SEO BLOCK (Glass-morphism)
========================================= */
.seo-bottom-block {
    text-align: left;
    padding: 35px;
}

.seo-bottom-block h2 {
    font-size: 1.6rem;
    color: rgb(var(--color-primary));
    margin-bottom: 15px;
    font-weight: 900;
    text-transform: uppercase;
}

.seo-bottom-block h3 {
    font-size: 1.3rem;
    color: rgb(var(--color-secondary));
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 800;
}

.seo-bottom-block p {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 15px;
}

.seo-bottom-block strong {
    color: white; 
}

/* =========================================
   CLEAN MASTER MOBILE FIX (768px)
========================================= */
@media (max-width: 1100px) {
    .navbar {
        height: auto; 
        padding: 15px 30px;
        flex-wrap: wrap; 
    }
    .nav-left, .nav-right {
        flex: 0 0 auto; 
    }
    .center-nav {
        position: static;
        transform: none;
        width: 100%; 
        display: flex;
        justify-content: center;
        margin-top: 15px; 
        order: 3; 
    }
    .center-nav .nav-links {
        gap: 25px; 
    }
}
@media (max-width: 767px) {
    :root { --card-radius: 12px; }
    .section-title { font-size: 1.25rem !important; }
    .cinematic-title { font-size: 1.4rem !important; }
    .hero-title { font-size: 1.6rem !important; }

    .navbar { padding: 10px 15px; height: auto; flex-wrap: wrap; }
    .nav-left, .nav-right { flex: 0 0 auto; }
    .center-nav { position: static; transform: none; width: 100%; display: flex; justify-content: center; margin-top: 12px; order: 3; }
    .center-nav .nav-links { gap: 20px; font-size: 0.95rem; }
 
    .logo-text { font-size: 1.2rem; }
    .nav-left img { height: 24px; width: 24px; }
    .discord-icon svg { width: 22px; height: 22px; }
    .support-btn { padding: 6px; }
    .kofi-icon { width: 18px; height: 18px; }
    .support-text { display: none; } 

    .dashboard-container { padding: 20px 10px; gap: 30px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .tournament-banner { flex-direction: column; text-align: center; gap: 20px; }
    .banner-btn { width: 100%; }
    .hero-section h1 { font-size: 1.8rem !important; }
    .hero-section p { font-size: 0.95rem !important; padding: 0 10px; }

    #faqArea h2:first-of-type { font-size: 1.4rem !important; margin-bottom: 20px !important; line-height: 1.2; }
    #faqArea div h2 { font-size: 1.2rem !important; line-height: 1.3; }

    .faq-details summary { font-size: 0.9rem !important; padding: 12px 40px 12px 15px !important; }
    .faq-details .faq-content { padding: 0 15px 12px 15px !important; }
    .faq-details .faq-content p { font-size: 0.85rem !important; line-height: 1.5; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
    .gallery-card { border-radius: 12px; }
    .gallery-info { padding: 30px 10px 10px; }
    .gallery-name { font-size: 1rem; margin-bottom: 2px; } 
    .gallery-group { font-size: 0.8rem; }

    .special-empty-card { padding: 30px 20px; }
    .special-title { font-size: 1.6rem !important; margin: 10px 0; }
    .special-subtext { font-size: 0.95rem !important; margin-bottom: 20px; }

    #faqArea .dashboard-container > div > div { padding: 20px !important; }

    .special-mode-wrapper { padding: 20px 10px; }
    .cinematic-title { font-size: 1.5rem !important; line-height: 1.2 !important; padding: 0 10px; }
    .special-chars-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; } 
    .special-card-v3 { border-radius: 12px; }
    .special-idol-info { padding: 10px; }
    .special-idol-info .idol-name { font-size: 1.1rem !important; }
    .special-idol-info .idol-group { font-size: 0.75rem !important; }
    .special-vote-btn { padding: 8px; font-size: 0.85rem !important; border-radius: 8px; }

    .battle-wrapper { gap: 10px; padding: 0 5px; }
    .battle-side { flex: 0 0 calc(50% - 5px); max-width: none; padding: 10px; }
    .battle-img { margin-bottom: 10px; }
    .battle-votes { font-size: 1rem; }
    .vote-btn { padding: 8px; font-size: 0.95rem; }



    .neon-champion-avatar img {
        width: 240px !important; 
        max-height: 50vh !important; 
        margin-bottom: 10px !important; 
    }
    #faqArea .dashboard-container > div {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(15, 15, 19, 0.95) !important;
        box-shadow: none !important;
        padding: 20px 15px !important; 
    }
    .faq-details summary { font-size: 1rem !important; padding: 15px !important; }
    .faq-details .faq-content { padding: 0 15px 15px 15px !important; }
    
    .rankings-title { font-size: 1.6rem; }

    .seo-bottom-block { padding: 20px 15px !important; }
    .seo-bottom-block h2 { font-size: 1.15rem !important; line-height: 1.3; margin-bottom: 12px; letter-spacing: 0; }
    .seo-bottom-block h3 { font-size: 1.05rem !important; line-height: 1.3; margin-top: 20px; margin-bottom: 8px; }
    .seo-bottom-block p { font-size: 0.9rem !important; line-height: 1.6; color: #a0a0a5 !important; margin-bottom: 12px; }
    
}

.voted-msg {
    font-size: 0.9rem;
    color: rgb(var(--color-secondary)); 
    font-weight: bold;
    margin-bottom: 15px;
    opacity: 0; 
    transform: translateY(-5px);
    transition: all 0.3s ease;
    display: none; 
}

.show-voted { display: block; opacity: 1; transform: translateY(0); }

/* =========================================
   🌐 NAVBAR DROPDOWN MENU
========================================= */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    display: none; 
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 2000;
    list-style: none;
    text-align: left;
}

@media (hover: hover) {
    .dropdown:hover .dropdown-menu { display: flex; flex-direction: column; animation: fadeIn 0.2s ease-in-out; }
}
.dropdown-menu.show-mobile { display: flex !important; flex-direction: column; animation: fadeIn 0.2s ease-in-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.dropdown-menu li { margin: 0; width: 100%; }
.dropdown-menu li a {
    display: block; width: 100%; padding: 10px 20px; color: white; text-decoration: none;
    font-size: 0.95rem; font-weight: 700; transition: background 0.2s, color 0.2s;
}
.dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgb(var(--color-primary)) !important; 
}

@media (max-width: 768px) {
    .dropdown-menu {
        width: 85vw; max-width: 260px; margin-top: 15px; 
        left: auto !important; right: 0 !important; transform: none !important; 
    }
    .dropdown-menu li a { padding: 12px 20px; font-size: 0.9rem; }
}

#trendingList { min-height: 220px; }

.tourney-action-btn {
    width: auto; padding: 10px 20px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 50px; color: white; font-weight: bold;
}
.tourney-action-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }

.tourney-share-btn {
    width: auto; padding: 10px 20px; border: 1px solid rgb(var(--color-primary)); color: white; 
    background: rgba(var(--color-primary), 0.2); border-radius: 50px; font-weight: bold;
}
.tourney-share-btn:hover {
    background: rgba(var(--color-primary), 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--color-primary), 0.3);
}

.hero-section { text-align: center; margin-bottom: 10px; padding: 0 10px; }
.hero-title { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 900; margin-bottom: 10px; color: white; line-height: 1.1; }
.hero-subtitle { color: var(--text-dim); font-size: clamp(0.95rem, 3vw, 1.1rem); max-width: 700px; margin: 0 auto; }
.user-stats-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(var(--color-primary), 0.3);
    border-radius: var(--card-radius); padding: 15px 25px; display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 25px; box-shadow: 0 4px 15px rgba(var(--color-primary), 0.1);
}
.stats-label { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; }
.stats-total { font-size: 2rem; font-weight: 900; color: white; }
.stats-counters { text-align: right; background: rgba(0,0,0,0.5); padding: 10px 15px; border-radius: 10px; }
.smash-count { font-size: 0.9rem; color: #ddd; font-weight: bold; margin-bottom: 4px; }
.pass-count { font-size: 0.9rem; color: #ddd; font-weight: bold; }

.faq-container { min-height: 80vh; padding-bottom: 50px; padding-top: 40px; }
.faq-glass-panel {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 16px;
    padding: 40px 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); backdrop-filter: blur(10px);
}
.faq-title { font-size: clamp(1.4rem, 5vw, 2rem); margin-bottom: 30px; text-align: center; color: white; line-height: 1.3; }

/* =========================================
   CLEANUP UTILITY & COMPONENT CLASSES
========================================= */
.is-hidden { display: none !important; }
.mb-20 { margin-bottom: 20px; }
.mt-15 { margin-top: 15px; }
.w-100 { width: 100%; }
.is-flex { display: flex !important; }
.is-block { display: block !important; }
.mb-5 { margin-bottom: 5px; }
.mb-15 { margin-bottom: 15px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.p-20 { padding: 20px; }
.py-20 { padding: 20px 0; }

.text-pink { color: rgb(var(--color-primary)) !important; }
.text-blue { color: rgb(var(--color-secondary)) !important; }
.text-gold { color: rgb(var(--color-special)) !important; }

.pb-50 { padding-bottom: 50px; }
.mb-30 { margin-bottom: 30px; }
.mw-900 { max-width: 900px !important; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.dropdown-view-all { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 5px; padding-top: 10px; display: block; }
.promo-footer { margin-top: 40px; text-align: center; width: 100%; }
.promo-text { font-size: 0.85rem; color: #aaa; margin-bottom: 15px; }
.promo-flex { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

.arena-wrapper { width: 100%; max-width: 1000px; margin: 0 auto; padding: 20px; }
.gallery-wrapper { max-width: 1400px; }

.modal-bar { transition: width 0.5s ease; height: 100%; }
.bar-pink { background: rgb(var(--color-primary)); }
.bar-blue { background: rgb(var(--color-secondary)); }

.faq-details summary h3 { display: inline; font-size: inherit; font-weight: inherit; }

/* Rankings Page Full Overhaul */
.rankings-page-wrapper { 
    padding: 15px 20px 40px 20px !important; 
    min-height: 80vh; 
    background: radial-gradient(ellipse at top, rgba(15, 15, 19, 0.4), rgba(15, 15, 19, 0.85)) !important; 
}
.rankings-inner { max-width: 1200px; margin: 0 auto; }

.rank-list-container { display: flex; flex-direction: column; gap: 12px; min-height: 650px; }

.search-input {
    width: 100%; max-width: 500px; padding: 15px 25px; border-radius: 50px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: white; font-size: 1.1rem; outline: none;
}
.search-input:focus { border-color: rgb(var(--color-primary)); box-shadow: 0 0 15px rgba(var(--color-primary), 0.3); background: rgba(0, 0, 0, 0.6); }

.rankings-modal-content { max-width: 600px; width: 95%; }
.rankings-title-text { text-align: center; margin-bottom: 20px; color: white; }
.rankings-flex-container { display: flex; gap: 15px; }
.rankings-col-pink { flex: 1; background: rgba(var(--color-primary), 0.05); padding: 15px; border-radius: 12px; border: 1px solid rgba(var(--color-primary), 0.15); }
.rankings-col-pink h3 { color: rgb(var(--color-primary)); text-align: center; margin-bottom: 15px; }
.rankings-col-blue { flex: 1; background: rgba(var(--color-secondary), 0.05); padding: 15px; border-radius: 12px; border: 1px solid rgba(var(--color-secondary), 0.15); }
.rankings-col-blue h3 { color: rgb(var(--color-secondary)); text-align: center; margin-bottom: 15px; }

.tug-bar-container { display: flex; height: 12px; background: #333; border-radius: 10px; overflow: hidden; }

/* Global States */
.local-warning-banner { background: #ff4444; color: white; text-align: center; padding: 6px; font-size: 0.8rem; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.empty-state-text { text-align: center; color: #888; padding: 18px 0; }
.centered-action-container { text-align: center; margin-top: 50px; width: 100%; }
.action-btn-wide { margin-top: 20px; width: auto; padding: 12px 30px; border-radius: 12px; font-weight: bold; }
.tourney-status-msg { text-align: center; min-height: 24px; font-weight: bold; color: #00ff00; margin-bottom: 10px; }

.scroll-to-top-btn {
    display: none; position: fixed; bottom: 20px; right: 20px; z-index: 99; 
    background: rgb(var(--color-primary)); color: white; border: none; padding: 15px; 
    border-radius: 50%; font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.load-more-btn { margin: 10px auto; display: block; padding: 10px 20px; border-radius: 50px; font-weight: bold; background: rgba(255,255,255,0.05); border: none; color: white; cursor: pointer; }
.load-more-btn:hover { background: rgba(255,255,255,0.1); }

.trending-item-inner { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; padding: 10px; background: rgba(255,255,255,0.05); border-radius: 8px; }
.trending-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.rankings-flex-row { display: flex; align-items: center; }
.rankings-info-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

a.mode-card { text-decoration: none; color: inherit; display: block; }
.tourney-header-wrapper { text-align: center; width: 100%; margin-bottom: 15px; }
.tourney-round-badge { font-size: 1.2rem; font-weight: 800; color: rgb(var(--color-special)); letter-spacing: 1px; text-transform: uppercase; }
.tourney-timer-text { text-align: center; color: #ccc; margin-bottom: 20px; font-weight: bold; }
.tourney-timer-highlight { color: rgb(var(--color-secondary)); }
.tug-bar-inner-a { background: rgb(var(--color-primary)); transition: width 0.5s ease; }
.tug-bar-inner-b { background: rgb(var(--color-secondary)); transition: width 0.5s ease; }

.trending-empty { text-align: center; color: #888; padding: 15px 0; }
/* --- TRENDING LIST HOVER EFFECT ONLY --- */
.lb-item-wrapper { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 10px; 
    padding: 10px; 
    background: rgba(255,255,255,0.03); 
    border-radius: 12px; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease; /* Smooth transition */
}

.lb-item-wrapper:hover {
    transform: translateX(5px);
    background: rgba(30, 30, 35, 0.95);
    border-color: rgba(var(--color-primary), 0.4);
    box-shadow: 0 8px 20px rgba(0,0,0,0.6), 0 0 15px rgba(var(--color-primary), 0.15);
}
.lb-rank-badge { font-size: 1.5rem; font-weight: bold; }
.lb-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.lb-info-title { margin: 0; font-size: 1.1rem; color: white; }
.lb-info-stats { margin: 0; font-size: 0.8rem; color: #aaa; }
.error-text { color: #ff4444; font-weight: bold; }
.suggest-box h4 { color: white; margin-bottom: 5px; }
.special-discord-btn { display: block; width: 100%; text-decoration: none; padding: 15px 0; border-radius: 12px; margin-bottom: 25px; }

.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-10 { gap: 10px; }
.mt-30 { margin-top: 30px; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }

.tourney-empty-state { text-align: center; margin-top: 50px; width: 100%; }
.loading-text-gold { text-align: center; color: rgb(var(--color-special)); font-weight: bold; animation: pulse 1.5s infinite; }
.msg-box-sub { text-align: center; color: #aaa; background: rgba(255,255,255,0.02); padding: 20px; border-radius: 12px; }
.msg-box-error { text-align: center; color: #ff4444; padding: 18px 0; }

.winner-cinematic-v2 { text-align: center; padding: 20px 0; }
.neon-champion-avatar { position: relative; display: inline-block; margin-bottom: 25px; }
.neon-champion-avatar img { 
    width: 320px; 
    aspect-ratio: var(--card-ratio, 3/4); 
    object-position: var(--img-anchor, center);
    object-fit: cover; border-radius: 16px; 
    border: 3px solid rgb(var(--color-primary)); box-shadow: 0 0 35px rgba(var(--color-primary), 0.4); 
}
.champion-badge { 
    position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); 
    background: linear-gradient(90deg, rgb(var(--color-primary)), rgb(var(--color-tertiary))); 
    color: white; padding: 6px 24px; border-radius: 30px; font-weight: 900; letter-spacing: 2px; font-size: 0.9rem; box-shadow: 0 5px 15px rgba(0,0,0,0.8); white-space: nowrap;
}
.neon-champion-name { font-size: clamp(1.8rem, 6vw, 2.8rem) !important; font-weight: 900; color: white; margin: 15px 0 5px; text-transform: uppercase; text-shadow: 0 0 15px rgba(255,255,255,0.3); }
.neon-champion-stats { color: rgb(var(--color-secondary)); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 1rem; }

.rankings-page-wrapper { padding: 15px 20px 40px 20px !important; }
.rankings-header { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; width: 100%; padding-top: 0 !important; }
.rankings-back-btn { align-self: flex-start; margin-bottom: 12px; padding: 6px 16px; border-radius: 50px; font-size: 0.85rem; position: static !important; width: auto !important; }
.rankings-header-text { text-align: center; width: 100%; padding: 0 10px; }

h1.cinematic-title { font-size: clamp(1.4rem, 4vw, 2.2rem) !important; font-weight: 900; text-transform: uppercase; line-height: 1.15; margin: 0; color: white; letter-spacing: -0.5px; }
h1.cinematic-title br { display: none; }
.title-accent { background: linear-gradient(to right, rgb(var(--color-primary)), rgb(var(--color-tertiary))); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; }
.rankings-header-text, h1, h2, h3 { width: 100%; max-width: 100%; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; }

@media (max-width: 768px) {
    .rankings-page-wrapper { padding: 10px 10px 30px 10px !important; }
    .rankings-header { align-items: center; margin-bottom: 15px; }
    .rankings-back-btn { margin-bottom: 10px; }
    .rankings-header-text { text-align: center; padding: 0; }
    h1.cinematic-title { font-size: 1.35rem !important; line-height: 1.2; letter-spacing: 0px; }
    h1.cinematic-title br { display: block; }
}
#galleryGrid { min-height: 80vh; }

a.menu-btn, a.action-btn-wide, a.nav-btn, a.tourney-action-btn, a.rankings-back-btn, a.btn { text-decoration: none !important; display: inline-block; box-sizing: border-box; }
a.menu-btn.w-100 { display: block; }
a.nav-item { text-decoration: none; }
a.view-more-btn { text-decoration: none !important; }
.end-game-title { font-size: 1.8rem; font-weight: 900; color: var(--text-light); margin-bottom: 20px; text-transform: uppercase; }
.seo-bottom-block h2.seo-heading { text-transform: none; font-size: 1.5rem; letter-spacing: normal; }
/* --- SEO UTILITY --- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* --- TAB UI --- */
.rankings-tabs {
    display: flex; gap: 15px; justify-content: center; margin-bottom: 20px;
    overflow-x: auto; padding-bottom: 10px; scrollbar-width: none;
}
.rankings-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px; padding: 12px 30px; color: var(--text-dim);
    font-weight: 800; font-size: 1rem; cursor: pointer; transition: all 0.3s ease;
    white-space: nowrap; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tab-btn:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.tab-btn.active {
    background: rgba(var(--color-primary), 0.1);
    border-color: rgb(var(--color-primary));
    color: rgb(var(--color-primary));
    box-shadow: 0 0 20px rgba(var(--color-primary), 0.2);
}

/* --- PREMIUM CARD DESIGN (v2) --- */
.rank-card-v2 {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(20, 20, 25, 0.85); border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px; padding: 15px 20px; margin-bottom: 15px;
    cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.rank-card-v2:hover {
    transform: translateY(-4px); background: rgba(30, 30, 35, 0.95);
    border-color: rgba(255, 255, 255, 0.15); box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.rank-first-v2 {
    background: linear-gradient(90deg, rgba(var(--color-primary), 0.1), rgba(20, 20, 25, 0.9));
    border-color: rgba(var(--color-primary), 0.4);
    box-shadow: 0 0 25px rgba(var(--color-primary), 0.15);
}

.rankings-left-v2 { display: flex; align-items: center; gap: 20px; }
.rank-pos-v2 { font-size: 1.6rem; font-weight: 900; color: var(--text-dim); min-width: 40px; text-align: right; }
.rank-first-v2 .rank-pos-v2 { color: rgb(var(--color-primary)); text-shadow: 0 0 10px rgba(var(--color-primary), 0.5); }

.rank-avatar-v2 {
    width: 70px; height: 90px; border-radius: 12px; object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.05);
}
.rank-first-v2 .rank-avatar-v2 { border-color: rgb(var(--color-primary)); box-shadow: 0 0 15px rgba(var(--color-primary), 0.4); }

.rank-info-v2 { display: flex; flex-direction: column; gap: 4px; }
.rank-name-v2 { font-size: 1.25rem; font-weight: 900; color: white; line-height: 1.1; }

.rank-tier-badge {
    color: var(--text-dim); font-size: 0.85rem; font-weight: 800;
}
.rank-first-v2 .rank-tier-badge { color: rgb(var(--color-primary)); }

.rank-votes-v2 { font-size: 0.9rem; color: #ccc; font-weight: 700; margin-top: 2px; }
.rank-medal-v2 { font-size: 1.8rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

/* --- MOBILE SPECIFIC (768px constraints) --- */
@media (max-width: 768px) {
    .rank-card-v2 { padding: 12px; }
    .rankings-left-v2 { gap: 12px; }
    .rank-avatar-v2 { width: 55px; height: 75px; }
    .rank-pos-v2 { min-width: 30px; font-size: 1.3rem; }
    .rank-name-v2 { font-size: 1.05rem; }
    .rank-tier-badge { font-size: 0.75rem; }
    .rank-votes-v2 { font-size: 0.8rem; }
    .rank-medal-v2 { font-size: 1.4rem; }
    /* Inside @media (max-width: 768px) */
.rankings-tabs { justify-content: center; }
    .tab-btn { padding: 10px 20px; font-size: 0.9rem; }
    /* Clear out the old column styling on mobile */
    .ranks-column { border: none !important; background: transparent !important; padding: 0 !important; }
}
/* =========================================
   DYNAMIC PREMIUM FILTERS UI (V2)
========================================= */
.gallery-controls-container {
    display: flex;
    align-items: flex-end; 
    gap: 12px; /* Tighter gap */
    width: 100%;
    margin-bottom: 25px;
    flex-wrap: wrap; 
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 110px; /* Slimmer for better mobile fit */
}

.filter-label {
    font-size: 0.7rem; /* Sleek, non-intrusive size */
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5); /* Dimmed for contrast */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-left: 4px;
}

.premium-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(20, 20, 25, 0.7); /* Glass-morphic dark */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 10px 30px 10px 15px; /* Tighter profile */
    border-radius: 10px; 
    font-size: 0.9rem; /* Scaled down text */
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    
    /* Sleek custom chevron */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.premium-select:focus, .premium-select:hover {
    border-color: rgb(var(--color-primary)); /* Pulls game theme color */
    background-color: rgba(var(--color-primary), 0.05); /* Slight tint of theme color */
    box-shadow: 0 0 15px rgba(var(--color-primary), 0.2);
}

/* Force native dropdown options to stay dark */
.premium-select option {
    background-color: #0f0f13; 
    color: #fff;
    font-weight: 600;
}

.search-input-wrapper {
    flex: 2 1 250px; /* Takes remaining width gracefully */
    position: relative;
}

.search-input-wrapper .search-input {
    width: 100%;
    padding: 10px 15px 10px 42px; 
    border-radius: 10px;
    background-color: rgba(20, 20, 25, 0.7); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    height: 42px; /* Matched sleek height */
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.search-input-wrapper .search-input:focus {
    border-color: rgb(var(--color-primary));
    box-shadow: 0 0 15px rgba(var(--color-primary), 0.2);
    background-color: rgba(0, 0, 0, 0.85); /* Deepen on focus */
}

.search-icon-overlay {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input-wrapper:focus-within .search-icon-overlay {
    color: rgb(var(--color-primary));
}

/* --- Mobile First Reflow --- */
@media (max-width: 768px) {
    .gallery-controls-container {
        gap: 8px; /* Extra tight for small screens */
        margin-bottom: 20px;
    }
    .filter-group {
        flex: 1 1 calc(50% - 8px); /* Perfect 2x2 grid */
        min-width: 0; /* Prevents awkward overflow */
    }
    .filter-label {
        font-size: 0.65rem; /* Super clean micro-typography */
    }
    .premium-select {
        padding: 8px 25px 8px 12px;
        font-size: 0.85rem;
        height: 38px;
    }
    .search-input-wrapper {
        flex: 1 1 100%; /* Force search bar to take full bottom row */
        margin-top: 4px;
    }
    .search-input-wrapper .search-input {
        height: 40px;
        font-size: 0.85rem;
    }
}
/* =========================================
   GALLERY-ONLY MODAL UI (Ultra Clean)
========================================= */
.locked-stats-msg {
    background: rgba(0, 0, 0, 0.5); 
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px; 
    padding: 20px 15px; 
    text-align: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.locked-text {
    color: white; 
    font-size: 0.95rem; 
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Perfectly spaces the emoji and text */
}