﻿.envelope-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 32px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px auto;
    box-sizing: border-box;
}


.step {
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.step::-webkit-scrollbar {
    display: none;
}

.env-wrapper {
    width: 200px;
    max-width: 100%;
    margin: 0 auto;
    min-width: 0;
    min-height: 0;
}

.env-main {
    width: 100%;
    height: 220px;
    min-height: 180px;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.env-photo {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    border: 2.5px solid #ffb3c1;
    background: #ffdde7;
    overflow: hidden;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.7s cubic-bezier(.4, 1.6, .6, 1), transform 0.7s cubic-bezier(.4, 1.6, .6, 1);
    transform: translateY(60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.env-photo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
    border-radius: 6px;
    box-shadow: none;
    border: none;
}

@media (max-width: 600px) {
    body {
        font-size: 1.1em;
        padding: 0;
        margin: 0;
        overflow-x: hidden;
    }

    .envelope-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4vw;
        width: 100vw;
        margin: 0 auto;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 70vh;
        box-sizing: border-box;
    }

    .env-wrapper {
        width: 44vw !important;
        max-width: 48vw !important;
        margin: 0 auto !important;
        min-width: 0 !important;
        min-height: 0 !important;
    }

    .env-main {
        width: 100% !important;
        height: 38vw !important;
        min-height: 120px;
        max-width: 100vw;
        padding: 0;
        box-sizing: border-box;
    }

    .env-photo {
        position: static !important;
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        max-width: 100vw !important;
        max-height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto !important;
        padding: 0 !important;
        left: 0 !important;
        top: 0 !important;
        transform: none !important;
        box-sizing: border-box !important;
    }

    .env-photo img {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        margin: auto !important;
        border-radius: 6px !important;
        box-shadow: none !important;
        border: none !important;
    }




    .glow-btn,
    button,
    input[type="text"] {
        font-size: 1.3em;
        width: 260px;
        max-width: 100%;
        box-sizing: border-box;
    }

    h1,
    h2,
    h3,
    .pixel-text {
        font-size: 1.2em !important;
        word-break: break-word;
    }

    .hello-kitty-wave-bg {
        width: 120px !important;
        height: 120px !important;
        right: 4px !important;
        bottom: 4px !important;
    }

    .hello-kitty-wave-svg {
        width: 110px !important;
        height: 110px !important;
    }

    .hello-kitty-bg {
        width: 40px !important;
        height: 40px !important;
        left: -30px !important;
        bottom: 8px !important;
    }

    .hello-kitty-svg {
        width: 40px !important;
        height: 40px !important;
    }

    .pixel-card,
    .expanded,
    .bouquet-card {
        width: 95vw !important;
        min-width: 0 !important;
        box-sizing: border-box;
        padding: 1vw !important;
    }
}


.env-main {
    width: 340px;
    height: 520px;
    position: relative;
    background: #fff5f7;
    border: 2.5px solid #ffb3c1;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
    overflow: visible;
}

.env-flap-top,
.env-flap-bottom,
.env-flap-left,
.env-flap-right {
    position: absolute;
    background: linear-gradient(180deg, #ffe5ec 0%, #ffc0e0 50%, #ffb3d9 100%);
    z-index: 3;
    transition: 0.6s cubic-bezier(.4, 1.6, .6, 1);
}

.env-flap-top {
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    clip-path: polygon(0 100%, 50% 0, 100% 100%);
    box-shadow: 0 2px 8px #ffb3c1cc;
}

.env-flap-bottom {
    bottom: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    box-shadow: 0 2px 8px #ffb3c1cc;
}

.env-flap-left {
    left: -60px;
    top: 0;
    width: 60px;
    height: 100%;
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
    box-shadow: 2px 0 8px #ffb3c1cc;
}

.env-flap-right {
    right: -60px;
    top: 0;
    width: 60px;
    height: 100%;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    box-shadow: -2px 0 8px #ffb3c1cc;
}

.env-photo {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    border: 2.5px solid #ffb3c1;
    background: #ffdde7;
    overflow: hidden;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.7s cubic-bezier(.4, 1.6, .6, 1), transform 0.7s cubic-bezier(.4, 1.6, .6, 1);
    transform: translateY(60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.env-photo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
    border-radius: 6px;
    box-shadow: none;
    border: none;
}

.env-wrapper.open .env-flap-top {
    transform: translateY(-50px) rotateX(60deg);
    opacity: 0;
}

.env-wrapper.open .env-flap-bottom {
    transform: translateY(50px) rotateX(-60deg);
    opacity: 0;
}

.env-wrapper.open .env-flap-left {
    transform: translateX(-50px) rotateY(60deg);
    opacity: 0;
}

.env-wrapper.open .env-flap-right {
    transform: translateX(50px) rotateY(-60deg);
    opacity: 0;
}

.env-wrapper.open .env-photo {
    opacity: 1;
    z-index: 5;
    transform: translateY(0);
}


.hello-kitty-wave-bg {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    width: 260px;
    height: 260px;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transition: none;
    margin: 0 !important;
    padding: 0 !important;
}

.hello-kitty-wave-svg {
    width: 240px;
    height: 240px;
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    background: none;
}

.kitty-wave-arm {
    transform-origin: 170px 150px;
    animation: kittyWaving 1.1s cubic-bezier(.4, 1.2, .6, 1) infinite alternate;
}

@keyframes kittyWaving {
    0% {
        transform: rotate(-10deg);
    }

    100% {
        transform: rotate(28deg);
    }
}


.hello-kitty-bg {
    position: fixed;
    left: -80px;
    bottom: 32px;
    z-index: 0;
    pointer-events: none;
    width: 64px;
    height: 64px;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    animation: kittyWalk 18s linear infinite;
}

.hello-kitty-svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 2px 8px #ffb3c1cc);
}

@keyframes kittyWalk {
    0% {
        left: -80px;
    }

    10% {
        bottom: 32px;
    }

    20% {
        bottom: 36px;
    }

    30% {
        bottom: 32px;
    }

    40% {
        bottom: 36px;
    }

    50% {
        bottom: 32px;
    }

    100% {
        left: 110vw;
    }
}

.typewriter-line span.letter {
    display: inline-block;
    opacity: 1;
    background: linear-gradient(90deg, #ff1744, #ff8fa3, #ffb300, #00e5ff, #ff1744 90%);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #ff1744;
    outline: none;
}

/* Enhanced Message Container */
.message-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 30px 20px;
}

.message-title {
    margin-bottom: 20px !important;
    font-size: 2.5rem !important;
    text-align: center;
    background: linear-gradient(135deg, #ff1744 0%, #ff8fa3 50%, #ffb300 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titlePulse 2s ease-in-out infinite;
    text-shadow: none;
    filter: drop-shadow(0 2px 8px rgba(255, 23, 68, 0.3));
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.message-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 243, 248, 0.95) 100%);
    border-radius: 20px;
    padding: 30px 25px;
    box-shadow: 
        0 8px 32px rgba(255, 77, 109, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.1);
    border: 3px solid #fff;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.message-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 179, 193, 0.05) 10px,
        rgba(255, 179, 193, 0.05) 20px
    );
    animation: shimmer 20s linear infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50%, 50%); }
}

