:root {
    --brand-primary: #d97a46;
    --brand-secondary: #5691af;
    --brand-dark: #2d3748;
    --bg-main: #ffffff;
    --bg-screen: #ffffff;
    --polaroid-bg: #f9f7ee;
    --sticker-bg: #fdfbf7;
    --sticker-border: #e5dfd3;
    --font-serif: 'DM Serif Display', 'Georgia', serif;
    --font-sans: 'DM Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit;
}
.hidden {
    display: none !important;
}
body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--brand-dark);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Nuke scrollbars globally */
* {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.screen {
    display: none;
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 0;
}

#screen-game {
    overflow: hidden !important;
    height: 100vh;
    height: 100dvh;
    padding: 0 !important;
}

#screen-game.active {
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0 !important;
}

.card {
    background: var(--bg-screen);
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 90%;
    max-width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
    margin: auto;
}

.card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input[type="text"], .form-select {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: white;
}

.form-group input[type="text"]:focus, .form-select:focus {
    border-color: var(--brand-primary);
}

.admin-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--brand-secondary);
    text-decoration: none;
    font-weight: 700;
}

.admin-link:hover {
    text-decoration: underline;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.upload-label:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.upload-label.has-image {
    border-style: solid;
    border-color: var(--brand-primary);
    background-color: #fff7ed;
    color: var(--brand-primary);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.counter-box {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.gender-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-primary);
    background: #fff7ed;
    padding: 10px 16px;
    border-radius: 12px;
}

.waiting-hint {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.loader-pulse {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--brand-primary);
    margin: 0 auto;
    animation: pulse 1.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.divider {
    margin: 20px 0 10px 0;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.quick-profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.quick-profile-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-profile-btn:hover {
    background: #f1f5f9;
    border-color: var(--brand-primary);
}

.quick-profile-btn img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.quick-profile-btn span {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.my-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--brand-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.my-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    height: 100%;
    min-height: 0;
    flex-shrink: 0;
    position: relative;
}

/* HEADER */
header {
    background: #ffffff;
    z-index: 30;
    width: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    height: 56px;
}

.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alignment-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #9ca3af;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #e2e8f0;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: var(--brand-primary);
}

.dot.current {
    background-color: var(--brand-primary);
    width: 16px;
    border-radius: 4px;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.filter-icon {
    color: #6b7280;
}

.credits-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
}

.credits-number {
    color: var(--brand-primary);
    font-weight: 600;
    font-size: 13px;
}

.credits-text {
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.header-progress-line {
    height: 3px;
    width: 70%;
    background: linear-gradient(to right, #a855f7, #ec4899);
}

/* MAIN CONTENT */
main {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: block;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: 120px; /* Space for floating button */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    position: relative;
    z-index: 1;
}

/* GAME BOARD */
.game-board {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 50%;
    flex: 1 1 0%;
    min-width: 0;
}

.polaroid-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* POLAROID STYLING */
.polaroid-card {
    background: #ffffff;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 0; /* Coins extérieurs anguleux */
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.05); /* Very light base shadow */
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Curved page-curl shadow */
.polaroid-card::before, .polaroid-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    bottom: 15px;
    left: 10px;
    width: 45%;
    top: 75%;
    box-shadow: 0 15px 12px rgba(0, 0, 0, 0.5);
    transform: rotate(-5deg);
}

.polaroid-card::after {
    right: 10px;
    left: auto;
    transform: rotate(5deg);
}

/* Hide curved shadow when polaroid is dimmed to prevent visual bugs */
.polaroid-card.dimmed::before, .polaroid-card.dimmed::after {
    display: none;
}

.polaroid-card.selected {
    box-shadow: 0 0 0 4px var(--brand-primary);
}

.polaroid-card.dimmed {
    opacity: 0.5;
}

.polaroid-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    align-self: stretch;
    flex-shrink: 0;
    background-color: #f1f5f9;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    z-index: 1;
}

.polaroid-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
}

.polaroid-img-wrapper > img:not(#camera-icon) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.polaroid-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Ombre interne encore plus fine */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    pointer-events: none;
}

.polaroid-sticker-container {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    margin-top: -14px;
    position: relative;
}

.polaroid-name-sticker {
    display: inline-block;
    background: #fdfbf7;
    color: #111827;
    padding: 2px 10px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.15);
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: var(--sticker-font-size, 16px);
    transform: none !important;
    position: relative;
    z-index: 2;
    max-width: 95%;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center;
    box-sizing: border-box;
}

