:root {
    --primary-color: #ff4d6d;
    --secondary-color: #ffb3c6;
    --background-grad: linear-gradient(135deg, #ffe5ec 0%, #ffc2d1 100%);
    --text-color: #590d22;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--background-grad);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(255, 77, 109, 0.15);
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    z-index: 10;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
    z-index: 20;
}

.hidden {
    display: none !important;
}

/* Shared Typography */
.title {
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.3);
}

.primary-btn {
    background: var(--primary-color);
    color: var(--white);
}

.primary-btn:hover,
.primary-btn:active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 77, 109, 0.4);
}

.secondary-btn {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.danger-btn {
    background: #590d22;
    color: var(--white);
}

/* --- Lock Screen --- */
.lock-container {
    text-align: center;
    padding: 2.5rem 1.5rem;
    width: 90%;
    max-width: 400px;
}

.lock-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(255, 77, 109, 0.15);
}

.pin-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.pin-box {
    width: 50px;
    height: 60px;
    font-size: 2rem;
    text-align: center;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    background: var(--white);
    color: var(--primary-color);
    font-weight: 800;
    outline: none;
    transition: border-color 0.3s ease;
}

.pin-box:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.3);
}

.error {
    color: #d11a2a;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* --- Gallery Screen --- */
.gallery-container {
    text-align: center;
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.photo-frame {
    width: 75vw;
    max-width: 250px;
    height: 45vh;
    max-height: 320px;
    margin: 1rem auto;
    position: relative;
    background: var(--white);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
}

.photo-frame:hover {
    transform: rotate(1deg) scale(1.02);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    position: absolute;
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    opacity: 1;
    transition: opacity 0.5s ease;
}


.hidden-img {
    opacity: 0;
    pointer-events: none;
}

.flirty-text {
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 2.5rem;
    margin: 0.5rem 0;
    padding: 0 1rem;
}

.gallery-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
}

/* --- Proposal Screen --- */
.proposal-container {
    text-align: center;
    padding: 1.5rem 1rem;
    width: 95%;
    max-width: 450px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.ring-logo {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

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

    50% {
        transform: translateY(-15px);
    }
}

.proposal-text {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.4;
    margin: 1rem 0;
    color: var(--text-color);
}

.flirty-subtext {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.button-group {
    position: relative;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.runaway-btn {
    position: absolute;
    /* Will be positioned via JS */
}

/* --- Success Screen --- */
.success-container {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--background-grad);
    color: var(--text-color);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.success-title {
    font-family: 'Dancing Script', cursive;
    color: var(--primary-color);
    font-size: clamp(2.5rem, 13vw, 4rem);
    line-height: 1.2;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.success-text {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 2rem 0;
    max-width: 90%;
    background: rgba(255, 255, 255, 0.7);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.heart-animation {
    font-size: 3rem;
    animation: pulse 1s infinite alternate;
}

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

    100% {
        transform: scale(1.3);
    }
}