.message-box::after {
    content: '💌';
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: floatEmoji 3s ease-in-out infinite;
}

@keyframes floatEmoji {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.typewriter-container {
    position: relative;
    z-index: 1;
}

.message-decorations {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.message-emoji {
    position: absolute;
    font-size: 2.5rem;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(255, 77, 109, 0.3));
}

.message-emoji.left {
    left: -10px;
    top: -10px;
    animation-delay: 0s;
}

.message-emoji.right {
    right: -10px;
    top: -10px;
    animation-delay: 1s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.message-hearts {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    font-size: 1.8rem;
}

.message-hearts span {
    display: inline-block;
    animation: heartBeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(255, 77, 109, 0.4));
}

.message-hearts span:nth-child(1) { animation-delay: 0s; }
.message-hearts span:nth-child(2) { animation-delay: 0.3s; }
.message-hearts span:nth-child(3) { animation-delay: 0.6s; }

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
}


.music-btn {
    min-width: 200px;
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-family: 'VT323', monospace;
    margin: 5px 0;
    padding: 10px 0;
    border-radius: 8px;
    border: none;
    background: #fff0f6;
    color: #ff1744;
    box-shadow: 0 2px 12px #ffb3c1aa;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-transform: uppercase;
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

#music-choices {
    position: relative;
    z-index: 200 !important;
}

.music-btn:hover {
    background: #ffb3c1;
    color: #fff;
    box-shadow: 0 4px 18px #ff1744aa;
    transform: translateY(-2px);
}


.typewriter-line {
    display: block;
    font-family: 'VT323', monospace;
    font-size: 2.4rem;
    color: #c2185b;
    text-align: center;
    margin: 20px auto;
    letter-spacing: 5px;
    line-height: 1.6;
    min-height: 1.2em;
    background: none;
    padding: 0;
    border: none;
    box-shadow: none;
    font-weight: bold;
    text-shadow: 
        3px 3px 0px #880e4f,
        -1px -1px 0px #f8bbd9,
        1px 0px 0px #880e4f,
        0px 1px 0px #880e4f;
    animation: fadeInText 0.5s ease-out;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .typewriter-line {
        font-size: 1.8rem;
        letter-spacing: 3px;
        margin: 16px auto;
    }
}

