@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400&display=swap');

:root {
    --color-cream: #fdfaf5;
    --color-ocre: #d48c5c;
    --color-dark: #3d3d3d;
    --color-petrol: #2b4f52;
    /* Verde petróleo */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lato', sans-serif;
    --transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-cream);
    color: var(--color-dark);
    font-family: var(--font-sans);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Progress Bar */
.progress-container {
    padding: 20px;
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 100;
    background: rgba(253, 250, 245, 0.9);
}

.progress-bar-bg {
    height: 3px;
    background: #e0e0e0;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 2px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-ocre);
    width: 0%;
    transition: width 0.8s ease;
}

/* Scene Management */
.scene {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    opacity: 0;
    transition: var(--transition);
}

.scene.active {
    display: flex;
    opacity: 1;
}

h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--color-petrol);
    text-align: center;
    letter-spacing: 1px;
}

.level-result {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: var(--color-ocre);
    margin-top: 20px;
    opacity: 0;
    text-align: center;
    transition: opacity 0.5s;
}

/* Level 1: Slot Machine */
.slot-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.slot {
    width: 80px;
    height: 100px;
    background: white;
    border: 2px solid var(--color-ocre);
    border-radius: 10px;
    font-family: var(--font-serif);
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s;
}

.slot:active {
    transform: scale(0.9);
}

/* Level 2: Memory */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(2, 100px);
    gap: 15px;
}

.card {
    width: 100px;
    height: 100px;
    background: var(--color-ocre);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.card-back {
    background: var(--color-ocre);
}

.card-front {
    background: white;
    color: var(--color-petrol);
    transform: rotateY(180deg);
    border: 1px solid var(--color-ocre);
}

.reveal-image {
    width: 250px;
    height: 150px;
    object-fit: cover;
    margin-top: 20px;
    border-radius: 10px;
    display: none;
}

/* Level 3: Flashlight */
.flashlight-container {
    position: relative;
    width: 320px;
    height: 320px;
    background: #111;
    border-radius: 50%;
    overflow: hidden;
    cursor: crosshair;
    border: 4px solid var(--color-ocre);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: background 1s ease;
}

.flashlight-container.won {
    background: #fff;
    cursor: default;
}

.flashlight-target {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: var(--font-serif);
    font-size: 1.6rem;
    pointer-events: none;
    text-align: center;
    width: 80%;
    line-height: 1.4;
    transition: color 1s ease;
    z-index: 5;
}

.flashlight-container.won .flashlight-target {
    color: var(--color-petrol);
}

.light-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 80px at var(--x) var(--y), rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.95) 100%);
    pointer-events: none;
    z-index: 10;
    transition: opacity 1s ease;
}

.flashlight-container.won .light-overlay {
    opacity: 0;
}

/* Level 4: Toast */
.toast-area {
    width: 100%;
    height: 150px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 320px;
    padding: 0 20px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    border: 1px dashed var(--color-ocre);
}

.glass {
    font-size: 5rem;
    cursor: grab;
    user-select: none;
    transition: transform 0.1s linear;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.1));
    z-index: 5;
}

.scene.cleared .toast-area {
    display: none;
}

.scene.cleared #toast-instruction {
    display: none;
}

/* Level 5: Envelope */
.envelope-container {
    position: relative;
    width: 200px;
    height: 150px;
    background: #f4e4bc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.seal {
    width: 50px;
    height: 50px;
    background: #b22222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    font-size: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.seal:hover {
    transform: scale(1.1);
}

.seal.broken {
    animation: breakSeal 0.5s forwards;
}

@keyframes breakSeal {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Next Button Area */
.next-btn-area {
    position: fixed;
    bottom: 40px;
    width: 100%;
    display: none;
    justify-content: center;
    z-index: 500;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-next {
    background: var(--color-ocre);
    color: white;
    border: none;
    padding: 12px 30px;
    font-family: var(--font-serif);
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 140, 92, 0.3);
    transition: transform 0.3s, background 0.3s;
}

.btn-next:hover {
    background: var(--color-petrol);
    transform: scale(1.05);
}

/* Final Invitation */
.final-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-cream);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 60px 20px;
}

.itinerary-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-width: 450px;
    width: 100%;
    text-align: center;
}

.final-img {
    width: 100%;
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.itinerary-item {
    margin: 20px 0;
    border-left: 2px solid var(--color-ocre);
    padding-left: 20px;
    text-align: left;
}

.itinerary-item h4 {
    color: var(--color-ocre);
    font-family: var(--font-serif);
}

.btn-confirm {
    background: var(--color-petrol);
    color: white;
    border: none;
    padding: 15px 40px;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 30px;
    transition: transform 0.3s;
}

.btn-confirm:hover {
    transform: scale(1.05);
}

.btn-confirm.confirmed {
    background: #ff85a2 !important;
    /* Rosa romántico */
    transform: scale(1);
    cursor: default;
    box-shadow: 0 4px 15px rgba(255, 133, 162, 0.4);
    margin-bottom: 20px;
}

.btn-download {
    background: white;
    color: var(--color-petrol);
    border: 2px solid var(--color-petrol);
    padding: 12px 30px;
    font-family: var(--font-serif);
    font-size: 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
}

.btn-download:hover {
    background: var(--color-petrol);
    color: white;
}

/* Petals Animation */
.petal {
    position: fixed;
    top: -50px;
    pointer-events: none;
    animation: fall linear forwards;
    z-index: 2000;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    opacity: 1 !important;
}