/* ==========================================
   1. VARIABLES & RESET
   ========================================== */
:root {
    --bg: #0b0e18;
    --card: #161b2a;
    --blue: #32c5ff;
    --purple: #8e44ad;
    --gold: #f1c40f;
    --green: #2ecc71;
    --text: #ffffff;
    --transition: 0.3s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }
body { background-color: var(--bg); color: var(--text); padding-bottom: 100px; overflow-x: hidden; }

/* ==========================================
   2. HEADER & NAVIGATION
   ========================================== */
header { 
    background: #161b2a; 
    padding: 12px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 2px solid var(--purple); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.logo { font-size: 26px; font-weight: 900; cursor: pointer; text-transform: uppercase; }
.logo span { color: var(--blue); }

.user-stats { display: flex; align-items: center; gap: 15px; }
.stat-box { 
    background: rgba(255,255,255,0.05); 
    padding: 6px 15px; 
    border-radius: 50px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 14px; 
    font-weight: bold; 
    border: 1px solid rgba(255,255,255,0.1); 
}

.xp-bar-mini { width: 80px; height: 8px; background: #222; border-radius: 5px; overflow: hidden; }
#xp-fill { height: 100%; background: var(--green); width: 0%; transition: 0.5s; }

#header-avatar { 
    width: 45px; height: 45px; border-radius: 50%; 
    border: 2px solid var(--blue); cursor: pointer; 
    object-fit: cover; transition: var(--transition); 
}
#header-avatar:hover { transform: scale(1.1); border-color: var(--gold); }

.main-nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 5%; flex-wrap: wrap; gap: 15px; }
.nav-buttons { display: flex; gap: 10px; }
.nav-btn { 
    padding: 10px 22px; border: none; border-radius: 12px; 
    font-weight: bold; cursor: pointer; color: white; 
    background: #1e293b; transition: var(--transition); 
}
.nav-btn.active { background: var(--blue); box-shadow: 0 0 15px rgba(50, 197, 255, 0.4); }

.search-box { 
    display: flex; align-items: center; background: #1c2237; 
    padding: 10px 18px; border-radius: 25px; border: 1px solid #333; 
}
.search-box input { background: transparent; border: none; color: white; margin-left: 10px; outline: none; width: 150px; }

/* ==========================================
   3. GAME GRID SYSTEM (POKI STYLE)
   ========================================== */
.game-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    grid-auto-rows: 150px; 
    grid-auto-flow: dense; 
    gap: 15px; 
    padding: 0 5%; 
}

.game-card { 
    background: var(--card); border-radius: 22px; 
    overflow: hidden; cursor: pointer; transition: var(--transition); 
    position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.4); 
}
.game-card:hover { transform: translateY(-8px) scale(1.02); z-index: 10; box-shadow: 0 10px 25px rgba(50, 197, 255, 0.2); }
.game-card img { width: 100%; height: 100%; object-fit: cover; }

/* Card Variations */
.game-card.wide { grid-column: span 2; }
.game-card.tall { grid-row: span 2; }
.game-card.big { grid-column: span 2; grid-row: span 2; }

/* Lock & Info Overlays */
.lock-badge { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.75); display: flex; flex-direction: column; 
    align-items: center; justify-content: center; color: var(--gold); 
    font-weight: bold; z-index: 5; text-align: center; 
}
.game-card.locked img { filter: grayscale(1) blur(2px); }

.game-info-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
    padding: 8px 12px; display: flex; justify-content: space-between;
    align-items: center; color: white; z-index: 2;
}
.game-title-text { font-size: 0.8rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.game-likes-count { font-size: 0.75rem; color: var(--green); font-weight: 800; display: flex; align-items: center; gap: 5px; }

/* ==========================================
   4. MODALS & AUTH CARDS
   ========================================== */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.92); z-index: 9999; 
    display: flex; align-items: center; justify-content: center; 
    backdrop-filter: blur(8px); 
}

.auth-card { 
    background: #161b2a; width: 95%; max-width: 420px; 
    padding: 35px; border-radius: 30px; border: 2px solid var(--purple); 
    text-align: center; position: relative; 
}

