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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #121212; /* Dark theme default */
    overflow: hidden;
    position: relative;
    transition: background-color 1.5s ease;
}

/* Capa de fondo que aparece al calcular */
.romantic-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
    opacity: 0;
    transition: opacity 1.5s ease;
    z-index: 0;
}

body.romantic-mode .romantic-bg {
    opacity: 1;
}

/* Background animated bubbles */
.background-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
}

body.romantic-mode .background-bubbles {
    opacity: 1;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background-color: rgba(255, 255, 255, 0.2);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    animation: float 10s infinite ease-in;
}

.x1 { left: 10%; width: 40px; height: 40px; animation-duration: 8s; }
.x2 { left: 30%; width: 80px; height: 80px; animation-duration: 12s; animation-delay: 2s; }
.x3 { left: 50%; width: 30px; height: 30px; animation-duration: 7s; animation-delay: 4s; }
.x4 { left: 70%; width: 60px; height: 60px; animation-duration: 11s; animation-delay: 1s; }
.x5 { left: 90%; width: 50px; height: 50px; animation-duration: 9s; animation-delay: 3s; }

@keyframes float {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-1000px) scale(1.5); opacity: 0; }
}

.calculator {
    position: relative;
    z-index: 1;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 24px;
    padding: 25px;
    width: 340px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 1.5s ease, border 1.5s ease;
}

body.romantic-mode .calculator {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(255, 117, 140, 0.37);
}

.calculator:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px 0 rgba(0,0,0,0.6);
}

body.romantic-mode .calculator:hover {
    box-shadow: 0 15px 35px 0 rgba(255, 117, 140, 0.5);
}

.display {
    margin-bottom: 20px;
}

.display #result {
    width: 100%;
    min-height: 80px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 16px;
    font-size: 2.5rem;
    color: #fff;
    text-align: right;
    padding: 10px 20px;
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    transition: background 1.5s ease, border 1.5s ease, box-shadow 1.5s ease, color 1.5s ease, font-size 1.5s ease, opacity 0.6s ease;
}

.fade-out {
    opacity: 0 !important;
}

body.romantic-mode .display #result {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.display #result.romantic-text {
    font-size: 1.1rem;
    text-align: center;
    justify-content: center;
    color: #ff3366;
    text-shadow: none;
    background: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.btn {
    height: 60px;
    border: none;
    outline: none;
    background: #333;
    border: 1px solid #444;
    border-radius: 16px;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease, background 1.5s ease, border 1.5s ease, color 1.5s ease;
}

body.romantic-mode .btn {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.btn:hover {
    background: #444;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

body.romantic-mode .btn:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

body.romantic-mode .btn:active {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.operator {
    background: #ff9f0a;
    color: #fff;
    font-weight: 600;
}

body.romantic-mode .operator {
    background: rgba(255, 255, 255, 0.4);
    color: #ff3366;
}

.operator:hover {
    background: #ffb340;
}

body.romantic-mode .operator:hover {
    background: rgba(255, 255, 255, 0.5);
}

.clear {
    color: #ff9f0a;
    font-weight: 600;
}

body.romantic-mode .clear {
    color: #ff3366;
}

.equals {
    background: #ff9f0a;
    color: white;
    grid-column: 4 / 5;
    grid-row: 3 / 6;
    height: auto;
    border: none;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(255, 159, 10, 0.4);
}

body.romantic-mode .equals {
    background: #ff3366;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.4);
}

.equals:hover {
    background: #ffb340;
    box-shadow: 0 6px 20px rgba(255, 159, 10, 0.6);
}

body.romantic-mode .equals:hover {
    background: #ff1a53;
    box-shadow: 0 6px 20px rgba(255, 51, 102, 0.6);
}

.zero {
    grid-column: 1 / 3;
    width: 100%;
}

/* Heart animation for display */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.heart-emoji {
    display: inline-block;
    animation: pulse 1.5s infinite;
}
