/* Reset and base styles */
:root {
    --romantic-font-stack: 'Dancing Script', cursive, serif;
    --serif-font-stack: 'Lora', serif;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove mobile tap highlight */
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrollbars */
    font-family: 'Lora', serif;
}

body {
    /* Default background: hot pink gradient */
    background: linear-gradient(135deg, #e91e63 0%, #880e4f 100%), radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: background 1.5s ease, background-image 1.5s ease;
}

#bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 1.5s ease;
    pointer-events: none;
}

.container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#scene-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* Behind text but above background */
}

.tap-text {
    position: absolute;
    z-index: 2; /* Above the heart */
    font-family: var(--romantic-font-stack);
    font-weight: 700;
    font-size: 2.5rem;
    color: #ffffff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    letter-spacing: 3px;
    text-align: center;
    pointer-events: none; /* Allow clicks to pass through to canvas */
    opacity: 1;
    /* Position below the heart */
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
}


.pixel-font {
    font-family: var(--romantic-font-stack);
}

.tap-text {
    font-family: var(--romantic-font-stack);
}

.instructions {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    z-index: 3;
    pointer-events: none;
}



/* Prevent text selection */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Class for background transition to purple gradient */
.purple-bg {
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%), radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}



/* Class to hide elements */
.hidden {
    opacity: 0 !important;
}

/* Fade out animation */
.fade-out {
    opacity: 1;
    animation: fadeOut 0.3s ease forwards;
}

/* Class for background transition to red gradient */
.red-bg {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%), radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

/* Second scene styles */
.scene-title-wrapper {
    position: absolute;
    z-index: 2;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    pointer-events: none;
}

.scene-title-text {
    font-family: var(--romantic-font-stack);
    font-weight: 700;
    font-size: 2.2rem;
    color: #ffffff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
    text-align: center;
    line-height: 1.3;
    animation: float 3s ease-in-out infinite;
}



.input-container {
    position: absolute;
    z-index: 2;
    font-family: var(--serif-font-stack);
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    letter-spacing: 3px;
    text-align: center;
    pointer-events: auto;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: auto;
    background: transparent;
    border: none;
    color: transparent;
    font-size: 16px; /* Minimum for mobile keyboards */
    caret-color: transparent;
}

.input-text {
    display: inline-block;
}

.input-cursor {
    display: inline-block;
    color: #ffffff;
    opacity: 1;
    transition: opacity 0.2s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

.validation-message {
    position: absolute;
    z-index: 2;
    font-family: var(--serif-font-stack);
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
    text-align: center;
    pointer-events: none;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    line-height: 1.4;
    opacity: 0;
}

.validation-message.show {
    opacity: 1;
}

.valentine-validation-message {
    position: absolute;
    z-index: 3;
    font-family: var(--serif-font-stack);
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
    text-align: center;
    pointer-events: none;
    top: 87%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    line-height: 1.4;
    opacity: 0;
}

.valentine-validation-message.show {
    opacity: 1;
}



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

@keyframes shake {
    0%, 100% {
        transform: translate(-50%, -50%) translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate(-50%, -50%) translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translate(-50%, -50%) translateX(5px);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}



/* Celebration scene styles */
.golden-bg {
    background: linear-gradient(135deg, #f57c00 0%, #bf360c 100%), radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.decorations-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-decor {
    position: absolute;
    opacity: 0.7;
    animation: float-decor 6s ease-in-out infinite;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

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

.name-container {
    position: absolute;
    z-index: 2;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 5px;
    pointer-events: none;
}

.name-letter {
    font-family: var(--romantic-font-stack);
    font-weight: 700;
    font-size: 3rem;
    color: #ffffff;
    text-shadow: 
        0 0 10px rgba(255, 182, 193, 0.8),
        0 0 20px rgba(255, 182, 193, 0.6),
        2px 2px 8px rgba(0, 0, 0, 0.6);
    animation: letter-pop 0.5s ease-out both;
    display: inline-block;
}

@keyframes letter-pop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebration-message {
    position: absolute;
    z-index: 2;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    pointer-events: none;
    text-align: center;
}

.celebration-message-main {
    font-family: var(--romantic-font-stack);
    font-weight: 700;
    font-size: 2.2rem;
    color: #ffffff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    letter-spacing: 3px;
    line-height: 1.3;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.celebration-message-sub {
    font-family: var(--serif-font-stack);
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
    line-height: 1.4;
    opacity: 0;
    animation: fadeIn 1s ease-out 2s forwards;
}



/* Valentine scene button styles */
.button-container {
    position: absolute;
    z-index: 2;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
}

.valentine-button {
    font-family: var(--serif-font-stack);
    font-weight: 700;
    font-size: 1.5rem;
    padding: 10px 20px;
    width: 180px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.valentine-button:active {
    transform: translate(2px, 2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.valentine-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.yes-button {
    background-color: #2e7d32;
    color: white;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.5);
}

.yes-button:hover:not(:disabled) {
    background-color: #388e3c;
    transform: translate(-2px, -2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.no-button {
    background-color: #6a1b9a;
    color: white;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.5);
}

.no-button:hover:not(:disabled) {
    background-color: #7b1fa2;
    transform: translate(-2px, -2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

