:root {
    --sunflower-brown: #704214;
    --petal-yellow: #FFD700;
    --petal-yellow-dark: #FFC125;
    --stem-green: #2E7D32;
    --leaf-green: #4CAF50;
    --heart-red: #ff3158;
    --text-pink: #FF4081;
    --cake-vanilla: #FFF5E4;
    --cake-strawberry: #FFCCD5;
    --cake-cream: #FFF0F5;
    --ribbon-color: #FF69B4;
    --sparkle-color: #FFD700;
    --strawberry-color: #FF4040;
    --blueberry-color: #4B0082;
    --chocolate-sprinkle: #3C2005;
    --edible-flower: #FFB6C1;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, #e0f7fa, #80deea, #4dd0e1);
    font-family: 'Arial', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    overflow-y: auto; /* Cho phép cuộn dọc để xem toàn bộ nội dung */
}

.container {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 20px; /* Thêm padding để tránh nội dung sát mép */
    width: 100%;
    box-sizing: border-box;
}

/* Sunflower base styles */
.sunflower, .bouquet-sunflower {
    position: absolute;
    z-index: 10;
    animation: sunflower-fall 15s linear infinite;
}

@keyframes sunflower-fall {
    0% {
        transform: translateY(-100px) rotate(0deg) scale(var(--scale, 0.5));
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg) scale(var(--scale, 0.5));
        opacity: 0;
    }
}

.sunflower-center {
    background: radial-gradient(circle, #8B4513 30%, #704214 70%);
    border-radius: 50%;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sunflower-petals {
    position: absolute;
    transform-origin: center center;
}

.petal {
    position: absolute;
    background: linear-gradient(to bottom, var(--petal-yellow), var(--petal-yellow-dark));
    border-radius: 50% 70% 35% 70%;
    transform-origin: bottom center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,0.1));
    animation: petalSpin 4s ease-in-out infinite;
    animation-delay: calc(var(--petal-index) * 0.1s);
}

/* Orbiting leaf styles */
.orbiting-leaf {
    position: absolute;
    width: var(--leaf-width, 20px);
    height: var(--leaf-height, 10px);
    background-color: var(--leaf-green);
    border-radius: 50% 50% 0 50%;
    transform-origin: center center;
    animation: leafOrbit var(--orbit-speed, 6s) linear infinite;
    z-index: 1;
    animation-direction: var(--orbit-direction, normal);
}

/* Bouquet sunflowers */
.sunflower-bouquet {
    width: 250px; /* Giảm kích thước bó hoa */
    height: 250px;
    margin: 20px auto;
    position: relative;
    animation: bouquet-float 4s ease-in-out infinite;
}

.bouquet-sunflower {
    animation: gentle-rotate var(--rotate-speed, 15s) ease-in-out infinite;
}

.bouquet-sunflower .sunflower-center {
    width: 70px;
    height: 70px;
    top: 40px;
    left: 15px;
    animation: pulse 3s infinite;
}

.bouquet-sunflower .sunflower-petals {
    top: -5px;
    left: -5px;
    width: 110px;
    height: 110px;
}

.bouquet-sunflower .petal {
    width: 22px;
    height: 50px;
    top: 30px;
    left: 44px;
}

.bouquet-sunflower .orbiting-leaf {
    top: 25px;
    left: 45px;
}

.bouquet-stem {
    position: absolute;
    width: 12px;
    height: 160px;
    background-color: var(--stem-green);
    bottom: -140px;
    left: 145px;
    border-radius: 5px;
    transform-origin: top center;
    animation: stemSway 4s ease-in-out infinite;
}

