/* ============================================
   أبطال الأخلاق - الأنماط الرئيسية
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00E676;
    --primary-dark: #00C853;
    --primary-light: #69F0AE;
    --secondary: #FFAB00;
    --secondary-dark: #FF8F00;
    --accent: #448AFF;
    --accent-light: #82B1FF;
    --purple: #D500F9;
    --purple-light: #EA80FC;
    --pink: #FF4081;
    --pink-light: #FF80AB;
    --gold: #FFD600;
    --gold-dark: #FF8F00;
    --correct: #00E676;
    --correct-light: #B9F6CA;
    --wrong: #FF5252;
    --wrong-light: #FFCDD2;
    --bg-start: #1A237E;
    --bg-mid: #6A1B9A;
    --bg-end: #C2185B;
    --card-bg: rgba(255, 255, 255, 0.96);
    --card-bg-solid: #FFFFFF;
    --text-dark: #1A237E;
    --text-medium: #37474F;
    --text-light: #78909C;
    --text-on-dark: #FFFFFF;
    --text-on-dark-secondary: rgba(255, 255, 255, 0.75);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.3);
    --shadow-color: 0 8px 32px rgba(106, 27, 154, 0.4);
    --shadow-glow: 0 4px 20px rgba(213, 0, 249, 0.25);
    --radius: 18px;
    --radius-lg: 26px;
    --radius-full: 50%;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Tajawal', sans-serif;

    /* ألوان الأجوبة الأربعة */
    --ans1-bg: #FFF3E0;
    --ans1-border: #FF9100;
    --ans1-badge: #E65100;
    --ans2-bg: #E3F2FD;
    --ans2-border: #448AFF;
    --ans2-badge: #1565C0;
    --ans3-bg: #F3E5F5;
    --ans3-border: #D500F9;
    --ans3-badge: #7B1FA2;
    --ans4-bg: #E8F5E9;
    --ans4-border: #00E676;
    --ans4-badge: #2E7D32;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: linear-gradient(160deg, #1A237E 0%, #283593 20%, #4A148C 45%, #880E4F 70%, #AD1457 90%, #E91E63 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-on-dark);
    direction: rtl;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* === الخلفية المتحركة === */
#animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    filter: blur(2px);
    box-shadow: 0 2px 12px rgba(255,255,255,0.08);
}

.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud-1 {
    width: 120px;
    height: 40px;
    top: 8%;
    right: -150px;
    animation: floatCloud 25s linear infinite;
}
.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    right: 15px;
}
.cloud-1::after {
    width: 70px;
    height: 45px;
    top: -20px;
    right: 45px;
}

.cloud-2 {
    width: 100px;
    height: 35px;
    top: 20%;
    right: -120px;
    animation: floatCloud 30s linear infinite 8s;
    opacity: 0.7;
}
.cloud-2::before {
    width: 45px;
    height: 40px;
    top: -20px;
    right: 10px;
}
.cloud-2::after {
    width: 55px;
    height: 38px;
    top: -18px;
    right: 35px;
}

.cloud-3 {
    width: 90px;
    height: 30px;
    top: 35%;
    right: -110px;
    animation: floatCloud 35s linear infinite 15s;
    opacity: 0.5;
}
.cloud-3::before {
    width: 40px;
    height: 35px;
    top: -18px;
    right: 8px;
}
.cloud-3::after {
    width: 50px;
    height: 32px;
    top: -15px;
    right: 30px;
}

@keyframes floatCloud {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100vw - 200px)); }
}

.star-bg {
    position: absolute;
    color: var(--gold);
    opacity: 0.8;
    animation: twinkle 2.5s ease-in-out infinite;
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(255, 214, 0, 0.8));
}
.star-bg-1 { top: 10%; left: 20%; animation-delay: 0s; }
.star-bg-2 { top: 25%; left: 70%; animation-delay: 0.5s; }
.star-bg-3 { top: 50%; left: 15%; animation-delay: 1s; }
.star-bg-4 { top: 65%; left: 80%; animation-delay: 1.5s; }
.star-bg-5 { top: 85%; left: 45%; animation-delay: 2s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.5; transform: scale(1) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.5) rotate(20deg); }
}

/* === الشاشات === */
.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease-out;
}

