/* Quiz section */

.quiz-section {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 0 20px;
}

.quiz-head {
    text-align: center;
    margin-bottom: 28px;
    padding: 26px 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 8px 32px 0 rgba(250, 208, 196, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.quiz-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #d67d63;
    padding: 6px 16px;
    background: linear-gradient(135deg, #fff5f2, #ffe6e0);
    border-radius: 999px;
    margin-bottom: 12px;
    border: 1px solid #ffe6e0;
    box-shadow: 0 2px 8px rgba(250, 208, 196, 0.2);
}

.quiz-head h2 {
    display: block;
    width: 100%;
    font-size: 2rem;
    font-weight: 800;
    color: #e59882;
    margin: 0 0 10px;
    text-shadow: 2px 2px 4px rgba(250, 208, 196, 0.5);
    line-height: 1.25;
}

.quiz-head p {
    color: #8a7772;
    max-width: 680px;
    margin: 0 auto;
    font-size: 0.98rem;
    line-height: 1.7;
}

.quiz-card {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 40px rgba(250, 208, 196, 0.35);
    padding: 32px 32px 30px;
    color: #5c4b47;
    font-family: 'Quicksand', sans-serif;
}

.quiz-progress {
    position: relative;
    height: 8px;
    background: #fff1ea;
    border-radius: 999px;
    margin-bottom: 26px;
    overflow: visible;
}

.quiz-progress-bar {
    height: 100%;
    width: 33.33%;
    background: linear-gradient(135deg, #fad0c4 0%, #fbc1b0 60%, #f3a48a 100%);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(243, 164, 138, 0.45);
}

.quiz-step-indicator {
    position: absolute;
    right: 0;
    top: -22px;
    font-size: 12px;
    font-weight: 700;
    color: #d67d63;
    letter-spacing: 0.06em;
}

.quiz-step {
    display: none;
    animation: quizFade 0.35s ease;
}

.quiz-step.active {
    display: block;
}

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

.quiz-q {
    font-size: 1.45rem;
    font-weight: 800;
    color: #5c4b47;
    margin: 0 0 6px;
    line-height: 1.35;
    text-align: center;
}

.quiz-sub {
    color: #8a7772;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 0 22px;
    text-align: center;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quiz-chip {
    display: flex;
    gap: 12px;
    align-items: center;
    text-align: left;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1.5px solid #ffe6dc;
    background: #fffaf6;
    color: #5c4b47;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
}

.quiz-chip:hover {
    border-color: #fbc1b0;
    background: #fff5ef;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(250, 208, 196, 0.35);
}

.quiz-chip.selected {
    border-color: #f3a48a;
    background: linear-gradient(135deg, #fff5f2, #ffe6e0);
    box-shadow: 0 6px 22px rgba(243, 164, 138, 0.4);
}

.quiz-chip-emoji {
    font-size: 1.7rem;
    line-height: 1;
    flex-shrink: 0;
}

.quiz-chip-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.quiz-chip-text strong {
    font-size: 0.98rem;
    font-weight: 700;
    color: #5c4b47;
}

.quiz-chip-text small {
    font-size: 0.78rem;
    color: #8a7772;
    line-height: 1.45;
}

.quiz-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    margin-bottom: 22px;
}

.quiz-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #6b574f;
}

.quiz-field-full {
    grid-column: 1 / -1;
}

.quiz-req {
    color: #e58a6e;
    font-weight: 800;
    margin-left: 2px;
}

.quiz-field input,
.quiz-field textarea {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid #ffe6dc;
    background: #fffaf6;
    font-family: inherit;
    font-size: 0.95rem;
    color: #5c4b47;
    outline: none;
    resize: vertical;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.quiz-field input:focus,
.quiz-field textarea:focus {
    border-color: #f3a48a;
    box-shadow: 0 0 0 4px rgba(250, 208, 196, 0.35);
}

.quiz-accent {
    color: #e59882;
}

.quiz-suggests {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: -6px;
}

.quiz-suggest-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #8a7772;
}

.quiz-suggest {
    font-family: inherit;
    font-size: 0.8rem;
    color: #8a6a5e;
    background: #fff5ef;
    border: 1.5px solid #ffe6dc;
    border-radius: 999px;
    padding: 6px 13px;
    cursor: pointer;
    line-height: 1.3;
    transition: all 0.2s ease;
}

.quiz-suggest:hover {
    border-color: #fbc1b0;
    background: #fff0e8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(250, 208, 196, 0.4);
}

.quiz-suggest.selected {
    border-color: #f3a48a;
    background: linear-gradient(135deg, #fff5f2, #ffe6e0);
    color: #d67d63;
    box-shadow: 0 4px 14px rgba(243, 164, 138, 0.35);
}

.quiz-options-methods {
    grid-template-columns: 1fr;
}

.quiz-method-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1.5px solid #ffe6dc;
    background: #fffaf6;
    color: #5c4b47;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
}

.quiz-method-card:hover {
    border-color: #fbc1b0;
    background: #fff5ef;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(250, 208, 196, 0.35);
}

.quiz-method-card.selected {
    border-color: #f3a48a;
    background: linear-gradient(135deg, #fff5f2, #ffe6e0);
    box-shadow: 0 6px 22px rgba(243, 164, 138, 0.4);
}

.quiz-method-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-method-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #d67d63;
    background: #fff5f2;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #ffe6dc;
}

.quiz-method-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: #5c4b47;
}

.quiz-method-desc {
    font-size: 0.85rem;
    color: #8a7772;
    line-height: 1.55;
    margin: 4px 0 0;
}

.quiz-method-cost {
    font-size: 0.78rem;
    color: #d67d63;
    font-weight: 700;
    margin-top: 4px;
}

.quiz-tiers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 720px) {
    .quiz-tiers { grid-template-columns: 1fr; }
}

.quiz-tier-card {
    position: relative;
    text-align: left;
    padding: 18px 18px 16px;
    border-radius: 20px;
    border: 1.5px solid #ffe6dc;
    background: #fffaf6;
    color: #5c4b47;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
}

.quiz-tier-card:hover {
    border-color: #fbc1b0;
    background: #fff5ef;
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(250, 208, 196, 0.4);
}

.quiz-tier-card.selected {
    border-color: #f3a48a;
    background: linear-gradient(135deg, #fff5f2, #ffe6e0);
    box-shadow: 0 8px 24px rgba(243, 164, 138, 0.45);
}

.quiz-tier-card-paid {
    border-color: #f3c2a4;
    background: linear-gradient(135deg, #fffaf2, #fff2e8);
}

.quiz-tier-ribbon {
    position: absolute;
    top: 10px;
    right: -32px;
    transform: rotate(35deg);
    background: linear-gradient(135deg, #f3a48a, #e59882);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 4px 36px;
    box-shadow: 0 3px 8px rgba(229, 152, 130, 0.45);
}

.quiz-tier-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.quiz-tier-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.quiz-tier-name {
    font-size: 1.02rem;
    font-weight: 800;
    color: #5c4b47;
    flex: 1;
}

.quiz-tier-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #d67d63;
    background: #fff5f2;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid #ffe6dc;
}

.quiz-tier-list {
    margin: 0;
    padding-left: 18px;
    color: #6b574f;
    font-size: 0.86rem;
    line-height: 1.6;
}

.quiz-tier-list li { margin-bottom: 2px; }

/* Giá đã áp gói premium: giá mới nổi bật, giá gốc gạch ngang mờ. */
.quiz-price-now {
    color: #2e9e6b;
    font-weight: 800;
}
.quiz-price-was {
    color: #b39c95;
    text-decoration: line-through;
    font-weight: 600;
    font-size: 0.92em;
}

/* Nhãn ưu đãi premium dưới thẻ gói trả phí. */
.quiz-tier-premium-note {
    margin: 10px 0 0;
    padding: 7px 12px;
    background: #effaf3;
    border: 1px solid #c4ebd4;
    border-radius: 10px;
    color: #2e9e6b;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
}

.quiz-paid-warning {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: #fff7ef;
    border: 1px solid #ffd9c8;
    border-radius: 14px;
    color: #8a5a47;
    font-size: 0.88rem;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-paid-warning-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quiz-paid-warning-actions .quiz-btn {
    padding: 8px 16px;
    font-size: 0.86rem;
}

.quiz-reading {
    margin: 22px 0 4px;
    padding: 22px 22px 18px;
    background: linear-gradient(135deg, #fff8f4, #fff5ef);
    border: 1px solid #ffe6dc;
    border-radius: 20px;
    color: #5c4b47;
    line-height: 1.7;
    font-size: 0.96rem;
    text-align: left;
}

.quiz-reading h1, .quiz-reading h2, .quiz-reading h3, .quiz-reading h4 {
    color: #d67d63;
    margin: 14px 0 6px;
    line-height: 1.35;
}
.quiz-reading h1 { font-size: 1.2rem; }
.quiz-reading h2 { font-size: 1.1rem; }
.quiz-reading h3, .quiz-reading h4 { font-size: 1rem; }

.quiz-reading p { margin: 0 0 10px; }
.quiz-reading ul, .quiz-reading ol { margin: 4px 0 12px 20px; }
.quiz-reading li { margin-bottom: 4px; }
.quiz-reading strong { color: #5c4b47; }
.quiz-reading em { color: #8a7772; }
.quiz-reading hr { border: none; border-top: 1px dashed #ffd9c8; margin: 14px 0; }
.quiz-reading blockquote {
    margin: 12px 0;
    padding: 12px 16px;
    background: #fff;
    border-left: 3px solid #f3a48a;
    border-radius: 0 12px 12px 0;
    color: #6b574f;
    font-style: italic;
}
.quiz-reading code {
    background: #fff5ef;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.88rem;
    color: #d67d63;
}

.quiz-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 26px 4px 24px;
    color: #8a7772;
    width: 100%;
}

/* ----- "Đang viết" skeleton shimmer loader ----- */
.quiz-loading-spark {
    display: inline-block;
    margin-right: 2px;
    animation: quizSparkPulse 1.8s ease-in-out infinite;
}

.quiz-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 460px;
    padding: 2px 6px;
}

.quiz-sk-line {
    height: 13px;
    border-radius: 7px;
    background-color: #f7ddd2;
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.85) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 160px 100%;
    background-repeat: no-repeat;
    background-position: -160px 0;
    transform-origin: left center;
    box-shadow: inset 0 0 0 1px rgba(243, 164, 138, 0.12);
    animation: quizSkShimmer 1.5s ease-in-out infinite, quizSkReveal 0.45s ease both;
}
.quiz-sk-line:nth-child(1) { width: 94%; animation-delay: 0s, 0s; }
.quiz-sk-line:nth-child(2) { width: 80%; animation-delay: 0.18s, 0.1s; }
.quiz-sk-line:nth-child(3) { width: 88%; animation-delay: 0.36s, 0.2s; }
.quiz-sk-line:nth-child(4) { width: 66%; animation-delay: 0.54s, 0.3s; }
.quiz-sk-line:nth-child(5) { width: 46%; animation-delay: 0.72s, 0.4s; }

.quiz-loading-text {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    background: linear-gradient(90deg, #d67d63, #f3a48a, #ffd9c8, #f3a48a, #d67d63);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: quizShimmer 2.6s linear infinite;
}

.quiz-dots i {
    font-style: normal;
    opacity: 0.2;
    animation: quizDot 1.4s infinite;
}
.quiz-dots i:nth-child(2) { animation-delay: 0.2s; }
.quiz-dots i:nth-child(3) { animation-delay: 0.4s; }

.quiz-loading-sub {
    margin: 0;
    font-size: 0.82rem;
    color: #b89a92;
    letter-spacing: 0.02em;
    animation: quizSubFade 2.6s ease-in-out infinite;
}

@keyframes quizSkShimmer {
    0% { background-position: -160px 0; }
    100% { background-position: calc(100% + 160px) 0; }
}
@keyframes quizSkReveal {
    from { opacity: 0; transform: scaleX(0.55); }
    to   { opacity: 1; transform: scaleX(1); }
}
@keyframes quizSparkPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.28) rotate(14deg); opacity: 1; }
}
@keyframes quizShimmer {
    to { background-position: 200% center; }
}
@keyframes quizDot {
    0%, 60%, 100% { opacity: 0.2; }
    30% { opacity: 1; }
}
@keyframes quizSubFade {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .quiz-loading-spark,
    .quiz-sk-line,
    .quiz-loading-text,
    .quiz-dots i,
    .quiz-loading-sub {
        animation: none !important;
    }
}

.quiz-error {
    margin: 16px 0 0;
    padding: 14px 18px;
    border-radius: 14px;
    background: #fff0eb;
    border: 1px solid #ffcab9;
    color: #c25640;
    font-size: 0.92rem;
    text-align: center;
}

.quiz-error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.quiz-error-hint {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: #a86b59;
}

.quiz-gender {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quiz-gender-btn {
    flex: 1;
    min-width: 90px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1.5px solid #ffe6dc;
    background: #fffaf6;
    color: #5c4b47;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-gender-btn:hover {
    border-color: #fbc1b0;
    background: #fff5ef;
}

.quiz-gender-btn.selected {
    border-color: #f3a48a;
    background: linear-gradient(135deg, #fff5f2, #ffe6e0);
    color: #d67d63;
    box-shadow: 0 4px 14px rgba(243, 164, 138, 0.35);
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.quiz-nav-result {
    justify-content: center;
    margin-top: 18px;
}

.quiz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 22px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
}

.quiz-btn-primary {
    background: linear-gradient(135deg, #fad0c4 0%, #fbc1b0 100%);
    color: #5c4b47;
    box-shadow: 0 6px 18px rgba(250, 208, 196, 0.5);
}

.quiz-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(250, 208, 196, 0.7);
    text-decoration: none;
    color: #5c4b47;
}

.quiz-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quiz-btn-ghost {
    background: transparent;
    color: #8a7772;
    border: 1.5px solid #ffe6dc;
    padding: 10px 18px;
}

.quiz-btn-ghost:hover {
    border-color: #fbc1b0;
    background: #fffaf6;
    color: #5c4b47;
}

.quiz-result {
    text-align: center;
    padding: 6px 6px 0;
}

.quiz-result-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #d67d63;
    padding: 6px 14px;
    background: linear-gradient(135deg, #fff5f2, #ffe6e0);
    border-radius: 999px;
    margin-bottom: 14px;
    border: 1px solid #ffe6e0;
}

.quiz-result-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #5c4b47;
    margin: 0 0 12px;
    line-height: 1.3;
}

.quiz-result-title span {
    color: #e59882;
}

.quiz-result-desc {
    color: #6b574f;
    font-size: 0.98rem;
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto 18px;
}

.quiz-result-meta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.quiz-result-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 18px;
    background: #fff5ef;
    border-radius: 14px;
    border: 1px solid #ffe6dc;
    min-width: 160px;
}

.quiz-meta-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #d67d63;
}

.quiz-meta-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #5c4b47;
}

.quiz-result-note {
    font-size: 0.8rem;
    color: #a89691;
    margin: 14px 0 0;
    line-height: 1.55;
}

.quiz-vc-row {
    display: flex;
    justify-content: center;
    margin: 18px 0 4px;
}

/* ---------- Card drawing (Tarot / Bài Tây) ---------- */
.quiz-draw {
    margin: 4px 0 20px;
    padding: 18px 18px 16px;
    background: linear-gradient(135deg, #fff8f4, #fff3ec);
    border: 1.5px solid #ffe6dc;
    border-radius: 20px;
}

.quiz-draw-loading {
    text-align: center;
    color: #8a7772;
    font-size: 0.92rem;
    padding: 10px 0;
}

.quiz-draw-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.quiz-draw-title {
    font-size: 1rem;
    font-weight: 800;
    color: #5c4b47;
}

.quiz-draw-counter {
    font-size: 0.82rem;
    font-weight: 800;
    color: #d67d63;
    background: #fff5f2;
    padding: 3px 12px;
    border-radius: 999px;
    border: 1px solid #ffe6dc;
}

.quiz-draw-hint {
    font-size: 0.82rem;
    color: #8a7772;
    line-height: 1.5;
    margin: 0 0 12px;
}

.quiz-deck {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-bottom: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 245, 239, 0.6);
    border: 1px solid #ffe6dc;
    scrollbar-width: thin;
    scrollbar-color: #f3a48a #fff1ea;
}

.quiz-deck::-webkit-scrollbar { width: 8px; }
.quiz-deck::-webkit-scrollbar-track { background: #fff1ea; border-radius: 999px; }
.quiz-deck::-webkit-scrollbar-thumb { background: #f3a48a; border-radius: 999px; }

.quiz-fcard {
    width: 52px;
    height: 84px;
    perspective: 800px;
    cursor: pointer;
    transition: transform 0.25s ease;
}

@media (min-width: 576px) {
    .quiz-fcard { width: 60px; height: 96px; }
}

.quiz-fcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.quiz-fcard.flipped .quiz-fcard-inner {
    transform: rotateY(180deg);
}

.quiz-fcard:hover:not(.flipped) {
    transform: translateY(-7px);
}

.quiz-fcard:hover:not(.flipped) .quiz-fcard-inner {
    box-shadow: 0 12px 20px rgba(229, 152, 130, 0.55);
}

.quiz-fcard-back,
.quiz-fcard-front {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    border: 1px solid #ffe6e0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.quiz-fcard-back {
    background-size: cover;
    background-position: center;
}

.quiz-deck-playing_cards .quiz-fcard-back {
    background-size: contain;
    background-repeat: no-repeat;
}

.quiz-fcard-front {
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-fcard-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.quiz-deck-playing_cards .quiz-fcard-front img {
    object-fit: contain;
}

.quiz-fcard-front img.reversed {
    transform: rotate(180deg);
}

.quiz-deck.done .quiz-fcard:not(.flipped) {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.quiz-drawn {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.quiz-drawn-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
    padding: 10px 14px;
    background: #fff;
    border: 1.5px solid #f3c2a4;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(243, 164, 138, 0.25);
    animation: quizFade 0.35s ease;
}

.quiz-drawn-pos {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #d67d63;
}

.quiz-drawn-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #5c4b47;
    line-height: 1.35;
}

.quiz-draw-reset {
    margin: 12px auto 0;
    padding: 8px 18px;
    font-size: 0.85rem;
}

@media (max-width: 720px) {
    .quiz-section { padding: 30px 0 10px; }
    .quiz-card { padding: 24px 18px 22px; border-radius: 22px; }
    .quiz-head h2 { font-size: 1.45rem; }
    .quiz-q { font-size: 1.2rem; }
    /* Chip chủ đề: 2 cột gọn để tận dụng chiều ngang trên mobile */
    .quiz-options { grid-template-columns: 1fr 1fr; gap: 10px; }
    .quiz-options-methods { grid-template-columns: 1fr; }
    #quiz-topics .quiz-chip { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 10px; }
    #quiz-topics .quiz-chip-text { align-items: center; }
    #quiz-topics .quiz-chip-text small { display: none; }
    #quiz-topics .quiz-chip-emoji { font-size: 1.85rem; }
    .quiz-form { grid-template-columns: 1fr; }
    .quiz-result-title { font-size: 1.3rem; }
    .quiz-result-meta-item { flex: 1; min-width: 0; }
    .quiz-nav { flex-direction: column-reverse; }
    .quiz-nav .quiz-btn { width: 100%; }
    .quiz-drawn-card { flex: 1; min-width: 100px; }
}

