:root {
    --bg-color: #fce4ec;
    --window-bg: #e0f2f1;
    --titlebar-bg: #b2dfdb;
    --border-color: #00796b;
    --text-primary: #37474f;
    --text-muted: #78909c;
    --accent-pink: #f48fb1;
    --accent-yellow: #fff59d;
    --shadow-soft: 4px 4px 0px rgba(0,0,0,0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    font-family: sans-serif;
}

.font-pixel { font-family: 'Pixelify Sans', sans-serif; }
.font-caveat { font-family: 'Caveat', cursive; font-size: 1.5rem; }

.text-muted { color: var(--text-muted); }
.text-pink { color: var(--accent-pink); }
.text-white { color: white; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.shadow-soft { box-shadow: var(--shadow-soft); }

/* Petals Animation */
.petals-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.petal {
    position: absolute;
    background: #ffb6c1;
    border-radius: 50% 0 50% 50%;
    width: 15px; height: 15px;
    opacity: 0.6;
    animation: fall linear infinite, sway ease-in-out infinite alternate;
}

@keyframes fall {
    0% { top: -10%; transform: rotate(0deg); }
    100% { top: 110%; transform: rotate(360deg); }
}
@keyframes sway {
    0% { margin-left: 0px; }
    100% { margin-left: 50px; }
}

#container {
    width: 100%;
    max-width: 450px;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* Steps */
.step {
    position: absolute;
    width: 100%;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(20px);
    display: flex;
    justify-content: center;
}

.step.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 10;
}

/* Retro Window */
.retro-window {
    background: var(--window-bg);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    box-shadow: 6px 6px 0px rgba(0, 121, 107, 0.2);
    overflow: hidden;
}

.retro-titlebar {
    background: var(--titlebar-bg);
    border-bottom: 3px solid var(--border-color);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Pixelify Sans', sans-serif;
    font-weight: 600;
    color: var(--border-color);
}

.retro-controls {
    display: flex;
    gap: 8px;
}

.retro-controls span {
    width: 16px; height: 16px;
    border: 2px solid var(--border-color);
    background: white;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
}

.retro-content {
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sticker {
    width: 120px; height: 120px;
    object-fit: contain;
    filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.1));
}

.sticker-small {
    width: 60px; height: 60px;
    object-fit: contain;
}

.bounce-anim { animation: bounce 2s infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.btn-retro {
    background: var(--accent-pink);
    color: white;
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 1.2rem;
    padding: 10px 25px;
    border: 3px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 3px 3px 0px var(--border-color);
    cursor: pointer;
    transition: transform 0.1s;
}
.btn-retro:active {
    transform: translate(3px, 3px);
    box-shadow: 0px 0px 0px var(--border-color);
}

.btn-retro-small {
    background: var(--accent-pink);
    color: white;
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 1rem;
    padding: 8px 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 2px 2px 0px var(--border-color);
    cursor: pointer;
}

.btn-retro-white {
    background: white;
    color: var(--accent-pink);
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 1.2rem;
    padding: 10px 25px;
    border: 3px solid var(--accent-pink);
    border-radius: 6px;
    box-shadow: 3px 3px 0px rgba(0,0,0,0.1);
    cursor: pointer;
}

/* Envelope */
.envelope-container { min-height: 250px; justify-content: center; }
.envelope-wrapper { position: relative; width: 260px; height: 160px; cursor: pointer; }
.envelope { position: relative; width: 100%; height: 100%; transition: transform 0.5s; transform-style: preserve-3d; }

.env-back {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: #d4a373; border-radius: 4px;
}

.env-letter {
    position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px;
    background: white; border-radius: 4px;
    padding: 20px; text-align: center;
    transition: transform 0.6s ease;
    z-index: 2;
    display: flex; flex-direction: column; justify-content: space-between;
}

.env-front {
    position: absolute; top:0; left:0; width:100%; height:100%;
    border-left: 130px solid #faedcd;
    border-right: 130px solid #faedcd;
    border-bottom: 80px solid #e9edc9;
    border-top: 80px solid transparent;
    z-index: 3;
    pointer-events: none;
}

.env-flap {
    position: absolute; top:0; left:0; width:0; height:0;
    border-left: 130px solid transparent;
    border-right: 130px solid transparent;
    border-top: 90px solid #ccd5ae;
    border-bottom: 70px solid transparent;
    z-index: 4;
    transform-origin: top;
    transition: transform 0.6s ease;
}

.env-seal {
    position: absolute; top: 90px; left: 50%; transform: translate(-50%, -50%);
    width: 50px; height: 50px; background: var(--accent-pink);
    border-radius: 50%; z-index: 5;
    color: white; font-family: 'Pixelify Sans', sans-serif; font-size: 0.8rem;
    display: flex; justify-content: center; align-items: center;
    border: 2px solid white; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: opacity 0.3s;
}

.envelope.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .env-seal { opacity: 0; pointer-events: none; }
.envelope.open .env-letter { transform: translateY(-100px); z-index: 6; }

/* Cassette Tapes */
.cassette-tape {
    background: #424242;
    width: 100%; max-width: 280px;
    height: 100px;
    border-radius: 8px;
    border: 2px solid #212121;
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    padding: 10px;
}
.tape-label {
    background: var(--accent-yellow);
    width: 90%; height: 35px;
    border-radius: 4px;
    display: flex; justify-content: center; align-items: center;
    border: 1px solid #cddc39;
    margin-bottom: 10px;
}
.tape-wheels {
    width: 60%; height: 30px;
    background: #616161; border-radius: 15px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 10px;
}
.wheel { width: 20px; height: 20px; background: white; border-radius: 50%; position: relative; border: 4px dashed #212121; }
.wheel.spinning { animation: spin 2s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.btn-play-tape {
    position: absolute; right: 10px; bottom: 10px;
    background: var(--accent-pink); color: white; border: none;
    width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; font-size: 0.8rem; box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

/* Flip Cards */
.flip-grid { display: flex; flex-direction: column; width: 100%; }
.flip-card {
    background-color: transparent;
    width: 100%; height: 120px;
    perspective: 1000px;
    cursor: pointer;
}
.flip-card-inner {
    position: relative; width: 100%; height: 100%;
    text-align: center; transition: transform 0.6s;
    transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
    position: absolute; width: 100%; height: 100%;
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    border-radius: 8px;
}
.flip-card-front {
    background-color: var(--accent-yellow);
    color: var(--text-primary);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    border: 2px solid #e6ce57;
}
.flip-card-back {
    background-color: #2980b9; color: white;
    transform: rotateY(180deg);
    background-size: cover; background-position: center;
    position: relative; overflow: hidden;
}
.card-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(255,255,255,0.9); color: var(--text-primary);
    padding: 5px; font-size: 1.2rem;
}

/* Final Letter */
.pink-card {
    background: var(--accent-pink);
    border-radius: 16px; padding: 40px 30px; text-align: center;
    width: 100%; max-width: 400px;
}
.letter-body { line-height: 1.5; font-size: 1.8rem; }