.screen-content {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    position: relative;
    z-index: 2;
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounceSlideIn {
    0% { opacity: 0; transform: translateX(-40px) scale(0.9); }
    60% { opacity: 1; transform: translateX(8px) scale(1.02); }
    80% { transform: translateX(-3px) scale(0.99); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3) rotate(-5deg); }
    40% { opacity: 1; transform: scale(1.08) rotate(1deg); }
    60% { transform: scale(0.95) rotate(-0.5deg); }
    80% { transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
    50% { box-shadow: 0 6px 25px rgba(0,0,0,0.25); }
}

/* === شاشة البداية === */
.splash-content {
    text-align: center;
}

.logo-container {
    margin-bottom: 40px;
}

.logo-shield {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--gold), var(--pink), var(--purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(213, 0, 249, 0.4), 0 0 60px rgba(255, 64, 129, 0.2);
    animation: logoFloat 3s ease-in-out infinite;
    position: relative;
}

.logo-shield::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid rgba(213, 0, 249, 0.4);
    animation: logoPulse 2s ease-out infinite;
}

.logo-icon {
    font-size: 50px;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes logoPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.game-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    -webkit-text-fill-color: white;
    margin-bottom: 8px;
    text-shadow: 0 3px 15px rgba(0,0,0,0.3), 0 0 40px rgba(255, 255, 255, 0.15);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.game-subtitle {
    font-size: 1.1rem;
    color: var(--text-on-dark-secondary);
    font-weight: 500;
}

.loading-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    margin: 0 auto 12px;
    overflow: hidden;
}

.loading-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--pink), var(--purple));
    border-radius: 3px;
    animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
    0% { width: 0; }
    100% { width: 100%; }
}

.loading-text {
    font-size: 0.9rem;
    color: var(--text-on-dark-secondary);
}

/* === شاشة الترحيب === */
.welcome-hero {
    text-align: center;
    margin-bottom: 30px;
}

.hero-badge {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(255, 214, 0, 0.5));
}

.bounce-animation {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-15px); }
    50% { transform: translateY(-8px); }
}

.welcome-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-on-dark);
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.welcome-desc {
    font-size: 1.05rem;
    color: var(--text-on-dark-secondary);
    line-height: 1.6;
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 100px;
    animation: slideUp 0.6s ease-out backwards;
    border: 1px solid rgba(255,255,255,0.2);
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }

.feature-icon {
    font-size: 28px;
}

.feature-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-on-dark);
}

/* === الأزرار === */
.btn {
    display: block;
    width: 100%;
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #FFD600, #FFAB00, #FF8F00);
    color: #4A148C;
    box-shadow: 0 6px 20px rgba(255, 214, 0, 0.45);
    font-size: 1.2rem;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(255, 214, 0, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #448AFF, #2979FF, #2962FF);
    color: white;
    border: none;
    margin-top: 12px;
    box-shadow: 0 6px 20px rgba(68, 138, 255, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(68, 138, 255, 0.55);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.25rem;
}

.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 214, 0, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(255, 214, 0, 0.7), 0 0 40px rgba(255, 171, 0, 0.3); }
}

/* === شاشة التسجيل === */
.register-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.5s ease-out;
}

.register-header {
    text-align: center;
    margin-bottom: 24px;
}

.register-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.register-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
}

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

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
    text-align: center;
    background: #FAFAFA;
}

.form-group input:focus {
    outline: none;
    border-color: var(--purple);
    background: white;
    box-shadow: 0 0 0 4px rgba(213, 0, 249, 0.12);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* === اختيار الجنس === */
.gender-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gender-btn {
    padding: 16px;
    border: 2.5px solid #E0E0E0;
    border-radius: var(--radius);
    background: #FAFAFA;
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gender-btn .gender-icon {
    font-size: 1.8rem;
}

.gender-btn:hover {
    transform: translateY(-2px);
}

.gender-btn[data-gender="male"]:hover {
    border-color: var(--accent);
    background: #E3F2FD;
}

.gender-btn[data-gender="female"]:hover {
    border-color: var(--pink);
    background: #FCE4EC;
}

.gender-btn[data-gender="male"].selected {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 16px rgba(68, 138, 255, 0.35);
}

.gender-btn[data-gender="female"].selected {
    border-color: var(--pink);
    background: var(--pink);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 64, 129, 0.35);
}

.age-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.age-btn {
    padding: 14px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius);
    background: #FAFAFA;
    font-family: var(--font);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.age-btn:hover {
    border-color: var(--purple);
    background: #F3E5F5;
}

.age-btn.selected {
    border-color: var(--purple);
    background: var(--purple);
    color: white;
    box-shadow: 0 4px 12px rgba(213, 0, 249, 0.3);
}

.register-error {
    color: var(--wrong);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
    min-height: 24px;
}

/* === شاشة المستويات === */
.levels-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.15);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    font-size: 32px;
}