.polaroid-role {
    font-family: 'Caveat', cursive;
    font-size: var(--role-font-size, 11px);
    font-weight: 700;
    color: #111827 !important;
    text-transform: uppercase;
    letter-spacing: var(--role-letter-spacing, 1.2px);
    background: none !important;
    border: none !important;
    margin-top: 2px !important;
    position: static;
    z-index: 1;
    max-width: 95%;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.1;
    display: block !important;
    text-align: center;
    box-sizing: border-box;
}

.zodiac-badge {
    position: absolute;
    bottom: -2px;
    right: 12px;
    font-size: 18px !important;
    color: #000;
    filter: drop-shadow(0px 1px 1px rgba(255,255,255,0.7));
    z-index: 15;
}

/* Dynamic role colors */
.role-blue { color: var(--brand-secondary); }
.role-orange { color: #f59e0b; }

/* MATCHED CONTAINER */
.matched-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    min-height: 1px;
    position: relative;
    z-index: 20;
}

.matched-pair-row {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    width: 100%;
    gap: 0; /* Touching each other exactly */
}

/* When matched, they sit perfectly flush */
.polaroid-wrapper.left-matched {
    width: 50%;
    z-index: 2;
}

.polaroid-wrapper.right-matched {
    width: 50%;
    z-index: 1;
}

.heart-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.2s;
}

.heart-badge.new-match {
    animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s backwards;
}

@keyframes heartPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.heart-badge:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.heart-badge svg {
    fill: url(#texture-pattern-red);
    stroke: none;
    width: 20px;
    height: 20px;
}


/* FLOATING CONFIRM BUTTON */
.floating-action-container {
    position: fixed;
    bottom: 50px; /* same bottom margin as welcome page */
    left: 0;
    right: 0;
    padding: 0; /* Full bleed left to right */
    z-index: 50;
    display: flex;
    justify-content: center;
}

#btn-validate {
    width: 100%;
    max-width: none;
    border-radius: 0;
    padding: 25px;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3), 1px 2px 3px rgba(0, 0, 0, 0.15) !important;
}

