/* ============================================================
   لعبة «صيّاد الجزم» — game page styles (RTL, mobile-first)
   ============================================================ */

.game-page {
    padding: 50px 0 70px;
    background: linear-gradient(160deg, #f4f7fb 0%, #eef2f7 55%, #f8fafc 100%);
    min-height: 70vh;
}

.game-shell {
    max-width: 760px;
    margin: 0 auto;
}

.game-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 20px 45px -18px rgba(44, 62, 80, 0.25), 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e8edf3;
    padding: 42px 36px;
    text-align: center;
    animation: gameCardIn 0.45s ease;
}

@keyframes gameCardIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hidden { display: none !important; }

/* ---- Start screen ---- */
.game-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 130%);
    color: #fff;
    font-size: 2.4rem;
    box-shadow: 0 12px 24px -8px rgba(44, 62, 80, 0.45);
    animation: gamePulse 2.4s ease-in-out infinite;
}

@keyframes gamePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.07); }
}

.game-card h1 {
    font-size: 2.4rem;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 800;
}

.game-sub {
    color: #64748b;
    font-size: 1.05rem;
    line-height: 1.9;
    max-width: 540px;
    margin: 0 auto 22px;
}

.game-rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 0 auto 30px;
    max-width: 560px;
    text-align: start;
}

.game-rules li {
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.92rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-rules li i { color: var(--accent); font-size: 1.05rem; }

.game-start-btn {
    font-size: 1.1rem;
    padding: 15px 46px;
    border-radius: 50px;
}

/* ---- HUD ---- */
.game-hud {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.hud-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 7px 18px;
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    min-width: 90px;
    justify-content: center;
}

.hud-item i { color: var(--accent); }
.hud-item.bump { animation: hudBump 0.35s ease; }

@keyframes hudBump {
    0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); }
}

/* ---- Progress + timer ---- */
.game-progress, .game-timer {
    height: 9px;
    border-radius: 50px;
    background: #edf1f6;
    overflow: hidden;
    margin-bottom: 10px;
}

.game-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.45s ease;
}

.game-timer-fill {
    height: 100%;
    width: 100%;
    border-radius: 50px;
    background: #22c55e;
    transition: width 0.1s linear;
}

.game-timer-fill.warn { background: #f59e0b; }
.game-timer-fill.danger { background: #ef4444; }

/* ---- Question ---- */
.game-type {
    display: inline-block;
    margin: 14px auto 12px;
    padding: 5px 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent) 160%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.game-question {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.8;
    margin-bottom: 26px;
}

.game-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    gap: 14px;
}

.game-option {
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 16px 18px;
    min-height: 58px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.game-option:hover:not(:disabled) {
    border-color: var(--primary);
    background: #eef4fb;
    transform: translateY(-2px);
}

.game-option:disabled { cursor: default; opacity: 0.75; }

.game-option.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
    opacity: 1;
    animation: optCorrect 0.4s ease;
}

.game-option.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    opacity: 1;
    animation: optWrong 0.4s ease;
}

@keyframes optCorrect {
    0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); }
}

@keyframes optWrong {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(6px); } 50% { transform: translateX(-6px); } 75% { transform: translateX(4px); }
}

/* ---- Feedback ---- */
.game-feedback {
    margin-top: 24px;
    padding: 22px;
    border-radius: 16px;
    animation: fbIn 0.35s ease;
}

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

.game-feedback.ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.game-feedback.no { background: #fef2f2; border: 1px solid #fecaca; }

.feedback-icon { font-size: 2.2rem; margin-bottom: 8px; }
.game-feedback.ok .feedback-icon { color: #16a34a; }
.game-feedback.no .feedback-icon { color: #dc2626; }

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

.game-feedback.ok .feedback-title { color: #166534; }
.game-feedback.no .feedback-title { color: #991b1b; }

.feedback-text {
    color: #475569;
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 18px;
}

.feedback-text b { color: var(--primary); }

/* ---- Result ---- */
.end-stars { font-size: 2.6rem; margin-bottom: 14px; color: #e2e8f0; }
.end-stars .lit { color: var(--accent); animation: starPop 0.5s ease backwards; }
.end-stars .lit:nth-child(2) { animation-delay: 0.18s; }
.end-stars .lit:nth-child(3) { animation-delay: 0.36s; }

@keyframes starPop {
    from { transform: scale(0) rotate(-40deg); opacity: 0; }
    to   { transform: scale(1) rotate(0); opacity: 1; }
}

.game-card h2 { color: var(--primary); font-size: 1.9rem; margin-bottom: 8px; }

.end-score {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    background: #f8fafc;
    border: 1px dashed var(--accent);
    border-radius: 14px;
    display: inline-block;
    padding: 14px 36px;
    margin: 8px 0 14px;
}

.end-score span { font-size: 2rem; color: var(--accent); }

.end-details { color: #64748b; font-size: 0.95rem; margin-bottom: 22px; }

.end-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.game-home-btn {
    background: #eef2f7;
    color: var(--primary);
    border: 1px solid #dbe3ec;
}

.game-home-btn:hover { background: #e2e8f0; transform: translateY(-3px); }

/* ---- Active nav link ---- */
.nav-link.game-nav-active {
    color: var(--primary);
    background: rgba(44, 62, 80, 0.06);
    border-radius: 8px;
    padding: 6px 12px;
}

/* ---- Dark mode ---- */
body.dark-mode .game-page { background: linear-gradient(160deg, #14181d 0%, #101418 100%); }
body.dark-mode .game-card { background: #1e1e1e; border-color: #333; }
body.dark-mode .game-card h1, body.dark-mode .game-card h2 { color: #eee; }
body.dark-mode .game-question { color: #eee; }
body.dark-mode .game-sub, body.dark-mode .end-details { color: #aaa; }
body.dark-mode .game-option { background: #262b33; border-color: #3a4048; color: #eee; }
body.dark-mode .game-option:hover:not(:disabled) { background: #2f3540; }
body.dark-mode .game-option.correct { background: #14532d; color: #dcfce7; border-color: #22c55e; }
body.dark-mode .game-option.wrong { background: #7f1d1d; color: #fee2e2; border-color: #ef4444; }
body.dark-mode .game-rules li { background: #262b33; border-color: #3a4048; color: #ccc; }
body.dark-mode .hud-item { background: #262b33; border-color: #3a4048; color: #eee; }
body.dark-mode .game-progress, body.dark-mode .game-timer { background: #2a2f38; }
body.dark-mode .game-feedback.ok { background: #14291b; border-color: #166534; }
body.dark-mode .game-feedback.no { background: #2b1616; border-color: #991b1b; }
body.dark-mode .feedback-text { color: #bbb; }
body.dark-mode .end-score { background: #262b33; }
body.dark-mode .game-home-btn { background: #262b33; color: #eee; border-color: #3a4048; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .game-page { padding: 30px 0 50px; }
    .game-card { padding: 28px 18px; border-radius: 18px; }
    .game-card h1 { font-size: 1.8rem; }
    .game-question { font-size: 1.2rem; }
    .game-options { grid-template-columns: 1fr; }
    .hud-item { min-width: 78px; padding: 6px 12px; font-size: 0.9rem; }
    .end-stars { font-size: 2rem; }
}