.player-details {
    display: flex;
    flex-direction: column;
}

.player-name-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-on-dark);
}

.player-stars-total {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold);
}

.star-icon {
    font-size: 16px;
}

.levels-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-on-dark);
    margin-bottom: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding-bottom: 30px;
}

.level-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: bounceSlideIn 0.5s ease-out backwards;
    border: 2px solid rgba(255,255,255,0.3);
}

.level-card:nth-child(1) { animation-delay: 0.05s; }
.level-card:nth-child(2) { animation-delay: 0.1s; }
.level-card:nth-child(3) { animation-delay: 0.15s; }
.level-card:nth-child(4) { animation-delay: 0.2s; }
.level-card:nth-child(5) { animation-delay: 0.25s; }
.level-card:nth-child(6) { animation-delay: 0.3s; }
.level-card:nth-child(7) { animation-delay: 0.35s; }
.level-card:nth-child(8) { animation-delay: 0.4s; }
.level-card:nth-child(9) { animation-delay: 0.45s; }
.level-card:nth-child(10) { animation-delay: 0.5s; }

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.level-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 36px rgba(0,0,0,0.25), 0 0 20px rgba(213, 0, 249, 0.15);
    border-color: var(--purple-light);
}

.level-card:active {
    transform: translateY(0);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.level-card.locked:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.level-card.completed {
    border: 2px solid var(--primary);
    box-shadow: 0 4px 16px rgba(0, 230, 118, 0.2);
}

.level-card.completed::after {
    content: '✓';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.level-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.level-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
    margin-bottom: 6px;
}

.level-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    font-size: 14px;
}

.level-star-empty {
    opacity: 0.3;
}

.level-lock {
    font-size: 24px;
    display: block;
    margin-top: 4px;
    opacity: 0.5;
}

/* === شاشة اللعب === */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.12);
}

.level-info {
    text-align: center;
    flex: 1;
}

#current-level-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-on-dark);
}

.question-counter {
    font-size: 0.8rem;
    color: var(--text-on-dark-secondary);
    font-weight: 600;
}

.game-stars {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(255, 248, 225, 0.9), rgba(255, 224, 130, 0.9));
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(255, 143, 0, 0.3);
    font-weight: 800;
    color: var(--gold-dark);
    border: 2px solid var(--gold);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--pink), var(--purple));
    background-size: 200% 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.question-card {
    background: linear-gradient(135deg, #ffffff 0%, #f5f0ff 50%, #fff0f5 100%);
    border-radius: var(--radius-lg);
    padding: 28px 22px 22px;
    box-shadow: 0 8px 32px rgba(106, 27, 154, 0.2), 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    animation: bounceIn 0.6s ease-out;
    text-align: center;
    border: 2.5px solid rgba(213, 0, 249, 0.2);
    position: relative;
    overflow: hidden;
}

.question-card::before {
    content: '❓';
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 70px;
    opacity: 0.05;
    transform: rotate(-15deg);
    pointer-events: none;
}

.question-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--purple), var(--pink), var(--gold));
}

