:root { 
    --dark-bg: #111827; 
    --panel-bg: #1f2937; 
    --border-color: #374151;
    --text-color: #e5e7eb; 
    --text-muted: #9ca3af; 
    --vibrant-blue: #3b82f6; 
    --vibrant-purple: #8b5cf6; 
    --vibrant-green: #22c55e; 
    --vibrant-red: #ef4444; 
    --vibrant-gold: #f59e0b; 
    --vibrant-teal: #14b8a6; 
    --accent-pink: #ec4899;
    --vibrant-sky: #38bdf8;
    
    /* Rarity Colors */
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b;
    --rarity-collectible: #ec4899;
}

/* --- Animations --- */
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(236, 72, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
}

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes story-progress { from { width: 0%; } to { width: 100%; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

@keyframes animated-rgb-button {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Vazirmatn', sans-serif; 
    margin: 0;
    background-color: var(--dark-bg); 
    background-image: url('https://www.transparenttextures.com/patterns/diagmonds.png');
    background-attachment: fixed;
    color: var(--text-color);
    padding: 70px 15px 100px 15px; /* Added padding-bottom for nav */
    box-sizing: border-box;
}

/* --- Header --- */
.header-container {
    position: fixed; top: 0; left: 0; width: 100%; 
    padding: 10px 15px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100; 
    box-sizing: border-box; 
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px); 
    border-bottom: 1px solid var(--border-color);
}
.header-left, .header-right { display: flex; align-items: center; gap: 10px; }

.header-center {
    position: absolute; left: 63%; top: 50%;
    transform: translate(-50%, -50%);
}
.header-logo { height: 45px; width: auto; }

.cta-button { 
    padding: 6px 12px; font-size: 13px; font-weight: 700; 
    border-radius: 8px; text-decoration: none; color: white; 
    background-color: var(--vibrant-purple); 
    border: none; cursor: pointer;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap; justify-content: center;
}
.cta-button:active { transform: scale(0.94); }

/* --- Sidebar Menu --- */
.menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    z-index: 2000; opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.menu-overlay.visible { opacity: 1; visibility: visible; }

.menu-dropdown-panel {
    display: block !important; position: fixed; top: 0; right: -280px; left: auto;
    width: 280px; height: 100vh;
    background: #1f2937; border-left: 1px solid var(--border-color);
    z-index: 2001; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0,0,0,0.5); overflow-y: auto;
}
.menu-dropdown-panel.visible { right: 0; }

