:root {
    --primary: #FF7B00; 
    --secondary: #FFBA08; 
    --accent: #E85D04; 
    --dark: #370617;
    --text-main: #FFFFFF;
    --text-dim: rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-color: #000;
}

h1, h2, h3, h4, h5 { font-family: 'Outfit', sans-serif; }

.dynamic-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(45deg, var(--dark), #6A040F, var(--accent), var(--primary));
    background-size: 400% 400%;
    animation: gradientBG 25s ease infinite;
    z-index: -1;
    will-change: background-position;
    transform: translateZ(0);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glass-container {
    max-width: 1200px;
    margin: 2rem auto;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--secondary), #FFF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

nav { display: flex; gap: 1rem; }

.nav-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-main);
    font-size: 1.1rem;
    padding: 0.5rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.nav-btn:hover { background: rgba(255, 255, 255, 0.1); }
.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--glass-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.view { display: none; animation: fadeIn 0.4s ease forwards; }
.active-view { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero { text-align: center; margin-bottom: 3rem; }
.hero h2 { font-size: 3rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.2rem; color: var(--text-dim); }

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.game-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    background: rgba(255, 255, 255, 0.15);
}

.card-image {
    width: 100%;
    height: 150px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    background-color: rgba(0,0,0,0.3);
    background-size: cover;
    background-position: center;
}

.pot-bg { background: url('https://i.ibb.co/BHwF4zGh/image.png') center/cover no-repeat; }
.tug-bg { background: url('https://i.ibb.co/Z1h9LtCB/1.png') center/cover no-repeat; }
.elephant-bg { background: url('https://i.ibb.co/mFN4xXBS/avurudu3.png') center/cover no-repeat; }

.game-card h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.game-card p { color: var(--text-dim); margin-bottom: 1.5rem; flex-grow: 1; }

.play-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 123, 0, 0.4);
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    /* Use block + auto overflow so the modal ITSELF scrolls from the top down */
    display: block;
    overflow-y: auto;
    /* Padding to push the glass panel away from the very edges */
    padding: 8vh 1rem 2rem 1rem;
}

.modal.hidden { display: none !important; }

.glass-panel {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    max-width: 450px;
    width: 100%;
    /* Horizontal auto-margin centers it left/right. Natural block flow leaves it at the top where padding dictates */
    margin: 0 auto;
}

.glass-panel h2 { margin-bottom: 1rem; color: white; }
.glass-panel input {
    width: 100%;
    padding: 0.9rem 1.1rem;
    margin: 0.75rem 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset;
}

.glass-panel input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.18), 0 1px 3px rgba(0,0,0,0.3) inset;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 3rem !important;
    margin: 1.5rem 0;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.password-toggle:hover {
    opacity: 1;
}

.primary-btn {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    box-shadow: 0 4px 20px rgba(255, 123, 0, 0.35);
    letter-spacing: 0.02em;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 123, 0, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 123, 0, 0.3);
    opacity: 0.92;
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Mobile modal fix */
@media (max-width: 600px) {
    .modal {
        padding: 5vh 0.5rem 2rem 0.5rem;
    }
    .glass-panel {
        padding: 2rem 1.25rem;
        border-radius: 20px;
    }
}

#game-container {
    width: 100%;
    height: 500px;
    background: rgba(0,0,0,0.4);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
}

.score-list {
    list-style: none;
    max-width: 600px;
    margin: 0 auto;
}

.score-list li {
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary);
    transition: transform 0.6s cubic-bezier(0.2, 0, 0.2, 1), background 0.2s ease;
    will-change: transform;
}

.score-list li:hover {
    transform: scale(1.02);
    background: rgba(0, 0, 0, 0.4);
    z-index: 10;
}

/* Helper for instant position resetting during FLIP animation */
.li-instant {
    transition: none !important;
}

.rank {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--secondary);
    width: 30px;
}

.name { flex-grow: 1; text-align: left; margin-left: 1rem; font-weight: 500; }
.score { font-weight: bold; font-family: monospace; font-size: 1.2rem; }

/* Simplified Personal Rank Display */
.personal-rank-premium {
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.1) 0%, rgba(22, 160, 133, 0.1) 100%);
    border: 1px solid rgba(26, 188, 156, 0.5);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.personal-rank-premium .rank-text {
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.3px;
}