.question-number {
    font-size: 0.85rem;
    font-weight: 800;
    color: white;
    margin-bottom: 14px;
    display: inline-block;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    padding: 4px 16px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.question-scenario {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.9;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.question-ask {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.7;
    color: white;
    background: #4A148C;
    padding: 8px 20px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 6px;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.answer-btn {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    animation: bounceSlideIn 0.5s ease-out backwards;
}

/* === لون مختلف لكل إجابة === */
.answer-btn:nth-child(1) {
    background: var(--ans1-bg);
    border: 2.5px solid var(--ans1-border);
    animation-delay: 0.1s;
}
.answer-btn:nth-child(2) {
    background: var(--ans2-bg);
    border: 2.5px solid var(--ans2-border);
    animation-delay: 0.18s;
}
.answer-btn:nth-child(3) {
    background: var(--ans3-bg);
    border: 2.5px solid var(--ans3-border);
    animation-delay: 0.26s;
}
.answer-btn:nth-child(4) {
    background: var(--ans4-bg);
    border: 2.5px solid var(--ans4-border);
    animation-delay: 0.34s;
}

.answer-btn:hover:not(.disabled) {
    transform: translateX(-6px) scale(1.02);
    filter: brightness(0.95);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.answer-btn:active:not(.disabled) {
    transform: translateX(0) scale(0.98);
}

.answer-btn .answer-letter {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    color: white;
    transition: var(--transition);
}

/* لون البادج حسب ترتيب الإجابة */
.answer-btn:nth-child(1) .answer-letter { background: var(--ans1-badge); }
.answer-btn:nth-child(2) .answer-letter { background: var(--ans2-badge); }
.answer-btn:nth-child(3) .answer-letter { background: var(--ans3-badge); }
.answer-btn:nth-child(4) .answer-letter { background: var(--ans4-badge); }

.answer-btn:hover:not(.disabled) .answer-letter {
    transform: scale(1.1) rotate(-5deg);
}

.answer-btn.correct {
    border-color: var(--correct) !important;
    background: var(--correct-light) !important;
    animation: correctPop 0.6s ease-out;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
}

.answer-btn.correct .answer-letter {
    background: var(--correct) !important;
    color: white;
    animation: starSpin 0.6s ease-out;
}

.answer-btn.wrong {
    border-color: var(--wrong) !important;
    background: var(--wrong-light) !important;
    animation: wrongShake 0.5s ease-out;
}

.answer-btn.wrong .answer-letter {
    background: var(--wrong) !important;
    color: white;
}

.answer-btn.disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.answer-btn.show-correct {
    border-color: var(--correct) !important;
    background: var(--correct-light) !important;
    box-shadow: 0 0 16px rgba(0, 230, 118, 0.3);
}

.answer-btn.show-correct .answer-letter {
    background: var(--correct) !important;
    color: white;
}

@keyframes correctPop {
    0% { transform: scale(1); }
    20% { transform: scale(1.06); }
    40% { transform: scale(0.97); }
    60% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-10px) rotate(-1deg); }
    30% { transform: translateX(10px) rotate(1deg); }
    45% { transform: translateX(-6px) rotate(-0.5deg); }
    60% { transform: translateX(6px) rotate(0.5deg); }
    75% { transform: translateX(-2px); }
}

@keyframes starSpin {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* === نتيجة الإجابة === */
.answer-feedback {
    display: none;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: bounceIn 0.5s ease-out;
}

.answer-feedback.show {
    display: block;
}

.answer-feedback:has(.correct-text) {
    background: linear-gradient(135deg, #EDE7F6, #E8EAF6);
    border: 2px solid var(--purple);
}

.answer-feedback:has(.wrong-text) {
    background: linear-gradient(135deg, #FCE4EC, #F3E5F5);
    border: 2px solid var(--pink);
}

.feedback-icon {
    font-size: 56px;
    margin-bottom: 10px;
    animation: bounceIn 0.6s ease-out;
}

.feedback-label {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.feedback-label.correct-label {
    color: #4A148C;
}

.feedback-label.wrong-label {
    color: #880E4F;
}

.feedback-correct-answer {
    display: none;
    font-size: 1.15rem;
    font-weight: 800;
    color: #1A237E;
    background: rgba(26, 35, 126, 0.1);
    border: 2px solid rgba(26, 35, 126, 0.25);
    border-radius: 14px;
    padding: 10px 20px;
    margin: 10px auto 14px;
    max-width: 90%;
    line-height: 1.8;
}

.feedback-text {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.9;
    color: var(--text-dark);
    margin-bottom: 20px;
    opacity: 0.85;
}

.feedback-text.correct-text {
    color: #4A148C;
}

.feedback-text.wrong-text {
    color: #880E4F;
}

/* === شاشة النتيجة === */
.result-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: scaleIn 0.6s ease-out;
}

.result-badge-container {
    margin-bottom: 16px;
}

.result-badge {
    font-size: 72px;
    animation: badgePop 0.8s ease-out;
}

@keyframes badgePop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.result-subtitle {
    font-size: 1rem;
    color: var(--text-medium);
    margin-bottom: 20px;
}

.result-stars-display {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 32px;
}

.result-star {
    animation: starPop 0.4s ease-out backwards;
}

.result-star:nth-child(1) { animation-delay: 0.2s; }
.result-star:nth-child(2) { animation-delay: 0.4s; }
.result-star:nth-child(3) { animation-delay: 0.6s; }

@keyframes starPop {
    0% { transform: scale(0) rotate(-90deg); opacity: 0; }
    70% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--purple);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-medium);
    font-weight: 600;
}

.result-message {
    background: linear-gradient(135deg, #F3E5F5, #FCE4EC);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4A148C;
    line-height: 1.7;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === شاشة الشارات === */
.badges-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.badges-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    flex: 1;
    text-align: center;
    color: var(--text-on-dark);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.badge-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: slideUp 0.5s ease-out backwards;
}

.badge-card.earned {
    border: 2px solid var(--gold);
    background: linear-gradient(135deg, #FFFDE7, #FFF9C4);
}

.badge-card.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.badge-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.badge-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
    margin-bottom: 4px;
}

.badge-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.badge-card.earned .badge-status {
    color: var(--gold-dark);
}

.badges-summary {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.15);
}

.badges-summary p {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-on-dark-secondary);
    line-height: 1.6;
}

/* === شريط التنقل السفلي === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(26, 35, 126, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
    z-index: 50;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
}

.nav-icon {
    font-size: 22px;
    transition: var(--transition);
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    transition: var(--transition);
}

.nav-item.active .nav-label {
    color: var(--gold);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-item.active {
    background: rgba(255, 214, 0, 0.12);
}

.has-bottom-nav {
    padding-bottom: 90px !important;
}

/* === أزرار نتيجة المستوى === */
.result-buttons-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    background: transparent;
    color: var(--text-dark);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.btn-outline:hover {
    border-color: var(--purple);
    background: #F3E5F5;
}

/* === صفحة الملف الشخصي === */
.profile-hero {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 10px;
}

.profile-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 12px;
}

.profile-avatar-big {
    font-size: 56px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(213, 0, 249, 0.2), rgba(255, 64, 129, 0.2));
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(213, 0, 249, 0.3);
    border: 3px solid rgba(255,255,255,0.3);
}

