/* ============================
   إعدادات عامة
============================ */

body {
    margin: 0;
    padding: 0;
    font-family: "Tajawal", sans-serif;
    background: #000814;
    color: #fff;
    overflow: hidden;
}

button {
    cursor: pointer;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    background: #00eaff;
    color: #000;
    font-size: 18px;
    font-weight: bold;
    transition: 0.2s;
}

button:hover {
    background: #00bcd4;
    transform: scale(1.05);
}

input {
    padding: 12px;
    border-radius: 8px;
    border: none;
    width: 80%;
    font-size: 18px;
    margin-bottom: 10px;
}

/* ============================
   الشاشات العامة
============================ */

.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

#startScreen,
#settingsScreen,
#playersScreen,
#gameScreen,
#winScreen {
    display: none;
}

#startScreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ============================
   شاشة الإعدادات
============================ */

.category-buttons button.selected {
    background: #00ffee;
    color: #000;
    transform: scale(1.1);
}

/* ============================
   شاشة اللاعبين
============================ */

#playersInputs input {
    margin-bottom: 12px;
}

/* ============================
   شاشة اللعبة
============================ */

#gameScreen {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#currentPlayerBox {
    font-size: 26px;
    margin-bottom: 10px;
}

#roundInfo {
    font-size: 22px;
    margin-bottom: 20px;
}

#wordBox {
    font-size: 32px;
    margin: 20px 0;
    min-height: 40px;
}

/* ============================
   المؤقت + شريط التقدم
============================ */

#timerBox {
    font-size: 48px;
    font-weight: bold;
    margin: 10px 0;
    padding: 10px 20px;
    border-radius: 12px;
    background: #001d2f;
    transition: 0.3s;
}

.timer-warning-box {
    background: #ff0033 !important;
    color: #fff;
    box-shadow: 0 0 20px #ff0033;
}

#progressContainer {
    width: 80%;
    height: 12px;
    background: #003344;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

#progressBar {
    width: 100%;
    height: 100%;
    background: #00eaff;
    transition: width 1s linear;
}

.progress-warning {
    background: #ff0033 !important;
}

/* ============================
   علامات الصح والخطأ
============================ */

#correctMark,
#wrongMark {
    position: absolute;
    top: 40%;
    font-size: 120px;
    display: none;
    z-index: 999;
}

#correctMark {
    color: #00ff88;
    text-shadow: 0 0 25px #00ff88;
}

#wrongMark {
    color: #ff0033;
    text-shadow: 0 0 25px #ff0033;
}

/* ============================
   اهتزاز الكلمة عند الخطأ
============================ */

.word-shake {
    animation: shake 0.4s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
    100% { transform: translateX(0); }
}

/* ============================
   شاشة الانتقال بين الجولات
============================ */

#transitionScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 20, 40, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#transitionText {
    font-size: 48px;
    color: #00eaff;
    text-shadow: 0 0 25px #00eaff;
}

/* ============================
   شاشة الفوز
============================ */

#winnerList div {
    margin: 10px 0;
    font-size: 24px;
}

.winner-first {
    font-size: 32px;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88;
}

/* ============================
   لوحة النقاط الجانبية
============================ */

#scoreBoard {
    position: fixed;
    right: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: #00111f;
    padding: 20px;
    box-shadow: -4px 0 20px #000;
    display: none;
    overflow-y: auto;
}

.score-item {
    padding: 10px;
    margin-bottom: 10px;
    background: #002233;
    border-radius: 8px;
}

.current-player {
    background: #00eaff;
    color: #000;
    font-weight: bold;
}

/* ============================
   شاشة الإيقاف المؤقت
============================ */

#pauseOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

#pauseOverlay button {
    font-size: 26px;
    padding: 15px 30px;
}

/* ============================
   وميض الشاشة عند انتهاء الوقت
============================ */

.screen-flash {
    animation: flash 0.5s ease-in-out 4;
}

@keyframes flash {
    0% { background-color: #000814; }
    50% { background-color: #ff0033; }
    100% { background-color: #000814; }
}
