* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #ffb6c1 0%, #ffc0cb 50%, #ffb6c1 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

main {
    width: 100%;
    max-width: 1200px;
}

.container {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
}

#gift-container {
    text-align: center;
    margin: 40px 0;
}

#gift {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    cursor: pointer;
    transition: transform 0.25s ease, text-shadow 0.25s ease;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    border: 3px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 18px 40px rgba(255, 105, 180, 0.18);
    backdrop-filter: blur(8px);
}

.gift-emoji {
    font-size: 6rem;
    line-height: 1;
}

#gift:hover {
    transform: scale(1.05);
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
    box-shadow: 0 24px 65px rgba(255, 105, 180, 0.3);
}

.gift-box,
.ribbon,
.ribbon::before,
.ribbon::after {
    display: none;
}

#click-counter {
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(255, 105, 180, 0.2);
    margin: 0;
}

#clicks {
    font-weight: bold;
    color: #ff69b4;
}

.back-button {
    display: inline-block;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 20;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.95);
    color: #ff1f8c;
    font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.back-button:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 14px 35px rgba(255, 105, 180, 0.25);
}


/* Stages de apertura */
.stage-1 .gift-box { transform: scale(1.02) rotate(-1deg); }
.stage-2 .gift-box { transform: scale(1.04) rotate(-1deg); }
.stage-3 .gift-box { transform: scale(1.06) rotate(-2deg); }
.stage-4 .gift-box { transform: scale(1.08) rotate(-2deg); }
.stage-5 .gift-box { transform: scale(1.1) rotate(-3deg); background: linear-gradient(45deg, #ff69b4, #ff8da1); }
.stage-6 .gift-box { transform: scale(1.12) rotate(-3deg); }
.stage-7 .gift-box { transform: scale(1.14) rotate(-4deg); }
.stage-8 .gift-box { transform: scale(1.16) rotate(-4deg); }
.stage-9 .gift-box { transform: scale(1.18) rotate(-5deg); }
.stage-10 .gift-box { transform: scale(1.2) rotate(-6deg); background: linear-gradient(45deg, #ff69b4, #ff7f9e); }
.stage-11 .gift-box { transform: scale(1.22) rotate(-7deg); }
.stage-12 .gift-box { transform: scale(1.24) rotate(-8deg); }
.stage-13 .gift-box { transform: scale(1.26) rotate(-9deg); }
.stage-14 .gift-box { transform: scale(1.28) rotate(-10deg); }
.stage-15 .gift-box { transform: scale(1.3) rotate(-11deg); }
.stage-16 .gift-box { transform: scale(1.32) rotate(-12deg); }
.stage-17 .gift-box { transform: scale(1.34) rotate(-13deg); }
.stage-18 .gift-box { transform: scale(1.36) rotate(-14deg); }
.stage-19 .gift-box { transform: scale(1.38) rotate(-15deg); }
.stage-20 .gift-box { transform: scale(1.5) rotate(-20deg); opacity: 0; }
.stage-11 .ribbon { transform: translate(-50%, -50%) rotate(35deg); }
.stage-12 .ribbon { transform: translate(-50%, -50%) rotate(30deg); }
.stage-13 .ribbon { transform: translate(-50%, -50%) rotate(25deg); }
.stage-14 .ribbon { transform: translate(-50%, -50%) rotate(20deg); }
.stage-15 .ribbon { transform: translate(-50%, -50%) rotate(15deg); }
.stage-16 .ribbon { transform: translate(-50%, -50%) rotate(10deg); }
.stage-17 .ribbon { transform: translate(-50%, -50%) rotate(5deg); }
.stage-18 .ribbon { transform: translate(-50%, -50%) rotate(0deg); }
.stage-19 .ribbon { transform: translate(-50%, -50%) rotate(-5deg); }
.stage-20 .ribbon { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg); }

#messages h2 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 20px;
    max-width: 980px;
    margin: 0 auto;
    align-items: start;
    justify-items: center;
}

.small-gift {
    position: relative;
    width: 180px;
    min-height: 150px;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
}

.small-gift.opened {
    min-height: auto;
    padding-bottom: 20px;
}

.gift-box-small,
.ribbon-small,
.ribbon-small::before {
    display: none;
}

.gift-emoji-small {
    font-size: 4.5rem;
    line-height: 1;
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 25px rgba(255, 105, 180, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.small-gift:hover .gift-emoji-small {
    transform: scale(1.05);
    box-shadow: 0 14px 30px rgba(255, 105, 180, 0.22);
}

.gift-label {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    font-size: 0.95rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(255, 105, 180, 0.4);
    margin: 0;
    font-weight: bold;
    z-index: 2;
    width: 100%;
    text-align: center;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(255, 105, 180, 0.12);
}

.message-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 14px;
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
    animation: fadeIn 0.5s ease-out;
    margin-top: 10px;
    min-width: 100%;
}

.message-content .mod-name {
    font-size: 1.1rem;
    margin-bottom: 5px;
    text-align: center;
}

.message-content .mod-role {
    font-size: 0.7rem;
    margin-bottom: 15px;
    text-align: center;
}

.message-content .message {
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: left;
}

/* Animación de temblor */
.shake {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    text-shadow: 1px 1px 2px rgba(255, 105, 180, 0.2);
}

.messages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.message-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.2);
    border: 2px solid rgba(255, 182, 193, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-out both;
}

.message-card:nth-child(1) { animation-delay: 0.1s; }
.message-card:nth-child(2) { animation-delay: 0.2s; }
.message-card:nth-child(3) { animation-delay: 0.3s; }
.message-card:nth-child(4) { animation-delay: 0.4s; }

.message-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 50px rgba(255, 105, 180, 0.3);
}

.mod-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ff69b4;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mod-role {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.message {
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
    font-style: italic;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    #messages h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    
    .gifts-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .small-gift {
        width: 120px;
        min-height: 120px;
    }
    
    .small-gift.opened {
        min-height: 200px;
    }
    
    .message-content {
        padding: 15px;
    }
    
    .message-content .mod-name {
        font-size: 1rem;
    }
    
    .message-content .mod-role {
        font-size: 0.65rem;
    }
    
    .message-content .message {
        font-size: 0.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .messages-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .message-card {
        padding: 25px;
    }
    
    .mod-name {
        font-size: 1.1rem;
    }
    
    .mod-role {
        font-size: 0.8rem;
    }
    
    .message {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    #gift {
        width: 120px;
        height: 120px;
    }
    
    #click-counter {
        font-size: 0.9rem;
    }
    
    #messages h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .gifts-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .small-gift {
        width: 100px;
        min-height: 100px;
    }
    
    .small-gift.opened {
        min-height: 180px;
    }
    
    .message-content {
        padding: 10px;
    }
    
    .message-content .mod-name {
        font-size: 0.9rem;
    }
    
    .message-content .mod-role {
        font-size: 0.6rem;
    }
    
    .message-content .message {
        font-size: 0.7rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .messages-grid {
        gap: 12px;
    }
    
    .message-card {
        padding: 20px;
        border-radius: 15px;
    }
    
    .mod-name {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .mod-role {
        font-size: 0.75rem;
        margin-bottom: 10px;
    }
    
    .message {
        font-size: 0.9rem;
    }
}
