@font-face {
    font-family: "cute";
    src: url(font.ttf);
    ;
}

* {
    font-family: "cute";
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background-image: url('bg.webp');
    background-size: contain;
    background-position: center;
    background-repeat: repeat;
    background-attachment: fixed;
}

#prompt {
    --paper: #fff9f9;
    --ink: #d6336c;
    --shadow: #e5d4d4;
    padding: 2.5rem 3rem;
    background: var(--paper);
    color: var(--ink);
    position: relative;
    transition: opacity 2s ease-out, transform 2s ease-out;
    position: fixed !important;
    border-radius: 5px 10px 5px 10px;
    border-image: url('border.png') 27 round;
    border-image-width: 10px;
    border-image-outset: 5px;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    z-index: 20;
    text-align: center;
}

/* Hide the letter initially to keep focus on the centered prompt */
#letter {
    display: block;
    opacity: 1;
    filter: blur(8px);
    transition: opacity 2s ease-in, filter 2s ease-in;
    z-index: 0;
}

/* Classes for faded states */
.prompt-fade {
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(0.8) !important;
}

.letter-show {
    display: block !important;
    opacity: 1 !important;
    filter: blur(0px) !important;
}

/* Style the letter content */
#letter {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    color: #333;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

#laogong {
    font-weight: bold;
    font-size: 1.3em;
    background: linear-gradient(to bottom, #ffffff 0%, #ffb3d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #ffb3d9;
    -webkit-text-stroke: 0.05px #d6336c;
    text-stroke: 0.05px #d6336c;
}

#signature {
    text-align: right;
    font-style: italic;
    margin-top: 2rem;
    font-size: 1.2em;
    font-weight: bold;
    font-size: 1.3em;
    background: linear-gradient(to bottom, #ffffff 0%, #ffb3d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #ffb3d9;
    -webkit-text-stroke: 0.05px #d6336c;
    text-stroke: 0.05px #d6336c;
}

#xiaogou {
    display: block;
    margin: 2rem auto 0 auto;
    width: 180px;
    max-width: 40%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(255, 107, 157, 0.15);

    @media (max-width: 600px) {
        width: 100px;
        max-width: 60%;
        margin-top: 1rem;
    }
}

/* Cute input styling */
input[type="password"] {
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--shadow);
    border-radius: 15px;
    background: #fff;
    color: var(--ink);
    font-family: "cute";
    font-size: 1rem;
    text-align: center;
    margin: 0.8rem 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

input[type="password"]:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.2);
    transform: scale(1.02);
}

/* Cute button styling */
button {
    background: linear-gradient(135deg, #ff6b9d, #ff8fa3);
    border: none;
    border-radius: 25px;
    padding: 0.8rem 2rem;
    color: white;
    font-family: "cute";
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(255, 107, 157, 0.4),
        0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 6px 20px rgba(255, 107, 157, 0.6),
        0 4px 10px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ff5a8d, #ff7f93);
}

button:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow:
        0 3px 10px rgba(255, 107, 157, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

button::before {
    content: '✨';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
}

button:hover::before {
    left: 10px;
    opacity: 1;
}

button::after {
    content: '💕';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
}

button:hover::after {
    right: 10px;
    opacity: 1;
}

/* Make sure form elements are centered */
form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

label {
    font-weight: bold;
    color: var(--ink);
}

@media (max-width: 600px) {
    #prompt {
        width: 90%;
        /* instead of fixed padding */
        padding: 1.2rem;
        /* reduce padding */
        font-size: 1rem;
        /* ensure text is readable */
    }

    #letter {
        width: 80%;
        padding: 1.5rem;
        font-size: 1rem;
    }
}