.flag-container {
    position: relative;
    width: 300px;
    height: 200px;
    margin: 0 auto;
    overflow: hidden;
}

.flag {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    animation: wave 3s ease-in-out infinite;
}

.flag-top {
    width: 100%;
    height: 50%;
    background-color: #fff;
}

.flag-bottom {
    width: 100%;
    height: 50%;
    background-color: #c00;
}

.flag-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.thank-you-flag {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    text-align: center;
}

.thank-you-flag.hidden {
    display: none;
}

@keyframes wave {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}