.typewriter-cursor {
    display: inline-block;
    width: 1ch;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Colorful, pixelized loading text */
.loading-pixel {
    font-size: 2.8rem;
    font-family: 'VT323', monospace;
    letter-spacing: 4px;
    text-shadow: 2px 2px 0 #fff, 0 2px 12px #ffb3c1, 0 0 18px #ff4d6d;
    margin-bottom: 8px;
    animation: rainbowText 2.5s linear infinite;
}

.rainbow-text {
    background: linear-gradient(90deg, #ff1744, #ff8fa3, #ffb300, #00e5ff, #ff1744 90%);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: rainbowText 3s linear infinite;
}

@keyframes rainbowText {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}


.pixel-heart svg {
    image-rendering: pixelated;
    width: 108px;
    height: 98px;
    display: block;
    filter: drop-shadow(0 0 12px #ffb3c1) drop-shadow(0 0 24px #ff4d6d44);
}

.pixel-heart {
    width: 108px;
    height: 98px;
    display: inline-block;
}


.animated-heart {
    animation: popIn 0.4s cubic-bezier(.2, 1.4, .6, 1.1);
    cursor: pointer;
    z-index: 2;
    filter: drop-shadow(0 0 8px #ffb3c1) drop-shadow(0 0 16px #ff4d6d44);
}


.fancy-heart {
    animation: heartSpin 1.2s cubic-bezier(.4, 1.6, .6, 1) alternate;
}

@keyframes heartSpin {
    0% {
        transform: scale(0.7) rotate(-18deg);
    }

    60% {
        transform: scale(1.1) rotate(12deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}


.heart-sparkle {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 60%, #ffb3c1 100%);
    opacity: 0.7;
    pointer-events: none;
    z-index: 3;
    animation: sparklePop 0.8s linear forwards;
    box-shadow: 0 0 8px #fff, 0 0 16px #ff4d6d88;
}

@keyframes sparklePop {
    0% {
        transform: scale(0.2);
        opacity: 0.7;
    }

    60% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(0.7);
        opacity: 0;
    }
}


.missed-heart {
    animation: missedHeart 0.4s cubic-bezier(.7, 0, 1, 1);
    filter: grayscale(0.7) blur(1px) brightness(0.7);
    opacity: 0.3 !important;
}

@keyframes missedHeart {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(0.7) rotate(24deg);
        opacity: 0.3;
    }
}


.teddy-bear-anim {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 18px 0 0 0;
    animation: bearBounceIn 1.2s cubic-bezier(.4, 1.6, .6, 1);
}

.teddy-bear-anim svg {
    filter: drop-shadow(0 0 12px #ffb3c1) drop-shadow(0 0 24px #ff4d6d44);
}

.bear-msg {
    font-size: 1.2rem;
    color: #a67c52;
    margin-top: 8px;
    text-align: center;
    font-family: 'VT323', monospace;
    text-shadow: 1px 1px 0 #fff, 0 2px 8px #ffb3c1;
}

@keyframes bearBounceIn {
    0% {
        transform: scale(0.2) translateY(80px);
        opacity: 0;
    }

    60% {
        transform: scale(1.1) translateY(-10px);
        opacity: 1;
    }

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

@keyframes popIn {
    0% {
        transform: scale(0.2);
        opacity: 0;
    }

    70% {
        transform: scale(1.2);
        opacity: 1;
    }

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

.bg-anim-heart {
    animation: floatBgHeart 10s linear infinite;
}

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

    50% {
        transform: translateY(-30px) scale(1.1);
    }

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


.big-reason {
    font-size: 2.1rem;
    line-height: 1.3;
    margin: 18px 0 12px 0;
    font-weight: bold;
    color: #b71c4f;
    text-shadow: 2px 2px 0px #fff, 0 2px 12px #ffb3c1;
}

:root {
    --primary: #ff4d6d;
    --bg: #ffb3c1;
    --dark-red: #d90429;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'VT323', monospace;
}

body {
    background: var(--bg);
    height: 100dvh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}


.pixel-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg) 0%, #ff9fb2 50%, var(--bg) 100%);
    background-size: 200% 200%;
    background-image:
        radial-gradient(var(--primary) 1px, transparent 1px),
        radial-gradient(#ff8fa3 0.5px, transparent 0.5px),
        radial-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 1px);
    background-size: 15px 15px, 30px 30px, 45px 45px;
    opacity: 0.4;
    z-index: -1;
    animation: pixelShift 40s ease-in-out infinite, gradientShift 15s ease-in-out infinite;
}

@keyframes pixelShift {
    0% {
        background-position: 0 0, 0 0, 0 0;
    }

    50% {
        background-position: 30px 30px, 60px 60px, 90px 90px;
    }

    100% {
        background-position: 0 0, 0 0, 0 0;
    }
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.floating-hearts {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-heart {
    position: absolute;
    color: white;
    opacity: 0.4;
    animation: floatUp 8s linear infinite, sway 4s ease-in-out infinite;
    font-size: 20px;
    /* Ensure text doesn't flow if position fails, but relying on absolute positioning */
    white-space: nowrap;
    filter: drop-shadow(0 0 8px rgba(255, 77, 109, 0.4)),
        drop-shadow(0 0 4px rgba(255, 77, 109, 0.6));
    text-shadow: 0 0 10px rgba(255, 77, 109, 0.8);
    font-weight: bold;
    z-index: -1 !important;
    pointer-events: none !important;
}

@keyframes floatUp {
    0% {
        transform: translateY(110vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-20vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes sway {

    0%,
    100% {
        transform: translateX(0px);
    }

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

    75% {
        transform: translateX(-40px);
    }
}


.pixel-star {
    position: fixed;
    color: #ffff99;
    font-size: 12px;
    pointer-events: none;
    z-index: 1;
    animation: starTwinkle 2s ease-in-out infinite;
    font-weight: bold;
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

#app-viewport {
    width: 100%;
    max-width: 450px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
    animation: viewportGlow 3s ease-in-out infinite;
}

@keyframes viewportGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(255, 77, 109, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 30px rgba(255, 77, 109, 0.6));
    }
}

.pixel-text {
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
    }

    50% {
        text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 77, 109, 0.4);
    }
}

.pixel-text.big {
    font-size: 2.5rem;
    text-shadow: 4px 4px 0px rgba(217, 4, 41, 0.3);
    animation: textGlow 2s ease-in-out infinite, textPulse 1.5s ease-in-out infinite;
}

@keyframes textPulse {

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

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

.env-title {
    font-size: 2rem;
    margin-bottom: 5px;
    animation: titlePulse 2s ease-in-out infinite;
}

.envelope-subtitle {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 15px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
    animation: subtitleGlow 3s ease-in-out infinite;
}

@keyframes titlePulse {

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

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

@keyframes subtitleGlow {

    0%,
    100% {
        opacity: 0.7;
        text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    }

    50% {
        opacity: 1;
        text-shadow: 2px 2px 10px rgba(255, 77, 109, 0.5);
    }
}


.pixel-card.expanded {
    background: rgba(255, 255, 255, 0.3);
    border: 4px solid white;
    border-radius: 15px;
    padding: 30px;
    width: 92%;
    backdrop-filter: blur(10px);
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.1);
    animation: cardEntrance 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), cardFloat 4s ease-in-out infinite;
    position: relative;
    margin-bottom: 100px;
}

.pixel-card.expanded::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, var(--primary), #ff8fa3, var(--primary));
    background-size: 200% 200%;
    border-radius: 15px;
    z-index: -1;
    opacity: 0;
    animation: cardGlow 3s ease-in-out infinite;
}


.pixel-video-wrapper {
    width: 96%;
    max-width: 600px;
    margin: 18px auto 0 auto;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    position: relative;
    box-shadow: 10px 10px 0px rgba(255, 77, 109, 0.12), inset 0 0 0 4px #fff;
}

.pixel-video {
    display: block;
    width: 100%;
    max-width: 580px;
    height: 320px;
    border-radius: 4px;
    overflow: hidden;
    object-fit: cover;
    border: 8px solid transparent;
    background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 6px), repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 6px);
    background-size: 12px 12px, 12px 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.pixel-video-wrapper::before {
    .env-photo {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
        border: 2.5px solid #ffb3c1;
        background: #ffdde7;
        overflow: hidden;
        opacity: 0;
        z-index: 2;
        transition: opacity 0.7s cubic-bezier(.4, 1.6, .6, 1), transform 0.7s cubic-bezier(.4, 1.6, .6, 1);
        transform: translateY(60px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
    }

    .env-wrapper.open .env-photo {
        opacity: 1;
        z-index: 5;
        transform: translateY(0);
    }

    .env-photo img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
        margin: auto;
        border-radius: 6px;
        box-shadow: none;
        border: none;
    }
}

.step {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: absolute;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.step.active {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
}


.vase-station {
    position: relative;
    width: 120px;
    height: 160px;
    margin: 10px auto 0 auto;
    display: flex;
    justify-content: center;
    animation: vaseFloat 4s ease-in-out infinite, vaseGlow 3s ease-in-out infinite;
}

@keyframes vaseFloat {

    0%,
    100% {
        transform: translateY(0px) rotateZ(0deg) scale(1);
    }

    25% {
        transform: translateY(-10px) rotateZ(0.3deg) scale(1.02);
    }

    50% {
        transform: translateY(-5px) rotateZ(-0.3deg) scale(1);
    }

    75% {
        transform: translateY(-8px) rotateZ(0.5deg) scale(1.01);
    }
}

@keyframes vaseGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 77, 109, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.6), inset -3px 0 8px rgba(0, 0, 0, 0.1), inset 3px 0 8px rgba(255, 192, 203, 0.3);
    }

    50% {
        box-shadow: 0 8px 25px rgba(255, 77, 109, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.8), inset -3px 0 8px rgba(0, 0, 0, 0.1), inset 3px 0 8px rgba(255, 192, 203, 0.5), 0 0 20px rgba(255, 192, 203, 0.5);
    }
}

.vase-glass {
    position: absolute;
    bottom: 0;
    width: 65%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 192, 203, 0.3) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-top: 2px solid white;
    border-radius: 1px 1px 20px 20px;
    z-index: 10;
    box-shadow:
        0 4px 15px rgba(255, 77, 109, 0.3),
        inset 0 0 15px rgba(255, 255, 255, 0.6),
        inset -3px 0 8px rgba(0, 0, 0, 0.1),
        inset 3px 0 8px rgba(255, 192, 203, 0.3);
    position: relative;
}

.vase-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.3) 2px,
            rgba(255, 255, 255, 0.3) 3px),
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.05) 2px,
            rgba(0, 0, 0, 0.05) 4px);
    border-radius: 6px 6px 30px 30px;
    pointer-events: none;
}