.sidebar-header {
    background: linear-gradient(135deg, var(--vibrant-purple), #1e1b4b);
    padding: 25px 20px; display: flex; flex-direction: column;
    align-items: center; text-align: center; margin-bottom: 10px;
}
.sidebar-avatar-wrapper {
    position: relative; width: 80px; height: 80px;
    margin-bottom: 10px; display: flex; justify-content: center; align-items: center;
}
.sidebar-avatar {
    width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border-color); z-index: 1;
}
.sidebar-avatar-frame {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 2; object-fit: contain; display: none;
}
.sidebar-username {
    color: white; font-weight: 900; font-size: 1.1rem;
    margin-bottom: 5px; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.sidebar-vip-badge {
    background: linear-gradient(45deg, #f59e0b, #b45309); color: white;
    font-size: 0.65rem; padding: 1px 6px; border-radius: 8px;
    font-weight: 900; display: inline-flex; align-items: center; gap: 3px;
    animation: pulse-gold 3s infinite;
}
.sidebar-stats-row {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-top: 5px; width: 100%;
}
.sidebar-level, .sidebar-coins {
    font-size: 0.8rem; color: var(--vibrant-gold);
    background: rgba(0,0,0,0.3); padding: 2px 10px; border-radius: 12px;
}
.sidebar-profile-btn {
    margin-top: 15px; background-color: rgba(255, 255, 255, 0.15);
    color: white; font-size: 0.8rem; padding: 5px 15px; border-radius: 20px;
    text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex; align-items: center; gap: 5px;
}
.menu-link {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    color: var(--text-color); font-size: 0.95rem; font-weight: 500;
    padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background-color 0.2s ease, padding-right 0.2s ease;
}
.menu-link:hover {
    background-color: rgba(255,255,255,0.05); padding-right: 25px; color: var(--vibrant-blue);
}
.menu-link i { width: 25px; text-align: center; color: var(--text-muted); }
.menu-link:hover i { color: var(--vibrant-blue); }
.menu-section-title {
    padding: 15px 20px 5px; font-size: 0.85rem; font-weight: 700;
    color: var(--vibrant-sky); text-transform: uppercase; letter-spacing: 1px; margin: 0;
}
.close-sidebar-btn {
    position: absolute; top: 15px; left: 15px; color: white;
    font-size: 1.2rem; background: rgba(0,0,0,0.2); width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer; border: none;
}

/* --- Layout Components --- */
.content { 
    display: flex; flex-direction: column; width: 100%; max-width: 600px; margin: 0 auto; gap: 20px;
}
.info-section { 
    padding: 20px; border-radius: 15px; width: 100%; box-sizing: border-box; 
    background-color: var(--panel-bg); border: 1px solid var(--border-color); text-align: center;
}
.info-section.glass-effect { backdrop-filter: blur(10px); }
.info-section h2 { font-size: 1.5rem; font-weight: 900; margin: 0 0 10px 0; }
.info-section p { color: var(--text-muted); margin-bottom: 20px; font-size: 0.9rem; }

/* --- Stories --- */
.stories-section {
    padding: 15px 0; background-color: var(--panel-bg);
    border: 1px solid var(--border-color); border-radius: 15px; overflow: hidden;
}
.stories-container {
    display: flex; gap: 15px; overflow-x: auto; padding: 5px 15px;
    scrollbar-width: none;
}
.stories-container::-webkit-scrollbar { display: none; }
.story-item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; flex-shrink: 0; transition: transform 0.1s;
}
.story-item:active { transform: scale(0.94); }
.story-item-thumbnail {
    width: 64px; height: 64px; border-radius: 50%; padding: 3px;
    background: linear-gradient(45deg, var(--vibrant-gold), var(--accent-pink), var(--vibrant-purple));
    display: flex; justify-content: center; align-items: center;
}
.story-item.seen .story-item-thumbnail { background: var(--border-color); }
.story-item-thumbnail img, .story-item-thumbnail video {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 2px solid var(--dark-bg);
}
.story-item-title {
    font-size: 0.75rem; font-weight: 500; color: var(--text-muted);
    max-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Story Viewer Modal */
.story-viewer-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); z-index: 2000;
    display: none; justify-content: center; align-items: center;
}
.story-viewer-modal.visible { display: flex; }
.story-viewer-content {
    position: relative; width: 100%; height: 100%; max-width: 450px;
    max-height: 95vh; display: flex; flex-direction: column;
    border-radius: 10px; overflow: hidden;
}
.story-viewer-header { position: absolute; top: 0; left: 0; width: 100%; padding: 10px; z-index: 2002; }
.story-progress-bars { display: flex; gap: 4px; width: 100%; }
.progress-bar-container { flex-grow: 1; height: 3px; background-color: rgba(255, 255, 255, 0.3); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background-color: white; width: 0%; }
.progress-bar-container.active .progress-bar-fill {
    animation-name: story-progress; animation-duration: 5s; animation-timing-function: linear; animation-fill-mode: forwards;
}
.story-viewer-close {
    position: absolute; top: 15px; right: 15px; background: none; border: none;
    color: white; font-size: 2rem; cursor: pointer; z-index: 2003;
}
.story-viewer-media { width: 100%; height: 100%; object-fit: contain; }
.story-cta-btn {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    z-index: 2005; background-color: var(--vibrant-blue); color: white;
    text-decoration: none; font-weight: 900; font-size: 0.9rem;
    padding: 10px 24px; border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px); display: flex; align-items: center; gap: 8px;
    animation: pulse-gold 2s infinite;
}
.story-navigation {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; z-index: 2001;
}
.story-nav-prev, .story-nav-next { flex: 1; height: 100%; cursor: pointer; }

/* --- Swiper Slider --- */
.featured-slider {
    width: 100%; height: 180px; border-radius: 15px;
    overflow: hidden; border: 1px solid var(--border-color);
}
.swiper-slide {
    display: flex; align-items: flex-end; justify-content: flex-start;
    text-align: right; color: #fff; background-size: cover; background-position: center;
}
.swiper-slide a {
    width: 100%; text-decoration: none; color: white; padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 70%);
}
.swiper-slide h3 { margin: 0; font-size: 1.2rem; font-weight: 900; }
.swiper-slide p { margin: 4px 0 0 0; font-size: 0.8rem; color: var(--text-muted); }
.swiper-pagination-bullet-active { background-color: var(--vibrant-blue) !important; }

