* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary: #6C63FF;
            --primary-dark: #5A52D5;
            --secondary: #FF6584;
            --success: #4CAF50;
            --warning: #FF9800;
            --danger: #F44336;
            --dark: #2D3436;
            --light: #F8F9FA;
            --gray: #636E72;
            --card-shadow: 0 10px 40px rgba(108, 99, 255, 0.15);
        }

        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: var(--dark);
        }

        /* Login Screen */
        .login-screen {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .login-card {
            background: white;
            border-radius: 24px;
            padding: 48px;
            width: 100%;
            max-width: 480px;
            box-shadow: var(--card-shadow);
            text-align: center;
        }

        .login-logo {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 24px;
            font-size: 36px;
            color: white;
        }

        .login-card h1 {
            font-size: 28px;
            margin-bottom: 8px;
            color: var(--dark);
        }

        .login-card p {
            color: var(--gray);
            margin-bottom: 32px;
        }

        .form-group {
            margin-bottom: 20px;
            text-align: left;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            font-size: 14px;
            color: var(--dark);
        }

        .form-group input, .form-group select {
            width: 100%;
            padding: 14px 16px;
            border: 2px solid #E8E8E8;
            border-radius: 12px;
            font-size: 15px;
            font-family: 'Poppins', sans-serif;
            transition: all 0.3s;
        }

        .form-group input:focus, .form-group select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
        }

        .btn {
            padding: 14px 28px;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            font-family: 'Poppins', sans-serif;
            cursor: pointer;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            width: 100%;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
        }

        .btn-secondary {
            background: white;
            color: var(--primary);
            border: 2px solid var(--primary);
        }

        .btn-success {
            background: var(--success);
            color: white;
        }

        .btn-warning {
            background: var(--warning);
            color: white;
        }

        .btn-danger {
            background: var(--danger);
            color: white;
        }

        .btn-sm {
            padding: 8px 16px;
            font-size: 13px;
            border-radius: 8px;
        }

        /* Dashboard */
        .dashboard {
            display: none;
            min-height: 100vh;
        }

        .navbar {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            padding: 16px 32px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 20px rgba(0,0,0,0.1);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .nav-brand {
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 700;
            font-size: 20px;
            color: var(--primary);
        }

        .nav-brand-icon {
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 20px;
        }

        .nav-user {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .nav-user-info {
            text-align: right;
        }

        .nav-user-info .name {
            font-weight: 600;
            font-size: 14px;
        }

        .nav-user-info .class {
            font-size: 12px;
            color: var(--gray);
        }

        .nav-avatar {
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 16px;
        }

        .nav-xp {
            background: linear-gradient(135deg, #FFD700, #FFA500);
            padding: 6px 14px;
            border-radius: 20px;
            font-weight: 700;
            font-size: 13px;
            color: #333;
        }

        .main-content {
            max-width: 1200px;
            margin: 0 auto;
            padding: 32px 20px;
        }

        /* Welcome Section */
        .welcome-section {
            background: rgba(255,255,255,0.95);
            border-radius: 20px;
            padding: 32px;
            margin-bottom: 32px;
            box-shadow: var(--card-shadow);
        }

        .welcome-section h2 {
            font-size: 24px;
            margin-bottom: 8px;
        }

        .welcome-section p {
            color: var(--gray);
        }

        .stats-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            margin-top: 24px;
        }

        .stat-card {
            background: linear-gradient(135deg, #f8f9fa, #e9ecef);
            border-radius: 16px;
            padding: 20px;
            text-align: center;
        }

        .stat-card .stat-value {
            font-size: 28px;
            font-weight: 700;
            color: var(--primary);
        }

        .stat-card .stat-label {
            font-size: 13px;
            color: var(--gray);
            margin-top: 4px;
        }

        /* Subject Cards */
        .section-title {
            color: white;
            font-size: 22px;
            margin-bottom: 20px;
            font-weight: 700;
        }

        .subjects-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 24px;
            margin-bottom: 32px;
        }

        .subject-card {
            background: white;
            border-radius: 20px;
            overflow: hidden;
            box-shadow: var(--card-shadow);
            cursor: pointer;
            transition: all 0.3s;
        }

        .subject-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 60px rgba(108, 99, 255, 0.25);
        }

        .subject-header {
            padding: 24px;
            color: white;
            position: relative;
        }

        .subject-icon {
            font-size: 40px;
            margin-bottom: 12px;
        }

        .subject-header h3 {
            font-size: 18px;
            margin-bottom: 4px;
        }

        .subject-header p {
            font-size: 13px;
            opacity: 0.9;
        }

        .subject-body {
            padding: 20px 24px;
        }

        .subject-progress {
            margin-bottom: 12px;
        }

        .progress-bar {
            height: 8px;
            background: #E8E8E8;
            border-radius: 10px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            border-radius: 10px;
            transition: width 0.5s;
        }

        .progress-text {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--gray);
            margin-top: 6px;
        }

        .subject-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 12px;
        }

        .subject-meta span {
            font-size: 12px;
            color: var(--gray);
        }

        .badge {
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
        }

        .badge-class-x {
            background: #E3F2FD;
            color: #1565C0;
        }

        .badge-class-xi {
            background: #F3E5F5;
            color: #7B1FA2;
        }

        /* Quiz Screen */
        .quiz-screen {
            display: none;
            min-height: 100vh;
        }

        .quiz-container {
            max-width: 800px;
            margin: 0 auto;
            padding: 32px 20px;
        }

        .quiz-header {
            background: rgba(255,255,255,0.95);
            border-radius: 20px;
            padding: 24px;
            margin-bottom: 24px;
            box-shadow: var(--card-shadow);
        }

        .quiz-header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .quiz-back-btn {
            background: none;
            border: none;
            font-size: 14px;
            color: var(--primary);
            cursor: pointer;
            font-family: 'Poppins', sans-serif;
            font-weight: 600;
        }

        .quiz-timer {
            background: var(--warning);
            color: white;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
        }

        .quiz-progress-bar {
            height: 10px;
            background: #E8E8E8;
            border-radius: 10px;
            overflow: hidden;
        }

        .quiz-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--success), #8BC34A);
            border-radius: 10px;
            transition: width 0.3s;
        }

        .quiz-question-card {
            background: rgba(255,255,255,0.95);
            border-radius: 20px;
            padding: 32px;
            box-shadow: var(--card-shadow);
            margin-bottom: 24px;
        }

        .question-number {
            font-size: 13px;
            color: var(--primary);
            font-weight: 600;
            margin-bottom: 12px;
        }

        .question-text {
            font-size: 18px;
            font-weight: 600;
            line-height: 1.6;
            margin-bottom: 24px;
        }

        .options-list {
            list-style: none;
        }

        .option-item {
            padding: 16px 20px;
            border: 2px solid #E8E8E8;
            border-radius: 12px;
            margin-bottom: 12px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 15px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .option-item:hover {
            border-color: var(--primary);
            background: rgba(108, 99, 255, 0.05);
        }

        .option-item.selected {
            border-color: var(--primary);
            background: rgba(108, 99, 255, 0.1);
        }

        .option-item.correct {
            border-color: var(--success);
            background: rgba(76, 175, 80, 0.1);
        }

        .option-item.wrong {
            border-color: var(--danger);
            background: rgba(244, 67, 54, 0.1);
        }

        .option-letter {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #E8E8E8;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
            flex-shrink: 0;
        }

        .option-item.selected .option-letter {
            background: var(--primary);
            color: white;
        }

        .option-item.correct .option-letter {
            background: var(--success);
            color: white;
        }

        .option-item.wrong .option-letter {
            background: var(--danger);
            color: white;
        }

        /* Hint Section */
        .hint-section {
            background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 24px;
            border-left: 4px solid var(--warning);
        }

        .hint-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .hint-header h4 {
            color: #E65100;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .hint-cost {
            font-size: 12px;
            color: #E65100;
            background: rgba(255, 152, 0, 0.2);
            padding: 4px 10px;
            border-radius: 12px;
            font-weight: 600;
        }

        .hint-text {
            font-size: 14px;
            color: #BF360C;
            line-height: 1.6;
        }

        .hint-text.hidden {
            filter: blur(5px);
            user-select: none;
        }

        .quiz-actions {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
        }

        /* Result Screen */
        .result-screen {
            display: none;
            min-height: 100vh;
        }

        .result-container {
            max-width: 600px;
            margin: 0 auto;
            padding: 32px 20px;
        }

        .result-card {
            background: white;
            border-radius: 24px;
            padding: 48px 32px;
            text-align: center;
            box-shadow: var(--card-shadow);
        }

        .result-icon {
            font-size: 64px;
            margin-bottom: 20px;
        }

        .result-title {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .result-score {
            font-size: 48px;
            font-weight: 700;
            color: var(--primary);
            margin: 16px 0;
        }

        .result-details {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin: 24px 0;
        }

        .result-detail-item {
            padding: 16px;
            background: #F8F9FA;
            border-radius: 12px;
        }

        .result-detail-item .value {
            font-size: 24px;
            font-weight: 700;
        }

        .result-detail-item .label {
            font-size: 12px;
            color: var(--gray);
            margin-top: 4px;
        }

        .result-xp {
            background: linear-gradient(135deg, #FFD700, #FFA500);
            color: #333;
            padding: 12px 24px;
            border-radius: 20px;
            font-weight: 700;
            display: inline-block;
            margin-bottom: 24px;
        }

        .result-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* Leaderboard */
        .leaderboard-section {
            background: rgba(255,255,255,0.95);
            border-radius: 20px;
            padding: 32px;
            box-shadow: var(--card-shadow);
            margin-bottom: 32px;
        }

        .leaderboard-section h3 {
            font-size: 20px;
            margin-bottom: 20px;
        }

        .leaderboard-list {
            list-style: none;
        }

        .leaderboard-item {
            display: flex;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #E8E8E8;
        }

        .leaderboard-item:last-child {
            border-bottom: none;
        }

        .lb-rank {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #E8E8E8;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
            margin-right: 16px;
        }

        .lb-rank.gold { background: #FFD700; color: #333; }
        .lb-rank.silver { background: #C0C0C0; color: #333; }
        .lb-rank.bronze { background: #CD7F32; color: white; }

        .lb-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 14px;
            margin-right: 12px;
        }

        .lb-info {
            flex: 1;
        }

        .lb-name {
            font-weight: 600;
            font-size: 14px;
        }

        .lb-class {
            font-size: 12px;
            color: var(--gray);
        }

        .lb-xp {
            font-weight: 700;
            color: var(--primary);
        }

        /* Animations */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

        .animate-in {
            animation: fadeIn 0.5s ease;
        }

        .animate-pulse {
            animation: pulse 0.5s ease;
        }

        .animate-shake {
            animation: shake 0.5s ease;
        }

        /* Confetti */
        .confetti-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1000;
        }

        .confetti {
            position: absolute;
            width: 10px;
            height: 10px;
            top: -10px;
            animation: confettiFall 3s linear forwards;
        }

        @keyframes confettiFall {
            to {
                top: 100vh;
                transform: rotate(720deg);
            }
        }

        /* Responsive */
        @media (max-width: 768px) {
            .navbar {
                padding: 12px 16px;
            }
            .nav-user-info {
                display: none;
            }
            .main-content {
                padding: 20px 12px;
            }
            .subjects-grid {
                grid-template-columns: 1fr;
            }
            .result-details {
                grid-template-columns: 1fr;
            }
            .quiz-actions {
                flex-direction: column;
            }
            .quiz-actions .btn {
                width: 100%;
            }
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            background: var(--dark);
            color: white;
            padding: 16px 24px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            z-index: 2000;
            animation: fadeIn 0.3s ease;
            box-shadow: 0 8px 30px rgba(0,0,0,0.3);
        }

        .toast.success { background: var(--success); }
        .toast.error { background: var(--danger); }
        .toast.warning { background: var(--warning); }

        /* Tab Navigation */
        .tab-nav {
            display: flex;
            gap: 8px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .tab-btn {
            padding: 10px 20px;
            border: none;
            background: rgba(255,255,255,0.2);
            color: white;
            border-radius: 10px;
            cursor: pointer;
            font-family: 'Poppins', sans-serif;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.3s;
        }

        .tab-btn.active {
            background: white;
            color: var(--primary);
        }

        .tab-btn:hover:not(.active) {
            background: rgba(255,255,255,0.4);
        }

        /* Achievement Badge */
        .achievement-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 24px;
            padding: 48px;
            text-align: center;
            z-index: 3000;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            animation: fadeIn 0.5s ease;
        }

        .achievement-popup .badge-icon {
            font-size: 64px;
            margin-bottom: 16px;
        }

        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 2500;
        }