/* ================================================================
   Pass / Match — CSS dédié
   ================================================================ */

/* ── Variables ──────────────────────────────────────────────────── */
:root {
    --pm-match: #27ae60;
    --pm-match-bg: rgba(39, 174, 96, 0.15);
    --pm-pass: #e84057;
    --pm-pass-bg: rgba(232, 64, 87, 0.15);
    --pm-gold: #c8aa6e;
    --pm-dark: #010a13;
    --pm-card-bg: #0a1428;
    --pm-border: rgba(200, 170, 110, 0.15);
    --pm-text: #e2d5b5;
    --pm-muted: #5b5a56;
}

/* ── Progress bar ───────────────────────────────────────────────── */
.pm-progress-wrap {
    padding: 0 1rem 0.5rem;
    flex-shrink: 0;
}
.pm-progress-bar {
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}
.pm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pm-gold), #e8c87a);
    border-radius: 2px;
    transition: width 0.35s ease;
    width: 0%;
}
.pm-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--pm-muted);
    margin-top: 0.3rem;
}

/* ── Card stack area ────────────────────────────────────────────── */
.pm-cards-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    overflow: hidden;
}

/* ── Scenario card ──────────────────────────────────────────────── */
.pm-card {
    position: absolute;
    width: calc(100% - 2rem);
    max-width: 420px;
    background: var(--pm-card-bg);
    border: 1px solid var(--pm-border);
    border-radius: 18px;
    padding: 1.8rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.08s ease, opacity 0.08s ease, box-shadow 0.15s ease;
    will-change: transform;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.pm-card:active { cursor: grabbing; }

/* Tint overlay for visual feedback during drag */
.pm-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.1s ease;
    pointer-events: none;
}
.pm-card.tint-match::before { background: var(--pm-match-bg); opacity: 1; }
.pm-card.tint-pass::before  { background: var(--pm-pass-bg);  opacity: 1; }

/* Category badge */
.pm-card-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--pm-muted);
    font-weight: 600;
}

/* Title */
.pm-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pm-gold);
    line-height: 1.3;
    font-family: 'Cinzel', serif;
}

/* Description */
.pm-card-desc {
    font-size: 0.9rem;
    color: var(--pm-text);
    line-height: 1.6;
    flex: 1;
}

/* Decision hint labels that appear on drag */
.pm-card-hint {
    position: absolute;
    top: 1.2rem;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.1s ease;
    border: 3px solid;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    transform: rotate(-15deg);
}
.pm-card-hint-match {
    left: 1.2rem;
    color: var(--pm-match);
    border-color: var(--pm-match);
    transform: rotate(-15deg);
}
.pm-card-hint-pass {
    right: 1.2rem;
    color: var(--pm-pass);
    border-color: var(--pm-pass);
    transform: rotate(15deg);
}
.pm-card.tint-match .pm-card-hint-match,
.pm-card.tint-pass  .pm-card-hint-pass {
    opacity: 1;
}

/* ── Action buttons ─────────────────────────────────────────────── */
.pm-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    padding: 1rem 1rem 1.5rem;
    flex-shrink: 0;
}

.pm-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.pm-btn:active { transform: scale(0.9); }

.pm-btn-pass {
    border-color: var(--pm-pass);
    color: var(--pm-pass);
}
.pm-btn-pass:hover,
.pm-btn-pass:focus {
    background: var(--pm-pass-bg);
    box-shadow: 0 0 20px rgba(232, 64, 87, 0.35);
}

.pm-btn-match {
    border-color: var(--pm-match);
    color: var(--pm-match);
}
.pm-btn-match:hover,
.pm-btn-match:focus {
    background: var(--pm-match-bg);
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.35);
}

.pm-btn-labels {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    padding: 0 1rem 0.5rem;
    flex-shrink: 0;
}
.pm-btn-label {
    width: 64px;
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--pm-muted);
}

/* ── LP feedback overlay ────────────────────────────────────────── */
.pm-lp-feedback {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-size: 2.5rem;
    font-weight: 900;
    pointer-events: none;
    opacity: 0;
    z-index: 100;
    transition: none;
    letter-spacing: 1px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}