.no-scores { text-align: center; color: var(--text-dim); font-style: italic; padding: 2rem; }

.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.back-btn:hover { background: rgba(255, 255, 255, 0.2); }
.score-display {
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(0,0,0,0.4);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.start-game-btn {
    background: var(--secondary);
    color: var(--dark);
    padding: 1rem 2rem;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.start-game-btn:hover { transform: scale(1.05); }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .game-header { flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 2rem; }
    #current-game-title { width: 100%; order: -1; text-align: center; font-size: 1.6rem; margin-bottom: 0px; }
    .glass-container { margin: 1rem; padding: 1.5rem; min-height: calc(100vh - 2rem); }
    .hero h2 { font-size: 2rem; }
    .score-list li { padding: 0.8rem; flex-wrap: wrap; }
    .lb-name-wrapper { flex: 1 1 auto; min-width: 0; margin-right: 10px; }
    .lb-name { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-grow: 1; }
    .lb-total { font-size: 0.95rem; }
    .lb-breakdown { font-size: 0.8rem; text-align: left; max-width: 100%; line-height: 1.4; }
    .lb-scores { 
        width: 100%; 
        display: flex; 
        flex-direction: row; 
        justify-content: flex-end; 
        align-items: center; 
        margin-top: 10px; 
        padding-top: 8px; 
        border-top: 1px dashed rgba(255,255,255,0.15); 
        margin-left: 0;
    }
    .lb-photo { width: 35px; height: 35px; margin-right: 10px; }
    .lb-rank { width: 30px; font-size: 1rem; margin-right: 5px; }
    .leaderboard-container table { font-size: 0.8rem; }
    .leaderboard-container th, .leaderboard-container td { padding: 0.5rem; }
    .logo { font-size: 2rem; }
    .navbar { flex-direction: row; justify-content: space-between; align-items: center; position: relative; }
    .mobile-menu-btn { display: block !important; background: none; border: none; cursor: pointer; padding: 5px; }
    #main-nav { 
        display: none !important; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        right: 0; 
        background: rgba(42, 8, 19, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column; 
        padding: 1.5rem; 
        border-radius: 16px; 
        z-index: 50;
        box-shadow: 0 15px 40px rgba(0,0,0,0.8);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    #main-nav.show-mobile-menu {
        display: flex !important;
        animation: fadeIn 0.3s ease-out;
    }
    #user-profile-header {
        flex-direction: column;
        border-left: none !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
        margin-top: 1rem;
        width: 100%;
        justify-content: center;
    }
    .nav-btn { 
        padding: 0.8rem 1rem; 
        font-size: 1.1rem; 
        width: 100%; 
        margin-bottom: 0.5rem; 
        background: rgba(255,255,255,0.05); 
        border-radius: 8px; 
        border: 1px solid transparent; 
        text-align: center;
        transition: background 0.2s;
    }
    .nav-btn.active {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
    }
    .games-grid { grid-template-columns: 1fr; }
    #game-container { height: 60vh; min-height: 400px; }
    .game-header { flex-direction: column; gap: 0.5rem; }
    .game-header h2 { font-size: 1.5rem; text-align: center; }
    .pull-btn { padding: 1rem 2rem; font-size: 1.5rem; margin-top: 60px; }
    .rope-container { justify-content: flex-start; padding-top: 40%; }
    .tug-label { font-size: 1.5rem; top: 10%; }
    .elephant-graphics { transform: scale(0.6) !important; transform-origin: center; }
    .start-game-btn { font-size: 1.2rem; padding: 0.8rem 1.5rem; }
}

/* User & Auth UI */
.lb-photo { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; margin-right: 15px; border: 2px solid var(--glass-border); }
.lb-rank { width: 40px; font-weight: bold; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; margin-right: 10px; color: var(--secondary); }
.lb-name-wrapper { flex-grow: 1; display: flex; align-items: center; min-width: 0; overflow: visible; }
.lb-name { font-weight: 500; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 5px; min-width: 0; }
.lb-scores { display: flex; flex-direction: column; text-align: right; min-width: max-content; margin-left: auto; }
.lb-total { font-size: 1.2rem; font-weight: bold; color: var(--secondary); font-family: monospace; }
.lb-breakdown { font-size: 0.8rem; color: var(--text-dim); }