.bouquet-leaf {
    position: absolute;
    width: 40px;
    height: 20px;
    background-color: var(--leaf-green);
    border-radius: 20px 20px 0 20px;
    transform: rotate(-30deg);
    bottom: -60px;
    left: 155px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bouquet-leaf:nth-child(8) {
    transform: scaleX(-1) rotate(-30deg);
    left: 105px;
}

/* Petal rotations */
.petal:nth-child(1) { --rotate-deg: 0deg; --petal-index: 1; }
.petal:nth-child(2) { --rotate-deg: 18deg; --petal-index: 2; }
.petal:nth-child(3) { --rotate-deg: 36deg; --petal-index: 3; }
.petal:nth-child(4) { --rotate-deg: 54deg; --petal-index: 4; }
.petal:nth-child(5) { --rotate-deg: 72deg; --petal-index: 5; }
.petal:nth-child(6) { --rotate-deg: 90deg; --petal-index: 6; }
.petal:nth-child(7) { --rotate-deg: 108deg; --petal-index: 7; }
.petal:nth-child(8) { --rotate-deg: 126deg; --petal-index: 8; }
.petal:nth-child(9) { --rotate-deg: 144deg; --petal-index: 9; }
.petal:nth-child(10) { --rotate-deg: 162deg; --petal-index: 10; }
.petal:nth-child(11) { --rotate-deg: 180deg; --petal-index: 11; }
.petal:nth-child(12) { --rotate-deg: 198deg; --petal-index: 12; }
.petal:nth-child(13) { --rotate-deg: 216deg; --petal-index: 13; }
.petal:nth-child(14) { --rotate-deg: 234deg; --petal-index: 14; }
.petal:nth-child(15) { --rotate-deg: 252deg; --petal-index: 15; }
.petal:nth-child(16) { --rotate-deg: 270deg; --petal-index: 16; }
.petal:nth-child(17) { --rotate-deg: 288deg; --petal-index: 17; }
.petal:nth-child(18) { --rotate-deg: 306deg; --petal-index: 18; }
.petal:nth-child(19) { --rotate-deg: 324deg; --petal-index: 19; }
.petal:nth-child(20) { --rotate-deg: 342deg; --petal-index: 20; }

/* Animations */
@keyframes bouquet-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes stemSway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(3deg); }
}

@keyframes petalSpin {
    0%, 100% { transform: rotate(var(--rotate-deg)) translateY(-35px) rotateZ(0deg); }
    50% { transform: rotate(var(--rotate-deg)) translateY(-35px) rotateZ(10deg); }
}

@keyframes leafOrbit {
    0% { transform: rotate(0deg) translateX(var(--orbit-radius-x, 50px)) translateY(var(--orbit-radius-y, 30px)) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(var(--orbit-radius-x, 50px)) translateY(var(--orbit-radius-y, 30px)) rotate(360deg); }
}

@keyframes gentle-rotate {
    0%, 100% { transform: rotate(-5deg) scale(var(--scale, 1)); }
    50% { transform: rotate(5deg) scale(var(--scale, 1)); }
}

/* Cake styles */
.regular-cake {
    width: 220px; /* Giảm kích thước bánh */
    height: 180px;
    position: relative;
    margin: 40px auto 20px;
    perspective: 1200px;
    animation: cake-glow 4s ease-in-out infinite;
    z-index: 5;
}

.cake-board {
    position: absolute;
    width: 280px;
    height: 20px;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to right, #FFDAB9, #FFE4C4);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.cake-layer {
    position: absolute;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    transform: rotateX(12deg);
    transform-origin: bottom;
}

.cake-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: radial-gradient(circle, var(--cake-cream) 50%, transparent 100%);
    border-radius: 15px 15px 0 0;
    z-index: 2;
}

