:root {
    --bg-dark: #0d1117;
    --card-bg: #161b22;
    --neon-blue: #00f2fe;
    --neon-purple: #4f46e5;
    --text-main: #c9d1d9;
    --text-white: #ffffff;
}

/* تفعيل التنقل السلس عبر الأقسام */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* القائمة العلوية */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background-color: #010409;
    border-bottom: 2px solid #21262d;
}

.main-nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-white);
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-right: 20px;
    font-weight: bold;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue);
}

/* الحاوية العامة */
.container {
    max-width: 1200px; /* تم توسيع الحاوية قليلاً لاستيعاب شبكة الكروت بشكل أفضل في الشاشات الكبيرة */
    margin: 40px auto;
    padding: 20px;
}

.main-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-white);
}

.neon-text {
    background: linear-gradient(to right, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text; /* خاصية التوافق لمتصفحات كروم وسفاري */
    background-clip: text;         /* الخاصية القياسية العالمية التي طلبها المحرر */
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: #8b949e;
    margin-bottom: 40px;
}

/* شبكة كروت الألعاب المطورة لمنع انفصال الكارت الرابع */
.games-grid {
    display: grid;
    /* التعديل: استخدام auto-fit مع minmax محسوب بدقة يضمن بقاء 4 كروت بجانب بعضها في الشاشات الواسعة */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.game-card {
    background-color: var(--card-bg);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 30px 20px; /* موازنة الحشوة الداخلية لتناسب الشاشات المختلفة */
    text-align: center;
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* لتوحيد أطوال الكروت وارتفاع الأزرار تلقائياً */
}

/* كرت مغلق أو قيد التطوير */
.game-card.locked {
    opacity: 0.8;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.card-badge {
    align-self: center;
    font-size: 0.8rem;
    padding: 4px 10px;
    background-color: #21262d;
    border-radius: 20px;
    color: var(--neon-blue);
    margin-bottom: 10px;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.play-btn {
    display: inline-block;
    margin-top: auto; /* يدفع الزر للأسفل دائماً لتتساوى محاذاة الأزرار في كافة الكروت */
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: var(--text-white);
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    transition: opacity 0.3s;
}

.play-btn:hover {
    opacity: 0.9;
}

/* صندوق الدعم */
.donate-box {
    background-color: var(--card-bg);
    border: 2px solid #21262d;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    margin-top: 60px;
}

.amt-buttons-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap; /* لمنع خروج الأزرار عن الشاشة في المتصفحات الضيقة */
}

.amt-btn {
    padding: 15px 35px;
    background-color: #21262d;
    color: var(--text-white);
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.amt-btn:hover, .amt-btn.active {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-color: transparent;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.custom-amt-wrapper {
    margin: 25px 0;
}

.custom-amt-wrapper input {
    padding: 12px;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: var(--text-white);
    font-size: 1.1rem;
    width: 150px;
    text-align: center;
    margin-right: 10px;
}

/* صفحة سياسة الخصوصية */
.privacy-page h1 {
    margin-bottom: 10px;
}

.last-updated {
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.privacy-section {
    margin-bottom: 30px;
    line-height: 1.8;
}

.privacy-section h2 {
    color: var(--text-white);
    border-bottom: 1px solid #21262d;
    padding-bottom: 8px;
}

/* التذييل */
.main-footer {
    text-align: center;
    padding: 30px;
    background-color: #010409;
    border-top: 1px solid #21262d;
    margin-top: 40px;
    color: #8b949e;
}

.footer-links a {
    color: var(--neon-blue);
    text-decoration: none;
    margin: 0 10px;
}

/* فواصل الأقسام */
.section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #21262d, transparent);
    margin: 60px 0;
}

/* ==========================================================================
   👑 التنسيقات المضافة لصفحة شروط الاستخدام والدعم الفني (إرادة ستوديو)
   ========================================================================== */

.terms-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    align-items: flex-start;
}

.terms-section-box, .support-section-box {
    background-color: var(--card-bg);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 30px;
}

.terms-section-box h2, .support-section-box h2 {
    color: var(--text-white);
    border-bottom: 2px solid #21262d;
    padding-bottom: 10px;
    margin-top: 0;
}

.terms-item {
    margin-bottom: 20px;
    line-height: 1.6;
}

.terms-item h3 {
    color: var(--neon-blue);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* تنسيق نموذج الدعم الفني النيوني */
.support-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
}

.form-group label {
    color: var(--text-main);
    font-weight: bold;
    font-size: 0.95rem;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 12px;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: var(--text-white);
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
}

/* زر إرسال الدعم */
.submit-support-btn {
    padding: 14px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: var(--text-white);
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s;
    margin-top: 10px;
}

.submit-support-btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

/* صندوق تذكرة النجاح المتوهج */
.success-neon-box {
    text-align: center;
    padding: 30px;
    border: 2px dashed var(--neon-blue);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
    background-color: #0d1117;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.success-neon-box h3 {
    color: var(--text-white);
    margin-top: 0;
}

/* التوافق التام مع الجوالات والشاشات الصغيرة */
@media (max-width: 992px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr); /* يعرض كارتين بجانب بعضهما في الشاشات المتوسطة والمستعرضة جزئياً */
    }
}

@media (max-width: 768px) {
    .terms-wrapper {
        grid-template-columns: 1fr;
    }
    .games-grid {
        grid-template-columns: 1fr; /* يتحول إلى سطر واحد ممتد في الجوالات لحفظ أبعاد التصميم */
    }
    .main-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .nav-links a {
        margin: 0 10px;
    }
}