* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

body {
    background-color: #ffd1dc;
    color: #ff3366;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.crt-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0) 60%, rgba(255, 200, 210, 0.3) 100%);
    z-index: 999;
    pointer-events: none;
}

.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0) 50%, rgba(255, 50, 100, 0.05) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 6px, 6px 100%;
    z-index: 998;
    pointer-events: none;
}

.game-container {
    width: 100%;
    max-width: 800px;
    height: 600px;
    border: 8px solid #ff6688;
    border-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12'><rect x='4' y='4' width='4' height='4' fill='%23ff6688'/></svg>") 4 repeat;
    background-color: #fff0f5;
    position: relative;
    box-shadow: 0 0 30px rgba(255, 102, 136, 0.4);
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.screen.active {
    display: flex;
}


#intro-screen {
    background-color: #ffdce5;
    background-image: 
        linear-gradient(rgba(255, 51, 102, 0.1) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 51, 102, 0.1) 2px, transparent 2px);
    background-size: 40px 40px;
    background-position: center;
}

.game-title {
    font-size: 2.2rem;
    color: #ff3366;
    text-shadow: 4px 4px #ffb6c1;
    line-height: 1.5;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 0.75rem;
    color: #ff6688;
}

.heart-container {
    margin: 20px 0;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.pixel-heart {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    animation: floatHeart 1.5s infinite ease-in-out;
    display: inline-block;
}

.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }

@keyframes floatHeart {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.15); }
}

.pixel-btn {
    background-color: transparent;
    border: 4px solid #ff3366;
    color: #ff3366;
    font-family: 'Press Start 2P', monospace;
    font-size: 1.1rem;
    padding: 15px 30px;
    cursor: pointer;
    box-shadow: 4px 4px 0px #b32247;
    transition: all 0.1s ease;
}

.pixel-btn:hover {
    background-color: #ff3366;
    color: #fff;
    box-shadow: 0px 0px 0px;
    transform: translate(4px, 4px);
}

.copyright {
    font-size: 0.55rem;
    color: #ff99aa;
}

#game-screen {
    background: linear-gradient(rgba(255, 240, 245, 0.5), rgba(255, 240, 245, 0.75)), url('assets/background.png');
    background-size: cover;
    background-position: center;
}

.stats-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #ff3366;
    border-bottom: 4px dashed #ff6688;
    padding-bottom: 10px;
}

.letter-box {
    background-color: rgba(255, 255, 255, 0.95);
    border: 4px double #ff3366;
    width: 100%;
    height: 70%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: inset 0 0 15px rgba(255, 51, 102, 0.1);
}

.letter-header {
    font-size: 1rem;
    color: #ff3366;
    margin-bottom: 15px;
}

.pixel-divider {
    width: 80%;
    height: 4px;
    background-color: #ffb6c1;
    margin-bottom: 20px;
}

.letter-content {
    font-size: 0.75rem;
    line-height: 1.8;
    color: #4a4a4a;
    text-align: left;
    width: 100%;
    overflow-y: auto;
    white-space: pre-wrap;
}

.small-btn {
    font-size: 0.65rem;
    padding: 8px 15px;
    border-color: #ff6688;
    color: #ff6688;
    box-shadow: 3px 3px 0px #b3445c;
}

.small-btn:hover {
    background-color: #ff6688;
    color: #fff;
}

.fade-transition {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        height: -webkit-fill-available;
    }

    .game-container {
        width: 100%;
        height: 90vh;
        max-height: 100%;
        border-width: 6px;
    }

    .screen {
        padding: 20px 15px;
    }

    .game-title {
        font-size: 1.4rem;
        line-height: 1.6;
        margin-top: 10px;
    }

    .subtitle {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }

    .pixel-heart {
        width: 24px;
        height: 24px;
    }

    .heart-container {
        margin: 10px 0;
        gap: 15px;
    }

    .pixel-btn {
        font-size: 0.8rem;
        padding: 12px 15px;
        width: 90%;
        max-width: 290px;
        
        white-space: nowrap;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .stats-bar {
        font-size: 0.55rem;
        padding-bottom: 8px;
    }

    .letter-box {
        height: 75%;
        padding: 15px;
    }

    .letter-header {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .pixel-divider {
        margin-bottom: 15px;
    }

    .letter-content {
        font-size: 0.65rem; 
        line-height: 1.8;
        padding-right: 5px;
    }

    .small-btn {
        font-size: 0.6rem;
        padding: 8px 15px;
        width: auto;
    }
}