@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; -webkit-tap-highlight-color: transparent; }

body { 
    background: url('https://images.unsplash.com/photo-1550684848-fac1c5b4e853?q=80&w=2070&auto=format&fit=crop') no-repeat center center fixed; 
    background-size: cover;
    height: 100vh; width: 100vw; overflow: hidden; user-select: none; color: #333; 
}

/* --- LAYOUT & SCROLL --- */
.screen { 
    display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; 
    flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; 
    background: #f4f6f8; padding-bottom: 150px;
}
.active { display: flex; animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

/* PREVENT SQUISHING */
.admin-banner, .quiz-card, .updates-card, .info-card, .signup-card, .result-card, .msg-card {
    flex-shrink: 0; width: 90%; max-width: 500px; margin-left: auto; margin-right: auto;
}

/* --- AUTH --- */
#signup-screen { background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); justify-content: center; align-items: center; padding: 20px; }
.signup-card { background: rgba(255, 255, 255, 0.95); padding: 30px 20px; border-radius: 25px; text-align: center; margin: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.input-group { position: relative; margin-bottom: 12px; width: 100%; }
.input-group i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #764ba2; font-size: 1.1rem; }
.input-group input { width: 100%; padding: 14px 15px 14px 45px; border: 2px solid #eef2f7; border-radius: 12px; font-size: 0.95rem; background: #f8f9fa; transition: 0.3s; outline: none; }
.input-group input:focus { border-color: #764ba2; background: #fff; box-shadow: 0 4px 10px rgba(118, 75, 162, 0.1); outline: none; }
.btn { width: 100%; padding: 15px; background: linear-gradient(135deg, #667eea, #764ba2); color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; margin-top: 10px; }
.google-btn { background: white; color: #333; border: 1px solid #ddd; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; }
.warning-text { font-size: 0.75rem; color: #c0392b; background: #fadbd8; padding: 10px; border-radius: 10px; margin-bottom: 20px; border: 1px solid #f5b7b1; }

/* --- HOME --- */
.header { padding: 15px 20px; background: white; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-radius: 0 0 20px 20px; position: sticky; top: 0; z-index: 50; flex-shrink: 0; width: 100%; }
.header-left { display: flex; align-items: center; gap: 12px; }
.app-name { font-size: 1.3rem; font-weight: 800; background: -webkit-linear-gradient(#667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.menu-icon { font-size: 1.4rem; color: #333; padding: 5px; cursor: pointer; }
.mail-btn { position: relative; font-size: 1.4rem; color: #ff9f43; background: #fff8e1; width: 35px; height: 35px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; }
.mail-badge { position: absolute; top: -2px; right: -2px; background: #ff4757; color: white; font-size: 0.65rem; font-weight: bold; width: 16px; height: 16px; border-radius: 50%; display: none; justify-content: center; align-items: center; border: 1px solid white; }

.admin-banner { margin-top: 20px; padding: 15px; background: linear-gradient(135deg, #ff9966, #ff5e62); border-radius: 20px; color: white; }
.updates-card { margin-top: 20px; background: white; border-radius: 20px; padding: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); display: none; }
#update-text-display { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; font-size: 0.95rem; color: #444; line-height: 1.5; }
.updates-img { width: 100%; border-radius: 10px; margin-bottom: 10px; display: block; }
.quiz-card { margin-top: 20px; background: white; border-radius: 25px; overflow: hidden; }
.quiz-img { height: 180px; background-color: #eee; background-size: cover; background-position: center; }
.quiz-content { padding: 25px; text-align: center; }
.play-btn { width: 80%; border-radius: 50px; padding: 15px; font-size: 1.1rem; border: none; background: linear-gradient(135deg, #667eea, #764ba2); color: white; font-weight: bold; }

/* --- INBOX --- */
.msg-card { background: white; margin: 15px 20px; padding: 15px; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-left: 5px solid #ffd700; flex-shrink: 0; }
.msg-header { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.8rem; color: #aaa; }
.msg-body { font-size: 1rem; color: #333; margin-bottom: 10px; font-weight: 500; }
.msg-code-box { background: #f9f9f9; padding: 10px; border-radius: 8px; border: 1px dashed #ccc; display: flex; justify-content: space-between; align-items: center; }
.copy-btn { background: #e94560; color: white; border: none; padding: 5px 10px; border-radius: 5px; font-size: 0.8rem; cursor: pointer; }

/* --- GAMEPLAY --- */
#quiz-screen { background: #fff; }
.quiz-header { flex-shrink: 0; padding: 20px; background: white; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; width: 100%; }
.question-box { padding: 20px; width: 100%; }
.question-text { font-size: 1.2rem; font-weight: 600; margin-bottom: 25px; color: #222; }
.option-btn { width: 100%; padding: 15px 20px; margin-bottom: 12px; border: 2px solid #eef2f7; border-radius: 15px; background: white; text-align: left; transition: 0.2s; }
.option-btn.correct { background: #e6ffea; border-color: #28a745; } .option-btn.wrong { background: #ffeaea; border-color: #dc3545; }
.timer-circle { width: 45px; height: 45px; border-radius: 50%; border: 3px solid #764ba2; color: #764ba2; display: flex; justify-content: center; align-items: center; font-weight: 800; }

/* --- RESULT & PROFILE --- */
.result-card, .info-card { background: white; padding: 30px 20px; border-radius: 25px; width: 90%; margin: 20px auto; text-align: center; }
.ticket-box { border: 2px dashed #764ba2; background: #f9f6ff; padding: 20px; margin: 20px 0; border-radius: 15px; }
.ticket-number { font-size: 2.5rem; font-weight: 800; color: #333; letter-spacing: 3px; }
.profile-avatar { width: 80px; height: 80px; background: #f0f0f0; border-radius: 50%; margin: 0 auto 15px auto; display: flex; justify-content: center; align-items: center; font-size: 2rem; color: #aaa; }
.edit-mobile-btn { background: none; border: none; color: #764ba2; cursor: pointer; font-size: 0.9rem; margin-left: 5px; }

/* --- MENU & ADS --- */
.side-menu { position: fixed; top: 0; right: -100%; width: 80%; height: 100%; background: white; z-index: 5000; padding: 30px; display: flex; flex-direction: column; box-shadow: -5px 0 30px rgba(0,0,0,0.2); transition: 0.3s; }
.side-menu.open { right: 0; }
.menu-item { padding: 15px 0; font-size: 1.1rem; border-bottom: 1px solid #f5f5f5; display: flex; align-items: center; }
.banner-ad-fixed { position: fixed; bottom: 0; left: 0; width: 100%; height: 60px; background: #fff; z-index: 9000; display: flex; justify-content: center; align-items: center; border-top: 1px solid #eee; }
.ad-container { padding: 10px; display: flex; justify-content: center; width: 100%; }
.ad-placeholder { width: 100%; height: 60px; background: #f0f0f0; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 0.8rem; }
#ad-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: black; z-index: 15000; display: none; flex-direction: column; justify-content: center; align-items: center; }
.close-ad-btn { margin-top: 30px; padding: 10px 25px; border: 1px solid white; background: transparent; color: white; border-radius: 50px; font-weight: bold; cursor: pointer; }
#inter-ad-box { width: 100%; display: flex; justify-content: center; align-items: center; }

/* LOADING & SYSTEM */
#loading-overlay, #maintenance-screen, #blocked-screen, #adblock-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #1a1a2e; z-index: 20000; display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; text-align: center; }
#maintenance-screen, #blocked-screen, #adblock-screen { display: none; padding: 20px; }
.active#maintenance-screen, .active#blocked-screen, .active#adblock-screen { display: flex; }