body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f3f3f3;
    font-family: "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
}

.notebook {
    position: relative;
    width: 700px;
    height: 900px;
    background-image: url('https://i.imgur.com/AfWpZxc.jpeg');
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 150px rgba(0,0,0,0.2);
    transition: all 0.3s ease-in-out;
}

textarea {
    position: absolute;
    top: 55px;
    left: 95px;
    width: 580px;
    height: 810px;
    border: none;
    outline: none;
    resize: none;
    background-color: transparent;
    font-size: 26px;
    line-height: 33.5px;
    color: #1a3a79;
    font-family: inherit;
    font-weight: bold;
    transition: opacity 0.3s ease-in-out;
}

.crash-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden; 
}

.crash-text-container span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: bold;
    opacity: 0; 
    color: #1a3a79;
    white-space: nowrap;
    font-family: inherit;
}

@media (max-width: 1200px) {
    .notebook {
        background-image: url('https://i.imgur.com/z9hBCMD.jpeg');
        width: 900px; 
        height: 900px; 
        box-shadow: none;
    }

    textarea {
        opacity: 0; 
        pointer-events: none;
    }
}

@media (max-width: 800px) {
    .notebook {
        background-image: url('https://i.imgur.com/cHHYBtr.jpeg');
        width: 900px; 
        height: 900px; 
        box-shadow: none;
    }

    textarea {
        opacity: 0; 
        pointer-events: none;
    }
}

@media (max-width: 500px) {
    .notebook {
        background-image: url('https://i.imgur.com/Rrgj8WB.jpeg');
        width: 100vw;
        height: 100vh;
        max-width: 900px;
        max-height: 900px;
        overflow: hidden; 
    }

    .crash-text-container span {
        animation-duration: 1.0s; 
        animation-fill-mode: forwards;
        opacity: 0; 
    }
    
    .crash-text-container span:nth-child(1) {
        animation-name: spread-word-1;
        animation-delay: 0s;
    }
    .crash-text-container span:nth-child(2) {
        animation-name: spread-word-2;
        animation-delay: 0.05s;
    }
    .crash-text-container span:nth-child(3) {
        animation-name: spread-word-3;
        animation-delay: 0.1s;
    }
    .crash-text-container span:nth-child(4) {
        animation-name: spread-word-4;
        animation-delay: 0.15s;
    }
    .crash-text-container span:nth-child(5) {
        animation-name: spread-word-5;
        animation-delay: 0.2s;
    }
    .crash-text-container span:nth-child(6) {
        animation-name: spread-word-6;
        animation-delay: 0.25s;
    }
    .crash-text-container span:nth-child(7) {
        animation-name: spread-word-7;
        animation-delay: 0.3s;
    }
    .crash-text-container span:nth-child(8) {
        animation-name: spread-word-8;
        animation-delay: 0.35s;
    }
}

@keyframes spread-word-1 { 
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
    100% { opacity: 0; transform: translate(-250px, -200px) rotate(-30deg) scale(4); }
}

@keyframes spread-word-2 {
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
    100% { opacity: 0; transform: translate(200px, -250px) rotate(20deg) scale(3); }
}

@keyframes spread-word-3 { 
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
    100% { opacity: 0; transform: translate(-180px, 220px) rotate(10deg) scale(4); }
}

@keyframes spread-word-4 { 
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
    100% { opacity: 0; transform: translate(230px, 190px) rotate(-25deg) scale(3); }
}

@keyframes spread-word-5 {
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
    100% { opacity: 0; transform: translate(-50%, -300px) rotate(5deg) scale(4); }
}

@keyframes spread-word-6 { 
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
    100% { opacity: 0; transform: translate(-50%, 280px) rotate(-10deg) scale(3); }
}

@keyframes spread-word-7 { 
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
    100% { opacity: 0; transform: translate(-300px, -50%) rotate(-15deg) scale(4); }
}

@keyframes spread-word-8 { 
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
    100% { opacity: 0; transform: translate(300px, -50%) rotate(15deg) scale(4); }
}