/* تعريف المتغيرات الأساسية للألوان تطابق الصور */
:root {
    --primary: #0a1f1e; 
    --primary-light: #12302e; 
    --gold: #c5a059;    
    --gold-gradient: linear-gradient(135deg, #e8ce91 0%, #c5a059 100%);
    --text-light: #ffffff;
    --text-gray: #a0a0a0;
    --shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* تنسيق جسم الصفحة */
body {
    font-family: 'Tajawal', sans-serif;
    background: radial-gradient(circle at center, #153533 0%, #071514 100%);
    margin: 0; padding: 10px; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
    color: var(--text-light); overflow-x: hidden;
    touch-action: manipulation;
}

/* الحاوية الرئيسية للمحتوى */
.main-container {
    background: #0d2524;
    max-width: 480px; width: 95%;
    border-radius: 20px; padding: 25px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gold);
    text-align: center; position: relative;
    animation: fadeIn 0.5s ease-out;
    margin-bottom: 15px;
    box-sizing: border-box;
}

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

/* تنسيقات الهيدر والشعار */
.header-logo { margin-bottom: 20px; display: flex; flex-direction: column; align-items: center; }
.crown-svg { width: 45px; height: 45px; fill: var(--gold); margin-bottom: 5px; }
.welcome-txt { font-family: 'Playfair Display', serif; font-style: italic; color: var(--text-light); font-size: 0.9rem; }
.hero-title { font-family: 'Playfair Display', serif; font-size: 2.2rem; margin: 0; color: var(--gold); font-weight: 700; letter-spacing: 2px;}
.subtitle-club { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: 'Tajawal', sans-serif; font-size: 0.8rem; letter-spacing: 4px; color: var(--text-light); margin-top: 2px;}
.subtitle-club .line { height: 1px; width: 30px; background: var(--gold); }
.ornament { margin-top: 5px; width: 60px; height: 10px; }

.desc-text { font-size: 0.85rem; color: #ddd; margin-bottom: 20px; line-height: 1.6; }

/* تنسيق بطاقات المعلومات */
.info-bar { display: flex; gap: 10px; margin: 15px 0; justify-content: space-between; }
.info-card {
    background: var(--primary-light); 
    border: 1px solid rgba(197, 160, 89, 0.4); 
    border-radius: 12px;
    padding: 10px 5px; flex: 1; display: flex; flex-direction: column; align-items: center;
}
.center-card { border: 1px solid var(--gold); }
.info-card svg { width: 20px; height: 20px; fill: var(--gold); margin-bottom: 5px; }
.info-label { font-size: 0.6rem; color: var(--text-light); font-weight: 700; margin-bottom: 3px; }
.info-value { font-size: 1.1rem; color: var(--gold); font-weight: 900; }
.text-green { color: #8bc34a; }

/* تنسيق خطوات المشاركة */
.participation-steps {
    background: var(--primary-light); border-radius: 15px; padding: 15px; margin: 25px 0;
    text-align: right; border: 1px solid rgba(197, 160, 89, 0.5);
}
.steps-main-title { text-align:center; font-weight:900; margin-bottom:15px; color:var(--gold); font-size: 1.1rem;}
.step-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0;}
.step-icon { color: var(--gold); width: 20px; height: 20px; flex-shrink: 0; }
.step-icon svg { width: 100%; height: 100%; fill: var(--gold); }
.step-text { flex: 1; text-align: right; font-size: 0.85rem; color: var(--text-light); }
.step-num { background: var(--gold); color: var(--primary); width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.8rem; }
.step-line { height: 1px; background: rgba(255,255,255,0.1); margin: 2px 0; }


.btn-start {
    background: var(--gold-gradient); color: var(--primary); border: none;
    width: 100%; padding: 16px; border-radius: 12px;
    font-weight: 900; font-size: 1.2rem; cursor: pointer;
    margin: 10px 0; transition: 0.3s;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    position: relative;
}
.btn-start .btn-icon { background: rgba(0,0,0,0.2); border-radius: 50%; width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; position: absolute; left: 15px; font-size: 0.9rem;}
.btn-start:active { transform: scale(0.98); }

.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.icon-btn { background: var(--primary-light); border: 1px solid var(--gold); border-radius: 8px; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s;}
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 20px; height: 20px; fill: var(--gold); }
.header-center { display: flex; flex-direction: column; align-items: center; }
.crown-small { width: 20px; height: 20px; fill: var(--gold); }
#board-title { margin: 0; font-size: 1.2rem; color: var(--gold); font-weight: 900; }

.choose-prompt { font-weight: 700; color: var(--text-light); font-size: 0.8rem; margin: 15px 0 10px; text-align: center; }

.grid-wrapper { position: relative; width: 100%; }

/* شبكة اللعبة محصنة ضد التمدد العشوائي - 10 أعمدة متطابقة دائماً */
.grid {
    display: grid; 
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px; width: 100%;
    direction: ltr !important; 
    padding: 5px 0;  
}

/* التعديل الجوهري: صف الكأس والفائز يأخذ العرض كاملاً في المنتصف لعدم تغطية أي رقم */
.winner-row {
    grid-column: 1 / -1; 
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    margin: 5px 0;
}

.winner-center-box {
    background: radial-gradient(circle, var(--primary) 0%, #000 100%);
    border: 2px solid var(--gold);
    border-radius: 20px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    color: var(--gold);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.6), inset 0 0 10px rgba(197, 160, 89, 0.3);
    z-index: 10;
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(197, 160, 89, 0.4), inset 0 0 5px rgba(197, 160, 89, 0.2); }
    100% { box-shadow: 0 0 20px rgba(197, 160, 89, 0.9), inset 0 0 15px rgba(197, 160, 89, 0.6); }
}

.winner-center-box .cup-icon { width: 32px; height: 32px; fill: var(--gold); margin-bottom: 5px; }
.winner-center-box .winner-title { font-size: 0.8rem; font-weight: 700; margin-bottom: 2px;}
.winner-center-box .winner-name { font-size: 1.1rem; color: #fff; font-weight: 900; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.winner-center-box .winner-num { font-size: 0.85rem; margin-top: 4px; font-weight: bold; }

/* خانة الرقم الفردية محصنة الأبعاد تماماً */
.box {
    background: var(--primary-light); height: 42px; width: 100%; border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column;
    align-items: center; justify-content: center; cursor: pointer; padding: 2px;
    transition: all 0.2s ease; box-sizing: border-box; 
    min-width: 0; 
    overflow: hidden; 
}
.box-num { font-weight: 700; line-height: 1; font-size: 0.85rem; color: var(--text-light); margin-top: 2px;}

.box-name {
    font-size: 0.45rem; color: var(--text-light); font-weight: 400;
    width: 100%; text-align: center; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    display: block; 
}

.box.taken { 
    background: var(--gold); 
    border-color: var(--gold); 
    cursor: default; 
}
.box.taken .box-num { color: var(--primary); font-weight: 900;}
.box.taken .box-name { color: var(--primary); font-weight: 900; font-size: 0.55rem;}

.security-badge {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px; border: 1px solid rgba(197, 160, 89, 0.3); border-radius: 20px;
    font-size: 0.75rem; font-weight: 700; color: var(--gold); margin: 0 auto; width: max-content;
}
.security-badge svg { fill: var(--gold); width: 16px; height: 16px; }

.toast-container {
    position: fixed; top: 25px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: var(--primary); padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5); z-index: 10005;
    font-weight: 900; display: none; width: max-content; max-width: 90%; text-align: center;
}

.lang-switcher {
    position: absolute; top: 20px; left: 20px; display: flex; align-items: center; gap: 5px; cursor: pointer;
    background: transparent; padding: 4px 10px; border-radius: 15px; border: 1px solid var(--gold); z-index: 10;
}
.lang-switcher svg { width: 16px; height: 16px; fill: var(--gold); }
.lang-switcher span { font-size: 0.75rem; font-weight: 700; color: var(--text-light); }

[lang="en"] .lang-switcher { left: auto; right: 20px; }
[lang="en"] body { direction: ltr !important; text-align: left !important; }
[lang="en"] .step-item { flex-direction: row-reverse; text-align: left; }
[lang="en"] .step-text { text-align: left; }

.modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); z-index: 9999; align-items: center; justify-content: center; }
.modal-content { background: var(--primary); border: 1px solid var(--gold); width: 88%; max-width: 320px; padding: 25px 20px; border-radius: 20px; text-align: center; box-shadow: var(--shadow); }
.btn-whatsapp { background: #25D366; color: white; padding: 12px; border-radius: 10px; font-weight: 700; display: block; margin-bottom: 10px; text-decoration: none; }
.btn-confirm { background: var(--gold-gradient); color: var(--primary); border: none; width: 100%; padding: 12px; border-radius: 10px; font-weight: 900; cursor: pointer; }
.btn-cancel { background: transparent; color: #888; border: none; margin-top: 15px; cursor: pointer; font-weight: bold;}

/* ---- الإضافات الجديدة الخاصة بنموذج الإدخال الاحترافي ---- */

.secure-input {
    width: 100%; padding: 12px; margin-bottom: 12px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(197, 160, 89, 0.4);
    border-radius: 10px; color: white; font-family: 'Tajawal', sans-serif;
    box-sizing: border-box; outline: none; text-align: center;
}
.secure-input:focus { border-color: var(--gold); background: rgba(255,255,255,0.1); }
.secure-input::placeholder { color: rgba(255,255,255,0.5); font-size: 0.85rem;}

.privacy-disclaimer {
    background: rgba(37, 211, 102, 0.1); border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 10px; padding: 10px; display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.7rem; color: #a5d6a7; text-align: right; margin-bottom: 15px; line-height: 1.4;
}
.privacy-disclaimer svg { width: 18px; height: 18px; fill: #25D366; flex-shrink: 0; margin-top: 2px;}

.privacy-toggle { display: flex; gap: 10px; margin-bottom: 10px; }
.privacy-btn {
    flex: 1; padding: 10px; background: transparent; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px; color: white; display: flex; align-items: center; justify-content: center; gap: 5px;
    cursor: pointer; transition: 0.3s; font-family: 'Tajawal', sans-serif; font-size: 0.85rem;
}
.privacy-btn svg { width: 16px; height: 16px; fill: white; }
.privacy-btn.active { background: rgba(197, 160, 89, 0.2); border-color: var(--gold); color: var(--gold); font-weight: bold; }
.privacy-btn.active svg { fill: var(--gold); }

* { user-select: none; -webkit-tap-highlight-color: transparent; }