.profile-level-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    border-top-color: transparent;
    animation: spinSlow 4s linear infinite;
}

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}

.profile-name {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-on-dark);
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.profile-age-badge {
    display: inline-block;
    padding: 4px 16px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* إحصائيات الملف الشخصي */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.profile-stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 10px;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: slideUp 0.5s ease-out backwards;
}

.profile-stat-card:nth-child(1) { animation-delay: 0.1s; }
.profile-stat-card:nth-child(2) { animation-delay: 0.2s; }
.profile-stat-card:nth-child(3) { animation-delay: 0.3s; }

.stat-stars { border-top: 3px solid var(--gold); }
.stat-badges { border-top: 3px solid var(--pink); }
.stat-levels { border-top: 3px solid var(--purple); }

.profile-stat-icon {
    font-size: 24px;
}

.profile-stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-dark);
}

.profile-stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
}

/* شريط التقدم العام */
.profile-progress-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.profile-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.profile-progress-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.profile-progress-percent {
    font-size: 1rem;
    font-weight: 900;
    color: var(--purple);
}

.profile-progress-bar {
    width: 100%;
    height: 12px;
    background: #EEE;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.profile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--pink), var(--gold));
    border-radius: 6px;
    transition: width 1s ease;
    width: 0%;
    background-size: 200% 100%;
    animation: shimmer 2s ease infinite;
}

.profile-progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-medium);
    text-align: center;
}

/* لوحة الشارات المصغرة */
.profile-badges-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

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

.profile-section-header h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
}

.btn-link {
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--purple);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-link:hover {
    background: rgba(213, 0, 249, 0.08);
}

.profile-badges-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.profile-badges-row::-webkit-scrollbar {
    display: none;
}