.btn-primary {
    width: 100%;
    max-width: 400px;
    background-image: url('assets/Aquarelle.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    font-family: inherit;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.05em;
    padding: 16px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s, background-size 10s ease-out;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary.hidden {
    display: none;
}

.btn-primary.btn-blue {
    background-color: #38bdf8;
    background-image: url('assets/Aquarelle1.jpg');
    background-blend-mode: soft-light;
}

.btn-secondary {
    width: 100%;
    max-width: 400px;
    background-color: white;
    background-image: url('assets/Aquarelle2.jpg');
    background-size: cover;
    background-position: center;
    background-blend-mode: soft-light;
    color: var(--brand-dark);
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    padding: 14px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    transition: background-color 0.2s;
}

.textured-bg-blue {
    background-color: #e0f2fe;
    background-image: url('assets/Aquarelle1.jpg');
    background-size: cover;
    background-blend-mode: soft-light;
    border-radius: 16px;
    padding: 15px 25px;
    min-width: 100px;
}

.textured-bg-orange {
    background-color: #ffedd5;
    background-image: url('assets/Aquarelle1.jpg');
    background-size: cover;
    background-blend-mode: soft-light;
    border-radius: 16px;
    padding: 15px 25px;
    min-width: 100px;
}




/* ANIMATIONS */
.enter-anim {
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.textured-icon-container {
    background-image: url('assets/Aquarelle.jpg');
    background-size: cover;
    background-position: center;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}

/* Mask for SVGs so they get the texture */
.textured-svg-mask {
    background-image: url('assets/Aquarelle3.jpg');
    background-size: cover;
    background-position: center;
    background-blend-mode: soft-light;
    background-color: var(--brand-primary);
    -webkit-mask-image: var(--svg-mask-url);
    mask-image: var(--svg-mask-url);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.success-screen {
    display: none;
}

.reg-step { display: none; flex-direction: column; width: 100%; opacity: 0; transition: opacity 0.3s ease; }
.reg-step.active { display: flex; width: 100%; opacity: 1; }

/* Utilities */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================================================
   TUTORIAL INTERACTIF (NOUVEAUX UTILISATEURS)
   ========================================================================== */

.tutorial-pulse-orange {
    position: relative;
    z-index: 30 !important;
    border-color: var(--brand-primary) !important;
    animation: tutorPulseOrange 1.4s ease-in-out infinite alternate !important;
}

@keyframes tutorPulseOrange {
    0% {
        box-shadow: 0 0 0 3px var(--brand-primary), 0 2px 8px rgba(217, 122, 70, 0.35);
    }
    100% {
        box-shadow: 0 0 0 5px var(--brand-primary), 0 6px 20px rgba(217, 122, 70, 0.7);
    }
}

.tutorial-pulse-blue {
    position: relative;
    z-index: 25 !important;
    border-color: #0284c7 !important;
    animation: tutorPulseBlue 1.4s ease-in-out infinite alternate !important;
}

@keyframes tutorPulseBlue {
    0% {
        box-shadow: 0 0 0 3px #0284c7, 0 2px 8px rgba(2, 132, 199, 0.3);
    }
    100% {
        box-shadow: 0 0 0 5px #0284c7, 0 6px 20px rgba(2, 132, 199, 0.7);
    }
}

/* Supprimer absolument les fausses ombres sur les cartes sélectionnées ou pulsées par le tuto pour éviter le bug de premier plan */
.polaroid-card.selected::before,
.polaroid-card.selected::after,
.polaroid-card.tutorial-pulse-orange::before,
.polaroid-card.tutorial-pulse-orange::after,
.polaroid-card.tutorial-pulse-blue::before,
.polaroid-card.tutorial-pulse-blue::after,
.polaroid-card.tutorial-dimmed::before,
.polaroid-card.tutorial-dimmed::after {
    display: none !important;
}

.polaroid-card.tutorial-dimmed {
    opacity: 0.55 !important;
    filter: grayscale(25%) !important;
    transition: opacity 0.3s ease, filter 0.3s ease !important;
}

.tutor-host-col {
    z-index: 500 !important;
    position: relative !important;
}

.tutor-host-wrapper {
    z-index: 500 !important;
    position: relative !important;
}

/* Pop-ups flottants qui passent par-dessus les images sans décaler la grille */
.tutor-floating-popup {
    position: absolute;
    z-index: 9999 !important;
    background: #ffffff;
    border: 2px solid var(--brand-primary);
    border-radius: 14px;
    padding: 8px 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(217, 122, 70, 0.35);
    animation: tutorFadeInSoft 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    text-align: left;
    line-height: 1.35;
    pointer-events: auto;
    box-sizing: border-box;
    width: calc(100% - 6px) !important;
    left: 3px !important;
    right: 3px !important;
}

.tutor-floating-popup.tutor-bubble-blue {
    border-color: #0284c7;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(2, 132, 199, 0.35);
}

.tutorial-bubble {
    background: #ffffff;
    border: 1.5px solid var(--brand-primary);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 6px 20px rgba(217, 122, 70, 0.18), 0 2px 5px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 40;
    animation: tutorFadeInSoft 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    text-align: left;
    line-height: 1.35;
    margin-top: 6px;
    margin-bottom: 6px;
}

.tutor-bubble-blue {
    border-color: #0284c7;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.18), 0 2px 5px rgba(0, 0, 0, 0.06);
}

.tutor-bubble-success,
.tutor-bubble-validate {
    position: fixed;
    top: max(14px, env(safe-area-inset-top, 14px));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 320px;
    box-sizing: border-box;
    background: #ffffff;
    z-index: 1000;
    pointer-events: auto;
    animation: tutorValidateSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    margin: 0;
}

.tutor-bubble-success {
    border-color: #16a34a;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 3px 10px rgba(22, 163, 74, 0.25);
    text-align: left;
}

.tutor-bubble-validate {
    border-color: #22c55e;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 3px 10px rgba(34, 197, 94, 0.25);
    text-align: center;
}

.tutor-bubble-success.tutor-bubble-closing,
.tutor-bubble-validate.tutor-bubble-closing {
    animation: tutorValidateSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes tutorValidateSlideDown {
    0% {
        opacity: 0;
        transform: translate(-50%, -15px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes tutorValidateSlideUp {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -15px);
    }
}

@keyframes tutorFadeInSoft {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.tutorial-arrow-up {
    position: absolute;
    top: -7px;
    left: 24px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 2px solid var(--brand-primary);
    border-top: 2px solid var(--brand-primary);
    transform: rotate(45deg);
}

.tutor-bubble-blue .tutorial-arrow-up {
    border-color: #0284c7;
}

.tutorial-arrow-right {
    position: absolute;
    top: 50%;
    right: -7px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-right: 2px solid var(--brand-primary);
    border-top: 2px solid var(--brand-primary);
    transform: translateY(-50%) rotate(45deg);
}

.tutor-bubble-blue .tutorial-arrow-right {
    border-color: #0284c7;
}

.tutorial-badge {
    display: inline-block;
    background: #fff7ed;
    color: #c2410c;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
}

.tutorial-badge.badge-blue {
    background: #f0f9ff;
    color: #0284c7;
}

.tutorial-badge.badge-green {
    background: #f0fdf4;
    color: #16a34a;
}

.tutorial-skip-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s;
}

.tutorial-skip-btn:hover {
    color: #475569;
}

.tutorial-pulse-btn {
    animation: tutorPulseBtn 1.4s ease-in-out infinite alternate !important;
    box-shadow: 0 0 0 4px #22c55e, 0 10px 30px rgba(34, 197, 94, 0.5) !important;
}

@keyframes tutorPulseBtn {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* ==========================================================================
   REVEAL CINÉMATIQUE (FOND ANANAS PARFAITEMENT SUPERPOSÉ)
   ========================================================================== */

.fashion-frame-ananas-bg {
    position: absolute;
    inset: 0;
    background-image: url('assets/Ananas_background.jpeg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: #090c10;
    filter: grayscale(100%) brightness(0.15);
    z-index: 1;
    pointer-events: none;
    transition: opacity 1.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Alignement parfait de l'échelle du papier peint ananas entre le pop-up et le bandeau de fin */
@media (max-aspect-ratio: 765/1024) {
    .fashion-frame-ananas-bg {
        background-size: auto 100vh;
    }
}

.fashion-frame-shadow {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 2;
    transition: opacity 1.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.cinematic-backdrop {
    position: fixed;
    inset: 0;
    background-image: url('assets/Ananas_background.jpeg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: #090c10;
    filter: grayscale(100%) brightness(0.15);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    transition: opacity 1.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.cinematic-backdrop.fading-in {
    z-index: 9999 !important;
    pointer-events: auto !important;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.cinematic-backdrop.active {
    opacity: 1;
    pointer-events: none;
}

/* Écran Merci */
#screen-thanks {
    position: relative;
    z-index: 1000;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

/* 1. Avant le reveal (en attente du match) : texte et logo parfaitement centrés dans la page */
#screen-thanks.active:not(.has-partner) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding: 0 16px;
}

#screen-thanks.active:not(.has-partner) .thanks-main-card {
    margin: auto;
}

#screen-thanks.active:not(.has-partner) #thanks-top-block {
    padding: 0;
}

/* 2. Quand le match est présent : disposition avec polaroid centré verticalement sur l'écran */
#screen-thanks.active.has-partner {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: max(25px, calc(50vh - 330px));
    padding-top: max(25px, calc(50dvh - 330px));
    padding-bottom: 80px;
}

#thanks-top-block {
    padding: 0;
    text-align: center;
}

#thanks-logo-wrap {
    margin: 0 auto 10px auto;
    display: flex;
    justify-content: center;
}

#thanks-logo-img {
    width: 85px;
    height: 85px;
    object-fit: contain;
}

#thanks-title {
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 6px;
    line-height: 1.2;
}

#partner-reveal {
    margin-top: 6px;
    padding-top: 0;
}

#match-title {
    font-size: 15px;
    margin-bottom: 12px;
    line-height: 1.2;
}

#screen-thanks.cinematic-active {
    overflow: hidden !important;
}

.fashion-frame-wrapper {
    position: relative;
    z-index: 1002;
    margin-bottom: 18px;
}

.fashion-frame {
    position: relative;
    z-index: 1003;
    padding: 24px 16px;
}

/* Mode mobile (écrans ≤ 600px de large) : polaroid parfaitement au centre vertical du téléphone */
@media (max-width: 600px) {
    #screen-thanks.active.has-partner {
        padding-top: max(20px, calc(50vh - 292px)) !important;
        padding-top: max(20px, calc(50dvh - 292px)) !important;
        padding-bottom: 60px !important;
    }

    #thanks-top-block {
        padding: 0 !important;
    }

    #thanks-logo-wrap {
        margin: 0 auto 8px auto !important;
    }

    #thanks-logo-img {
        width: 72px !important;
        height: 72px !important;
    }

    #thanks-title {
        font-size: 21px !important;
        margin-top: 0 !important;
        margin-bottom: 4px !important;
        line-height: 1.2 !important;
    }

    #partner-reveal {
        margin-top: 4px !important;
        padding-top: 0 !important;
    }

    #match-title {
        font-size: 15px !important;
        margin-bottom: 12px !important;
        line-height: 1.2 !important;
    }

    .fashion-frame-wrapper {
        margin-bottom: 16px !important;
    }

    .fashion-frame {
        padding: 20px 14px !important;
    }

    .partner-mission-box {
        margin-top: 14px !important;
        padding: 12px 16px !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
    }
}

