@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,500;1,600&family=Caveat:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --night: #070812;
    --lavender: #cbb8e8;
    --gold: #f1cb8a;
    --pink: #efa7bd;
    --white: #f8f3ec;
    --muted: rgba(203, 184, 232, 0.72);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    background: var(--night);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--white);
    overflow: hidden;
}

button {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* =========================
   FOND
========================= */

#app {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100svh;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(74, 63, 111, 0.28),
            transparent 45%
        ),
        radial-gradient(
            circle at 20% 90%,
            rgba(239, 167, 189, 0.08),
            transparent 35%
        ),
        var(--night);
}

#stars {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: white;
    opacity: 0.25;

    animation:
        twinkle 3s ease-in-out infinite,
        drift 8s ease-in-out infinite;
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 0.1;
        transform: scale(0.7);
    }

    50% {
        opacity: 0.85;
        transform: scale(1.25);
    }
}

@keyframes drift {
    0%,
    100% {
        margin-top: 0;
    }

    50% {
        margin-top: -4px;
    }
}

/* =========================
   ÉCRANS
========================= */

.screen {
    position: absolute;
    inset: 0;
    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 42px 25px 72px;

    text-align: center;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform:
        translateY(35px)
        scale(0.96)
        rotate(-1deg);

    filter: blur(5px);

    transition:
        opacity 0.8s ease,
        transform 0.9s cubic-bezier(.22, 1, .36, 1),
        filter 0.8s ease,
        visibility 0.8s;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform:
        translateY(0)
        scale(1)
        rotate(0);

    filter: blur(0);
}

/* =========================
   TEXTES
========================= */

.eyebrow {
    margin-bottom: 18px;

    color: var(--lavender);

    font-size: 10px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;

    opacity: 0;
}

.screen.active .eyebrow {
    animation: textReveal 0.9s 0.15s forwards;
}

h1 {
    margin-bottom: 18px;

    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(40px, 11vw, 58px);
    font-weight: 600;
    line-height: 1.03;
}

h1 em {
    color: var(--gold);
    font-style: italic;
}

.sub {
    max-width: 350px;
    margin-bottom: 30px;

    color: var(--muted);

    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-style: italic;
    line-height: 1.5;

    opacity: 0;
}

.screen.active .sub {
    animation: textReveal 1s 0.35s forwards;
}

.story-text {
    max-width: 350px;
    margin-bottom: 20px;

    color: var(--white);

    font-family: 'Caveat', cursive;
    font-size: 27px;
    line-height: 1.25;

    opacity: 0;
}

.screen.active .story-text {
    animation: textReveal 1s 0.25s forwards;
}

/* =========================
   REPÈRE ECAM
========================= */

.location-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;

    margin: 4px 0 20px;

    opacity: 0;
}

.screen.active .location-marker {
    animation: textReveal 1s 0.5s forwards;
}

.pin-svg {
    width: 24px;
    height: 34px;

    color: var(--gold);

    filter:
        drop-shadow(
            0 0 10px
            rgba(241, 203, 138, 0.5)
        );

    animation: pinBounce 2.6s ease-in-out infinite;
}

.location-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 13px;
    letter-spacing: 0.28em;
    text-transform: uppercase;

    color: rgba(241, 203, 138, 0.75);
}

@keyframes pinBounce {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   BOUTONS
========================= */

.btn {
    position: relative;

    border: 1px solid var(--gold);
    border-radius: 999px;

    padding: 14px 30px;

    background: rgba(241, 203, 138, 0.04);

    color: var(--gold);

    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;

    cursor: pointer;

    overflow: hidden;

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
}

.btn::before {
    content: '';

    position: absolute;
    top: 0;
    left: -100%;

    width: 100%;
    height: 100%;

    background: rgba(241, 203, 138, 0.12);

    transition: left 0.4s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--gold);
    color: var(--night);

    transform: translateY(-3px);

    box-shadow:
        0 0 25px rgba(241, 203, 138, 0.18),
        0 10px 30px rgba(0, 0, 0, 0.25);
}

.btn:active {
    transform: scale(0.95);
}

.btn.ghost {
    border-color: rgba(203, 184, 232, 0.65);
    color: var(--lavender);
}

/* =========================
   PHOTOS
========================= */

