/* --- 1. CORE VARIABLES & RESET (Modern Neon) --- */
:root {
    --bg-dark: #090a0f;
    --bg-panel: rgba(18, 22, 33, 0.7);
    --primary: #45a2ff; /* Neon Blue */
    --accent: #9b59b6; /* Neon Purple */
    --coin-gold: #ffeb3b;
    --text-main: #e8eaf6;
    --text-muted: #8c9eff;
    --glass-border: rgba(69, 162, 255, 0.2);
    --gradient-main: linear-gradient(45deg, #45a2ff, #9b59b6);
    --font-display: 'Orbitron', sans-serif;
    --font-main: 'Poppins', sans-serif;
    --speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 10%, #1e2430 0%, var(--bg-dark) 80%);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* App Container */
#app-container {
    height: 100%;
    width: 100%;
    position: relative;
}

/* --- 2. UTILITY & ANIMATIONS (Screen Transitions) --- */
.hidden { display: none !important; }

.screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    padding-top: 80px;
    overflow-y: auto;
    background-color: var(--bg-dark); /* Ensure background is solid during transition */
    padding-bottom: 20px;
}

.screen-in {
    opacity: 1;
    transform: translateX(0%);
}

.screen-out-right {
    opacity: 0;
    transform: translateX(100%);
}

/* Floating Click Feedback Animation */
.click-feedback {
    position: absolute;
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--primary);
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    text-shadow: 0 0 10px var(--primary);
    z-index: 10;
}
@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-70px) scale(1.3); }
}

/* --- 3. UI COMPONENTS (Glassmorphism & Buttons) --- */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: all var(--speed);
}

.btn {
    border: none;
    outline: none;
    padding: 12px 20px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    font-family: var(--font-main);
}
.btn:active { transform: scale(0.96); }

.btn-primary {
    background: var(--gradient-main);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(69, 162, 255, 0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

/* --- 4. HEADER --- */
header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    background: rgba(9, 10, 15, 0.8);
    backdrop-filter: blur(10px);
}

.balance-badge {
    padding: 8px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 900;
    font-family: var(--font-display);
    color: var(--coin-gold);
    text-shadow: 0 0 5px rgba(255, 235, 59, 0.5);
}
.balance-badge ion-icon { font-size: 1.3em; }

/* --- 5. MAIN GAME AREA --- */
#home-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 100px;
}

.center-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* The Coin */
.coin-container {
    width: 250px;
    height: 250px;
    cursor: pointer;
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 40px;
    filter: drop-shadow(0 0 10px rgba(255, 235, 59, 0.5));
}
.coin-container:active { transform: scale(0.95); }

.coin {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 70% 30%, #fffde7 0%, #ffc107 80%, #ff9800 100%);
    box-shadow: 
        inset 0 0 25px rgba(255,255,255,0.7),
        0 0 40px var(--coin-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin ion-icon {
    font-size: 6rem;
    color: rgba(0,0,0,0.7);
    filter: drop-shadow(0 3px 2px rgba(255, 255, 255, 0.3));
}

/* Progress Bar */
.progress-container {
    width: 90%;
    max-width: 400px;
    margin-bottom: 30px;
}

.progress-track {
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-main);
    border-radius: 5px;
    transition: width 0.1s linear;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

/* Feature Buttons Grid */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 90%;
    max-width: 400px;
    margin-bottom: 20px;
}
.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    text-align: center;
    min-height: 120px;
    justify-content: space-between;
}
.feature-card h4 { margin: 5px 0 10px; font-weight: 600; font-size: 1rem; }
.feature-card p { font-size: 0.75rem; color: var(--text-muted); }
.feature-card ion-icon { font-size: 1.8rem; margin-bottom: 5px; }

/* --- 6. WITHDRAWAL SCREEN UI --- */
#withdraw-screen {
    padding: 20px;
}

.screen-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-top: 20px;
}
.back-btn { font-size: 1.8rem; background: none; border: none; color: white; margin-right: 15px; }
.screen-header h2 { font-family: var(--font-display); font-weight: 700; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; color: var(--text-muted); margin-bottom: 6px; font-size: 0.85rem; }
.form-input, .form-select {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    padding: 14px;
    border-radius: 10px;
    color: white;
    font-family: var(--font-main);
    outline: none;
}

.history-card {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent);
    transition: all var(--speed);
}
.history-card.status-pending { border-left-color: #f39c12; }
.history-card.status-approved { border-left-color: #27ae60; }

.history-card div {
    font-family: var(--font-display);
}

/* --- 7. AD OVERLAY / DISCLAIMER --- */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    transition: opacity 0.5s;
}
.spinner {
    width: 60px; height: 60px;
    border: 5px solid rgba(255,255,255,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.disclaimer {
    font-size: 0.7rem;
    color: #4f5b73;
    margin-top: 25px;
    text-align: center;
    padding: 0 20px;
}