*,
*::before,
*::after {
    box-sizing: border-box;
}

@font-face {
    font-family: 'StardewValley';
    src: url('https://www.dafont.com/stardew-valley.font') format('truetype');
}

body {
    background-color: #2c2c2c;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    margin: 0;
    font-family: 'StardewValley', 'Courier New', Courier, monospace;
    color: white;
    text-align: center;
    overflow: hidden;
}

.container {
    background-image: url('https://wallpapercave.com/wp/wp6659180.png');
    background-size: cover;
    background-position: center;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

#password-container {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 0 0 5px #ab6d43, 0 0 0 10px #f5deb3;
}

h1 {
    font-size: 3em;
    text-shadow: 3px 3px 0px #ab6d43;
    margin-bottom: 20px;
}

#password-input {
    width: 200px;
    height: 40px;
    font-size: 24px;
    text-align: center;
    border: 4px solid #ab6d43;
    border-radius: 5px;
    margin: 10px;
    background-color: #f5deb3;
    color: #ab6d43;
    image-rendering: pixelated;
    box-shadow: inset 2px 2px 0px #d2b48c;
    outline: none;
}

#submit-button {
    width: 120px;
    height: 50px;
    font-size: 20px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #ab6d43;
    color: white;
    border: 4px solid #f5deb3;
    image-rendering: pixelated;
    text-shadow: 2px 2px 0px #6b4528;
    box-shadow: 0px 4px 0px #6b4528;
    transition: all 0.1s ease-in-out;
}

#submit-button:hover {
    background-color: #c9845b;
    transform: translateY(2px);
    box-shadow: 0px 2px 0px #6b4528;
}

#content-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

#envelope-canvas {
    cursor: pointer;
    image-rendering: pixelated;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

#letter-container {
    display: none;
    background-color: #f5f5dc;
    padding: 40px;
    border: 8px solid #a0522d;
    border-radius: 10px;
    width: 50vw;
    max-width: 50em;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
    color: #a0522d;
    font-size: 1.5em;
    line-height: 1.6em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    image-rendering: pixelated;
    scrollbar-width: thin;
    scrollbar-color: #a0522d #d2b48c;
    margin: auto;
}

@media (max-width: 768px) {
    .container {
        background-image: url('https://images.wallpapersden.com/image/download/stardew-valley-hd-gaming-background_bWtmaWiUmZqaraWkpJRmZ21lrWdmZ2U.jpg');
    }

    h1 {
        font-size: 1.2em;
    }

    #password-input {
        width: 100px;
        height: 25px;
        font-size: 16px;
    }

    #submit-button {
        width: 70px;
        height: 35px;
        font-size: 14px;
    }

    #letter-container {
        width: 95vw;
        padding: 10px;
        font-size: 0.8em;
        line-height: 1.2em;
    }
}

#letter-container p {
    white-space: nowrap;
    overflow-x: auto;
    margin-bottom: 1em;
    line-height: 1.2em;
}

#letter-container::-webkit-scrollbar {
    width: 12px;
    image-rendering: pixelated;
}

#letter-container::-webkit-scrollbar-track {
    background: #d2b48c;
    border-radius: 10px;
    image-rendering: pixelated;
}

#letter-container::-webkit-scrollbar-thumb {
    background-color: #a0522d;
    border-radius: 10px;
    border: 2px solid #8b4513;
    image-rendering: pixelated;
}

#letter-container::-webkit-scrollbar-thumb:hover {
    background-color: #8b4513;
}

.incorrect-password-highlight {
    border-color: #ff0000 !important;
    box-shadow: inset 2px 2px 0px #ff8888 !important;
}
