@font-face {
    font-family: 'Ariata Display';
    src: url('assets/fonts/AriataDisplayBlack.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgb(27, 27, 27);
    font-family: 'Georgia', serif;
}

.container {
    text-align: center;
}

h1 {
    color: white;
    margin-bottom: 20px;
    font-family: 'Ariata Display', serif;
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.main-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.submit-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    border-color: white;
    color: white;
    transform: scale(1.1);
}

.submit-btn:active {
    transform: scale(0.95);
}

.submit-btn svg {
    width: 24px;
    height: 24px;
}

.submit-btn.success {
    border-color: #4ade80;
    color: #4ade80;
}

.message-box {
    width: 700px;
    max-width: 100%;
    height: 400px;
    background: #f5f5f0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
    cursor: text;
    position: relative;
    overflow: hidden;
    outline: none;
}

.text-container {
    position: relative;
    z-index: 1;
    font-size: 40px;
    line-height: 64px;
    font-family: 'Dancing Script', cursive;
    color: #333;
    text-align: left;
    word-wrap: break-word;
    min-height: 100%;
}

.letter {
    position: relative;
    display: inline;
    font-family: 'Dancing Script', cursive;
}

.letter.space {
    display: inline;
    width: 0.3em;
}

.letter svg.squiggle {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    transform: translateY(-50%);
    pointer-events: none;
    overflow: visible;
}

.letter svg.squiggle path {
    fill: none;
    stroke: #333;
    stroke-width: 5;
    stroke-linecap: round;
    opacity: 0.9;
}

.cursor {
    display: inline;
    animation: blink 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    color: #333;
    font-weight: 100;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hint {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    font-style: italic;
    margin: 0;
}

.bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 700px;
    max-width: 100%;
    margin-top: 12px;
}

.erase-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    font-size: 12px;
    font-family: 'Outfit', sans-serif;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.erase-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
}

/* Animation for squiggle appearing */
@keyframes drawSquiggle {
    from {
        stroke-dashoffset: 100;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.letter svg.squiggle path {
    stroke-dasharray: 100;
    animation: drawSquiggle 0.2s ease-out forwards;
}

/* New paper slide-in animation */
.new-paper {
    position: fixed;
    width: 700px;
    max-width: calc(100vw - 40px);
    height: 400px;
    background: #f5f5f0;
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.new-paper.sliding {
    animation: slideInPaper 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideInPaper {
    0% {
        transform: rotate(15deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .container {
        display: flex;
        flex-direction: column;
        padding: 0 20px;
        width: 100%;
    }

    /* Flatten wrappers so children become direct flex items of .container */
    .main-row,
    .bottom-row {
        display: contents;
    }

    h1 {
        order: 1;
        font-size: 1.4rem;
        letter-spacing: 1px;
        margin-bottom: 14px;
    }

    .message-box {
        order: 2;
        width: 100%;
        height: 280px;
        padding: 20px;
    }

    .hint {
        order: 3;
        font-size: 12px;
        margin-top: 12px;
        text-align: left;
    }

    .submit-btn {
        order: 4;
        width: 44px;
        height: 44px;
        margin-top: 10px;
        align-self: center;
    }

    .submit-btn svg {
        width: 20px;
        height: 20px;
    }

    .erase-btn {
        order: 5;
        position: fixed;
        bottom: 20px;
        right: 20px;
    }

    .text-container {
        font-size: 28px;
        line-height: 44px;
    }

    .new-paper {
        width: calc(100vw - 40px);
        height: 280px;
    }
}

@media (max-width: 400px) {
    .message-box {
        height: 220px;
        padding: 16px;
    }

    .text-container {
        font-size: 22px;
        line-height: 36px;
    }

    h1 {
        font-size: 1.2rem;
    }

    .new-paper {
        height: 220px;
    }
}
