body {
    background-color: #1a1a2e;
    color: #e0e0e0;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Base styles for containers */
#lock-screen, main, #letter-section {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

/* Lock Screen Styles */
#lock-screen h1 {
    color: #fca311;
}
.puzzle-text {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #c0c0c0;
}
#lock-error {
    color: #ff4d4d;
    margin-top: 10px;
    font-weight: bold;
}

/* Main Chat Styles */
#chat-container {
    background-color: #16213e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    padding: 20px;
    height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
    text-align: left;
}
.chat-message {
    margin-bottom: 15px;
    line-height: 1.5;
}
.chat-message strong {
    color: #fca311;
}
#error-message {
    color: #ff4d4d;
    margin-top: 10px;
    font-weight: bold;
}

/* Letter Section Styles */
.letter-nav {
    text-align: right;
    margin-bottom: 20px;
}
#letter-content {
    background-color: #16213e;
    padding: 25px;
    border-radius: 8px;
    line-height: 1.8;
    text-align: left;
    white-space: pre-wrap;
}
.letter-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Form Styles */
form {
    display: flex;
    gap: 10px;
}
label {
    position: absolute;
    left: -10000px; /* Hide label visually but keep for screen readers */
}
input[type="text"], textarea {
    flex-grow: 1;
    background-color: #0f3460;
    border: 1px solid #e0e0e0;
    color: #e0e0e0;
    padding: 10px;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Segoe UI', sans-serif;
}
input[type="text"]:focus, textarea:focus {
    outline: 2px solid #fca311;
}
button {
    background-color: #fca311;
    color: #1a1a2e;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
}
button:focus {
    outline: 2px solid #e0e0e0;
}

/* Hide elements by default */
#main-content, #input-area, #letter-section, #comments-section {
    display: none;
}

/* Comments Section Styles */
#comments-section h3 {
    color: #fca311;
}
.comment {
    background-color: #16213e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    text-align: left;
}
.comment-text {
    line-height: 1.6;
}
.comment-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.comment-actions button {
    background-color: transparent;
    color: #fca311;
    border: 1px solid #fca311;
    padding: 5px 10px;
    font-size: 0.9em;
}
.comment-actions button.delete-btn {
    color: #ff4d4d;
    border-color: #ff4d4d;
}
.edit-textarea {
    width: 100%;
    box-sizing: border-box;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
}
.modal-content {
    background-color: #1a1a2e;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #fca311;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}
.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}
.close-btn:hover,
.close-btn:focus {
    color: #fca311;
    text-decoration: none;
    cursor: pointer;
}
#archive-list {
    list-style: none;
    padding: 0;
}
#archive-list li {
    background-color: #16213e;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 5px;
    cursor: pointer;
}
#archive-list li:hover {
    background-color: #0f3460;
}

/* Birthday Intro Styles */
#birthday-intro {
    width: 100%;
    max-width: 800px;
    text-align: center;
    padding: 20px;
}

.intro-title {
    color: #fca311;
    font-size: 2.5em;
    margin-bottom: 30px;
    animation: fadeIn 2s ease-in;
}

#wishes-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wish-card {
    background-color: rgba(22, 33, 62, 0.9);
    border: 1px solid #fca311;
    border-radius: 10px;
    padding: 20px;
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.wish-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.wish-sender {
    color: #fca311;
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
    display: block;
}

.wish-text {
    font-size: 1.1em;
    line-height: 1.6;
    font-style: italic;
}

#start-story-btn {
    background-color: #fca311;
    color: #1a1a2e;
    font-size: 1.5em;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(252, 163, 17, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: pulse 2s infinite;
}

#start-story-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(252, 163, 17, 0.8);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}