/* En mode cinématique pop-up : SUPPRESSION STRICTE de TOUTES les ombres et contours du papier déchiré */
#screen-thanks.cinematic-active .fashion-frame-shadow {
    display: none !important;
    opacity: 0 !important;
    box-shadow: none !important;
}

#screen-thanks.cinematic-active .fashion-frame {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    box-shadow: none !important;
    filter: none !important;
    background: transparent !important;
    opacity: 1 !important;
}

#screen-thanks.cinematic-active .fashion-frame-wrapper {
    box-shadow: none !important;
    filter: none !important;
    background: transparent !important;
    opacity: 1 !important;
}

#screen-thanks.cinematic-active .fashion-frame-ananas-bg {
    opacity: 0 !important;
    display: none !important;
}

#screen-thanks.cinematic-active .polaroid-card::before,
#screen-thanks.cinematic-active .polaroid-card::after {
    display: none !important;
}

#partner-card {
    position: relative;
    z-index: 1005;
    pointer-events: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: filter 1.8s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: scale(1.05);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#screen-thanks.cinematic-active #partner-card {
    filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.9));
}

#partner-card.card-fade-prep {
    opacity: 0 !important;
    transform: scale(0.96) !important;
}

#partner-mission {
    position: relative;
    z-index: 1005;
}

