/* =====================================================
   QUIZ GAME — Las Casas  |  Mobile-first
===================================================== */

.qz-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #e65100, #ff8f00);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(230,81,0,.4);
    touch-action: manipulation;
}
.qz-open-btn:active { transform: scale(.97); }

/* Modal */
.qz-modal {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(0,0,0,.9);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.qz-modal-inner {
    width: 100%;
    max-width: 420px;
    min-height: 100dvh;
    background: #1a0a00;
    display: flex;
    flex-direction: column;
}

/* Themes */
.qz-modal[data-theme="blue"]   .qz-header          { background: #0d47a1; }
.qz-modal[data-theme="blue"]   .qz-open-btn         { background: linear-gradient(135deg,#0d47a1,#42a5f5); }
.qz-modal[data-theme="blue"]   .qz-answer--correct  { background: #1b5e20; border-color: #4caf50; }
.qz-modal[data-theme="blue"]   .qz-ring-fill        { stroke: #42a5f5; }
.qz-modal[data-theme="green"]  .qz-header           { background: #1b5e20; }
.qz-modal[data-theme="dark"]   .qz-modal-inner      { background: #111; }

/* Header */
.qz-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #e65100;
    position: sticky;
    top: 0;
    z-index: 10;
}
.qz-logo { font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0; }
.qz-logo span { color: #ffe0b2; }
.qz-progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}
.qz-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,.25);
    border-radius: 3px;
    overflow: hidden;
}
.qz-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width .4s ease;
}
.qz-progress-text { font-size: 12px; color: #ffe0b2; font-weight: 600; white-space: nowrap; }
.qz-score-mini {
    background: rgba(255,255,255,.2);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    min-width: 36px;
    text-align: center;
}
.qz-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.4);
    background: transparent;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    touch-action: manipulation;
}
.qz-close:active { background: rgba(255,255,255,.2); }

/* Ticker */
.qz-ticker {
    height: 36px;
    overflow: hidden;
    background: #120500;
    border-bottom: 1px solid #2a1200;
}
.qz-ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: qz-scroll 30s linear infinite;
}
.qz-ticker-track:hover { animation-play-state: paused; }
@keyframes qz-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.qz-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px;
    text-decoration: none;
    color: #8d6e63;
    font-size: 12px;
    height: 36px;
    border-right: 1px solid #2a1200;
    transition: color .2s;
}
.qz-ticker-item:hover { color: #ff8f00; }
.qz-ticker-item img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; }
.qz-ticker-name  { font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.qz-ticker-price { color: #ff8f00; font-weight: 700; }

/* Screens */
.qz-screen { flex: 1; display: flex; flex-direction: column; }

/* Start screen */
.qz-screen--start { align-items: center; justify-content: center; padding: 20px 16px; }
.qz-start-content { text-align: center; width: 100%; max-width: 320px; }
.qz-start-icon { font-size: 56px; margin-bottom: 12px; }
.qz-start-content h2 { color: #fff; font-size: 20px; margin-bottom: 8px; }
.qz-start-content p  { color: #8d6e63; font-size: 14px; margin-bottom: 18px; }
.qz-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 24px;
}
.qz-cat-item {
    background: #2a1200;
    border: 1px solid #3a2010;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: #ff8f00;
    font-weight: 600;
}
.qz-start-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #e65100, #ff8f00);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.qz-start-btn:active { transform: scale(.98); }

/* Question screen */
.qz-screen--question { padding: 12px 14px; gap: 10px; }

.qz-question-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.qz-cat-badge {
    background: #2a1200;
    border: 1px solid #3a2010;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    color: #ff8f00;
    font-weight: 600;
}

/* Timer ring */
.qz-timer-ring {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}
.qz-timer-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.qz-ring-bg   { fill: none; stroke: #2a1200; stroke-width: 3; }
.qz-ring-fill {
    fill: none;
    stroke: #ff8f00;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke .3s;
}
.qz-ring-fill--danger { stroke: #f44336; }
.qz-timer-val {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.qz-question-text {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.4;
    min-height: 56px;
}

/* Answers */
.qz-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.qz-answer {
    width: 100%;
    padding: 14px 16px;
    background: #2a1200;
    border: 2px solid #3a2010;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .15s, border-color .15s, transform .1s;
    line-height: 1.3;
}
.qz-answer:active:not([disabled]) { transform: scale(.98); }
.qz-answer--correct {
    background: #1b5e20 !important;
    border-color: #4caf50 !important;
    color: #fff !important;
}
.qz-answer--wrong {
    background: #7f0000 !important;
    border-color: #f44336 !important;
    color: #fff !important;
}
.qz-answer--reveal {
    background: #2a3a20 !important;
    border-color: #4caf50 !important;
    opacity: .7;
}
.qz-answer[disabled] { cursor: default; }

/* Feedback */
.qz-feedback {
    background: #2a1200;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.qz-feedback-text { font-size: 16px; font-weight: 700; color: #fff; }
.qz-feedback-fact { font-size: 13px; color: #8d6e63; line-height: 1.4; }
.qz-next-btn {
    align-self: flex-end;
    padding: 10px 20px;
    background: #e65100;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    margin-top: 4px;
}
.qz-next-btn:active { transform: scale(.97); }

/* Result screen */
.qz-screen--result { align-items: center; justify-content: center; padding: 20px 16px; }
.qz-result-content { text-align: center; width: 100%; max-width: 320px; }
.qz-result-icon  { font-size: 56px; margin-bottom: 8px; }
.qz-result-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.qz-result-score {
    font-size: 42px;
    font-weight: 900;
    color: #ff8f00;
    margin: 8px 0 4px;
}
.qz-result-rank  { font-size: 16px; color: #ffe0b2; font-weight: 600; margin-bottom: 8px; }
.qz-result-stats { font-size: 13px; color: #8d6e63; margin-bottom: 20px; line-height: 1.6; }
.qz-play-again {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e65100, #ff8f00);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.qz-play-again:active { transform: scale(.98); }

/* Ad block */
.qz-ad-block {
    border-top: 1px solid #2a1200;
    background: #120500;
    min-height: 64px;
    flex-shrink: 0;
}
.qz-ad-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; text-decoration: none; color: inherit;
}
.qz-ad-link:active { background: rgba(255,255,255,.03); }
.qz-ad-img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.qz-ad-body  { flex: 1; }
.qz-ad-badge { font-size: 10px; color: #5d4037; text-transform: uppercase; letter-spacing: .05em; }
.qz-ad-title { font-size: 13px; color: #d7ccc8; font-weight: 700; line-height: 1.3; }
.qz-ad-label { font-size: 12px; color: #ff8f00; font-weight: 700; margin-top: 2px; }
.qz-ad-placeholder {
    padding: 18px 12px; text-align: center;
    font-size: 12px; color: #5d4037; font-style: italic;
}
