:root {
    --primary: #ff4d6d;
    --secondary: #ff758f;
    --bg-dark: #1a0a1a;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
    background: radial-gradient(circle at center, #2d0a2d 0%, #0a050a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    /* Changed from hidden to allow scrolling */
    padding: 2rem 1rem;
    color: white;
}

#entry-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a050a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.8s ease;
}

.overlay-content {
    text-align: center;
    animation: pulse 2s infinite;
}

.heart-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

#start-btn {
    background: var(--primary);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
}

#entry-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

    50% {
        transform: scale(1.05);
    }

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

.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.music-control:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.music-control.playing #music-icon {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

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

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
    /* Reduced padding for better mobile/laptop fit */
    width: 100%;
    max-width: 500px;
    text-align: center;
    z-index: 10;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: visible;
    /* Changed from hidden to show all content */
    animation: fadeIn 1s ease-out;
    margin: auto;
    /* Help with centering in scrollable body */
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cursive {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    background: linear-gradient(45deg, #ff4d6d, #ffb3c1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.letter-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px hide solid rgba(255, 255, 255, 0.1);
    max-height: 250px;
    overflow-y: auto;
    text-align: left;
}

.letter-text {
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 300;
    font-style: italic;
    color: #ffd1dc;
}

/* Custom Scrollbar */
.letter-container::-webkit-scrollbar {
    width: 6px;
}

.letter-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.promise-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 2rem;
}

.promise-item {
    background: rgba(77, 255, 145, 0.1);
    border: 1px solid rgba(77, 255, 145, 0.3);
    padding: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #4dff91;
}

.punishment-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

.punishment-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.punish-btn {
    font-size: 0.9rem;
    padding: 10px 18px;
    background: rgba(255, 77, 109, 0.15);
    /* Added slight background for visibility */
    border: 1.5px solid var(--primary);
    color: white;
    font-weight: 500;
}

.punish-btn:hover {
    background: var(--primary);
}

#punishment-text {
    margin-top: 15px;
    color: var(--secondary);
    font-weight: 600;
    font-style: italic;
}

.forgiveness-meter {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.slider-hint {
    background: rgba(255, 77, 109, 0.2);
    border: 1px solid var(--primary);
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: 2px;
    display: inline-block;
    animation: pulseHint 1.5s infinite;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

@keyframes pulseHint {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 77, 109, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 109, 0);
    }
}

@keyframes glowText {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

@keyframes bounceHorizontal {

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

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

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    margin: 30px 0;
    background: transparent;
    cursor: grab;
    position: relative;
    z-index: 100;
    /* Ensure it's above everything else in the card */
    display: block;
    touch-action: pan-x;
    /* Critical for mobile touch */
}

input[type=range]:active {
    cursor: grabbing;
}

/* Chrome/Safari/Edge Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Firefox Track */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Chrome/Safari/Edge Thumb */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 36px;
    width: 36px;
    border-radius: 50%;
    background: #ff4d6d;
    cursor: pointer;
    margin-top: -12px;
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.5);
    border: 3px solid #ffffff;
    animation: pulseThumb 2s infinite;
}

/* Firefox Thumb */
input[type=range]::-moz-range-thumb {
    height: 36px;
    width: 36px;
    border-radius: 50%;
    background: #ff4d6d;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.5);
    border: 3px solid #ffffff;
    animation: pulseThumb 2s infinite;
}

@keyframes pulseThumb {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.7);
    }

    50% {
        transform: scale(1.3);
        box-shadow: 0 0 0 20px rgba(255, 77, 109, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 109, 0);
    }
}

.status-display {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

#status-emoji {
    font-size: 2rem;
    display: block;
    transition: transform 0.3s ease;
}

#status-text {
    font-weight: 600;
}

.interactive-reasons {
    margin-bottom: 2rem;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.3);
}

button:hover {
    transform: translateY(-2px);
    background: var(--secondary);
    box-shadow: 0 6px 20px rgba(255, 77, 109, 0.5);
}

.hidden {
    display: none;
    opacity: 0;
}

#reasons-list {
    margin-top: 1.5rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reason {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.love-message {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
    animation: fadeIn 1s ease-in forwards;
}

.love-message p {
    font-size: 1.5rem;
    font-family: 'Dancing Script', cursive;
    color: var(--secondary);
}

.small {
    font-size: 0.85rem !important;
    font-family: 'Outfit' !important;
    opacity: 0.7;
    margin-top: 5px;
    margin-bottom: 20px;
    color: white !important;
}

footer {
    margin-top: 2rem;
    opacity: 0.8;
}

strong {
    color: var(--primary);
}

/* Floating Hearts */
.heart {
    position: absolute;
    color: var(--primary);
    opacity: 0.6;
    pointer-events: none;
    animation: float 5s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}