.vase-glass::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#flower-bed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.pixel-flower-svg {
    position: absolute;
    left: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%);
    animation: bloomSmooth 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, flowerSway 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
    will-change: transform;
    z-index: 6;
}

.ribbon {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    font-size: 1.8rem;
    animation: ribbonWave 3s ease-in-out infinite, ribbonPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 77, 109, 0.4));
}

@keyframes bloomSmooth {
    0% {
        transform: translateX(-50%) scale(0) rotate(var(--r));
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1) rotate(var(--r));
    }

    100% {
        transform: translateX(-50%) scale(1.3) rotate(var(--r));
        opacity: 1;
    }
}

@keyframes flowerSway {

    0%,
    100% {
        transform: translateX(-50%) rotate(var(--r));
    }

    25% {
        transform: translateX(calc(-50% + 4px)) rotate(calc(var(--r) + 2deg));
    }

    50% {
        transform: translateX(-50%) rotate(var(--r));
    }

    75% {
        transform: translateX(calc(-50% - 4px)) rotate(calc(var(--r) - 2deg));
    }
}

@keyframes ribbonWave {

    0%,
    100% {
        transform: translateX(-50%) rotateZ(0deg) scale(1);
    }

    25% {
        transform: translateX(-50%) rotateZ(8deg) scale(1.05);
    }

    50% {
        transform: translateX(-50%) rotateZ(0deg) scale(1);
    }

    75% {
        transform: translateX(-50%) rotateZ(-8deg) scale(1.05);
    }
}

