:root {
    --primary-color: #ff6b6b;
    --secondary-color: #ff9aa2;
    --accent-color: #ffb7b2;
    --background-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-color: #4a4a4a;
    --heading-color: #d6336c;
    --white: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Quicksand', sans-serif;
    background: var(--background-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 90%;
    max-width: 750px;
    position: relative;
    padding: 25px;
    background: var(--glass-bg);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    text-align: center;
    transition: background 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

.container.no-bg {
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-color: transparent;
}

h1 {
    font-family: 'Pacifico', cursive;
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: var(--heading-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Game Section */
#game-section {
    transition: opacity 0.5s ease-out;
}

canvas {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--white);
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
    cursor: none;
}

#score-board {
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 20px;
    border-radius: 50px;
    display: inline-block;
    color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.instructions {
    font-family: 'Nunito', sans-serif;
    margin-top: 8px;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Proposal Section */
#proposal-section {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in;
    z-index: 10;
}

.hidden {
    display: none !important;
}

#proposal-section.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
}

.proposal-text {
    font-size: 2.8rem;
    color: #ff2e63;
    animation: heartbeat 2s infinite;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

.lucky-text {
    font-family: 'Pacifico', cursive;
    font-size: 1.3rem;
    color: #e84393;
}

.buttons {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 25px;
    position: relative;
    height: 80px;
}

button {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    padding: 12px 35px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#yes-btn {
    background: linear-gradient(135deg, #4cd137 0%, #44bd32 100%);
    color: white;
}

#yes-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(76, 209, 55, 0.4);
}

#no-btn {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: white;
    position: relative;
    transition: all 0.4s ease;
}

/* Celebration */
#celebration {
    margin-top: -20px;
    background: rgba(255, 255, 255, 0.8);
    padding: 25px 35px;
    border-radius: 20px;
    animation: popIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
}

.celebration-title {
    color: var(--primary-color) !important;
    font-family: 'Pacifico', cursive !important;
    font-size: 2.8rem !important;
    margin: 0 0 10px 0 !important;
}

.celebration-text {
    font-size: 1.3rem;
    margin-top: 8px;
}

/* Final Message */
#final-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 20;
    text-align: center;
    animation: fadeInUpCentered 1.5s ease;
}

.final-title {
    font-family: 'Pacifico', cursive !important;
    font-size: 2.5rem !important;
    color: #ff2e63 !important;
    text-shadow: 0 0 20px rgba(255, 46, 99, 0.3);
    margin-bottom: 10px !important;
}

.final-text {
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    color: #e84393;
}

/* Animations */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.1);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(1);
    }
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUpCentered {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

/* Dual slide layout */
.dual-slide {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.dual-slide .slide-img {
    width: 48%;
    max-height: 350px;
}

/* Triple slide layout */
.triple-slide {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.triple-slide .slide-img {
    width: 32%;
    max-height: 300px;
}

/* Start Overlay */
#start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffd1dc 0%, #ffb6c1 50%, #ff91a4 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.8s ease;
}

#start-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.start-content {
    text-align: center;
}

.start-title {
    font-family: 'Pacifico', cursive;
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 25px;
}

#start-btn {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    padding: 14px 45px;
    border: none;
    border-radius: 50px;
    background: white;
    color: #ff6b81;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s ease infinite;
}

#start-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Countdown Section */
#countdown-section {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 20;
    text-align: center;
}

#countdown-number {
    font-family: 'Fredoka One', cursive;
    font-size: 7rem;
    color: #ff2e63;
    text-shadow: 0 0 40px rgba(255, 46, 99, 0.4);
    animation: countPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes countPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); }
}

/* Slideshow Section */
#slideshow-section {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    z-index: 20;
    text-align: center;
    animation: fadeInUpCentered 0.8s ease;
}

.slideshow-title {
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    color: #ff2e63;
    margin-bottom: 12px;
}

.slide-container {
    position: relative;
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 15px;
    min-height: 300px;
}

.slide-img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 15px;
}

video.slide-img {
    max-height: 420px;
    width: 100%;
    object-fit: contain;
}

.slide-img.slide-out-left {
    animation: slideOutLeft 0.5s ease forwards;
}

.slide-img.slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

.slide-img.slide-out-right {
    animation: slideOutRight 0.5s ease forwards;
}

.slide-img.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-container.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        width: 95%;
    }

    h1 {
        font-size: 2rem;
    }

    .proposal-text {
        font-size: 2.5rem;
    }

    .buttons {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        height: auto;
    }

    canvas {
        border-width: 2px;
        border-radius: 10px;
    }

    .start-title {
        font-size: 2rem;
    }

    #countdown-number {
        font-size: 6rem;
    }

    .slideshow-title {
        font-size: 1.5rem;
    }

    .slide-container {
        min-height: 250px;
    }

    .slide-img {
        max-height: 380px;
    }

    .dual-slide .slide-img {
        max-height: 300px;
    }
}