/* Transition d'opacité fluide pour tous les éléments qui apparaissent au fadeout */
.thanks-fade-element {
    opacity: 1;
    transition: opacity 1.8s cubic-bezier(0.25, 1, 0.5, 1);
}

#screen-thanks.cinematic-active .thanks-fade-element {
    opacity: 0;
    pointer-events: none;
    transition: none !important;
}

#screen-thanks.cinematic-active #credit-tutor-container,
#screen-thanks.cinematic-active #scroll-arrow-container {
    opacity: 0;
    pointer-events: none;
}

.partner-mission-box {
    margin-top: 25px;
    padding: 16px 18px;
    background: var(--bg-main);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    color: #1a202c;
    line-height: 1.5;
    text-align: center;
    font-weight: 500;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3), 1px 2px 3px rgba(0, 0, 0, 0.15);
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    text-shadow: none;
    transition: color 1.8s cubic-bezier(0.25, 1, 0.5, 1),
                background 1.8s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 1.8s cubic-bezier(0.25, 1, 0.5, 1),
                text-shadow 1.8s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.5s ease;
}

.partner-mission-box.cinematic-white {
    color: #ffffff;
    background: transparent;
    border: none;
    box-shadow: none;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}

.partner-mission-box.cinematic-white strong {
    color: #fdba74;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
    transition: color 1.8s ease, text-shadow 1.8s ease;
}

.partner-mission-box .astro-link {
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s ease, opacity 0.2s ease;
}

.partner-mission-box .astro-link:hover {
    opacity: 0.8;
}

.partner-mission-box.cinematic-white .astro-link {
    color: #fdba74;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}

/* ==========================================================================
   TUTORIEL CRÉDIT (EXPANSION FLUIDE ET GLISSEMENT DES POLAROIDS)
   ========================================================================== */

#credit-tutor-container {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: max-height 0.85s cubic-bezier(0.16, 1, 0.3, 1),
                margin-top 0.85s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
    will-change: max-height, margin-top, opacity;
}

#credit-tutor-container.open {
    max-height: 280px;
    margin-top: 24px;
    opacity: 1;
}

#credit-tutor-container.closing {
    max-height: 0 !important;
    margin-top: 0 !important;
    opacity: 0 !important;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                margin-top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease !important;
}

.tutor-bubble-credit {
    border-color: var(--brand-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 3px 10px rgba(217, 122, 70, 0.18);
    background: #ffffff;
}