@keyframes ribbonPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}


.pixel-loader-container {
    width: 220px;
    height: 30px;
    border: 4px solid white;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px;
    margin: 15px auto;
}

#bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #ff8fa3);
    box-shadow: inset -4px 0px 0px rgba(0, 0, 0, 0.2), 0 0 15px var(--primary);
    transition: width 0.025s linear;
}


#heart-trigger {
    position: relative;
    width: 180px;
    height: 180px;
    cursor: pointer;
    margin: 30px 0;
    animation: triggerFloat 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heart-icon {
    z-index: 5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: beat 0.8s infinite, heartGlow 2.5s ease-in-out infinite, heartPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 77, 109, 0.8));
    text-shadow: 0 0 20px rgba(255, 77, 109, 0.6);
}

.ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    opacity: 0.5;
    animation: ripple 2s infinite, rippleGlow 2.5s ease-in-out infinite, blinkingRipple 1.5s ease-in-out infinite;
}

@keyframes blinkingRipple {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes triggerFloat {

    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.03);
    }
}

@keyframes heartPulse {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(255, 77, 109, 0.6);
    }

    50% {
        text-shadow: 0 0 40px rgba(255, 77, 109, 1), 0 0 60px rgba(255, 192, 203, 0.6);
    }
}

@keyframes heartGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(255, 77, 109, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 30px rgba(255, 77, 109, 1)), drop-shadow(0 0 50px rgba(255, 192, 203, 0.8));
    }
}

@keyframes rippleGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 77, 109, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 77, 109, 0.9), 0 0 60px rgba(255, 192, 203, 0.5);
    }
}

.pulse-exit {
    animation: heartPulseExit 0.6s ease-in forwards;
}

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

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(0.3);
        opacity: 0;
    }
}


.pixel-dock {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    animation: dockSlideIn 0.6s ease-out;
}

@keyframes dockSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

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

.pixel-dock button,
.flower-btn {
    background: white;
    border: 2px solid var(--primary);
    padding: 12px 14px;
    font-size: 1.6rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(255, 77, 109, 0.25), inset 0 -2px 5px rgba(0, 0, 0, 0.05);
    animation: buttonBounce 0.5s ease-out;
}

@keyframes buttonBounce {
    0% {
        transform: scale(0.7) rotateZ(-15deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1) rotateZ(0deg);
        opacity: 1;
    }
}

.pixel-dock button:active,
.flower-btn:active {
    transform: scale(0.88) rotateZ(-3deg);
    box-shadow: inset 0 3px 8px rgba(255, 77, 109, 0.4), inset 0 -1px 3px rgba(0, 0, 0, 0.2);
}

.pixel-dock button:hover,
.flower-btn:hover {
    background: linear-gradient(135deg, var(--primary), #ff8fa3);
    color: white;
    transform: scale(1.12) translateY(-3px) rotateZ(5deg);
    box-shadow: 0 8px 20px rgba(255, 77, 109, 0.5), 0 0 25px rgba(255, 77, 109, 0.3);
}

.glow-btn {
    background: white;
    color: var(--primary);
    border: 3px solid var(--primary);
    padding: 12px 30px;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 6px 6px 0px var(--primary), 0 0 20px rgba(255, 77, 109, 0.3);
    margin-top: 20px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    font-weight: bold;
    position: relative;
    animation: glowButtonPulse 2s ease-in-out infinite;
}

@keyframes glowButtonPulse {

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

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

.glow-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), #ff8fa3, var(--primary));
    background-size: 200% 200%;
    border-radius: 5px;
    z-index: -1;
    opacity: 0;
    animation: buttonGlow 3s ease-in-out infinite;
}