.medal-gold { font-size: 2.2rem; }
.medal-silver { font-size: 1.8rem; }
.medal-bronze { font-size: 1.5rem; }

#auth-photo::-webkit-file-upload-button {
    background: var(--primary); color: white; border: none; padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; font-family: inherit; font-weight: bold; margin-right: 1rem;
}
#auth-photo { cursor: pointer; }

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Verified Badge Tooltip */
.verified-badge {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    cursor: pointer;
}
.verified-badge .badge-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.92);
    color: #ccc;
    font-size: 0.65rem;
    line-height: 1.3;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(29,161,242,0.4);
    white-space: normal;
    width: max-content;
    max-width: 200px;
    min-width: 100px;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
@media (max-width: 480px) {
    .verified-badge .badge-tooltip {
        max-width: 150px;
        min-width: 80px;
        font-size: 0.6rem;
    }
}
.verified-badge .badge-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.92);
}
.verified-badge .badge-tooltip .tooltip-title {
    color: #1DA1F2;
    font-weight: bold;
    font-size: 0.75rem;
    margin-bottom: 2px;
}
.verified-badge:hover .badge-tooltip {
    visibility: visible;
    opacity: 1;
}
.verified-badge.tooltip-active .badge-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Admin Dashboard */
.admin-dashboard {
    max-width: 900px;
    margin: 0 auto;
}

.admin-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.admin-header h2 {
    color: #FFD700;
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.admin-header p {
    color: var(--text-dim);
    font-size: 1rem;
}

.admin-search-wrapper {
    margin-bottom: 1rem;
}

.admin-search-wrapper input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.admin-search-wrapper input:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(0, 0, 0, 0.55);
}

.admin-player-count {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    padding-left: 4px;
}

.admin-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-dim);
    padding: 3rem 1rem;
    font-size: 1.1rem;
    font-style: italic;
}

.admin-player-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1rem 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.admin-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.admin-card-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border);
    flex-shrink: 0;
}

.admin-card-info {
    min-width: 0;
    flex: 1;
}

.admin-card-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-card-detail {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.admin-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-btn {
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: white;
    transition: opacity 0.2s, transform 0.15s;
    font-family: inherit;
}

.admin-btn:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

.admin-btn:active {
    transform: scale(0.97);
}

.admin-btn-view { background: #3498db; }
.admin-btn-reset { background: #FFC107; color: #333; }
.admin-btn-remove { background: #ef233c; }

@media (max-width: 768px) {
    .admin-player-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.2rem;
    }
    .admin-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Online Status Indicator */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #747d8c; /* Dull gray for offline */
    display: inline-block;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.status-dot.online {
    background-color: #2ecc71; /* Vibrant green */
    box-shadow: 0 0 8px #2ecc71, 0 0 12px #2ecc71;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

/* Meme Game UI */
.meme-post {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.meme-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

.meme-header-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 1px solid var(--primary);
}

.meme-header-info {
    flex: 1;
}

.meme-author {
    font-weight: bold;
    color: white;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
}

.meme-time {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.meme-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: white;
}

.meme-image-container {
    width: 100%;
    background: #050505;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.meme-image-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.meme-stats {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.meme-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.reaction-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 500;
}

.reaction-btn:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.reaction-btn.reacted-haha {
    color: #F1C40F;
    background: rgba(241, 196, 15, 0.15);
}

.reaction-btn.reacted-heart {
    color: #E74C3C;
    background: rgba(231, 76, 60, 0.15);
}

.reaction-btn img {
    width: 22px;
    height: 22px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reaction-btn:active img {
    transform: scale(1.3);
}

/* Unique Floating Action Button (FAB) */
.fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFE135, #FFB300); /* Unique Yellowish-gold gradient */
    color: #370617;
    border: 3px solid #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(255, 179, 0, 0.6), inset 0 -4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(255, 179, 0, 0.8), inset 0 -4px 10px rgba(0,0,0,0.1);
}

.fab-btn:active {
    transform: scale(0.95);
}

.fab-tooltip {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    background: rgba(0,0,0,0.8);
    color: #FFF;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.tooltip-trigger:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

/* Telegram-like Animated popup Toast */
.t-toast {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), fadeOut 0.5s ease 4.5s forwards;
    transform-origin: right center;
    width: 300px;
}

.t-toast-icon {
    font-size: 2.5rem;
    animation: bounce 1s infinite alternate;
}

.t-toast-content h4 {
    margin: 0 0 5px 0;
    color: #FFD700;
    font-size: 1.1rem;
}

.t-toast-content p {
    margin: 0;
    color: white;
    font-size: 0.9rem;
    line-height: 1.3;
}

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

@keyframes bounce {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-5px) scale(1.1); }
}

@media (max-width: 768px) {
    .fab-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    .fab-tooltip {
        display: none; /* Hide on mobile to prevent overflow issues */
    }
    .t-toast { width: calc(100vw - 40px); }
    .meme-image-container img { max-height: 300px; }
}
/* Sidebar and Header overrides */
.hamburger-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}
.hamburger-icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

#sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    transition: opacity 0.3s;
}
#sidebar-overlay.hidden { opacity: 0; pointer-events: none; }
#sidebar-overlay.active { opacity: 1; pointer-events:all; }

.sidebar {
    position: fixed; top: 0; left: -300px; width: 300px; height: 100vh;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10001;
    border-right: 1px solid var(--glass-border);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
}
.sidebar.active { left: 0; }
.sidebar.hidden { display: block; left: -300px; }

.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem; border-bottom: 1px solid var(--glass-border);
}
.sidebar-header h2 { font-size: 1.3rem; color: var(--primary); }
.sidebar-content { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; overflow-y: auto; }

