/* ══════════════════════════════════════════════
   AUTO-QUIZ — OVERLAY CSS
   Loading overlay, upload progress card, checkmark,
   reading dots, skeleton cards, revealed cards.
   ══════════════════════════════════════════════ */

#loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg, #141313);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 30px 20px;
}

#progress-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.skeleton-choices-wrap {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* ── UPLOAD CARD ── */
.upload-card {
    width: min(360px, 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #1c1b1b;
    border-radius: 20px;
    padding: 24px;
    animation: fade-in 0.2s ease both;
}

.upload-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.upload-card-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-card-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.upload-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 1px;
}

.upload-card-filename {
    font-family: "Poppins", sans-serif;
    font-size: clamp(1rem, 4vw, 1.15rem);
    font-weight: 600;
    color: var(--text-mid, #e2e2e9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.upload-card-status {
    font-family: "Poppins", sans-serif;
    font-size: clamp(0.70rem, 3vw, 0.80rem);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease, opacity 0.18s ease;
    background-image: linear-gradient(90deg,
            var(--text-soft, #a0a0ab) 0%,
            var(--text-soft, #a0a0ab) 35%,
            #ffffff 50%,
            var(--text-soft, #a0a0ab) 65%,
            var(--text-soft, #a0a0ab) 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: text-pulse 2.2s linear infinite;
}

.upload-card-percent {
    flex-shrink: 0;
    font-family: "Poppins", sans-serif;
    font-size: clamp(1.7rem, 7vw, 2rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.upload-card-track {
    width: 100%;
    height: 10px;
    background: #2a2a2a;
    border-radius: 20px;
    overflow: hidden;
}

.upload-card-fill {
    width: 0%;
    height: 100%;
    border-radius: 20px;
    background: var(--gradient);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-card-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 2px;
}

.upload-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-family: "Poppins", sans-serif;
    font-size: clamp(0.72rem, 3vw, 0.78rem);
    color: var(--text-soft, #a0a0ab);
    font-variant-numeric: tabular-nums;
}

.upload-card-action-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.upload-cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    font-family: "Poppins", sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #e2e2e6;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background 0.18s cubic-bezier(0.2, 0, 0, 1),
        border-color 0.18s cubic-bezier(0.2, 0, 0, 1),
        color 0.18s cubic-bezier(0.2, 0, 0, 1),
        transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.upload-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.upload-cancel-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.12);
}

.upload-cancel-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 2px;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes check-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes check-draw {
    from {
        stroke-dashoffset: 50;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.upload-complete-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 4px 0 8px;
    animation: fade-in 0.15s ease both;
}

.upload-complete-icon {
    width: 52px;
    height: 52px;
    background: #e8faf0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: check-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.upload-complete-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: check-draw 0.35s 0.12s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.upload-complete-label {
    font-family: "Poppins", sans-serif;
    font-size: clamp(0.88rem, 3vw, 0.96rem);
    font-weight: 600;
    color: #27ae60;
}

/* ── CONNECTING STATUS DOTS ── */
#upload-inline-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    animation: fade-in 0.2s ease both;
}

.trivia-dots-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    max-width: min(360px, 84vw);
}

@keyframes text-pulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.trivia-status-text {
    font-family: "Poppins", sans-serif;
    font-size: clamp(0.85rem, 3vw, 0.94rem);
    font-weight: 500;
    background-image: linear-gradient(90deg,
            var(--text-soft, #a0a0ab) 0%,
            var(--text-soft, #a0a0ab) 35%,
            #ffffff 50%,
            var(--text-soft, #a0a0ab) 65%,
            var(--text-soft, #a0a0ab) 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: text-pulse 2.2s linear infinite;
}

.trivia-status-text.trivia-fade {
    animation: fade-in 0.35s ease both, text-pulse 2.2s linear infinite;
}

.trivia-status-subtext {
    font-family: "Poppins", sans-serif;
    font-size: clamp(0.74rem, 2.6vw, 0.8rem);
    font-weight: 400;
    color: var(--text-soft, #a0a0ab);
    opacity: 0.8;
}

.trivia-status-subtext.trivia-fade {
    animation: fade-in 0.35s ease both;
}

.trivia-fade {
    animation: fade-in 0.35s ease both;
}

/* ── SKELETON PHASE ── */
#skeleton-phase {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 460px;
    gap: 12px;
    padding-top: 10px;
}

.skeleton-ready-label {
    font-family: "Poppins", sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: #a0a0ab;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
    opacity: 0;
    animation: skel-fade-in 0.4s ease 0.05s forwards;
}

#skeleton-cards {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-card {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    animation: skel-fade-in 0.35s ease forwards;
}

.skel {
    background: linear-gradient(90deg, #222226 25%, #2e2e33 50%, #222226 75%);
    background-size: 400% 100%;
    animation: shimmer 1.7s ease-in-out infinite;
    border-radius: 20px;
}

.skel-q {
    height: 16px;
    width: 100%;
}

.skel-choice {
    height: 36px;
    width: 75%;
    border-radius: 18px;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes skel-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── REVEALED CARD ── */
.revealed-card {
    background: transparent;
    border-radius: 16px;
    padding: 18px 16px 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: card-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes card-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.real-q-num {
    font-family: "Poppins", sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: #a0a0ab;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.real-q-text {
    font-family: "Poppins", sans-serif;
    font-size: 0.92rem;
    font-weight: 400;
    color: #e2e2e9;
    line-height: 1.45;
}

.real-choices-wrap {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 2px;
}

.real-choice {
    font-family: "Poppins", sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    color: #a0a0ab;
    border-radius: 9px;
    padding: 8px 12px;
}