/* =========================================================
   Quête principale — panel + dialogue overlay + claim modal
   DA "Plaque d'obsidienne tiède" partout.
   ========================================================= */

/* ---- Panel wrap ---- */
.main-quest-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 10px;
}

/* ---- Hub : Corbak (gauche) + contenu (droite) ---- */
.mq-hub {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 22px;
    padding: 22px 26px;
    border-radius: 14px;
    background: linear-gradient(165deg, #1c1815 0%, #120f0d 55%, #0b0908 100%);
    border: 1px solid rgba(var(--gold-rgb), 0.55);
    box-shadow:
        inset 0 1px 0 rgba(var(--gold-rgb), 0.22),
        inset 0 -12px 18px -12px rgba(0, 0, 0, 0.55),
        0 3px 14px -3px rgba(0, 0, 0, 0.55);
}

.mq-hub-corbak-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.mq-hub-corbak {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(var(--gold-rgb), 0.3));
}
.mq-replay {
    font-size: 0.7rem;
    letter-spacing: 0.6px;
    padding: 3px 10px;
}

.mq-hub-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mq-hub-step {
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.9;
}
.mq-hub-title {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    letter-spacing: 1.2px;
    color: var(--gold-text-light);
    text-shadow: 0 2px 10px rgba(var(--gold-rgb), 0.3);
}
.mq-hub-divider {
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--gold-rgb), 0.75), transparent);
    margin: 2px 0 2px;
}

/* ---- Objectif ---- */
.mq-objective {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--gold-rgb), 0.3);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mq-objective-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.mq-objective-label {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
}
.mq-objective-count {
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold-text-light);
    letter-spacing: 0.5px;
}
.mq-objective-text {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.92rem;
    color: var(--text-main);
}
.mq-objective-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
}
.mq-objective-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold) 55%, var(--gold-light) 100%);
    box-shadow: 0 0 8px rgba(var(--gold-rgb), 0.5);
    transition: width 0.5s cubic-bezier(.2, .8, .2, 1);
}

/* ---- Rewards row ---- */
.mq-rewards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.mq-reward {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(var(--gold-rgb), 0.35);
    font-family: 'Oswald', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gold-text-warm);
    letter-spacing: 0.4px;
}
.mq-reward-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}
.mq-reward-icon-corrupted {
    filter: sepia(1) hue-rotate(230deg) saturate(3.2);
}
.mq-reward-corrupted {
    border-color: rgba(199, 125, 255, 0.45);
    color: #d9b8ff;
}
.mq-reward-title {
    border-color: rgba(var(--gold-rgb), 0.55);
    color: var(--gold-light);
    font-style: italic;
}

/* ---- Bouton Valider ---- */
.mq-claim-btn {
    margin-top: 8px;
    align-self: flex-start;
    padding: 10px 24px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    /* Hérite .btn.btn-gold */
}
.mq-claim-btn:not(:disabled) {
    animation: mqClaimPulse 2.6s ease-in-out infinite;
}
@keyframes mqClaimPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(var(--gold-rgb), 0), inset 0 1px 0 rgba(var(--gold-rgb), 0.22), inset 0 -10px 14px -10px rgba(0,0,0,0.55), 0 1px 0 rgba(0,0,0,0.5), 0 2px 8px -2px rgba(0,0,0,0.45); }
    50%      { box-shadow: 0 0 22px rgba(var(--gold-rgb), 0.45), inset 0 1px 0 rgba(var(--gold-rgb), 0.35), inset 0 -10px 14px -10px rgba(0,0,0,0.55), 0 1px 0 rgba(0,0,0,0.5), 0 2px 12px -2px rgba(0,0,0,0.45); }
}

/* ---- Historique ---- */
.mq-history {
    margin-top: 22px;
    background: linear-gradient(165deg, rgba(28, 24, 21, 0.8) 0%, rgba(18, 15, 13, 0.9) 100%);
    border: 1px solid rgba(var(--gold-rgb), 0.22);
    border-radius: 10px;
    padding: 10px 14px;
}
.mq-history summary {
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
}
.mq-history summary::-webkit-details-marker { display: none; }
.mq-history summary::before {
    content: '▸';
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}
.mq-history[open] summary::before { transform: rotate(90deg); }
.mq-history-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 9px;
    background: rgba(var(--gold-rgb), 0.15);
    border: 1px solid rgba(var(--gold-rgb), 0.4);
    border-radius: 10px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold);
    margin-left: auto;
}
.mq-history-list {
    list-style: none;
    padding: 10px 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mq-history-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.mq-history-item:hover { background: rgba(var(--gold-rgb), 0.05); }
.mq-history-step {
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.6px;
}
.mq-history-title { color: var(--text-main); }
.mq-history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- All done (post-C13) ---- */
.mq-all-done {
    text-align: center;
    padding: 60px 20px;
}
.mq-all-done-corbak {
    width: 180px;
    height: 180px;
    opacity: 0.75;
    filter: grayscale(0.3) drop-shadow(0 0 18px rgba(var(--gold-rgb), 0.2));
}
.mq-all-done-title {
    margin: 16px 0 6px;
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--gold-light);
    letter-spacing: 1.4px;
}
.mq-all-done-sub {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 420px;
    margin: 0 auto;
}

/* =========================================================
   Dialogue overlay (typewriter, fork du tuto)
   ========================================================= */