.profile-badge-mini {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 28px;
    background: #F5F5F5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.profile-badge-mini.earned {
    background: linear-gradient(135deg, #FFFDE7, #FFF9C4);
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.3);
    border: 2px solid var(--gold);
}

.profile-badge-mini.locked {
    filter: grayscale(1);
    opacity: 0.35;
}

/* تفاصيل المستويات */
.profile-levels-section {
    margin-bottom: 16px;
}

.profile-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-on-dark);
    margin-bottom: 10px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.profile-levels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-level-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.profile-level-item.completed {
    border-right: 4px solid var(--primary);
}

.profile-level-item.locked {
    opacity: 0.5;
}

.profile-level-icon-sm {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F3E5F5, #FCE4EC);
    border-radius: 12px;
    flex-shrink: 0;
}

.profile-level-info {
    flex: 1;
}

.profile-level-name-sm {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

.profile-level-stars-sm {
    font-size: 12px;
    display: flex;
    gap: 1px;
}

.profile-level-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.profile-level-status.done {
    background: var(--correct-light);
    color: var(--primary-dark);
}

.profile-level-status.locked-status {
    background: #EEE;
    color: var(--text-light);
}

.profile-level-status.available {
    background: #F3E5F5;
    color: var(--purple);
}

/* رتبة البطل */
.profile-rank-card {
    background: linear-gradient(135deg, rgba(106, 27, 154, 0.2), rgba(194, 24, 91, 0.2));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.15);
}

.profile-rank-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.profile-rank-info {
    display: flex;
    flex-direction: column;
}

.profile-rank-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
}

.profile-rank-desc {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-on-dark-secondary);
}

/* === شاشة الإعدادات === */
.settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.settings-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    flex: 1;
    text-align: center;
    color: var(--text-on-dark);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.settings-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.settings-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.settings-item:active {
    transform: translateY(0);
}

.settings-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F3E5F5, #FCE4EC);
    border-radius: 12px;
    flex-shrink: 0;
}

.settings-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.settings-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
}

.settings-value {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
}

.settings-arrow {
    font-size: 16px;
    color: var(--text-light);
}

.toggle-switch {
    width: 48px;
    height: 28px;
    background: var(--purple);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-switch.off {
    background: #CCC;
}

.toggle-knob {
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    right: 3px;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch.off .toggle-knob {
    right: auto;
    left: 3px;
}

.settings-about {
    text-align: center;
    padding: 20px;
    color: var(--text-on-dark-secondary);
    font-size: 0.8rem;
    line-height: 1.8;
}

/* === تأثير الكونفيتي === */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

/* === تأثير النجوم المتطايرة === */
#star-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
    pointer-events: none;
}

.star-particle {
    position: absolute;
    font-size: 20px;
    animation: starFloat 1.5s ease-out forwards;
    pointer-events: none;
}

@keyframes starFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-150px) scale(0.3) rotate(360deg);
    }
}

/* === عناصر الزينة === */
.decoration-stars {
    position: absolute;
    font-size: 20px;
    color: var(--gold);
    opacity: 0.5;
    pointer-events: none;
}

/* === التمرير المخصص === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* === التجاوب === */
@media (max-width: 400px) {
    .game-title {
        font-size: 2rem;
    }

    .welcome-title {
        font-size: 1.6rem;
    }

    .welcome-features {
        gap: 10px;
    }

    .feature-item {
        padding: 12px 14px;
        min-width: 85px;
    }

    .question-scenario {
        font-size: 0.95rem;
    }

    .question-ask {
        font-size: 1.1rem;
    }

    .answer-btn {
        padding: 14px 16px;
        font-size: 0.93rem;
    }

    .age-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .levels-grid {
        gap: 10px;
    }

    .level-card {
        padding: 16px 12px;
    }

    .result-title {
        font-size: 1.5rem;
    }
}

@media (min-width: 500px) {
    .screen-content {
        max-width: 480px;
        margin: 0 auto;
    }
}

/* === حالة عدم الاتصال PWA === */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* === تحسين الأداء === */
.screen {
    will-change: opacity, transform;
}

.level-card, .answer-btn, .btn {
    -webkit-tap-highlight-color: transparent;
}

/* إلغاء تأثير اللمس الافتراضي على iOS */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