.photo-screen {
    justify-content: center;
}

.photo-content {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(100%, 360px);
}

.photo-screen h2 {
    margin-bottom: 20px;

    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(34px, 9vw, 48px);
    line-height: 1.05;

    opacity: 0;
}

.screen.active .photo-screen h2 {
    animation:
        textReveal 0.9s 0.2s forwards;
}

.photo-screen h2 em {
    color: var(--gold);
    font-style: italic;
}

.photo-frame {
    position: relative;

    width: min(78vw, 300px);
    height: min(48vh, 360px);

    margin-bottom: 17px;

    perspective: 1000px;
}

.photo-frame::before {
    content: '';

    position: absolute;
    inset: -7px;

    border: 1px solid rgba(241, 203, 138, 0.28);
    border-radius: 7px;

    transform: rotate(2deg);

    opacity: 0;
}

.screen.active .photo-frame::before {
    animation:
        frameAppear 1s 0.5s forwards;
}

.photo-frame::after {
    content: '';

    position: absolute;
    inset: 4px;

    border: 1px solid rgba(203, 184, 232, 0.1);
    border-radius: 5px;

    pointer-events: none;
}

.memory-photo {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border-radius: 5px;

    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.55),
        0 0 35px rgba(203, 184, 232, 0.07);

    opacity: 0;

    transform:
        scale(0.72)
        translateY(35px)
        rotate(-2deg);
}

.screen.active .memory-photo {
    animation:
        photoZoom 1.4s
        0.55s
        cubic-bezier(.22, 1, .36, 1)
        forwards,
        photoFloat 5s
        2s
        ease-in-out
        infinite;
}

@keyframes photoZoom {
    from {
        opacity: 0;
        transform:
            scale(0.72)
            translateY(35px)
            rotate(-2deg);
    }

    to {
        opacity: 1;
        transform:
            scale(1)
            translateY(0)
            rotate(0);
    }
}

@keyframes photoFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-7px) rotate(0.3deg);
    }
}

@keyframes frameAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(2deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(2deg);
    }
}

.photo-text {
    max-width: 330px;
    margin-bottom: 20px;

    color: var(--muted);

    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    line-height: 1.45;

    opacity: 0;
}

.screen.active .photo-text {
    animation:
        textReveal 0.9s 1.1s forwards;
}

/* =========================
   JEU
========================= */

.q-count {
    margin-bottom: 15px;

    color: var(--lavender);

    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;

    opacity: 0.65;
}

.q-text {
    max-width: 350px;
    margin-bottom: 28px;

    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(27px, 7vw, 35px);
    line-height: 1.2;

    animation: questionAppear 0.6s ease;
}

@keyframes questionAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.options {
    display: flex;
    flex-direction: column;
    gap: 11px;

    width: min(100%, 350px);
}

.option {
    position: relative;

    padding: 15px 18px;

    border: 1px solid rgba(203, 184, 232, 0.25);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.035);

    color: var(--white);

    text-align: left;

    cursor: pointer;

    opacity: 0;

    animation:
        optionAppear 0.5s forwards;

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.option:nth-child(1) {
    animation-delay: 0.1s;
}

.option:nth-child(2) {
    animation-delay: 0.2s;
}

.option:nth-child(3) {
    animation-delay: 0.3s;
}

