@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --- 1. GLOBAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Layout ko failne se rokta hai */
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #1a1a2e;
    color: white;
    height: 100vh;
    width: 100vw;
    overflow-x: hidden; /* Horizontal Scroll Block */
    overflow-y: hidden;
}

/* --- 2. SCREEN CONTAINER --- */
.screen {
    display: none;
    height: 100%;
    width: 100%;
    flex-direction: column;
    background: linear-gradient(135deg, #240b36 0%, #c31432 100%);
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

.screen.active {
    display: flex;
}

/* --- 3. LOGIN SCREEN (MOBILE FIX) --- */
#screen-login {
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
}

.login-card {
    width: 90%; /* Screen ka 90% hissa lega */
    max-width: 350px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 30px 20px; /* Andar ka gap */
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    margin: 0 auto; /* Center mein rakhne ke liye */
}

.login-logo {
    width: 100px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3));
}

.login-card h2 { font-size: 1.4rem; margin-bottom: 5px; }
.login-card p { font-size: 0.85rem; opacity: 0.8; margin-bottom: 20px; }

/* --- 4. INPUTS & BUTTONS (MOBILE ALIGNMENT FIX) --- */
input[type="text"], 
input[type="number"], 
input[type="password"],
select,
input[type="file"] {
    width: 100%; /* Parent container ka 100% */
    max-width: 100%; /* Bahar nahi niklega */
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: none;
    background: #ffffff;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    display: block;
}

input[type="file"] {
    padding: 10px;
    font-size: 0.8rem;
    background: #fff;
    height: auto;
}

.btn-main {
    width: 100%;
    padding: 14px;
    background: #FFC107;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.4);
    display: block;
    margin-top: 10px;
}

.btn-main:active { transform: scale(0.98); }

/* --- 5. HEADER --- */
.header-nav, .lb-header {
    width: 100%;
    padding: 15px 20px;
    padding-top: max(15px, env(safe-area-inset-top)); /* Notch se bachega */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    flex-shrink: 0;
}

.header-nav button, .lb-header button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- 6. ADMIN PANEL (SIDE CUT FIX) --- */
.admin-tabs {
    display: flex;
    justify-content: center;
    padding: 15px 0;
    background: rgba(0,0,0,0.1);
    flex-shrink: 0;
    width: 100%;
}

.admin-tabs button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 8px 20px;
    margin: 0 5px;
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
}

.admin-tabs button.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    font-weight: bold;
}

/* Container Fix for Mobile */
.admin-tab-content {
    display: none;
    width: 100%;
    padding: 20px; 
    padding-left: 25px; /* Thoda extra gap left se */
    padding-right: 25px; /* Thoda extra gap right se */
    padding-bottom: 80px;
    overflow-y: auto;
}

.admin-tab-content.active { display: block; }

.form-group {
    width: 100%;
    margin-bottom: 15px;
}

.form-group label {
    font-size: 0.85rem;
    margin-left: 5px;
    margin-bottom: 5px;
    display: block;
    color: rgba(255,255,255,0.9);
}

/* --- 7. LEADERBOARD --- */
.sub-badge {
    font-size: 0.65rem;
    background: #FFC107;
    color: #000;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
    margin-top: 5px;
    display: inline-block;
}

.podium-area {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 20px 0;
    height: 220px;
    flex-shrink: 0;
    width: 100%;
}

.pod-item { text-align: center; width: 30%; position: relative; display: flex; flex-direction: column; align-items: center; }
.pod-1 { z-index: 10; transform: translateY(-10px) scale(1.1); }
.pod-avatar { width: 60px; height: 60px; border-radius: 50%; border: 3px solid #FFC107; object-fit: cover; background: #fff; }
.pod-1 .pod-avatar { width: 80px; height: 80px; border-color: #FFD700; box-shadow: 0 0 15px #FFD700; }
.crown { position: absolute; top: -25px; color: #FFD700; font-size: 1.5rem; }
.pod-rank { background: #240b36; width: 22px; height: 22px; border-radius: 50%; position: absolute; bottom: 45px; font-size: 0.7rem; line-height: 22px; border: 2px solid #fff; font-weight: bold; }
.pod-name { font-size: 0.75rem; margin-top: 5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pod-score { color: #FFC107; font-weight: 800; font-size: 0.95rem; }

/* List Styles */
.lb-list, .history-list {
    background: #fff;
    flex-grow: 1;
    border-radius: 25px 25px 0 0;
    color: #333;
    padding: 20px;
    overflow-y: auto;
    width: 100%;
    padding-bottom: 50px;
}

.lb-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.row-left { display: flex; align-items: center; gap: 10px; }
.row-rank { font-weight: 700; color: #999; width: 20px; text-align: center; }
.row-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #eee; }
.row-info div:first-child { font-weight: 700; font-size: 0.9rem; color: #000; }
.row-info div:last-child { font-size: 0.7rem; color: #FF9800; }
.row-points { font-weight: 900; color: #333; font-size: 0.95rem; background: #f5f5f5; padding: 5px 10px; border-radius: 8px; }

/* --- 8. MODAL (POPUP) --- */
.modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-box {
    background: #fff;
    width: 90%;
    max-width: 320px;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    color: #000;
}
.modal-box h3 { margin-bottom: 15px; }
.modal-box input { border: 1px solid #ddd; background: #f9f9f9; width: 100%; }
.btn-sec { width: 100%; padding: 12px; background: #eee; color: #333; border: none; border-radius: 10px; font-weight: 600; margin-top: 10px; cursor: pointer; }