.glow-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.2), 0 0 40px rgba(255, 77, 109, 0.8), 0 0 60px rgba(255, 192, 203, 0.4);
    transform: scale(1.08) translateY(-2px);
    transform: translateY(-2px);
}

.glow-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0px var(--primary), 0 0 15px rgba(255, 77, 109, 0.4);
}


#runaway-no {
    transition: all 0.3s ease-out;
}

#runaway-no.angry-dodge {
    animation: buttonShake 0.3s ease-in-out;
}

#runaway-no.button-angry {
    animation: buttonAngry 0.8s ease-in-out forwards;
    background: rgba(255, 77, 109, 0.3) !important;
    color: var(--dark-red) !important;
    border-color: var(--dark-red) !important;
}

#yes-btn.button-huge {
    animation: yesExpand 0.6s ease-out forwards;
}

@keyframes buttonShake {

    0%,
    100% {
        transform: rotateZ(0deg) scale(1);
    }

    10% {
        transform: rotateZ(-8deg) scale(0.95);
    }

    20% {
        transform: rotateZ(8deg) scale(0.95);
    }

    30% {
        transform: rotateZ(-8deg) scale(0.95);
    }

    40% {
        transform: rotateZ(8deg) scale(0.95);
    }

    50% {
        transform: rotateZ(0deg) scale(1);
    }
}

@keyframes buttonAngry {
    0% {
        transform: scale(1) rotateZ(0deg);
        background: rgba(255, 255, 255, 0.7);
        opacity: 1;
    }

    50% {
        transform: scale(0.8) rotateZ(-5deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(0.5) rotateZ(360deg);
        background: rgba(255, 77, 109, 0.3);
        opacity: 0;
    }
}

@keyframes yesExpand {
    0% {
        font-size: 1.6rem;
    }

    100% {
        font-size: 2.2rem;
    }
}

@keyframes angerBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate(calc(cos(var(--angle)) * 120px),
                calc(sin(var(--angle)) * 120px)) scale(0) rotate(360deg);
    }
}

@keyframes pacmanAttack {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: translate(100px, -50px) scale(1.1) rotate(-15deg);
    }

    100% {
        opacity: 0.7;
        transform: translate(0, 0) scale(1) rotate(0deg);
        filter: hue-rotate(10deg) brightness(1.3);
    }
}

@keyframes buttonGlow {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 0.3;
    }
}

.alt-btn {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 77, 109, 0.5);
}

.alt-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.arrow-btn {
    background: white;
    border: 2px solid var(--primary);
    padding: 8px 15px;
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 5px;
    margin: 0 10px;
    transition: all 0.2s;
    color: var(--primary);
}

.arrow-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

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

input {
    padding: 12px;
    width: 90%;
    border: 3px solid white;
    background: rgba(255, 255, 255, 0.6);
    font-size: 1.3rem;
    text-align: center;
    margin: 10px 0;
    outline: none;
    transition: all 0.3s;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(255, 77, 109, 0.1);
}

input:focus {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.6), inset 0 0 10px rgba(255, 77, 109, 0.2);
    border-color: var(--primary);
    transform: scale(1.02);
}





.pixel-flower-svg {
    transition: transform 0.35s ease;
}

.pixel-flower-svg:hover {
    transform: translateY(-6px) scale(1.08);
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25));
}

.pixel-dock button {
    transform-origin: center;
}

.pixel-dock button:hover {
    animation: dockButtonPop 0.45s cubic-bezier(.2, .8, .2, 1);
}

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

    50% {
        transform: scale(1.12) rotate(-6deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.pixel-video {
    transition: transform 0.35s ease, filter 0.35s ease;
}

.pixel-video:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 18px 40px rgba(255, 77, 109, 0.25));
}


@media (max-width: 600px) {
    .pixel-video {
        height: 220px;
    }

    .pixel-heart svg {
        width: 88px;
        height: 78px;
    }
}


.game-link {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 60;
    background: white;
    color: var(--primary);
    border: 3px solid var(--primary);
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 6px 6px 0px var(--primary), 0 0 18px rgba(255, 77, 109, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.game-link:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 10px 10px 0px rgba(217, 4, 41, 0.15), 0 0 36px rgba(255, 77, 109, 0.4);
}

.game-root {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, 
        #ffc0cb 0%, 
        #ffb3d9 25%, 
        #ffa6c9 50%, 
        #ff9cc2 75%, 
        #ffb3d9 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Hearts Background */
.game-bg-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.game-floating-heart {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: floatUpGame 15s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(255, 77, 109, 0.3));
}

@keyframes floatUpGame {
    0% {
        transform: translateY(100vh) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) rotate(360deg) translateX(var(--sway, 0));
        opacity: 0;
    }
}

/* Sparkles Background */
.game-bg-sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.game-sparkle {
    position: absolute;
    font-size: 1rem;
    animation: sparkleGame 3s ease-in-out infinite;
    opacity: 0;
}

@keyframes sparkleGame {
    0%, 100% { 
        opacity: 0; 
        transform: scale(0.5) rotate(0deg);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.2) rotate(180deg);
    }
}

/* Decorative Corners */
.game-root::before,
.game-root::after {
    content: '';
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulse 4s ease-in-out infinite;
}