.close-modal { position: absolute; top: 15px; right: 20px; font-size: 2rem; color: #555; cursor: pointer; background: none; border: none; }

/* PUBG Profile Style */
.diamond-badge-wrapper { position: relative; margin-bottom: 20px; }
.diamond-badge { 
    width: 85px; height: 85px; margin: 0 auto; background: #2c3e50; 
    border: 4px solid var(--blue); transform: rotate(45deg); 
    display: flex; align-items: center; justify-content: center; 
    box-shadow: 0 0 20px rgba(50, 197, 255, 0.6); 
}
.diamond-badge span { transform: rotate(-45deg); font-size: 2.2rem; font-weight: 900; color: #fff; }

.profile-photo-upload { position: relative; width: 120px; height: 120px; margin: 0 auto 15px; border-radius: 50%; border: 4px solid var(--purple); }
.profile-photo-upload img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.edit-photo-btn { 
    position: absolute; bottom: 5px; right: 5px; background: var(--purple); 
    width: 35px; height: 35px; border-radius: 50%; display: flex; 
    align-items: center; justify-content: center; cursor: pointer; border: 3px solid #161b2a; 
}

.pubg-progress-bar { width: 100%; height: 12px; background: #111; border-radius: 6px; overflow: hidden; margin: 12px 0; border: 1px solid #333; }
.pubg-progress-bar .fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple)); width: 0%; transition: 1s ease; }

.p-stats-row { display: flex; justify-content: space-around; margin-top: 15px; }

/* ==========================================
   5. FLOATING ACTION BUTTONS (FAB)
   ========================================== */
.fab-container { 
    position: fixed; bottom: 25px; right: 25px; 
    display: flex; flex-direction: column; gap: 12px; z-index: 1001; 
}

.fab { 
    padding: 12px 25px; border-radius: 30px; border: none; 
    font-weight: 900; cursor: pointer; color: white; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.4); transition: var(--transition); 
    display: flex; align-items: center; gap: 10px; text-transform: uppercase; 
}
.fab:hover { transform: scale(1.05) translateY(-3px); }

