/* الخزائن المحمولة — Dial Safe Feed */
.qds, .qds * { box-sizing: border-box; }
.qds {
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    color: #f5f5f5;
    font-family: 'Tajawal', sans-serif;
    overflow: hidden;
}
.qds-container {
    height: 100%;
    width: 100%;
    position: relative;
}
.qds-card {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 16px 90px;
    opacity: 0;
    transform: translateY(100%);
    transition: transform .35s ease, opacity .35s ease;
    pointer-events: none;
}
.qds-card.active { opacity: 1; transform: translateY(0); pointer-events: auto; z-index: 2; }
.qds-card.prev { opacity: 0; transform: translateY(-100%); z-index: 1; }

.qds-card-inner {
    width: 100%;
    max-width: 440px;
    max-height: 100%;
    overflow-y: auto;
    background: linear-gradient(160deg, #1a1210 0%, #0f0d0c 100%);
    border: 1px solid #3d2a1f;
    border-radius: 20px;
    padding: 18px 16px 16px;
    scrollbar-width: thin;
}

.qds-emoji { font-size: 34px; text-align: center; margin-bottom: 6px; }
.qds-location {
    text-align: center;
    font-size: 13px;
    color: #fbbf24;
    font-weight: 700;
    margin-bottom: 6px;
}
.qds-type-badge {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #a78bfa;
    font-weight: 700;
    margin-bottom: 10px;
}
.qds-scenario {
    font-size: 14px;
    line-height: 1.7;
    color: #e5e7eb;
    margin-bottom: 12px;
    white-space: pre-wrap;
}
.qds-rules {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
}
.qds-rules-title {
    font-size: 12px;
    font-weight: 800;
    color: #fca5a5;
    margin-bottom: 6px;
}
.qds-rules ol {
    margin: 0;
    padding-right: 16px;
    font-size: 12px;
    line-height: 1.6;
    color: #d1d5db;
}

/* Dial */
.qds-dial-host { margin: 8px auto 12px; }
.qds-dial-host.qds-shake { animation: qds-shake .4s ease; }
@keyframes qds-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.qds-dial-wrap { display: flex; justify-content: center; }
.qds-dial {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, #2a2018 0%, #141010 70%);
    border: 3px solid #5c4033;
    box-shadow: inset 0 0 20px rgba(0,0,0,.6), 0 4px 16px rgba(0,0,0,.5);
}
.qds-dial-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    z-index: 2;
}
.qds-dial-arrow {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #fbbf24;
    opacity: .7;
    z-index: 1;
}
.qds-lamp {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    background: #1f1510;
    border: 2px solid #4a3728;
    box-shadow: inset 0 0 4px rgba(0,0,0,.8);
    transition: background .25s, box-shadow .25s, border-color .25s;
}
.qds-lamp.lit {
    background: #22c55e;
    border-color: #86efac;
    box-shadow: 0 0 12px #22c55e, 0 0 24px rgba(34,197,94,.4);
}

.qds-status {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: 10px;
    min-height: 20px;
}
.qds-status.ok { color: #86efac; }
.qds-status.fail { color: #f87171; }
.qds-status.win { color: #fbbf24; font-size: 15px; }

.qds-btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.qds-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 4px;
    background: linear-gradient(180deg, #3d2a1f 0%, #2a1f18 100%);
    color: #fef3c7;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid #5c4033;
    transition: transform .12s, background .12s, opacity .12s;
    min-height: 48px;
}
.qds-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #5c4033 0%, #3d2a1f 100%);
    transform: translateY(-1px);
}
.qds-btn:active:not(:disabled) { transform: scale(.96); }
.qds-btn:disabled { opacity: .4; cursor: default; }

.qds-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
}
.qds-result.ok {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

/* Loader */
.qds-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: #0a0a0a;
}
.qds-loader.hidden { display: none; }
.qds-loader-icon { font-size: 48px; margin-bottom: 12px; animation: qds-pulse 1.2s ease infinite; }
.qds-loader-text { color: #9ca3af; font-size: 15px; }
@keyframes qds-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: .8; }
}

/* Actions sidebar */
.qds-actions {
    position: fixed;
    left: 12px;
    bottom: 100px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.qds-action-btn {
    background: rgba(255,255,255,.08);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.qds-action-btn.active { color: #f472b6; }
.qds-action-count { font-size: 11px; margin-top: 2px; }

.qds-swipe-hint {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,.45);
    font-size: 12px;
    z-index: 15;
    animation: qds-bounce 2s ease infinite;
}
@keyframes qds-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}

.qds-progress {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 20;
    background: rgba(0,0,0,.5);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #fbbf24;
    backdrop-filter: blur(6px);
}

.qds-embedded .qds-swipe-hint,
.qds-embedded .qds-progress { display: none; }

@media (max-width: 380px) {
    .qds-dial { width: 160px; height: 160px; }
    .qds-btn { font-size: 14px; min-height: 44px; }
}
