/* Дополнительные стили для страницы поздравления */

/* Анимация появления кота */
@keyframes catAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.cat-image {
    animation: catAppear 1.5s ease-out;
}

/* Анимация появления речевого пузыря */
@keyframes bubbleAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.3);
    }
    50% {
        transform: translateX(-50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

.speech-bubble {
    animation: bubbleAppear 1s ease-out 0.5s both;
}

/* Эффект мерцания для текста */
@keyframes twinkle {
    0%, 100% {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    }
    50% {
        text-shadow: 0 0 10px rgba(255, 193, 7, 0.8), 0 0 20px rgba(255, 193, 7, 0.6);
    }
}

.name-text {
    animation: twinkle 2s infinite;
}

/* Эффект пульсации для речевого пузыря */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 193, 7, 0.3);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

.speech-bubble {
    animation: pulse 3s infinite;
}

/* Дополнительные сердечки с разными стилями */
.heart:nth-child(odd) {
    color: #ff69b4;
    font-size: 1.5rem;
}

.heart:nth-child(even) {
    color: #ff1493;
    font-size: 2.5rem;
}

/* Эффект градиента для фона */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Эффект наведения для кота */
.cat-image {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.cat-image:hover {
    transform: scale(1.05);
}

/* Дополнительные стили для позиционирования кота внизу */
.cat-container {
    align-items: flex-end !important;
    padding-bottom: 0 !important;
    position: relative;
}

.cat-image {
    margin-bottom: 0 !important;
    position: relative;
    bottom: 0;
    z-index: 2;
}

/* Эффект свечения снизу как на изображении */
.cat-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20%;
    background: radial-gradient(ellipse at center, rgba(138, 43, 226, 0.6) 0%, rgba(75, 0, 130, 0.4) 30%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

/* Дополнительное свечение для большей реалистичности */
.cat-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 15%;
    background: radial-gradient(ellipse at center, rgba(138, 43, 226, 0.8) 0%, rgba(75, 0, 130, 0.5) 40%, transparent 80%);
    z-index: 1;
    pointer-events: none;
    filter: blur(20px);
}

/* Дополнительные оптимизации для мобильных устройств */
@media (max-width: 768px) {
    .cat-image {
        max-width: 100%;
        max-height: 90%;
    }
    
    .speech-bubble {
        top: 25%;
        max-width: 90%;
        padding: 18px 25px;
    }
    
    .birthday-text {
        font-size: 1.8rem;
        font-family: 'Fredoka', cursive;
        font-weight: 700;
        margin-bottom: 8px;
    }
    
    .name-text-large {
        font-size: 2.4rem;
        font-family: 'Fredoka', cursive;
        font-weight: 700;
        margin-top: 12px;
        margin-bottom: 8px;
    }
    
    /* Дополнительные медиа-запросы для точного позиционирования */
@media (max-width: 464px) and (max-height: 786px) {
    .speech-bubble {
        top: 18%;
    }
}

@media (max-width: 430px) and (max-height: 932px) {
    .speech-bubble {
        top: 20%;
    }
}

@media (max-width: 390px) and (max-height: 844px) {
    .speech-bubble {
        top: 18%;
    }
}

@media (max-width: 375px) and (max-height: 812px) {
    .speech-bubble {
        top: 17%;
    }
}

/* Оптимизация для touch-устройств */
    .sleep-btn {
        min-height: 44px; /* Минимальный размер для удобного нажатия */
        touch-action: manipulation;
    }
    
    .cat-image {
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    .cat-image {
        max-width: 100%;
        max-height: 85%;
    }
    
    .speech-bubble {
        top: 20%;
        max-width: 95%;
        padding: 16px 20px;
    }
    
    .birthday-text {
        font-size: 1.6rem;
        font-family: 'Fredoka', cursive;
        font-weight: 700;
        margin-bottom: 6px;
    }
    
    .name-text-large {
        font-size: 2.2rem;
        font-family: 'Fredoka', cursive;
        font-weight: 700;
        margin-top: 10px;
        margin-bottom: 6px;
    }
    
    /* Дополнительные оптимизации для маленьких экранов */
    .sleep-modal-content {
        margin: 10px;
    }
    
    .sleep-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .sleep-btn {
        width: 100%;
        min-height: 48px;
    }
}

/* Специальные оптимизации для POCO и Android устройств */
@media (max-width: 414px) and (max-height: 896px) {
    body {
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }
    
    .speech-bubble {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .cat-image {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Оптимизация для очень маленьких экранов */
@media (max-width: 360px) {
    .sleep-modal-content {
        padding: 10px;
        margin: 5px;
    }
    
    .sleep-question h2 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    
    .sleep-question p {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }
    
    .sleep-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-height: 40px;
    }
}

/* Оптимизация для ландшафтной ориентации на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .sleep-modal-content {
        max-width: 80%;
        padding: 15px;
    }
    
    .sleep-question h2 {
        font-size: 1.2rem;
    }
    
    .sleep-question p {
        font-size: 0.8rem;
    }
    
    .sleep-buttons {
        flex-direction: row;
        gap: 15px;
    }
    
    .sleep-btn {
        min-width: 60px;
        padding: 8px 15px;
    }
}

/* Эффект печатания для текста */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.speech-text {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 2s steps(40, end) 1s both;
}

/* Дополнительные анимации для сердечек */
.heart:nth-child(3n) {
    animation: float 8s infinite linear;
    color: #ff6b6b;
}

.heart:nth-child(5n) {
    animation: float 4s infinite linear;
    color: #4ecdc4;
}

.heart:nth-child(7n) {
    animation: float 6s infinite linear;
    color: #45b7d1;
}
