* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', 'Bangla', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Custom Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

.container {
    max-width: 500px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    position: relative;
    padding-bottom: 70px;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

/* Header Styles */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 30px 30px;
    color: white;
}

.welcome-text h2 {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.welcome-text p {
    opacity: 0.9;
    font-size: 0.9em;
}

.rank-badge {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1em;
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    margin: -30px 20px 20px 20px;
    padding: 25px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: white;
    position: relative;
    z-index: 10;
}

.balance-icon {
    font-size: 2.5em;
}

.balance-info {
    flex: 1;
    text-align: center;
}

.balance-label {
    font-size: 0.8em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.balance-amount {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.balance-value {
    font-size: 0.9em;
    opacity: 0.9;
}

.balance-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-buy, .btn-withdraw {
    padding: 8px 15px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.8em;
    font-weight: 600;
    text-align: center;
    transition: transform 0.2s;
}

.btn-buy {
    background: #4CAF50;
    color: white;
}

.btn-withdraw {
    background: #ffc107;
    color: #333;
}

.btn-buy:hover, .btn-withdraw:hover {
    transform: scale(1.05);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 0 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}

/* Section Title */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 20px;
    margin: 20px 0 15px 0;
}

.section-title h3 {
    font-size: 1.2em;
    color: #333;
}

.view-all {
    color: #667eea;
    text-decoration: none;
    font-size: 0.8em;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 0 20px;
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102,126,234,0.1), transparent);
    transition: left 0.5s;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.game-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.game-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.game-desc {
    font-size: 0.7em;
    color: #666;
    margin-bottom: 10px;
}

.game-cost {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    color: #ff6b6b;
    display: inline-block;
    margin-top: 5px;
}

.game-reward {
    font-size: 0.7em;
    color: #4CAF50;
    margin-top: 5px;
}

/* Transactions List */
.transactions-list {
    background: white;
    margin: 0 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.transaction-item:hover {
    background: #f8f9fa;
}

.trans-icon {
    font-size: 1.5em;
    margin-right: 15px;
}

.trans-details {
    flex: 1;
}

.trans-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
}

.trans-date {
    font-size: 0.7em;
    color: #999;
}

.trans-amount {
    font-weight: bold;
    font-size: 1.1em;
}

.trans-amount.positive {
    color: #4CAF50;
}

.trans-amount.negative {
    color: #ff6b6b;
}

/* Referral Box */
.referral-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 20px;
    padding: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.referral-icon {
    font-size: 2.5em;
}

.referral-content {
    flex: 1;
}

.referral-content h4 {
    margin-bottom: 5px;
}

.referral-content p {
    font-size: 0.8em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.referral-code-box {
    display: flex;
    gap: 10px;
}

.referral-code-box input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.8em;
    background: rgba(255,255,255,0.2);
    color: white;
}

.referral-code-box input::placeholder {
    color: rgba(255,255,255,0.7);
}

.referral-code-box button {
    padding: 8px 15px;
    background: white;
    border: none;
    border-radius: 10px;
    color: #667eea;
    font-weight: bold;
    cursor: pointer;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
}

.nav-item {
    text-align: center;
    text-decoration: none;
    color: #999;
    transition: all 0.3s;
    padding: 5px 10px;
    border-radius: 10px;
}

.nav-item.active {
    color: #667eea;
    background: rgba(102,126,234,0.1);
}

.nav-icon {
    font-size: 1.5em;
    display: block;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 0.7em;
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
    background: white;
    padding: 35px;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.auth-logo p {
    color: #666;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.7em;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Game Header */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    text-decoration: none;
    font-size: 1.5em;
    color: #333;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 10px;
}

.game-header h2 {
    font-size: 1.2em;
    color: #333;
}

.game-cost {
    background: #ff6b6b;
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.7em;
}

.balance-info {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

/* Quiz Styles */
#question-container {
    padding: 20px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.question-counter {
    font-weight: bold;
    color: #667eea;
}

.timer {
    font-weight: bold;
    color: #ff6b6b;
}

.question-text {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.options {
    display: grid;
    gap: 12px;
}

.option {
    background: white;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-letter {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.option:hover {
    transform: translateX(5px);
    border-color: #667eea;
    background: #f8f9fa;
}

.option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin: 15px;
    text-align: center;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.text-center {
    text-align: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Responsive */
@media (max-width: 480px) {
    .balance-amount {
        font-size: 1.5em;
    }
    
    .games-grid {
        gap: 10px;
    }
    
    .game-card {
        padding: 15px;
    }
    
    .auth-box {
        padding: 25px;
    }
}