/* كابوس البقاء — Survival Horror Story */
.qhorror, .qhorror * { box-sizing: border-box; }
.qhorror-body { margin: 0; background: #050508; color: #e8e8ec; font-family: 'Tajawal', sans-serif; min-height: 100vh; }
.qhorror { min-height: 100vh; position: relative; }

.qhorror-panel { min-height: 100vh; padding: 24px 20px 40px; max-width: 520px; margin: 0 auto; }
.qhorror-start { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.qhorror-logo { font-size: 56px; filter: drop-shadow(0 0 20px rgba(220,38,38,.5)); }
.qhorror-start h1 { font-size: 28px; margin: 0; color: #fca5a5; }
.qhorror-start p { color: #9ca3af; line-height: 1.6; margin: 0 0 16px; }
.qhorror-start label { align-self: stretch; text-align: right; font-size: 13px; color: #a78bfa; }
.qhorror-start select { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #333; background: #12121a; color: #fff; font-family: inherit; }

.qhorror-btn {
    display: inline-block; padding: 12px 20px; border-radius: 10px; border: none;
    font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; text-align: center;
}
.qhorror-btn-primary { background: linear-gradient(135deg, #7f1d1d, #dc2626); color: #fff; width: 100%; }
.qhorror-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.qhorror-hud {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding: 12px 14px; background: rgba(20,20,30,.9); border: 1px solid #2a2a3a; border-radius: 12px; margin-bottom: 16px;
}
.qhorror-hud-item { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.qhorror-hud-items { flex: 1; font-size: 12px; color: #94a3b8; min-width: 120px; }
.qhorror-hud-beat { font-size: 12px; color: #6b7280; margin-right: auto; }

.qhorror-scene { font-size: 14px; color: #fbbf24; margin: 0 0 10px; font-weight: 700; }
.qhorror-narrative {
    font-size: 16px; line-height: 1.85; color: #e5e7eb; margin-bottom: 20px;
    padding: 16px; background: rgba(15,15,22,.8); border-right: 3px solid #7f1d1d; border-radius: 8px;
}
.qhorror-choices { display: flex; flex-direction: column; gap: 10px; }
.qhorror-choice {
    width: 100%; text-align: right; padding: 14px 16px; border-radius: 12px;
    border: 1px solid #3f3f55; background: #14141f; color: #f3f4f6; font-family: inherit; font-size: 15px; cursor: pointer;
    transition: border-color .2s, background .2s;
}
.qhorror-choice:hover:not(:disabled) { border-color: #dc2626; background: #1a1218; }
.qhorror-choice:disabled { opacity: 0.45; cursor: not-allowed; }
.qhorror-choice .risk { display: block; font-size: 11px; color: #f87171; margin-top: 4px; }

.qhorror-puzzle-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.qhorror-puzzle-box {
    width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
    background: #12121a; border: 1px solid #4c1d95; border-radius: 16px; padding: 20px;
}
.qhorror-puzzle-box h3 { margin: 0 0 8px; color: #c4b5fd; }
.qhorror-puzzle-box p { color: #d1d5db; font-size: 14px; line-height: 1.6; }

.qh-mini-opt { display: flex; gap: 8px; margin-top: 12px; }
.qh-mini-opt button { flex: 1; padding: 12px; border-radius: 10px; border: 1px solid #444; background: #1e1e2e; color: #fff; font-family: inherit; cursor: pointer; }
.qh-seq-slots { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.qh-seq-slot { padding: 10px; border: 2px dashed #444; border-radius: 8px; min-height: 40px; font-size: 14px; }
.qh-seq-slot.filled { border-style: solid; border-color: #7c3aed; }
.qh-seq-pool { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.qh-seq-chip { padding: 8px 12px; border-radius: 999px; border: none; background: #2a2a3a; color: #fff; font-family: inherit; cursor: pointer; }
.qh-seq-chip.used { opacity: 0.35; pointer-events: none; }
.qh-cw-input { width: 100%; padding: 12px; font-size: 18px; text-align: center; letter-spacing: 4px; border-radius: 10px; border: 1px solid #555; background: #0a0a0f; color: #fff; margin: 12px 0; }

.qhorror-ending { text-align: center; }
.qhorror-ending h2 { font-size: 24px; color: #fca5a5; }
#qh-ending-text { line-height: 1.8; color: #d1d5db; margin: 16px 0; text-align: right; }
#qh-ending-stats { background: #14141f; padding: 12px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; text-align: right; }

.qhorror-loading {
    position: fixed; inset: 0; background: rgba(5,5,8,.95); z-index: 200;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.qhorror-loading-spin {
    width: 48px; height: 48px; border: 3px solid #333; border-top-color: #dc2626;
    border-radius: 50%; animation: qhspin .8s linear infinite;
}
@keyframes qhspin { to { transform: rotate(360deg); } }