.game-root::before {
    top: -100px;
    left: -100px;
}

.game-root::after {
    bottom: -100px;
    right: -100px;
    animation-delay: 2s;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.5;
    }
}

/* Pixel Pattern Overlay */
.game-root {
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Floating Pixel Squares */
@keyframes floatPixel {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 0;
    }
}

.game-bg-hearts::before,
.game-bg-hearts::after {
    content: '💝';
    position: absolute;
    font-size: 3rem;
    opacity: 0.2;
    animation: floatPixel 8s ease-in-out infinite;
}

.game-bg-hearts::before {
    top: 10%;
    left: 5%;
    animation-delay: 1s;
}

.game-bg-hearts::after {
    top: 20%;
    right: 8%;
    animation-delay: 3s;
}

/* Corner Decorations */
.game-corner-deco {
    position: fixed;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.game-corner-deco.top-left {
    top: 20px;
    left: 20px;
    animation: bobFloat 4s ease-in-out infinite;
}

.game-corner-deco.bottom-right {
    bottom: 20px;
    right: 20px;
    animation: bobFloat 4s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes bobFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

@media (max-width: 600px) {
    .game-corner-deco {
        opacity: 0.4;
    }
    
    .game-corner-deco svg {
        width: 50px;
        height: 50px;
    }
    
    .game-corner-deco.top-left {
        top: 10px;
        left: 10px;
    }
    
    .game-corner-deco.bottom-right {
        bottom: 10px;
        right: 10px;
    }
}

.game-card {
    width: 95%;
    max-width: 720px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 18px;
    border: 4px solid #fff;
    box-shadow: 12px 12px 0 rgba(255, 77, 109, 0.08);
    position: relative;
    z-index: 10;
}

/* Orbiting hearts around the card */
.game-card::before {
    content: '💕';
    position: absolute;
    top: -20px;
    left: 50%;
    font-size: 1.5rem;
    animation: orbit1 8s linear infinite;
    transform-origin: 0 370px;
    opacity: 0.5;
}

.game-card::after {
    content: '💖';
    position: absolute;
    top: -20px;
    left: 50%;
    font-size: 1.5rem;
    animation: orbit2 8s linear infinite;
    transform-origin: 0 370px;
    opacity: 0.5;
}

@keyframes orbit1 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes orbit2 {
    from {
        transform: rotate(180deg);
    }
    to {
        transform: rotate(540deg);
    }
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.game-area {
    position: relative;
    width: 100%;
    height: 420px;
    margin-top: 14px;
    background: linear-gradient(180deg, #fff6f8, #ffeef4);
    border: 4px dashed rgba(255, 192, 203, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.quiz-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.game-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

.score-bubble {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(255, 77, 109, 0.2);
}

.timer-bubble {
    background: white;
    border: 2px solid var(--primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: bold;
}

.game-heart {
    position: absolute;
    width: 56px;
    height: 46px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    image-rendering: pixelated;
    transition: transform 0.12s ease;
}

.game-heart svg {
    width: 56px;
    height: 46px;
    image-rendering: pixelated;
    display: block;
}

.game-heart:active {
    transform: scale(0.9);
}

.game-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.game-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 50;
}

.game-modal {
    background: white;
    padding: 18px;
    border-radius: 10px;
    text-align: center;
}

.quiz-subtitle {
    font-size: 0.9rem;
    color: #b71c4f;
    margin-top: 2px;
}

.quiz-panel {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 18px 16px;
    border: 3px solid #ffb3c1;
    box-shadow: 0 10px 24px rgba(255, 77, 109, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    animation: quizPanelIn 0.4s ease-out forwards;
}

.quiz-panel-active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.quiz-question {
    font-size: 1.4rem;
    text-align: center;
}

.quiz-helper {
    font-size: 0.95rem;
    text-align: center;
    color: #b71c4f;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

.quiz-option-btn {
    width: 100%;
    font-size: 1.2rem;
    padding: 8px 4px;
}

.quiz-pulse-ring {
    position: absolute;
    inset: 10px;
    border-radius: 16px;
    border: 3px solid rgba(255, 77, 109, 0.6);
    pointer-events: none;
    animation: quizPulse 0.6s ease-out forwards;
}

.quiz-correct-flash {
    animation: quizCorrect 0.3s ease-out;
}

.quiz-wrong-shake {
    animation: quizWrong 0.4s ease-out;
}

@keyframes quizPanelIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes quizPulse {
    0% {
        opacity: 0.7;
        transform: scale(0.9);
    }
    100% {
        opacity: 0;
        transform: scale(1.1);
    }
}

@keyframes quizCorrect {
    0% {
        box-shadow: 0 0 0 rgba(76, 175, 80, 0.0);
    }
    100% {
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.6);
    }
}

@keyframes quizWrong {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
}

@media (max-width: 600px) {
    .game-card {
        padding: 12px;
        width: 98%;
    }

    .game-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .game-stats {
        justify-content: center;
        width: 100%;
    }

    .game-area {
        height: 300px;
        margin-top: 10px;
    }

    .game-controls {
        justify-content: center;
        width: 100%;
    }

    .game-controls .glow-btn {
        width: auto !important;
        flex: 1;
        padding: 10px 5px !important;
        font-size: 1.1rem !important;
        min-width: 0;
    }

    .game-heart {
        width: 44px;
        height: 36px;
    }

    .game-heart svg {
        width: 44px;
        height: 36px;
    }
}

.hidden {
    display: none !important;
}

.pulse {
    animation: beat 1s infinite;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.final-img {
    width: 100%;
    border: 6px solid white;
    border-radius: 12px;
    margin-top: 20px;
}

@keyframes beat {

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

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

@keyframes shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}


.sparkle {
    position: fixed;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: -1 !important;
    animation: sparkleFloat 3s ease-out forwards;
}

@keyframes sparkleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5) rotate(360deg);
    }
}

.firework-particle {
    position: fixed;
    font-size: 1.2rem;
    animation: fireworkBurst 2s ease-out forwards;
}

@keyframes fireworkBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(calc(cos(var(--angle)) * 150px), calc(sin(var(--angle)) * 150px)) scale(0);
    }
}

@keyframes pixelFloat {
    0% {
        opacity: 0.2;
        transform: translateY(0) translateX(0);
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translateY(-80px) translateX(30px) rotate(360deg);
    }
}


.single-envelope-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    width: 100%;
    min-height: 300px;
}

.env-wrapper.single-env {
    width: 320px !important;
    max-width: 90vw !important;
    cursor: pointer;
    transition: transform 0.3s;
}

.env-wrapper.single-env:hover {
    transform: scale(1.05);
}

.single-env .env-main {
    height: 220px !important;
    min-height: 220px !important;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.polaroid-frame {
    background: white;
    padding: 12px 12px 40px 12px;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 85vw;
    max-height: 70vh;
    object-fit: contain;
    transform: rotate(-2deg);
}


.click-hint {
    color: white;
    margin-top: 15px;
    font-size: 1.2rem;
    animation: textGlow 2s infinite;
}



.envelope-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 600px;
    margin: 20px auto;
}

.env-wrapper {
    flex: 0 0 auto;
    width: 160px !important;
    margin: 5px;
}

.env-main {
    height: 140px !important;
    min-height: 140px !important;
}

.env-photo {
    padding: 5px !important;
    background: black;
}

.env-photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 4px;
    background: white;
}

.modal-overlay,
.single-envelope-container,
.single-env {
    display: none !important;
}


#nav-to-pw {
    margin-top: 20px;
    margin-bottom: 50px;
}