.pm-lp-feedback.show {
    animation: lpPop 0.7s ease forwards;
}
.pm-lp-feedback.positive { color: var(--pm-match); }
.pm-lp-feedback.negative { color: var(--pm-pass); }

@keyframes lpPop {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20%  { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
    60%  { opacity: 1; transform: translate(-50%, -70%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -90%) scale(0.9); }
}

/* ── Card exit animations ───────────────────────────────────────── */
@keyframes swipeLeft {
    to { transform: translateX(-150%) rotate(-25deg); opacity: 0; }
}
@keyframes swipeRight {
    to { transform: translateX(150%) rotate(25deg); opacity: 0; }
}
.pm-card.exit-left  { animation: swipeLeft  0.35s ease forwards; pointer-events: none; }
.pm-card.exit-right { animation: swipeRight 0.35s ease forwards; pointer-events: none; }

/* ── Card enter animation ───────────────────────────────────────── */
@keyframes cardEnter {
    from { transform: scale(0.85) translateY(30px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.pm-card.entering { animation: cardEnter 0.3s ease forwards; }

/* ── Background card (next card peeking) ──────────────────────── */
.pm-card.bg-card {
    transform: scale(0.94) translateY(16px);
    opacity: 0.5;
    pointer-events: none;
    filter: blur(1px);
    z-index: 1;
}
.pm-card.front-card {
    z-index: 2;
}

/* ── Done state ─────────────────────────────────────────────────── */
.pm-done-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}
.pm-done-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(200,170,110,0.2);
    border-top-color: var(--pm-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result page ─────────────────────────────────────────────────── */
.pm-result-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem 1.25rem 2rem;
    max-width: 480px;
    margin: 0 auto;
    gap: 1.5rem;
}

.pm-result-logo {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--pm-gold);
    text-decoration: none;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    align-self: flex-start;
}

.pm-result-hero {
    text-align: center;
    width: 100%;
}
.pm-result-emoji {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    display: block;
}
.pm-result-lp {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.pm-result-lp-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
    margin-bottom: 1rem;
}
.pm-result-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Cinzel', serif;
    color: var(--pm-gold);
    margin-bottom: 0.5rem;
}
.pm-result-desc {
    font-size: 0.9rem;
    color: var(--pm-text);
    line-height: 1.6;
    max-width: 360px;
    margin: 0 auto;
}

.pm-result-stats {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}
.pm-result-stat {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    max-width: 140px;
}
.pm-result-stat-val {
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
}
.pm-result-stat-lab {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--pm-muted);
    margin-top: 0.2rem;
    display: block;
}

.pm-result-ctas {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}
.pm-btn-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: transform 0.15s ease, opacity 0.15s ease;
    font-family: inherit;
}
.pm-btn-cta:active { transform: scale(0.97); opacity: 0.9; }

.pm-btn-replay {
    background: var(--pm-gold);
    color: #000;
}
.pm-btn-share {
    background: rgba(255,255,255,0.08);
    color: var(--pm-text);
    border: 1px solid var(--pm-border);
}
.pm-btn-quiz {
    background: rgba(200,170,110,0.1);
    color: var(--pm-gold);
    border: 1px solid rgba(200,170,110,0.3);
}

/* ── LP counter animation ────────────────────────────────────────── */
.pm-result-lp.counting {
    animation: pulse-lp 0.15s ease infinite alternate;
}
@keyframes pulse-lp {
    from { transform: scale(1); }
    to   { transform: scale(1.04); }
}

/* ── Responsive mobile (petit écran / hauteur réduite) ──────────── */
@media (max-height: 700px), (max-width: 380px) {
    .pm-btn {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }
    .pm-btn-label {
        width: 52px;
        font-size: 0.6rem;
    }
    .pm-actions {
        gap: 2rem;
        padding: 0.6rem 1rem 0.8rem;
    }
    .pm-btn-labels {
        gap: 2rem;
        padding: 0 1rem 0.3rem;
    }
    .pm-progress-wrap {
        padding: 0 1rem 0.25rem;
    }
    .pm-cards-area {
        padding: 0 0.75rem;
    }
}