.sidebar-nav-btn {
    text-align: left; padding: 1rem 1.5rem; border-radius: 12px;
    background: rgba(255,255,255,0.03); border: 1px solid transparent;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
.sidebar-nav-btn:hover { background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border); }
.sidebar-nav-btn.active { background: rgba(255,123,0,0.15); border: 1px solid var(--primary); color: var(--primary); }

/* Premium WhatsApp Buttons */
.professional-btn {
    background: linear-gradient(135deg, #128C7E, #25D366) !important;
    color: white !important;
    border: none !important;
    position: relative;
    overflow: hidden;
}
.professional-btn::after {
    content: ''; position: absolute; top:0; left:-100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg); transition: 0.5s;
}
.professional-btn:hover::after { left: 150%; }

.wa-follow-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 30px; border-radius: 30px; font-weight: 800; font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4); width: 100%; text-decoration: none;
}
.wa-follow-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.6);
}

.wa-header-btn {
    padding: 10px 20px; border-radius: 24px; font-weight: bold; cursor: pointer;
    display: flex; align-items: center; gap: 10px; transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); font-size: 1.05rem;
}
.wa-header-btn:hover {
    transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* Responsive Overrides */
@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
}

/* Event Countdown */
.event-countdown-banner {
    background: linear-gradient(90deg, #FF7B00, #E85D04);
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
}

.countdown-timer-box {
    background: rgba(0,0,0,0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1.3rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

/* Global site Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 0.9rem;
    width: 100%;
}

.contact-button {
    background: #25D366;
    color: white;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* Animated 3D Verified Badge */
.anim-verified-3d {
    display: inline-block;
    vertical-align: middle;
    animation: pop3DBadge 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: center;
}
.anim-verified-3d .badge-shine-group {
    transform: translateX(-35px);
    animation: shineSweep 3s infinite cubic-bezier(0.4, 0, 0.2, 1);
    animation-delay: 0.8s;
}
.anim-verified-3d .badge-check-3d {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: draw3DCheck 0.4s ease-out 0.4s forwards;
}

@keyframes pop3DBadge {
    0% { transform: scale(0) rotate(-15deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes shineSweep {
    0%, 20% { transform: translateX(-35px); }
    80%, 100% { transform: translateX(45px); }
}
@keyframes draw3DCheck {
    to { stroke-dashoffset: 0; }
}

/* Animated 3D Crown for 1st Place */
.animated-crown {
    position: relative;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.crown-wrapper {
    width: 100%;
    height: 100%;
    animation: rotate3DCrown 4s linear infinite;
    transform-origin: center center;
}

.crown-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0px 5px 8px rgba(255, 215, 0, 0.6));
}

@keyframes rotate3DCrown {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.shine-container {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    overflow: hidden;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
}

.shine-effect {
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9), transparent);
    transform: skewX(-25deg);
    animation: shineCrown 3s infinite;
}

@keyframes shineCrown {
    0% { left: -150%; }
    50% { left: 150%; }
    100% { left: 150%; }
}