.mq-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.mq-dialog-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.mq-dialog-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}
.mq-dialog-wrap {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 0;
    max-width: 780px;
    width: 100%;
    padding: 0 20px 60px;
    z-index: 1;
}
.mq-dialog-corbak {
    width: clamp(180px, 22vw, 280px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.8));
    margin-bottom: -20px;
    margin-right: -10px;
}
.mq-dialog-box {
    flex: 1;
    position: relative;
    padding: 20px 24px 56px;
    background: linear-gradient(170deg, rgba(30, 22, 12, 0.96) 0%, rgba(16, 12, 8, 0.98) 100%);
    border: 2px solid rgba(var(--gold-rgb), 0.55);
    border-radius: 10px;
    box-shadow:
        0 0 30px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(var(--gold-rgb), 0.22),
        inset 0 -10px 14px -10px rgba(0, 0, 0, 0.55);
    font-family: 'Roboto Condensed', sans-serif;
    color: var(--gold-text-warm);
    cursor: pointer;
}
.mq-dialog-text {
    font-size: 1.05rem;
    line-height: 1.55;
    min-height: 80px;
    white-space: pre-wrap;
}
.mq-dialog-caret {
    display: inline-block;
    width: 8px;
    margin-left: 2px;
    color: var(--gold);
    animation: mqCaretBlink 0.9s steps(2) infinite;
}
.mq-dialog-caret::before { content: '▌'; }
@keyframes mqCaretBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}
.mq-dialog-next {
    position: absolute;
    right: 14px;
    bottom: 12px;
    padding: 6px 16px;
    background: linear-gradient(165deg, #241e19 0%, #181310 55%, #0d0a08 100%);
    border: 1px solid rgba(var(--gold-rgb), 0.75);
    border-radius: 8px;
    color: var(--gold-text-light);
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.mq-dialog-next.ready {
    opacity: 1;
    pointer-events: auto;
}
.mq-dialog-next:hover {
    background: linear-gradient(165deg, #2c241d 0%, #1c1712 55%, #100c0a 100%);
    box-shadow: 0 0 12px rgba(var(--gold-rgb), 0.35);
}

/* =========================================================
   Modal génér. (claim + egg picker)
   ========================================================= */
.mq-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mq-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.mq-modal-box {
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 26px;
    background: linear-gradient(165deg, #1c1815 0%, #120f0d 55%, #0b0908 100%);
    border: 1px solid rgba(var(--gold-rgb), 0.7);
    border-radius: 14px;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(var(--gold-rgb), 0.3),
        0 0 30px rgba(var(--gold-rgb), 0.2);
    transform: scale(0.94);
    transition: transform 0.3s cubic-bezier(.2, 1.2, .3, 1);
}
.mq-modal-overlay.is-open .mq-modal-box {
    transform: scale(1);
}
.mq-modal-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(var(--gold-rgb), 0.3);
}
.mq-modal-corbak {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(var(--gold-rgb), 0.4));
}
.mq-modal-title-wrap { flex: 1; }
.mq-modal-label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--gold);
}
.mq-modal-title {
    margin: 2px 0 0;
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--gold-text-light);
    letter-spacing: 0.8px;
}
.mq-modal-dialog {
    padding: 10px 0;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--gold-text-warm);
    font-style: italic;
}
.mq-claim-line { margin: 6px 0; }
.mq-modal-rewards {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(var(--gold-rgb), 0.35);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mq-claim-reward {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.92rem;
    color: var(--gold-text-light);
}
.mq-claim-reward img { width: 22px; height: 22px; object-fit: contain; }
.mq-claim-reward-egg .mq-egg-sprite {
    width: 42px;
    height: 42px;
}
.mq-claim-reward-title em {
    color: var(--gold-light);
    font-style: italic;
}
.mq-modal-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.mq-modal-ok {
    padding: 8px 22px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* ---- Egg picker modal ---- */
.mq-modal-box-picker { max-width: 560px; }
.mq-egg-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.mq-egg-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--gold-rgb), 0.3);
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.mq-egg-card:hover {
    background: rgba(var(--gold-rgb), 0.1);
    border-color: rgba(var(--gold-rgb), 0.8);
    transform: translateY(-2px);
}
.mq-egg-card-sprite {
    width: 56px;
    height: 56px;
}
.mq-egg-card-name {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.6px;
    color: var(--gold);
}

/* ---- Sprite œuf (1ère frame uniquement) ---- */
.mq-egg-sprite,
.mq-egg-card-sprite {
    display: inline-block;
    overflow: hidden;
    position: relative;
    vertical-align: middle;
}
.mq-egg-sprite > i,
.mq-egg-card-sprite > i {
    display: block;
    width: 128px;
    height: 128px;
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: auto;
    transform-origin: top left;
}
.mq-egg-sprite { width: 42px; height: 42px; }
.mq-egg-sprite > i { transform: scale(0.328); }          /* 42/128 */
.mq-egg-card-sprite { width: 56px; height: 56px; }
.mq-egg-card-sprite > i { transform: scale(0.4375); }    /* 56/128 */

/* ---- Mobile ---- */
@media (max-width: 640px) {
    .mq-hub {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
    .mq-hub-corbak { width: 110px; height: 110px; }
    .mq-hub-title { font-size: 1.3rem; }
    .mq-egg-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .mq-dialog-wrap {
        flex-direction: column;
        align-items: center;
        padding: 0 14px 40px;
    }
    .mq-dialog-corbak { margin: 0 0 -10px; }
}