.fab-ads { background: linear-gradient(90deg, #e67e22, #d35400); }
.fab:disabled { background: #444 !important; color: #888; cursor: not-allowed; opacity: 0.6; }

/* ==========================================
   6. ANIMATIONS & SPECIAL EFFECTS
   ========================================== */
.level-up-card { 
    border-color: var(--gold); 
    animation: popup-bounce 0.5s ease-out; 
}
@keyframes popup-bounce {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.level-up-badge {
    width: 100px; height: 100px; background: var(--gold); border-radius: 50%;
    margin: 0 auto 20px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: black;
    box-shadow: 0 0 30px var(--gold); font-weight: 900;
}

.glow-btn { animation: btn-glow 1.5s infinite; }
@keyframes btn-glow {
    0%, 100% { box-shadow: 0 0 5px var(--blue); }
    50% { box-shadow: 0 0 20px var(--blue); }
}

/* ==========================================
   7. MOBILE RESPONSIVENESS
   ========================================== */
@media (max-width: 600px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px 3% !important;
    }
    .game-card.big, .game-card.wide { grid-column: span 2 !important; }
    
    header { padding: 10px 3%; }
    .stat-box { padding: 4px 8px; font-size: 11px; }
    .xp-bar-mini { width: 40px; }

    .main-nav { flex-direction: column; align-items: center; }
    .nav-buttons { width: 100%; justify-content: center; overflow-x: auto; padding-bottom: 8px; }
    .search-box { width: 100%; }
    
    .fab-container { bottom: 15px; right: 15px; }
    .fab { padding: 10px 18px; font-size: 12px; }
}
/* Reward Success Styling */
.reward-popup {
    border: 2px solid var(--green) !important;
    animation: reward-bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes reward-bounce {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.reward-icon-circle {
    width: 80px; height: 80px; background: var(--green); border-radius: 50%;
    margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2.5rem; box-shadow: 0 0 20px var(--green);
}

.reward-text { color: var(--green); font-size: 2.5rem; font-weight: 900; }

/* Level Up Mega Effect */
.level-up-card {
    border: 4px solid var(--gold) !important;
    background: linear-gradient(180deg, #1c2237, #0b0e18) !important;
    box-shadow: 0 0 50px rgba(241, 196, 15, 0.5) !important;
}

/* Confetti Effect (Simple CSS) */
.confetti-effect {
    position: absolute; width: 100%; height: 100%;
    background-image: radial-gradient(circle, var(--gold) 10%, transparent 10%), 
                      radial-gradient(circle, var(--blue) 10%, transparent 10%);
    background-size: 20px 20px;
    opacity: 0.3; pointer-events: none;
}
/* Legendary Rank Effect */
.legendary-glow {
    color: #ff00ff !important;
    text-shadow: 0 0 15px #ff00ff, 0 0 30px #ff00ff;
    font-weight: 900;
    animation: legend-pulse 1.5s infinite alternate;
}

@keyframes legend-pulse {
    from { filter: brightness(1); }
    to { filter: brightness(1.5); }
}

.rank-display {
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-top: 5px;
    font-weight: bold;
    text-transform: uppercase;
}
/* Red Notification Dot */
.red-dot {
    position: absolute; top: -5px; right: -5px;
    width: 12px; height: 12px; background: #ff4d4d;
    border-radius: 50%; border: 2px solid white;
    box-shadow: 0 0 10px #ff4d4d;
}

/* Mission Tabs */
.mission-tabs {
    display: flex; gap: 10px; margin-bottom: 20px;
    background: rgba(0,0,0,0.3); padding: 5px; border-radius: 10px;
}
.tab-btn {
    flex: 1; padding: 10px; border: none; background: transparent;
    color: #888; font-weight: 900; cursor: pointer; transition: 0.3s;
}
.tab-btn.active { background: var(--blue); color: white; border-radius: 8px; }

/* Mission Item Style */
.mission-item {
    background: rgba(255,255,255,0.03); padding: 15px;
    border-radius: 12px; margin-bottom: 10px; display: flex;
    justify-content: space-between; align-items: center;
    border-left: 4px solid var(--purple);
}
.m-info { text-align: left; }
.m-info span { display: block; font-weight: bold; color: #fff; font-size: 0.9rem; }
.m-info small { color: var(--green); font-weight: bold; }

.collect-btn {
    background: var(--gold); color: #000; border: none;
    padding: 8px 15px; border-radius: 8px; font-weight: 900;
    cursor: pointer; box-shadow: 0 0 10px var(--gold);
}
.collect-btn:disabled { background: #444; color: #888; box-shadow: none; cursor: not-allowed; }
/* --- Floating Action Buttons (FAB) Styling Update --- */
.fab-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999 !important; /* ካብ ኩሉ ንላዕሊ ንክኸውን */
    pointer-events: auto !important; /* ምጽቃጥ ንክፍቀድ */
}

.fab {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.fab {
    padding: 12px 25px;
    border-radius: 30px;
    border: none;
    font-weight: 900;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s all ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

/* MISSIONS - ወርቃዊ ሕብሪ (Black text looks better on Gold) */
.fab-missions {
    background: linear-gradient(90deg, #f1c40f, #f39c12) !important;
    color: #000 !important; 
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.4);
}

/* DAILY CLAIM - ቀጠልያ ሕብሪ */
.fab-claim {
    background: linear-gradient(90deg, #2ecc71, #27ae60) !important;
    color: #fff !important;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

/* WATCH AD - ብራቱኳን ሕብሪ (ከምዘለዎ) */
.fab-ads {
    background: linear-gradient(90deg, #e67e22, #d35400) !important;
    color: #fff !important;
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
}

/* Hover Effect - ክትጽግዖ ከለኻ ንቑጽር ዝበለ ሕብሪ ይሃቦ */
.fab:hover {
    transform: scale(1.05) translateY(-3px);
    filter: brightness(1.2);
}

/* እቲ ቀይሕ ነጥቢ (Notification Dot) */
.red-dot {
    position: absolute;
    top: -2px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #ff4d4d;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 10px #ff4d4d;
}