@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.screen.active {
    display: flex;
    opacity: 1;
    animation: screenFadeIn 0.5s ease-in-out;
}

@keyframes screenFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pantalla de lluvia de corazones */
#heartRain {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    flex-direction: column;
}

.title-container {
    text-align: center;
    z-index: 10;
    margin-bottom: 50px;
}

.pixel-title {
    font-size: 3rem;
    color: #ff6b9d;
    text-shadow: 
        4px 4px 0px #ff1744,
        8px 8px 0px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

.pixel-subtitle {
    font-size: 1rem;
    color: #fff;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#heartCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Escena del yorkie */
#yorkieScene {
    background: linear-gradient(180deg, #87ceeb 0%, #98d8c8 100%);
}

.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.yorkie-wrapper {
    position: absolute;
    bottom: 150px;
    left: -200px;
    width: 200px;
    height: 200px;
}

.yorkie {
    width: 120px;
    height: 100px;
    position: relative;
    animation: run 0.4s steps(4) infinite;
}

/* Cuerpo del yorkie */
.yorkie::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 45px;
    background: #D4A574;
    border: 2px solid #8B6F47;
    border-radius: 8px;
    top: 35px;
    left: 25px;
    box-shadow: inset -2px -2px 0 #8B6F47;
}

/* Cabeza */
.yorkie::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 35px;
    background: #D4A574;
    border: 2px solid #8B6F47;
    border-radius: 50% 50% 40% 40%;
    top: 20px;
    left: 15px;
    box-shadow: inset -2px -2px 0 #8B6F47;
}

/* Ojos y nariz usando elementos adicionales */
.yorkie .eye {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #000;
    border-radius: 50%;
    top: 32px;
    z-index: 2;
}

.yorkie .eye.left {
    left: 28px;
}

.yorkie .eye.right {
    left: 38px;
}

.yorkie .nose {
    position: absolute;
    width: 6px;
    height: 5px;
    background: #000;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    top: 38px;
    left: 31px;
    z-index: 2;
}

/* Orejas */
.yorkie .ear {
    position: absolute;
    width: 15px;
    height: 20px;
    background: #D4A574;
    border: 2px solid #8B6F47;
    border-radius: 50% 50% 0 0;
    top: 15px;
    z-index: 1;
}

.yorkie .ear.left {
    left: 8px;
    transform: rotate(-20deg);
}

.yorkie .ear.right {
    left: 50px;
    transform: rotate(20deg);
}

/* Patas */
.yorkie .leg {
    position: absolute;
    width: 10px;
    height: 25px;
    background: #D4A574;
    border: 2px solid #8B6F47;
    border-radius: 5px;
    bottom: 0;
}

.yorkie .leg.front-left {
    left: 20px;
}

.yorkie .leg.front-right {
    left: 35px;
}

.yorkie .leg.back-left {
    left: 55px;
}

.yorkie .leg.back-right {
    left: 70px;
}

/* Cola */
.yorkie .tail {
    position: absolute;
    width: 8px;
    height: 25px;
    background: #D4A574;
    border: 2px solid #8B6F47;
    border-radius: 0 0 5px 5px;
    bottom: 15px;
    right: -5px;
    transform: rotate(-10deg);
}

@keyframes run {
    0% { transform: translateY(0) scaleX(1); }
    25% { transform: translateY(-5px) scaleX(1); }
    50% { transform: translateY(0) scaleX(1); }
    75% { transform: translateY(-5px) scaleX(1); }
    100% { transform: translateY(0) scaleX(1); }
}

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: 
        repeating-linear-gradient(
            90deg,
            #8B7355 0px,
            #8B7355 20px,
            #A0826D 20px,
            #A0826D 40px
        );
    border-top: 4px solid #6B5D4F;
    animation: groundMove 0.5s linear infinite;
}

@keyframes groundMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

.clouds {
    position: absolute;
    top: 50px;
    width: 100%;
    height: 100px;
}