/* --- Feature Cards (Market) --- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; }
.feature-card {
    background-color: var(--panel-bg); border: 1px solid var(--border-color);
    border-radius: 15px; padding: 20px 15px; text-align: center; text-decoration: none;
    color: var(--text-color); transition: transform 0.2s ease;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.feature-card:hover { transform: translateY(-5px); background-color: #2a3647; }
.feature-card:active { transform: scale(0.94); }
.feature-card i { font-size: 2rem; margin-bottom: 5px; }

/* --- Articles Slider --- */
.articles-slider { width: 100%; height: auto; margin-top: 20px; padding-bottom: 30px; overflow: hidden; }
.articles-slider .swiper-slide { width: 85%; max-width: 320px; height: auto; }
.article-card { 
    background-color: var(--dark-bg); border: 1px solid var(--border-color); border-radius: 15px; 
    overflow: hidden; text-decoration: none; color: var(--text-color); 
    display: flex; flex-direction: column; height: 100%; 
}
.article-card-image { width: 100%; height: 180px; object-fit: cover; }
.article-card-content { padding: 15px; text-align: right; flex-grow: 1; }
.article-card-content h3 { margin: 0 0 10px 0; font-size: 1.1rem; font-weight: 700; }
.article-card-content p { margin: 0 0 15px 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.article-card-footer { padding: 0 15px 15px 15px; margin-top: auto; text-align: right; }
.article-card-footer a { color: var(--vibrant-green); font-weight: 700; text-decoration: none; }

/* --- Notifications --- */
.notification-bell { position: relative; cursor: pointer; }
.notification-bell i { font-size: 1.5rem; color: var(--text-color); }
.notification-bell.has-new { animation: pulse-ring 1.5s infinite; }
.notification-count { 
    position: absolute; top: -5px; right: -8px; background-color: var(--vibrant-red); 
    color: white; border-radius: 50%; width: 20px; height: 20px; 
    font-size: 0.75rem; display: none; justify-content: center; align-items: center; 
    border: 2px solid var(--dark-bg); font-weight: 700;
}
.notification-count.visible { display: flex; }
.notification-panel { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background-color: rgba(0, 0, 0, 0.6); z-index: 1100; display: flex; 
    justify-content: center; align-items: flex-start; padding-top: 70px; 
    backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; 
}
.notification-panel.visible { opacity: 1; pointer-events: auto; }
.notification-container { 
    background: linear-gradient(145deg, #232d3f, #1a2230); border-radius: 15px; 
    border: 1px solid var(--border-color); width: 90%; max-width: 400px; 
    max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; 
    transform: translateY(-20px); transition: transform 0.3s ease-out; 
}
.notification-panel.visible .notification-container { transform: translateY(0); }
.notification-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border-color); }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.8rem; cursor: pointer; line-height: 1; }
.notification-list { padding: 5px; overflow-y: auto; }
.notification-item { display: flex; align-items: center; gap: 15px; padding: 15px; border-bottom: 1px solid var(--border-color); text-decoration: none; color: var(--text-color); }
.notification-item.unread { background-color: rgba(190, 24, 93, 0.1); }
.notification-avatar { width: 40px; height: 40px; border-radius: 50%; background-size: cover; background-position: center; flex-shrink: 0; }
.notification-content { flex-grow: 1; text-align: right; }
.notification-text span { font-weight: 700; color: var(--accent-pink); }
.notification-time { font-size: 0.75rem; color: var(--text-muted); }
.no-notifications { text-align: center; padding: 20px; color: var(--text-muted); }

/* --- Footer --- */
.site-footer {
    background-color: var(--panel-bg); border-top: 1px solid var(--border-color);
    padding: 40px 20px; text-align: right; margin-top: 20px;
}
.footer-container {
    max-width: 600px; margin: 0 auto; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px;
}
.footer-column h4 {
    font-size: 1.1rem; font-weight: 700; color: var(--text-color);
    margin-bottom: 15px; position: relative; padding-bottom: 10px;
}
.footer-column h4::after {
    content: ''; position: absolute; bottom: 0; right: 0; width: 40px; height: 2px;
    background: linear-gradient(to left, var(--vibrant-purple), var(--vibrant-blue));
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.social-links { display: flex; gap: 15px; margin-top: 20px; }
.social-links a { color: var(--text-muted); font-size: 1.5rem; }
.footer-bottom { border-top: 1px solid var(--border-color); margin-top: 30px; padding-top: 20px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.footer-app-download { background-color: var(--dark-bg); border: 1px solid var(--vibrant-blue); padding: 20px; border-radius: 10px; }
.app-download-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.app-download-btn {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 10px 15px; border-radius: 8px; text-decoration: none; font-weight: 700;
    background-color: var(--panel-bg); color: var(--text-color); border: 1px solid var(--border-color);
}
.app-download-btn .fab.fa-google-play { color: var(--vibrant-green); }

/* --- Profile Prompt Modal --- */
#profile-prompt-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(17, 24, 39, 0.8); backdrop-filter: blur(8px);
    z-index: 2000; justify-content: center; align-items: center; padding: 15px;
    box-sizing: border-box; opacity: 0; transition: opacity 0.3s ease-out;
}
#profile-prompt-modal.visible { opacity: 1; }
#profile-prompt-modal-content {
    background-color: var(--panel-bg); padding: 25px; border-radius: 15px;
    text-align: center; max-width: 90%; width: 400px;
    border: 1px solid var(--border-color); transform: scale(0.95); transition: transform 0.3s ease-out;
}
#profile-prompt-modal.visible #profile-prompt-modal-content { transform: scale(1); }
#profile-prompt-modal h3 { color: var(--vibrant-gold); margin-top: 0; font-weight: 900; }
#profile-prompt-modal .prompt-actions { display: flex; gap: 10px; justify-content: center; }