.option:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes optionAppear {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.option:hover {
    transform: translateX(7px);

    border-color: rgba(241, 203, 138, 0.55);

    background: rgba(241, 203, 138, 0.06);
}

.option.correct {
    border-color: #7ed957;

    background: rgba(126, 217, 87, 0.12);

    color: #7ed957;

    box-shadow:
        0 0 25px rgba(126, 217, 87, 0.18);

    animation: correctAnswer 0.6s ease;
}

.option.wrong {
    border-color: #ff6b6b;

    background: rgba(255, 107, 107, 0.1);

    color: #ff6b6b;

    opacity: 0.75;

    animation: wrongAnswer 0.4s ease;
}

@keyframes correctAnswer {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes wrongAnswer {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

#game-reaction {
    min-height: 30px;
    margin-top: 15px;
}

/* =========================
   10 RAISONS
========================= */

.reasons-screen {
    justify-content: flex-start;
    overflow-y: auto;

    padding-top: 60px;
    padding-bottom: 100px;

    scrollbar-width: none;
}

.reasons-screen::-webkit-scrollbar {
    display: none;
}

.reasons-list {
    width: min(100%, 380px);

    display: flex;
    flex-direction: column;
    gap: 18px;

    margin: 10px 0 30px;

    text-align: left;
}

.reason-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;

    padding: 17px 18px;

    border-left: 1px solid rgba(241, 203, 138, 0.5);
    border-radius: 0 12px 12px 0;

    background: rgba(255, 255, 255, 0.025);

    opacity: 0;
    transform: translateY(25px);
}

.screen.active .reason-item {
    animation-name: reasonReveal;
    animation-duration: 0.8s;
    animation-timing-function: ease;
    animation-fill-mode: forwards;
}

.reason-item:nth-child(1) {
    animation-delay: 0.15s;
}

.reason-item:nth-child(2) {
    animation-delay: 0.3s;
}

.reason-item:nth-child(3) {
    animation-delay: 0.45s;
}

.reason-item:nth-child(4) {
    animation-delay: 0.6s;
}

.reason-item:nth-child(5) {
    animation-delay: 0.75s;
}

.reason-item:nth-child(6) {
    animation-delay: 0.9s;
}

.reason-item:nth-child(7) {
    animation-delay: 1.05s;
}

.reason-item:nth-child(8) {
    animation-delay: 1.2s;
}

.reason-item:nth-child(9) {
    animation-delay: 1.35s;
}

.reason-item:nth-child(10) {
    animation-delay: 1.5s;
}

.reason-item span {
    flex-shrink: 0;

    color: var(--gold);

    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
}

.reason-item p {
    color: var(--white);

    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    line-height: 1.4;
}

@keyframes reasonReveal {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   LETTRE
========================= */

.letter-screen {
    justify-content: flex-start;

    overflow-y: auto;

    padding-top: 70px;
    padding-bottom: 120px;

    scrollbar-width: none;
}

.letter-screen::-webkit-scrollbar {
    display: none;
}

/* =========================
   CASQUE (icône narrative)
========================= */

.headphone-wrap {
    position: relative;
    width: 78px;

    margin: 0 auto 22px;
    flex-shrink: 0;

    color: rgba(241, 203, 138, 0.55);

    opacity: 0;
}

.screen.active .headphone-wrap {
    animation: textReveal 1s 0.3s forwards;
}

.headphone-svg {
    width: 100%;
    height: auto;

    overflow: visible;
}

.headphone-svg .ear-left,
.headphone-svg .ear-right {
    transition: transform 0.5s ease;
    transform-origin: center;
}

.headphone-svg .crack-line {
    opacity: 0;

    stroke-dasharray: 60;
    stroke-dashoffset: 60;
}

.headphone-wrap.broken .headphone-svg {
    animation: headphoneShake 0.5s ease;
}

.headphone-wrap.broken .crack-line {
    opacity: 1;

    animation: crackDraw 0.6s ease forwards 0.15s;
}

.headphone-wrap.broken .ear-left {
    transform: translate(-4px, 3px) rotate(-9deg);
}

.headphone-wrap.broken .ear-right {
    transform: translate(4px, 3px) rotate(9deg);
}

.headphone-wrap.broken {
    color: rgba(180, 180, 190, 0.5);
}

@keyframes headphoneShake {
    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-3px);
    }

    40% {
        transform: translateX(3px);
    }

    60% {
        transform: translateX(-2px);
    }

    80% {
        transform: translateX(2px);
    }
}

@keyframes crackDraw {
    to {
        stroke-dashoffset: 0;
    }
}

#letter-text {
    width: min(100%, 390px);

    margin-bottom: 35px;

    color: var(--white);

    font-family: 'Caveat', cursive;
    font-size: clamp(23px, 6vw, 29px);
    line-height: 1.75;

    text-align: left;

    white-space: pre-wrap;
}

#letter-button {
    margin-bottom: 30px;
}

/* =========================
   FERME LES YEUX
========================= */

.eyes-screen {
    background: #050508;
}

.eyes-text {
    max-width: 300px;

    color: var(--gold);

    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 22px;
    letter-spacing: 0.04em;
    line-height: 1.4;

    opacity: 0;
}