.cloud {
    position: absolute;
    width: 80px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    opacity: 0.7;
}

.cloud:before,
.cloud:after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
}

.cloud:before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud:after {
    width: 60px;
    height: 60px;
    top: -35px;
    right: 10px;
}

.cloud1 {
    left: 10%;
    animation: cloudMove1 20s linear infinite;
}

.cloud2 {
    left: 40%;
    animation: cloudMove2 25s linear infinite;
}

.cloud3 {
    left: 70%;
    animation: cloudMove3 30s linear infinite;
}

@keyframes cloudMove1 {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

@keyframes cloudMove2 {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

@keyframes cloudMove3 {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

/* Pantalla de pregunta */
#questionScreen {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
}

.question-container {
    text-align: center;
    padding: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.question-box {
    background: rgba(255, 255, 255, 0.95);
    border: 8px solid #ff6b9d;
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 
        0 0 0 4px #fff,
        0 0 0 12px #ff6b9d,
        0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: boxAppear 0.5s ease-out;
    max-width: 600px;
    margin: 0 auto;
    overflow: visible;
}

@keyframes boxAppear {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.question-text {
    font-size: 2rem;
    color: #ff1744;
    margin-bottom: 50px;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
    line-height: 1.6;
}

.buttons-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    position: relative;
    min-height: 120px;
    padding: 20px;
    width: 100%;
}

.game-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    padding: 20px 40px;
    border: 6px solid #000;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.1s;
    position: relative;
    text-transform: uppercase;
    box-shadow: 
        0 8px 0 #000,
        0 12px 20px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
}

.game-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 4px 0 #000,
        0 8px 15px rgba(0, 0, 0, 0.2);
}

.yes-btn {
    background: #4caf50;
    color: #fff;
    z-index: 10;
    position: relative;
}

.yes-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.no-btn {
    background: #f44336;
    color: #fff;
    position: relative;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 5;
}

.no-btn.absolute {
    position: absolute;
}

.no-btn:hover {
    background: #da190b;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

/* Pantalla de éxito */
#successScreen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.success-container {
    text-align: center;
    padding: 40px;
}

.success-box {
    background: rgba(255, 255, 255, 0.95);
    border: 8px solid #ff6b9d;
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 
        0 0 0 4px #fff,
        0 0 0 12px #ff6b9d,
        0 20px 40px rgba(0, 0, 0, 0.3);
    animation: successAppear 0.8s ease-out, bounce 2s ease-in-out infinite;
    max-width: 600px;
}

@keyframes successAppear {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.success-title {
    font-size: 2.5rem;
    color: #ff1744;
    margin-bottom: 30px;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
    animation: rainbow 3s ease-in-out infinite;
}

@keyframes rainbow {
    0%, 100% { color: #ff1744; }
    25% { color: #ff6b9d; }
    50% { color: #e91e63; }
    75% { color: #ff1744; }
}

.success-message {
    font-size: 1rem;
    color: #333;
    margin: 20px 0;
    line-height: 1.8;
}

.hearts-celebration {
    margin-top: 40px;
    font-size: 3rem;
}

.heart-emoji {
    display: inline-block;
    animation: float 2s ease-in-out infinite;
    margin: 0 10px;
}

.heart-emoji:nth-child(1) { animation-delay: 0s; }
.heart-emoji:nth-child(2) { animation-delay: 0.4s; }
.heart-emoji:nth-child(3) { animation-delay: 0.8s; }
.heart-emoji:nth-child(4) { animation-delay: 1.2s; }
.heart-emoji:nth-child(5) { animation-delay: 1.6s; }

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* Efectos de partículas */
.particle {
    position: absolute;
    pointer-events: none;
    font-size: 1.5rem;
    animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pixel-title {
        font-size: 2rem;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .game-btn {
        font-size: 1rem;
        padding: 15px 30px;
    }
    
    .success-title {
        font-size: 1.5rem;
    }
    
    .buttons-container {
        flex-direction: column;
    }
}