* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

.container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100vw;
    max-width: 100vw;
    position: relative;
    z-index: 10;
    background: none;
}

.model-container {
    flex: 1 1 0;
    min-width: 0;
    min-height: 300px;
    height: auto;
    position: relative;
    padding-top: env(safe-area-inset-top);
    display: flex;
    align-items: center;
    justify-content: center;
}

.content {
    flex: 1 1 0;
    min-width: 0;
    min-height: 400px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5%;
    padding-left: max(5%, env(safe-area-inset-left));
    padding-right: max(5%, env(safe-area-inset-right));
    padding-bottom: max(5%, env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow-y: auto;
}

/* Loader overlay */
.loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(245, 247, 250, 0.9);
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease-out;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff5e62;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.congratulation {
    font-family: 'Dancing Script', cursive;
    font-size: 5rem;
    color: #ff5e62;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: fadeInUp 1s ease-out;
}

.sub-heading {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #2e5090;
    animation: fadeInUp 1.2s ease-out;
}

.message, .quote, .signature {
    position: relative;
    min-height: 1.5em;
}

.message.typing::after, .quote.typing::after, .signature.typing::after {
    content: '|';
    position: absolute;
    right: -5px;
    animation: blink 1s infinite;
}

.message::after, .quote::after, .signature::after {
    content: '';
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.message {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    animation: fadeInUp 1.4s ease-out;
}

.quote {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
    padding-left: 20px;
    border-left: 4px solid #ff5e62;
    animation: fadeInUp 1.6s ease-out;
}

.signature {
    font-family: 'Dancing Script', cursive;
    text-align: right;
    color: #FF85A1;
    font-size: 1.2rem;
    margin-bottom: 25px;
    animation: fadeInUp 1.7s ease-out;
}

.heart {
    display: inline-block;
    color: #FF85A1;
    animation: heartbeat 1.5s infinite;
    font-size: 1.2em;
    margin-left: 2px;
    vertical-align: middle;
}

.button-container {
    animation: fadeInUp 1.8s ease-out;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    pointer-events: none;
    opacity: 0.8;
    will-change: transform;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.celebrate-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    background: linear-gradient(45deg, #FF85A1, #FFB7B2);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 133, 161, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    touch-action: manipulation;
}

.celebrate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 94, 98, 0.4);
}

.celebrate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 94, 98, 0.4);
}

.celebrate-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.celebrate-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sway {
    0% { transform: translateX(-15px) rotate(-5deg); }
    50% { transform: translateX(0) rotate(0deg); }
    100% { transform: translateX(15px) rotate(5deg); }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        min-height: 100vh;
        width: 100vw;
    }
    .model-container {
        width: 100vw;
        min-height: 220px;
        height: 40vh;
        max-height: 50vh;
    }
    .content {
        width: 100vw;
        min-height: 50vh;
        height: auto;
        padding: 6% 5% 10% 5%;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        min-height: 100vh;
        width: 100vw;
    }
    .model-container {
        width: 100vw;
        min-height: 180px;
        height: 35vh;
        max-height: 45vh;
    }
    .content {
        width: 100vw;
        min-height: 55vh;
        height: auto;
        padding: 7% 4% 12% 4%;
    }
    .congratulation {
        font-size: 2.2rem;
        margin-top: 18px;
        text-align: center;
    }
    .sub-heading {
        font-size: 1.2rem;
        margin-bottom: 18px;
        text-align: center;
    }
    .message, .quote {
        font-size: 1rem;
        margin-bottom: 12px;
        line-height: 1.5;
    }
    .signature {
        font-size: 1rem;
        margin-bottom: 18px;
    }
    .celebrate-btn {
        padding: 12px 25px;
        font-size: 1rem;
        margin: 20px auto;
        display: block;
        width: 100%;
        max-width: 250px;
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    .container {
        flex-direction: column;
        min-height: 100vh;
        width: 100vw;
    }
    .model-container {
        width: 100vw;
        min-height: 120px;
        height: 30vh;
        max-height: 35vh;
    }
    .content {
        width: 100vw;
        min-height: 60vh;
        height: auto;
        padding: 8% 3% 15% 3%;
    }
    .congratulation {
        font-size: 1.5rem;
        margin-top: 12px;
        text-align: center;
    }
    .sub-heading {
        font-size: 1rem;
        margin-bottom: 12px;
        text-align: center;
    }
    .message, .quote {
        font-size: 0.95rem;
        margin-bottom: 10px;
        line-height: 1.5;
    }
    .signature {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    .celebrate-btn {
        padding: 10px 18px;
        font-size: 0.98rem;
        margin: 15px auto;
        width: 100%;
        max-width: 200px;
    }
}

/* Safe area insets for modern mobile browsers */
@supports (padding: max(0px)) {
    .content {
        padding-left: max(5%, env(safe-area-inset-left));
        padding-right: max(5%, env(safe-area-inset-right));
        padding-bottom: max(5%, env(safe-area-inset-bottom));
    }
    .model-container {
        padding-top: env(safe-area-inset-top);
    }
}

/* Allow scroll for long content */
html, body {
    height: 100%;
    width: 100%;
}

body {
    overflow-y: auto;
    overflow-x: hidden;
}

.container, .content, .model-container {
    box-sizing: border-box;
}

/* Prevent text selection during typing animation */
.message, .quote, .signature {
    user-select: none;
    -webkit-user-select: none;
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .loader-spinner {
        border-width: 3px;
    }
    
    .celebrate-btn {
        box-shadow: 0 4px 15px rgba(255, 133, 161, 0.3);
    }
}