/* --- Floating Rewards & Modal --- */
.floating-rewards-btn {
    position: fixed; bottom: 85px; left: 15px; width: 55px; height: 55px;
    background: linear-gradient(45deg, var(--vibrant-purple), var(--accent-pink));
    color: white; border: none; border-radius: 50%; font-size: 1.8rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    z-index: 999; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    animation: pulse-ring 2s infinite; transition: transform 0.2s ease;
}
.floating-rewards-btn:active { transform: scale(0.94); }

.rewards-modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(17, 24, 39, 0.8); backdrop-filter: blur(8px);
    z-index: 2100; justify-content: center; align-items: center; padding: 15px;
    box-sizing: border-box; opacity: 0; transition: opacity 0.3s ease-out;
}
.rewards-modal-overlay.visible { display: flex; opacity: 1; }
.rewards-modal-content {
    background-color: var(--panel-bg); padding: 20px; border-radius: 15px;
    text-align: right; max-width: 90%; width: 450px;
    border: 1px solid var(--border-color); transform: scale(0.95);
    transition: transform 0.3s ease-out; position: relative; 
}
.rewards-modal-overlay.visible .rewards-modal-content { transform: scale(1); }
.rewards-modal-content h3 { color: var(--text-color); margin-top: 0; text-align: center; font-weight: 900; }
.rewards-modal-content .close-btn { position: absolute; top: 10px; left: 10px; padding: 5px; }
.rewards-modal-link {
    display: flex; align-items: center; gap: 15px; background-color: var(--dark-bg);
    border: 1px solid var(--border-color); border-radius: 10px; padding: 15px;
    text-decoration: none; color: var(--text-color); margin-bottom: 15px;
}
.rewards-modal-link:hover { background-color: #2a3647; border-color: var(--vibrant-blue); }
.rewards-modal-icon {
    width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 1.8rem; flex-shrink: 0;
}
.rewards-modal-text h4 { margin: 0 0 5px 0; font-size: 1.1rem; font-weight: 700; }
.rewards-modal-text p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* --- Bottom Nav (Modern) --- */
.bottom-nav {
    position: fixed; bottom: 11px; left: 15px; right: 15px; height: 70px;
    background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 24px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; z-index: 1000; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none; color: var(--text-muted); padding: 5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative;
}
.nav-item:active { transform: scale(0.94); }
.nav-item i {
    font-size: 1.4rem; margin-bottom: 2px; transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.nav-item span {
    font-size: 0.6rem; font-weight: 500; opacity: 0.7; transform: scale(0.9); transition: all 0.3s ease;
}
.nav-item.active { color: white; }
.nav-item.active i {
    transform: translateY(-8px) scale(1.2); color: var(--vibrant-sky);
    filter: drop-shadow(0 5px 15px var(--vibrant-sky));
}
.nav-item.active span {
    opacity: 1; transform: scale(1) translateY(-2px); color: var(--vibrant-sky); font-weight: 900;
}
.nav-item.active::after {
    content: ''; position: absolute; bottom: -8px; width: 4px; height: 4px;
    background-color: var(--vibrant-sky); border-radius: 50%; box-shadow: 0 0 8px var(--vibrant-sky);
}

/* --- GapMap Widget (پاتوق) - PRESERVED --- */
.gapmap-widget-container {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 1px solid #6366f1; position: relative; overflow: hidden;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); margin-bottom: 20px;
    animation: border-pulse 4s infinite alternate;
}
.gapmap-widget-container::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%236366f1' fill-opacity='0.1' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3; z-index: 0;
}
.gapmap-header-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; position: relative; z-index: 1;
}
.live-status-badge {
    background-color: rgba(239, 68, 68, 0.2); color: #ef4444; padding: 4px 8px;
    border-radius: 6px; font-size: 0.75rem; font-weight: 900;
    display: flex; align-items: center; gap: 6px; border: 1px solid rgba(239, 68, 68, 0.4);
}
.blink-dot {
    width: 8px; height: 8px; background-color: #ef4444; border-radius: 50%;
    animation: blinker 1.5s linear infinite;
}
@keyframes blinker { 50% { opacity: 0; } }
@keyframes border-pulse {
    0% { border-color: #6366f1; }
    100% { border-color: #a855f7; box-shadow: 0 0 25px rgba(168, 85, 247, 0.4); }
}
.online-users-stack { margin-bottom: 20px; position: relative; z-index: 1; }
.stack-avatars { display: flex; align-items: center; justify-content: flex-end; }
.stack-img {
    width: 35px; height: 35px; border-radius: 50%; border: 2px solid #1e1b4b;
    margin-left: -10px; box-shadow: 0 2px 5px rgba(0,0,0,0.3); background-color: #312e81;
}
.stack-count { font-size: 0.8rem; color: #94a3b8; margin-right: 10px; font-weight: 700; }
.gapmap-actions { display: flex; gap: 10px; position: relative; z-index: 1; }
.gapmap-enter-btn {
    flex-grow: 1; background: linear-gradient(90deg, #6366f1, #8b5cf6);
    color: white; text-decoration: none; padding: 12px; border-radius: 12px;
    font-weight: 900; display: flex; align-items: center; justify-content: center;
    gap: 10px; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); transition: transform 0.2s;
}
.gapmap-enter-btn:active { transform: scale(0.95); }
.gapmap-game-btn, .gapmap-music-btn {
    width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem; transition: transform 0.2s;
    text-decoration: none; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05);
}
.gapmap-game-btn { color: #f59e0b; }
.gapmap-music-btn { color: #10b981; }

/* --- Search Drawer --- */
.header-icon-btn {
    background: transparent; border: none; color: var(--text-color);
    font-size: 1.4rem; cursor: pointer; padding: 5px; margin-left: 5px;
}
.search-drawer {
    position: fixed; top: 70px; left: 0; width: 100%; background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border-color); padding: 0; max-height: 0; overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    z-index: 3000; box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.search-drawer.open { max-height: 400px; padding-bottom: 15px; overflow-y: auto; }
.search-input-wrapper {
    position: relative; padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; align-items: center;
}
#global-search-input {
    width: 100%; background-color: var(--dark-bg); border: 1px solid var(--border-color);
    padding: 12px 40px 12px 15px; border-radius: 10px; color: white;
    font-family: 'Vazirmatn', sans-serif; outline: none;
}
#global-search-input:focus { border-color: var(--vibrant-blue); }
.search-icon-inside { position: absolute; right: 30px; color: var(--text-muted); }
.close-search-btn { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; margin-right: 10px; cursor: pointer; }
.search-suggestions-container { padding: 10px 15px; }
.suggestions-title { font-size: 0.85rem; color: var(--text-muted); margin: 5px 0 10px 0; font-weight: 700; }
.search-results-list { list-style: none; padding: 0; margin: 0; }
.search-user-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px; border-radius: 8px; text-decoration: none; transition: background-color 0.2s;
}
.search-user-item:hover { background-color: rgba(255,255,255,0.05); }
.s-user-info { display: flex; align-items: center; gap: 12px; }
.s-user-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-color); }
.s-user-details { display: flex; flex-direction: column; }
.s-username { color: var(--text-color); font-weight: 700; font-size: 0.9rem; }
.s-username i { margin-right: 4px; color: var(--vibrant-blue); }
.s-level { color: var(--text-muted); font-size: 0.75rem; }
.follow-btn-sm {
    background-color: var(--vibrant-blue); color: white; border: none;
    padding: 5px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.loading-item { text-align: center; color: var(--text-muted); padding: 10px; }

/* --- Duo Grid Layout (Visual Cards) --- */
.duo-grid-container { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.mini-visual-card {
    position: relative; border-radius: 15px; padding: 15px 10px; text-align: center;
    border: 1px solid var(--border-color); display: flex; flex-direction: column;
    align-items: center; justify-content: space-between; height: 170px;
    overflow: hidden; backdrop-filter: blur(5px);
}
.mini-card-icon-area { height: 60px; width: 100%; position: relative; display: flex; justify-content: center; align-items: center; margin-bottom: 5px; }
.mini-card-title { font-size: 0.95rem; font-weight: 900; margin: 5px 0 2px 0; color: white; }
.mini-card-desc { font-size: 0.7rem; color: var(--text-muted); margin: 0 0 10px 0; white-space: nowrap; }
.mini-btn { width: 100% !important; padding: 8px 0 !important; font-size: 0.8rem !important; border-radius: 10px; justify-content: center; margin-top: auto; }

/* Specific Mini Cards */
.glass-battle { background: linear-gradient(160deg, rgba(239, 68, 68, 0.1), rgba(31, 41, 55, 0.9)); border-color: rgba(239, 68, 68, 0.3); }
.mic-left-mini, .mic-right-mini { font-size: 2rem; color: var(--text-muted); filter: drop-shadow(0 0 5px rgba(255,255,255,0.1)); }
.mic-left-mini { color: var(--vibrant-blue); transform: rotate(15deg) translateX(-5px); }
.mic-right-mini { color: var(--vibrant-red); transform: rotate(-15deg) translateX(5px); }
.battle-btn-pulse { background: linear-gradient(90deg, #ef4444, #b91c1c); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); }
.vs-badge-mini {
    background: #fff; color: #000; font-weight: 900; font-size: 0.7rem;
    padding: 2px 5px; border-radius: 4px; z-index: 10;
    box-shadow: 0 0 8px var(--vibrant-red); animation: pulse-ring 2s infinite;
}

.glass-tournament { background: linear-gradient(160deg, rgba(245, 158, 11, 0.1), rgba(31, 41, 55, 0.9)); border-color: rgba(245, 158, 11, 0.3); }
.trophy-mini { font-size: 2.5rem; background: linear-gradient(to bottom, #fcd34d, #b45309); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.3)); }
.crown-mini { position: absolute; top: -5px; font-size: 1rem; color: #fbbf24; }
.tournament-btn-shine { background: linear-gradient(90deg, #f59e0b, #d97706); position: relative; overflow: hidden; }
.tournament-btn-shine::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg); animation: shine-pass 3s infinite;
}
@keyframes shine-pass { 0% { left: -100%; } 20% { left: 200%; } 100% { left: 200%; } }

.glass-character { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.3); }
.character-mini { font-size: 2.5rem; color: var(--vibrant-sky); filter: drop-shadow(0 0 10px var(--vibrant-sky)); }
.rgb-btn {
    background-image: linear-gradient(90deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    background-size: 300% 300%; animation: animated-rgb-button 8s linear infinite; border: none; color: white;
}

.glass-gang { background: linear-gradient(160deg, rgba(139, 92, 246, 0.1), rgba(31, 41, 55, 0.9)); border-color: rgba(139, 92, 246, 0.3); }
.gang-main-mini { font-size: 2.5rem; background: linear-gradient(to bottom, #a855f7, #6d28d9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; z-index: 2; }
.gang-bg-mini { position: absolute; font-size: 1.8rem; color: rgba(167, 139, 250, 0.2); animation: spin 10s linear infinite; }
.gang-btn-glow { background: linear-gradient(90deg, #8b5cf6, #6d28d9); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); }

@media (max-width: 360px) {
    .mini-visual-card { height: 160px; padding: 10px 5px; }
    .mini-card-title { font-size: 0.85rem; }
    .mini-card-desc { font-size: 0.65rem; }
    .mic-left-mini, .mic-right-mini { font-size: 1.5rem; }
    .trophy-mini, .character-mini, .gang-main-mini { font-size: 2rem; }
}

/* --- Radio Strip --- */
.radio-strip-container {
    width: 100%; max-width: 100%; box-sizing: border-box; height: 70px;
    background: linear-gradient(90deg, #1e1b4b, #312e81);
    border: 1px solid rgba(99, 102, 241, 0.3); border-radius: 12px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; position: relative; overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.radio-strip-container::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: var(--vibrant-red); box-shadow: 0 0 10px var(--vibrant-red);
}
.radio-info { display: flex; align-items: center; gap: 12px; flex-grow: 1; overflow: hidden; padding-left: 10px; }
.radio-icon-box {
    width: 40px; height: 40px; background: rgba(255, 255, 255, 0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--vibrant-red); border: 1px solid rgba(239, 68, 68, 0.3);
}
.radio-text-group { display: flex; flex-direction: column; justify-content: center; white-space: nowrap; overflow: hidden; }
.radio-title { font-size: 0.9rem; font-weight: 900; color: #fff; display: flex; align-items: center; gap: 6px; }
.on-air-badge {
    font-size: 0.6rem; background: var(--vibrant-red); color: white;
    padding: 1px 4px; border-radius: 4px; animation: blink 1.5s infinite;
}
.radio-subtitle { font-size: 0.75rem; color: var(--text-muted); }
.equalizer { display: flex; gap: 3px; align-items: flex-end; height: 20px; margin-right: 15px; }
.bar { width: 1px; background: var(--vibrant-sky); border-radius: 10px; animation: bounce 0.5s infinite ease-in-out alternate; }
.bar:nth-child(1) { height: 10px; animation-delay: 0.1s; }
.bar:nth-child(2) { height: 18px; animation-delay: 0.3s; }
.bar:nth-child(3) { height: 14px; animation-delay: 0.2s; }
.bar:nth-child(4) { height: 20px; animation-delay: 0.4s; }
.bar:nth-child(5) { height: 12px; animation-delay: 0.1s; }
.radio-btn-play {
    background: linear-gradient(45deg, var(--vibrant-red), #be123c);
    color: white; border: none; border-radius: 50%; width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; cursor: pointer; margin-right: 10px; flex-shrink: 0;
}
@keyframes bounce { 0% { transform: scaleY(0.5); } 100% { transform: scaleY(1.2); } }
@media (max-width: 480px) {
    .equalizer { height: 15px; margin-right: 8px; }
    .bar { width: 3px; }
    .radio-strip-container { padding: 0 5px; }
}

/* --- Skeleton Loading --- */
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }
.skeleton {
    background: linear-gradient(to right, #1f2937 8%, #374151 18%, #1f2937 33%);
    background-size: 1000px 100%; animation: shimmer 2s infinite linear;
    border-radius: 15px; position: relative; overflow: hidden;
}
.featured-slider .skeleton-slide { width: 100%; height: 100%; display: flex; align-items: flex-end; padding: 15px; box-sizing: border-box; }
.skeleton-text { height: 20px; width: 60%; background-color: rgba(255,255,255,0.1); border-radius: 4px; margin-bottom: 8px; }
.skeleton-text.sm { width: 40%; height: 15px; }

/* --- App Grid (Icons) --- */
.app-grid-container { position: relative; width: 100%; margin: 20px 0; overflow: hidden; }
.app-grid-scroll {
    display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; 
    gap: 15px 20px; padding: 10px 20px; overflow-x: auto; scroll-behavior: smooth;
    scrollbar-width: none;
}
.app-grid-scroll::-webkit-scrollbar { display: none; }
.app-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px; width: 70px;
    text-decoration: none; transition: transform 0.2s;
}
.app-item:active { transform: scale(0.92); }
.app-icon {
    width: 55px; height: 55px; border-radius: 16px; display: flex;
    align-items: center; justify-content: center; font-size: 1.4rem; color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); position: relative;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}
.app-label {
    font-size: 0.7rem; color: var(--text-muted); text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
/* Color Utilities */
.box-gold { background: linear-gradient(135deg, #f59e0b, #b45309); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
.box-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.box-red { background: linear-gradient(135deg, #ef4444, #991b1b); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.box-teal { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.box-green { background: linear-gradient(135deg, #22c55e, #15803d); }
.box-orange { background: linear-gradient(135deg, #f97316, #c2410c); }
.box-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.box-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.box-yellow { background: linear-gradient(135deg, #eab308, #a16207); }
.box-sky { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.box-red-dark { background: linear-gradient(135deg, #be123c, #881337); }
.box-pink { background: linear-gradient(135deg, #ec4899, #be185d); }
.box-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.box-gray { background: linear-gradient(135deg, #6b7280, #374151); }
.box-lime { background: linear-gradient(135deg, #84cc16, #4d7c0f); }
.box-gold-dark { background: linear-gradient(135deg, #d97706, #92400e); }
.box-brown { background: linear-gradient(135deg, #a8a29e, #57534e); }
.box-dark { background: linear-gradient(135deg, #1f2937, #111827); border: 1px solid #374151; }
.box-blue-dark { background: linear-gradient(135deg, #1e40af, #1e3a8a); }
.vip-item .app-icon { border: 2px solid #fcd34d; animation: glow-gold 3s infinite alternate; }
.live-dot {
    position: absolute; top: 5px; right: 5px; width: 8px; height: 8px;
    background-color: #fff; border-radius: 50%; animation: blink 1s infinite;
}
.fade-overlay {
    position: absolute; top: 0; left: 0; bottom: 0; width: 120px;
    background: linear-gradient(to right, var(--dark-bg), transparent);
    pointer-events: none; z-index: 5;
}
@keyframes glow-gold { from { box-shadow: 0 0 5px #f59e0b; } to { box-shadow: 0 0 15px #fcd34d; } }

/* --- Smart Action Bar --- */
#smart-action-bar-container { width: 100%; margin-bottom: 15px; display: none; animation: slideDownFade 0.5s ease-out forwards; }
.smart-action-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; border-radius: 10px; background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); text-decoration: none;
    position: relative; overflow: hidden;
}
.smart-action-bar.theme-gold { background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(31, 41, 55, 0.9)); border-color: rgba(245, 158, 11, 0.4); }
.smart-action-bar.theme-green { background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), rgba(31, 41, 55, 0.9)); border-color: rgba(34, 197, 94, 0.4); }
.smart-action-bar.theme-purple { background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(31, 41, 55, 0.9)); border-color: rgba(139, 92, 246, 0.4); }
.sab-content { display: flex; align-items: center; gap: 10px; }
.sab-icon-box {
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
    justify-content: center; font-size: 1rem; animation: pulse-ring 2s infinite;
}
.theme-gold .sab-icon-box { background: rgba(245, 158, 11, 0.2); color: var(--vibrant-gold); }
.theme-green .sab-icon-box { background: rgba(34, 197, 94, 0.2); color: var(--vibrant-green); }
.theme-purple .sab-icon-box { background: rgba(139, 92, 246, 0.2); color: var(--vibrant-purple); }
.sab-text { display: flex; flex-direction: column; }
.sab-title { font-size: 0.85rem; font-weight: 900; color: #fff; }
.sab-sub { font-size: 0.7rem; color: var(--text-muted); }
.sab-arrow {
    font-size: 0.8rem; color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.1);
    width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
@keyframes slideDownFade { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Beat Center --- */
.beat-center-card {
    position: relative; background: linear-gradient(135deg, #881337, #1e1b4b);
    border: 1px solid rgba(244, 63, 94, 0.4); border-radius: 16px; padding: 20px;
    display: flex; align-items: center; justify-content: space-between;
    overflow: hidden; box-shadow: 0 8px 20px rgba(136, 19, 55, 0.3); transition: transform 0.2s ease;
}
.beat-center-card:active { transform: scale(0.98); }
.bc-bg-wave {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23fb7185' fill-opacity='0.1'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3; z-index: 0;
}
.bc-content { display: flex; align-items: center; gap: 15px; z-index: 1; }
.bc-icon-wrapper {
    width: 50px; height: 50px; background: rgba(255, 255, 255, 0.1); border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 0 15px rgba(244, 63, 94, 0.5);
    animation: pulse-ring 3s infinite;
}
.bc-info { display: flex; flex-direction: column; }
.bc-title { margin: 0; font-size: 1.1rem; font-weight: 900; color: white; display: flex; align-items: center; gap: 8px; }
.bc-badge { font-size: 0.6rem; background: #f43f5e; color: white; padding: 2px 6px; border-radius: 6px; animation: bounce 2s infinite; }
.bc-desc { margin: 4px 0 0; font-size: 0.75rem; color: #fecdd3; }
.bc-visualizer { display: flex; gap: 4px; align-items: center; height: 30px; margin: 0 15px; z-index: 1; }
.bc-visualizer span {
    display: block; width: 4px; background: #fb7185; border-radius: 4px;
    animation: sound-wave 1s infinite ease-in-out alternate;
}
.bc-visualizer span:nth-child(1) { height: 10px; animation-delay: 0.1s; }
.bc-visualizer span:nth-child(2) { height: 25px; animation-delay: 0.3s; }
.bc-visualizer span:nth-child(3) { height: 15px; animation-delay: 0.2s; }
.bc-visualizer span:nth-child(4) { height: 30px; animation-delay: 0.4s; }
@keyframes sound-wave { 0% { height: 5px; opacity: 0.5; } 100% { height: 100%; opacity: 1; box-shadow: 0 0 8px #f43f5e; } }
.bc-action-btn {
    background: white; color: #881337; text-decoration: none; padding: 8px 16px;
    border-radius: 20px; font-weight: 900; font-size: 0.85rem; display: flex;
    align-items: center; gap: 6px; transition: all 0.2s; z-index: 1; white-space: nowrap;
}
.bc-action-btn:hover { background: #fff1f2; transform: translateX(-3px); }
@media (max-width: 480px) {
    .bc-visualizer { display: none; }
    .beat-center-card { padding: 15px; }
    .bc-icon-wrapper { width: 40px; height: 40px; font-size: 1.2rem; }
}

/* --- Game Center (Amusement Park) --- */
.game-card {
    background-color: var(--panel-bg); border: 1px solid var(--border-color);
    border-radius: 15px; padding: 15px 5px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-decoration: none;
    position: relative; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s;
    overflow: hidden;
}
.game-card:active { transform: scale(0.92); }
.game-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, var(--theme-color), transparent 70%);
    opacity: 0; transition: opacity 0.3s; z-index: 0;
}
.game-card:hover::before { opacity: 0.15; }
.game-card:hover { border-color: var(--theme-color); transform: translateY(-3px); }
.game-icon-box {
    font-size: 1.8rem; color: var(--theme-color); margin-bottom: 8px; z-index: 1;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)); transition: transform 0.2s;
}
.game-card:hover .game-icon-box { transform: scale(1.1) rotate(5deg); }
.game-title { color: var(--text-color); font-size: 0.75rem; font-weight: 700; z-index: 1; white-space: nowrap; }
.game-badge {
    position: absolute; top: 5px; right: 5px; background-color: var(--vibrant-red);
    color: white; font-size: 0.55rem; padding: 2px 6px; border-radius: 8px;
    font-weight: 900; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.online-dot {
    position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
    background-color: var(--vibrant-green); border-radius: 50%;
    box-shadow: 0 0 8px var(--vibrant-green); animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.5; transform: scale(0.8); }
}