@media (max-width: 600px) {
    body {
        overflow-y: auto;
        padding-bottom: 0;
    }

    #app-viewport {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 100dvh;
        width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

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

        width: 100%;
        padding: 40px 20px 0 20px;
        margin: auto 0;

        min-height: 80dvh;

        box-sizing: border-box;
    }

    .envelope-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 90vw;
        margin: 20px auto;
    }

    .env-main {
        aspect-ratio: 1.4;
        height: auto !important;
    }

    #nav-to-pw {
        margin-top: 50px !important;
        margin-bottom: 200px !important;
    }


    .pixel-dock {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        margin-bottom: 25px;
    }

    .flower-btn {
        width: auto !important;
        min-width: 65px;
        padding: 10px 12px !important;
        font-size: 1.4rem !important;
    }
}


.game-link {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 99999;
    background: #ff4d6d;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.4);
    border: 2px solid white;
    transition: transform 0.2s, background 0.2s;
}

.game-link:hover {
    transform: scale(1.05);
    background: #ff1744;
}

@media (max-width: 600px) {
    .game-link {
        font-size: 1rem;
        padding: 6px 12px;
        top: 10px;
        right: 10px;
    }
}

.hidden {
    display: none !important;
}

/* Volume Control Styles */
.volume-control {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-icon {
    background: linear-gradient(135deg, #ff4d6d 0%, #ff1744 100%);
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 77, 109, 0.5);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 77, 109, 0.7);
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 25px;
    border: 3px solid #ff4d6d;
    box-shadow: 0 4px 20px rgba(255, 77, 109, 0.3);
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.volume-control:hover .volume-slider-container,
.volume-slider-container:focus-within {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.volume-slider {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #ff1744 0%, #ff4d6d 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid #ff1744;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 23, 68, 0.4);
    transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid #ff1744;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 23, 68, 0.4);
    transition: transform 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.volume-percentage {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: #ff1744;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

/* Page Transition Styles */
.step {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.step.active {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.step.hidden {
    animation: fadeOutDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Button Click Animation */
.glow-btn,
.music-btn,
.arrow-btn,
.flower-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-btn:active,
.music-btn:active,
.arrow-btn:active,
.flower-btn:active {
    transform: scale(0.95);
}

.glow-btn::after,
.music-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.glow-btn:active::after,
.music-btn:active::after {
    width: 300px;
    height: 300px;
}

@media (max-width: 600px) {
    .volume-control {
        top: 15px;
        left: 15px;
    }
    
    .volume-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .volume-slider {
        width: 80px;
    }
    
    .volume-percentage {
        font-size: 1rem;
        min-width: 35px;
    }
}