@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

.triviator-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); z-index: 999999;
    display: flex; justify-content: center; align-items: center;
    font-family: 'Courier Prime', monospace;
}

.triviator-container {
    width: 100%; max-width: 680px; 
    background-color: #25262a; /* لون خلفية أفتح وأكثر نعومة */
    border-radius: 14px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    position: relative; overflow: hidden; color: #fff;
}

.triviator-screen {
    padding: 25px; display: flex; flex-direction: column; align-items: center; min-height: 720px;
    box-sizing: border-box;
    background-color: #25262a; 
}

.triviator-logo img { 
    max-width: 200px; 
    margin-bottom: 20px; 
    /* إضافة الوميض الديناميكي المستمر حول اللوجو */
    animation: logoDynamicGlow 2.5s infinite alternate ease-in-out;
}

.triviator-profile { text-align: center; transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative;
}
.triviator-profile.shrunk { transform: scale(0.4) translate(-100%, -150%); position: absolute; top: 20px; left: 20px; z-index: 100; }
.triviator-profile img { width: 120px;
    height: 120px; border-radius: 50%; border: 3px solid #555; }
.triviator-profile h2 { font-size: 1.2rem; margin-top: 10px; color: #ccc;
}
.triviator-controls { margin-top: 40px; width: 100%; max-width: 300px; }
.triv-control-group { margin-bottom: 20px; }
.triv-control-group label { display: block; margin-bottom: 5px;
    color: #888; font-size: 0.9rem; }
.triv-control-group select { width: 100%; padding: 10px; background: #2a2a2a; border: 1px solid #444; color: #fff;
    font-family: 'Courier Prime', monospace; border-radius: 4px; }
.triv-btn { width: 100%; padding: 15px; background-color: #28a745; color: #fff; border: none; border-radius: 5px;
    font-size: 1.2rem; font-weight: bold; font-family: 'Courier Prime', monospace; cursor: pointer; }
.triv-btn:hover { background-color: #218838;
}

/* الإطار الميكانيكي الخارجي */
.fmc-hardware-bezel {
    background: linear-gradient(145deg, #3a3b3f, #232426);
    padding: 45px 15px 25px 15px;
    border-radius: 12px;
    border: 4px solid #1c1d1f;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.9), 0 15px 35px rgba(0,0,0,0.9);
    width: 100%; box-sizing: border-box;
    position: relative;
}

/* مسامير التثبيت الجانبية */
.fmc-screw {
    width: 16px; height: 16px;
    background: radial-gradient(circle, #555 20%, #222 80%);
    border: 2px solid #111; border-radius: 50%; position: absolute;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.2), 0 2px 4px rgba(0,0,0,0.6);
}
.fmc-screw::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 10px; height: 2px;
    background-color: #111;
    transform: translate(-50%, -50%) rotate(45deg);
}
.fmc-screw.top-left { top: 12px; left: 12px; }
.fmc-screw.top-right { top: 12px; right: 12px; }
.fmc-screw.bottom-left { bottom: 12px;
    left: 12px; }
.fmc-screw.bottom-right { bottom: 12px; right: 12px; }

.fmc-main-wrapper {
    display: flex; justify-content: space-between; align-items: stretch;
    width: 100%; position: relative;
}

/* الأزرار الجانبية وترتيبها الميكانيكي */
.fmc-side-keys {
    display: flex; flex-direction: column; justify-content: flex-end;
    gap: 25px; padding-bottom: 25px; width: 40px; box-sizing: border-box; z-index: 5;
}
.fmc-left-keys { align-items: flex-start; }
.fmc-right-keys { align-items: flex-end;
}

.fmc-key {
    width: 32px; height: 24px;
    background: linear-gradient(180deg, #444549, #242527);
    border: 2px solid #151617; border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 3px 5px rgba(0,0,0,0.7);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    position: relative;
    transition: transform 0.05s ease, background 0.1s ease; box-sizing: border-box;
}
.fmc-key:active {
    transform: translateY(1px); background: linear-gradient(180deg, #242527, #151617);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
}
.fmc-key span {
    width: 14px; height: 3px; background-color: #111; border-radius: 1px;
    display: block;
    transition: background-color 0.2s, box-shadow 0.2s;
}

/* اللمبة الخضراء المضيئة عند اختيار الإجابة */
.fmc-key.light-on span {
    background-color: #2ecc71 !important;
    box-shadow: 0 0 10px #2ecc71, 0 0 4px #2ecc71 !important;
}

/* تأثير الكلمات المحفورة في الألومنيوم أسفل الأزرار */
.engraved-label {
    position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); margin-top: 4px;
    font-size: 0.65rem; color: #505255; font-family: 'Courier Prime', monospace; font-weight: bold;
    text-shadow: -1px -1px 0px rgba(0,0,0,0.9), 1px 1px 0px rgba(255,255,255,0.15);
    pointer-events: none; letter-spacing: 0.5px;
}

/* شاشة العرض الرقمية الداكنة */
.fmc-display {
    flex-grow: 1; background-color: #161719; border: 4px solid #111;
    padding: 20px 20px 210px 20px; /* تفريغ سفلي إجباري لحماية منطقة الخيارات المطلقة */
    box-sizing: border-box;
    display: flex; flex-direction: column; height: auto;
    box-shadow: inset 0 0 20px #000; border-radius: 4px; position: relative;
}

.fmc-header { display: flex;
    justify-content: space-between; font-size: 1.1rem; padding-bottom: 15px; margin-bottom: 20px; }
.fmc-left { color: #fff; line-height: 1.4; }
.fmc-right { text-align: right; line-height: 1.4;
}
.fmc-time-utc { color: #4aa3df; }
.fmc-time-sta { color: #2ecc71; font-weight: bold; }
.fmc-time-eta { color: #fff; }
.fmc-time-eet { color: #fff;
}

.fmc-radar-area { position: relative; height: 180px; display: flex; flex-direction: column; align-items: center; border-bottom: 1px solid #333; margin-bottom: 20px;
}
.radar-destination-triangle { width: 24px; height: 24px; position: absolute; top: -10px; z-index: 2; }
.radar-path-line { border-left: 2px dashed #555; position: absolute;
    top: 14px; bottom: 15%; z-index: 1; height: auto; }
.radar-airplane-icon { position: absolute; bottom: 15%; z-index: 2; transition: bottom 0.2s linear;
    left: 50%; transform: translateX(-50%); font-size: 32px; color: #fff; line-height: 1; height: 32px; width: 32px; display: flex; align-items: center; justify-content: center;
}
.airplane-labels { position: absolute; left: 100%; margin-left: 6px; display: flex; flex-direction: column; align-items: flex-start; }
.airplane-user { font-size: 0.65rem; color: #fff;
    white-space: nowrap; font-family: 'Courier Prime', monospace; letter-spacing: 1px; opacity: 0.9; line-height: 1.2; }
.airplane-fl { font-size: 0.65rem; color: #fff; white-space: nowrap;
    font-family: 'Courier Prime', monospace; letter-spacing: 1px; opacity: 0.9; line-height: 1.2; }
.fmc-fuel-indicator { position: absolute; bottom: 8px; right: 5px; font-size: 1.1rem;
    color: #4aa3df; z-index: 3;}

.fmc-question-area { margin-bottom: 25px; min-height: 80px; }
#fmc-q-id { color: #888; font-size: 0.9rem; margin-bottom: 12px;
}
#fmc-q-text { color: #4aa3df; font-size: 1rem; line-height: 1.4; text-transform: uppercase;
}

/* القفل الرياضي المطلق لخيارات الأسئلة لمنع زحزحة المحاذاة */
.fmc-options-area {
    position: absolute;
    bottom: 0; left: 20px;
    right: 20px;
    height: 195px; /* الارتفاع الإجمالي للمصفوفة */
    display: flex; flex-direction: column; justify-content: flex-end;
    gap: 25px;
    /* تطابق تام مع الفراغات بين الأزرار المادية */
    padding-bottom: 21px;
    /* موازنة سماكة شفة الشاشة السفلية */
    margin: 0; box-sizing: border-box;
    border-top: 1px dashed #333; padding-top: 15px;
}

/* تمت إزالة cursor: pointer من هنا لمنع النقر على النص */
.fmc-option-row, .fmc-status-fetching-row {
    display: flex;
    align-items: center; position: relative;
    height: 24px; /* نفس طول الزر الفيزيائي بالملي لتر */
    box-sizing: border-box;
}

.fmc-opt-text {
    color: #fff; font-size: 0.95rem; line-height: 24px; text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    width: 100%; max-width: 90%;
}
.fmc-opt-text::before { content: "➤ "; color: #fff; }
.fmc-option-row.selected .fmc-opt-text,
.fmc-option-row.selected .fmc-opt-text::before { color: #2ecc71 !important;
}

/* شاشة الإرسال المستقلة أسفل يمين الشاشة */
.fmc-bottom-action-area {
    position: absolute; bottom: 5px; right: 12px; z-index: 12;
    height: 24px; display: flex; align-items: center; gap: 40px;
}
.fmc-bottom-action-area .fmc-send-action {
    color: #2ecc71; font-size: 1.1rem; font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.fmc-bottom-action-area .fmc-end-action {
    color: #4aa3df; font-size: 1.1rem; font-weight: bold; text-transform: uppercase;
    letter-spacing: 1px;
}

/* الأزرار الميكانيكية السفلية وإضاءة لمبة البيان المطلوبة */
.fmc-bottom-keys {
    display: flex; justify-content: space-between;
    width: 100%;
    max-width: 530px;
    margin: 25px auto 0 auto; padding: 0 15px; box-sizing: border-box;
}

/* إضاءة الزر السفلي الأيمن المخصص للإرسال بضوء أخضر دائم وجذاب */
.fmc-key-green-led span {
    background-color: #2ecc71 !important;
    box-shadow: 0 0 12px #2ecc71, 0 0 5px #2ecc71 !important;
}

#triviator-alert-overlay { position: absolute; top: 0; left: 0; right: 0;
    bottom: 0; background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; z-index: 20; text-align: center; }
.triviator-alert-content { display: flex; flex-direction: column;
    align-items: center; justify-content: center; width: 100%; }
#triviator-alert-message { font-size: 2rem; padding: 10px 20px; margin: 0; }
#triviator-alert-subtitle { font-size: 1.2rem;
    color: #ddd; margin: 10px 0 30px 0; font-weight: normal; }

.exit-btn {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    border: 2px solid #a93226; border-radius: 8px; padding: 12px 40px; font-size: 1.3rem; color: #fff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4); transition: all 0.2s ease; width: auto; letter-spacing: 2px;
}
.exit-btn:hover { background: linear-gradient(145deg, #c0392b, #a93226); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6); }

.alert-mayday { color: #e74c3c;
    animation: flash 0.5s ease-in-out 6; }
@keyframes flash { 0%, 100% { opacity: 1; } 50% { opacity: 0;
} }
.alert-diverted { color: #4aa3df; }
.alert-landed { color: #2ecc71; }
.flash-red { animation: flashRedKey 0.3s ease-in-out 2;
}
@keyframes flashRedKey { 0%, 100% { color: #fff; } 50% { color: #e74c3c;
} }
.flash-green { animation: flashGreenKey 0.3s ease-in-out 2; }
@keyframes flashGreenKey { 0%, 100% { color: #fff;
} 50% { color: #2ecc71; } }
.critical-blink { animation: blinkRedKey 1s ease-in-out infinite;
}
@keyframes blinkRedKey { 0%, 100% { color: #fff; } 50% { color: #e74c3c;
} }
.critical-blink-fuel { animation: blinkRedFuelKey 1s ease-in-out infinite; }
@keyframes blinkRedFuelKey { 0%, 100% { color: #4aa3df;
} 50% { color: #e74c3c; } }

/* ====================================================
   تأثير الوميض الديناميكي حول لوجو اللعبة
   ==================================================== */
@keyframes logoDynamicGlow {
    0% { 
        filter: drop-shadow(0 0 10px rgba(233, 30, 99, 0.3)) drop-shadow(0 0 15px rgba(33, 150, 243, 0.3)); 
    }
    100% { 
        filter: drop-shadow(0 0 25px rgba(233, 30, 99, 0.8)) drop-shadow(0 0 40px rgba(33, 150, 243, 0.8)); 
    }
}