.middle-layer {
    height: 90px;
    bottom: 0;
    width: 220px;
    left: 20px;
    background: linear-gradient(to bottom, var(--cake-vanilla), #FFE4B5);
    border: 3px solid #E6C78A;
}

.top-layer {
    height: 70px;
    bottom: 90px;
    width: 180px;
    left: 40px;
    background: linear-gradient(to bottom, var(--cake-strawberry), #FF99AA);
    border: 3px solid #FF758A;
}

/* Cream decorations */
.cream-decoration {
    position: absolute;
    background: radial-gradient(circle, var(--cake-cream) 50%, transparent 100%);
    border-radius: 50%;
    z-index: 5;
    animation: cream-wobble 2.5s ease-in-out infinite;
}

.cream-decoration.top {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.cream-decoration.side {
    width: 25px;
    height: 25px;
    top: 15px;
    left: 15px;
}

.cream-decoration.side.right {
    left: auto;
    right: 15px;
}

/* Ribbon */
.ribbon {
    position: absolute;
    width: 100%;
    height: 25px;
    background: linear-gradient(to right, var(--ribbon-color), #FF1493);
    top: 10px;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.ribbon::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 25px;
    background: var(--ribbon-color);
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    z-index: -1;
}

/* Fruit decorations */
.fruit-decoration {
    position: absolute;
    z-index: 6;
    animation: fruit-sparkle 3s infinite;
}

.fruit-decoration.strawberry {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--strawberry-color) 60%, #CC0000 100%);
    clip-path: polygon(50% 0%, 70% 30%, 100% 70%, 50% 100%, 0% 70%, 30% 30%);
    top: -15px;
    left: 20%;
}

.fruit-decoration.strawberry.right {
    left: auto;
    right: 20%;
}

.fruit-decoration.blueberry {
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, var(--blueberry-color) 50%, #2E0854 100%);
    border-radius: 50%;
    top: 0;
    left: 30%;
}

.fruit-decoration.blueberry.right {
    left: auto;
    right: 30%;
}

/* Chocolate sprinkles */
.chocolate-sprinkle {
    position: absolute;
    width: 10px;
    height: 3px;
    background: var(--chocolate-sprinkle);
    border-radius: 2px;
    z-index: 6;
    animation: fruit-sparkle 2s infinite;
}

.chocolate-sprinkle.one {
    top: -5px;
    left: 40%;
    transform: rotate(45deg);
}

.chocolate-sprinkle.two {
    top: -5px;
    left: 60%;
    transform: rotate(-45deg);
}

/* Edible flowers */
.edible-flower {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--edible-flower) 30%, #FF9999 70%);
    border-radius: 50%;
    z-index: 6;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
    animation: flower-sway 3s ease-in-out infinite;
}

.edible-flower.top {
    top: -10px;
    left: 25%;
}

.edible-flower.top.right {
    left: auto;
    right: 25%;
}

/* Candles */
.candle {
    width: 12px;
    height: 60px;
    background: linear-gradient(to bottom, #F0FFF0, #98FB98);
    position: absolute;
    top: -24px; /* Điều chỉnh vị trí trên cùng của nến */
    z-index: 7;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateZ(10px);
}

.candle::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 25px;
    background: radial-gradient(circle, #FF4500 20%, #FFA500 50%, transparent 80%);
    border-radius: 50% 50% 40% 40%;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    animation: candle-flicker 0.4s infinite alternate;
}

.candle::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--sparkle-color);
    border-radius: 50%;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    animation: sparkle 1.2s infinite;
}

/* Điều chỉnh vị trí các nến */
.candle1 { left: 60%; transform: translateX(-50%) translateX(-30px); }
.candle2 { left: 60%; transform: translateX(-50%); }
.candle3 { left: 60%; transform: translateX(-50%) translateX(30px); }

/* Cake animations */
@keyframes cake-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

@keyframes cream-wobble {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

@keyframes candle-flicker {
    0% { transform: translateX(-50%) scale(1); }
    100% { transform: translateX(-50%) scale(1.15); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(0.5); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

@keyframes fruit-sparkle {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

@keyframes flower-sway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(5deg); }
}

/* Other styles */
h1 {
    font-size: 2.5rem; /* Giảm kích thước phông chữ mặc định */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    margin: 10px 0; /* Điều chỉnh lề */
    animation: pulse 2s infinite;
    color: var(--text-pink);
}

h2 {
    font-size: 1.8rem; /* Giảm kích thước phông chữ mặc định */
    margin: 10px 0;
    animation: colorChange 4s infinite;
}

.message {
    font-size: 1.1rem;
    max-width: 90%; /* Giảm chiều rộng tối đa */
    margin: 15px auto;
    line-height: 1.5;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 10px;
    animation: fadeIn 2s;
    color: #333;
}

.heart {
    position: relative;
    width: 80px; /* Giảm kích thước trái tim */
    height: 70px;
    margin: 20px auto;
    animation: heartbeat 1.5s infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 100;
}

.heart:hover {
    transform: scale(1.1);
}

.heart:before,
.heart:after {
    content: "";
    position: absolute;
    left: 50px;
    top: 0;
    width: 50px;
    height: 80px;
    background: var(--heart-red);
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.love-message {
    position: absolute;
    font-size: 0;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
    transition: font-size 0.5s ease;
    pointer-events: none;
    z-index: 101;
    white-space: nowrap;
}

.love-message.active {
    font-size: 24px;
    animation: lovePopup 2s forwards;
}

.floating-text {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    opacity: 0;
    animation: floatIn 5s ease-in-out infinite;
    color: var(--text-pink);
    text-shadow: 0 0 5px white;
}

.floating-text:nth-child(1) { animation-delay: 0s; }
.floating-text:nth-child(2) { animation-delay: 1s; }
.floating-text:nth-child(3) { animation-delay: 2s; }
.floating-text:nth-child(4) { animation-delay: 3s; }
.floating-text:nth-child(5) { animation-delay: 4s; }

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes colorChange {
    0% { color: var(--heart-red); }
    33% { color: #9c27b0; }
    66% { color: #5bffef; }
    100% { color: var(--heart-red); }
}

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

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    40% { transform: scale(1); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes lovePopup {
    0% { font-size: 0; opacity: 0; transform: scale(0.5); }
    20% { font-size: 24px; opacity: 1; transform: scale(1); }
    80% { font-size: 28px; opacity: 1; transform: scale(1.1) rotate(var(--rotation)); }
    100% { font-size: 50px; opacity: 0; transform: translateY(-100px) rotate(var(--rotation)); }
}

@keyframes flicker {
    0%, 100% { 
        transform: scale(1.0);
        box-shadow: 0 0 10px 5px rgba(255, 128, 0, 0.6),
                    0 0 20px 10px rgba(255, 128, 0, 0.4);
    }
    50% { 
        transform: scale(0.95);
        box-shadow: 0 0 8px 4px rgba(255, 128, 0, 0.6),
                    0 0 16px 8px rgba(255, 128, 0, 0.4);
    }
}

@keyframes floatIn {
    0%, 100% { opacity: 0; transform: translateY(50px); }
    20%, 80% { opacity: 1; transform: translateY(0); }
}

/* Gate container styles */
.gate-container {
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 90%;
    width: 400px;
    margin: 20px;
    transition: transform 0.3s ease;
}

.gate-container h1 {
    color: var(--text-pink);
    margin-bottom: 15px;
    font-size: 2rem;
}

.progress {
    font-size: 1rem;
    color: #555;
    margin-bottom: 15px;
}

.question {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
}

input {
    padding: 10px;
    width: 100%;
    max-width: 300px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

input:focus {
    border-color: var(--text-pink);
    box-shadow: 0 0 5px rgba(255, 64, 129, 0.3);
    outline: none;
}

button {
    background-color: var(--text-pink);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: #e91e63;
    transform: scale(1.05);
}

.error {
    color: #f44336;
    margin: 10px 0;
    font-size: 0.9rem;
    display: none;
}

.hint {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Success message */
.success {
    color: #4CAF50;
    margin: 10px 0;
    font-size: 1rem;
    font-weight: bold;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.success[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* Firework styles */
.firework {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: firework-burst 2s ease-out forwards;
    z-index: 1000;
}

@keyframes firework-burst {
    0% {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy))) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translate(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy))) scale(0);
        opacity: 0;
    }
}

/* Popup image animation */
.popup-image {
    position: absolute;
    width: 60px;
    height: 60px;
    object-fit: cover;
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
    z-index: 1000;
    animation: image-popup 3.5s ease-in-out forwards;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

/* Shape styles for popup image */
.popup-image.square {
    border-radius: 12px;
}

.popup-image.triangle {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.popup-image.diamond {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.popup-image.heart {
    clip-path: path('M 50 15 C 30 0, 0 20, 0 40 C 0 60, 20 80, 50 100 C 80 80, 100 60, 100 40 C 100 20, 70 0, 50 15 Z');
}

.popup-image.pentagon {
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.popup-image.hexagon {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

@keyframes image-popup {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    }
    40% {
        transform: translate(-50%, -50%) scale(1.5) rotate(8deg);
        opacity: 1;
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
    }
    80% {
        transform: translate(-50%, -50%) scale(2.0) rotate(12deg);
        opacity: 1;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5) rotate(15deg);
        opacity: 0;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
}

/* Falling petals */
.falling-petal {
    position: absolute;
    top: -30px;
    background-color: var(--petal-yellow);
    border-radius: 50% 70% 35% 70%;
    opacity: 0.8;
    z-index: 1;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    animation: falling-petal 10s linear forwards;
}

@keyframes falling-petal {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(50vh) rotate(180deg);
        opacity: 0.9;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Center pattern */
.center-pattern {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 10%),
        radial-gradient(circle at 70% 30%, rgba(255,255,255,0.1) 0%, transparent 10%),
        radial-gradient(circle at 30% 70%, rgba(255,255,255,0.1) 0%, transparent 10%),
        radial-gradient(circle at 70% 70%, rgba(255,255,255,0.1) 0%, transparent 10%),
        radial-gradient(circle, transparent 30%, rgba(0,0,0,0.15) 90%);
    border-radius: 50%;
}

/* Sunflower leaf */
.sunflower-leaf {
    position: absolute;
    width: 25px;
    height: 15px;
    background-color: var(--leaf-green);
    border-radius: 50% 50% 0 50%;
    transform: rotate(-30deg);
    bottom: 40px;
    left: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Random message */
.random-message {
    position: absolute;
    font-size: 28px;
    font-weight: bold;
    color: var(--heart-red);
    text-shadow: 0 0 5px white;
    opacity: 0;
    transform: scale(0.5) rotate(var(--rotation));
    animation: message-popup 2s forwards;
    z-index: 1000;
    white-space: nowrap;
}

@keyframes message-popup {
    0% { opacity: 0; transform: scale(0.5) rotate(var(--rotation)); }
    20% { opacity: 1; transform: scale(1) rotate(var(--rotation)); }
    80% { opacity: 1; transform: scale(1.1) rotate(var(--rotation)); }
    100% { opacity: 0; transform: scale(1.5) translateY(-100px) rotate(var(--rotation)); }
}

/* Hover effects */
.bouquet-sunflower:hover {
    animation: gentle-rotate 3s ease-in-out infinite;
    filter: brightness(1.1);
    transform: scale(var(--scale)) !important;
}

.bouquet-sunflower:hover .petal {
    filter: brightness(1.1) drop-shadow(0 3px 2px rgba(0,0,0,0.15));
}

/* Media query cho mobile */
@media (max-width: 600px) {
    /* Đảm bảo body có thể cuộn */
    body {
        overflow-y: auto;
        height: auto; /* Bỏ giới hạn chiều cao cố định */
        padding: 10px;
    }

    /* Điều chỉnh container */
    .container {
        padding: 15px;
        min-height: 100vh; /* Đảm bảo container đủ cao */
    }

    /* Điều chỉnh tiêu đề */
    h1 {
        font-size: 1.8rem; /* Giảm kích thước phông chữ */
        margin: 10px 0;
    }

    h2 {
        font-size: 1.3rem;
        margin: 8px 0;
    }

    /* Điều chỉnh message */
    .message {
        font-size: 0.9rem;
        padding: 12px;
        margin: 10px auto;
        max-width: 95%;
    }

    /* Điều chỉnh bó hoa */
    .sunflower-bouquet {
        transform: scale(0.65); /* Thu nhỏ hơn nữa */
        margin: 15px auto;
    }

    /* Điều chỉnh bánh */
    .regular-cake {
        transform: scale(0.7);
        margin: 20px auto;
    }

    /* Điều chỉnh trái tim */
    .heart {
        transform: scale(0.7);
        margin: 15px auto;
    }

    /* Điều chỉnh hoa rơi */
    .sunflower {
        --scale: 0.25; /* Thu nhỏ hoa rơi */
    }

    .sunflower .petal {
        width: 12px;
        height: 25px;
    }

    .sunflower .sunflower-center {
        top: -7px;
        width: 60px;
        height: 60px;
        left: -25px;
    }

    .orbiting-leaf {
        --leaf-width: 8px !important;
        --leaf-height: 4px !important;
    }

    /* Tắt animation cho hiệu suất */
    .bouquet-sunflower:hover .petal,
    .bouquet-sunflower:hover {
        animation: none;
        transform: none;
        filter: none;
    }

    /* Điều chỉnh gate-container */
    .gate-container {
        padding: 15px;
        width: 90%;
        margin: 10px;
        transform: scale(0.95);
    }

    .gate-container h1 {
        font-size: 1.5rem;
    }

    .progress {
        font-size: 0.9rem;
    }

    .question {
        font-size: 1rem;
    }

    input {
        padding: 8px;
        font-size: 0.9rem;
        max-width: 100%;
    }

    button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .error {
        font-size: 0.8rem;
    }

    .hint {
        font-size: 0.8rem;
    }

    .success {
        font-size: 0.9rem;
    }

    .firework {
        width: 8px;
        height: 8px;
    }

    .popup-image {
        width: 40px;
        height: 40px;
        border: 1px solid rgba(255, 255, 255, 0.8);
    }

    .popup-image.square {
        border-radius: 10px;
    }

    @keyframes image-popup {
        0% {
            transform: translate(-50%, -50%) scale(0) rotate(0deg);
            opacity: 0;
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
        }
        40% {
            transform: translate(-50%, -50%) scale(1.2) rotate(8deg);
            opacity: 1;
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
        }
        80% {
            transform: translate(-50%, -50%) scale(1.6) rotate(12deg);
            opacity: 1;
            box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
        }
        100% {
            transform: translate(-50%, -50%) scale(2.0) rotate(15deg);
            opacity: 0;
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
        }
    }
}

/* Tắt animation phức tạp trên mobile để tối ưu hiệu suất */
@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
    .sunflower, 
    .bouquet-sunflower, 
    .floating-text, 
    .candle:before, 
    .petal, 
    .orbiting-leaf, 
    .regular-cake, 
    .cream-decoration, 
    .candle::after, 
    .fruit-decoration, 
    .edible-flower, 
    .chocolate-sprinkle,
    .heart {
        animation: none !important;
    }
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    .sunflower, .bouquet-sunflower, .floating-text, .candle:before, .petal, .orbiting-leaf, .regular-cake, .cream-decoration, .candle::after, .fruit-decoration, .edible-flower, .chocolate-sprinkle {
        animation: none;
    }
}