.screen.active .eyes-text {
    animation: eyesFade 2.4s ease forwards;
}

@keyframes eyesFade {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    30% {
        opacity: 1;
        transform: translateY(0);
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* =========================
   FINALE
========================= */

.final-screen {
    background:
        radial-gradient(
            circle at center,
            rgba(203, 184, 232, 0.08),
            transparent 55%
        );
}

.final-photo-wrapper {
    position: relative;

    width: min(74vw, 300px);

    margin-bottom: 27px;

    opacity: 0;
}

.screen.active .final-photo-wrapper {
    animation:
        finalEntrance 1.4s
        cubic-bezier(.22, 1, .36, 1)
        forwards;
}

.final-photo-wrapper::before {
    content: '';

    position: absolute;
    inset: -9px;

    border: 1px solid rgba(241, 203, 138, 0.35);
    border-radius: 8px;

    transform: rotate(-2deg);
}

.final-photo-wrapper::after {
    content: '♥';

    position: absolute;

    right: -13px;
    bottom: -15px;

    color: var(--pink);

    font-size: 25px;

    filter:
        drop-shadow(
            0 0 8px
            rgba(239, 167, 189, 0.45)
        );

    animation: heartPulse 2s infinite;
}

.final-photo {
    position: relative;
    z-index: 1;

    display: block;

    width: 100%;
    aspect-ratio: 4 / 5;

    object-fit: cover;

    border-radius: 6px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.65),
        0 0 45px rgba(203, 184, 232, 0.08);
}

@keyframes finalEntrance {
    from {
        opacity: 0;

        transform:
            scale(0.75)
            translateY(30px);

        filter: blur(10px);
    }

    to {
        opacity: 1;

        transform:
            scale(1)
            translateY(0);

        filter: blur(0);
    }
}

@keyframes heartPulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.signature {
    margin-top: -12px;
    margin-bottom: 28px;

    color: var(--gold);

    font-family: 'Caveat', cursive;
    font-size: 25px;
}

/* =========================
   CONFETTIS
========================= */

#confetti {
    position: absolute;
    inset: 0;
    z-index: 4;

    overflow: hidden;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    top: -40px;

    opacity: 0;

    animation-name: confettiFall;
    animation-timing-function: cubic-bezier(.25, .46, .45, .94);
    animation-fill-mode: forwards;

    will-change: transform, opacity;
}

.confetti-piece.is-square {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.confetti-piece.is-heart {
    color: var(--pink);
    font-size: 16px;

    filter:
        drop-shadow(
            0 0 6px
            rgba(239, 167, 189, 0.4)
        );
}

@keyframes confettiFall {
    0% {
        opacity: 0;
        transform:
            translateY(0)
            translateX(0)
            rotate(0deg);
    }

    10% {
        opacity: 1;
    }

    100% {
        opacity: 0.9;
        transform:
            translateY(115vh)
            translateX(var(--drift, 0px))
            rotate(360deg);
    }
}

/* =========================
   PROGRESSION
========================= */

.progress-dots {
    position: absolute;
    z-index: 10;

    bottom: 22px;
    left: 50%;

    display: flex;
    gap: 7px;

    transform: translateX(-50%);
}

.dot {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.18);

    transition:
        background 0.4s ease,
        transform 0.4s ease;
}

.dot.active {
    background: var(--gold);

    transform: scale(1.6);

    box-shadow:
        0 0 10px
        rgba(241, 203, 138, 0.5);
}

/* =========================
   PETITS ÉCRANS
========================= */

@media (max-width: 380px) {

    .screen {
        padding-left: 20px;
        padding-right: 20px;
    }

    h1 {
        font-size: 38px;
    }

    .sub {
        font-size: 18px;
    }

    .story-text {
        font-size: 24px;
    }

    .photo-frame {
        height: 42vh;
    }

    #letter-text {
        font-size: 21px;
        line-height: 1.7;
    }

    .reason-item p {
        font-size: 18px;
    }
}

/* =========================
   ORDINATEUR
========================= */

@media (min-width: 700px) {

    #app {
        max-width: 540px;
        margin: 0 auto;

        box-shadow:
            0 0 100px rgba(0, 0, 0, 0.45);
    }
}

/* =========================
   ACCESSIBILITÉ
========================= */

button:focus-visible,
.option:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}