:root {
    --bg-color: #f4e8d1;
    --text-color: #4a3b2c;
    --accent-color: #8b5a2b;
    --border-color: #cda476;
}

body {
    margin: 0;
    padding: 0;
    background-color: #2c241b;
    font-family: 'Playfair Display', serif;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.parchment {
    background-color: var(--bg-color);
    background-image: url('https://www.transparenttextures.com/patterns/aged-paper.png');
    max-width: 800px;
    width: 90%;
    margin: 40px auto;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 50px rgba(139, 90, 43, 0.2);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    position: relative;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 3em;
    color: var(--accent-color);
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.subtitle {
    font-style: italic;
    font-size: 1.1em;
    color: #6b533c;
}

.ornament {
    font-size: 2em;
    color: var(--accent-color);
    text-align: center;
    margin: 20px 0;
}

.intro {
    font-size: 1.2em;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.dictionary {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.word-entry {
    background: rgba(255, 255, 255, 0.3);
    padding: 15px 20px;
    border-left: 4px solid var(--accent-color);
    border-radius: 0 5px 5px 0;
    transition: transform 0.2s, background-color 0.2s;
}

.word-entry:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.5);
}

.word-title {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 1.3em;
    color: var(--accent-color);
}

.word-meaning {
    font-size: 1.2em;
    margin-left: 10px;
}

.word-author {
    font-size: 0.9em;
    font-style: italic;
    color: #7a634c;
    margin-top: 5px;
    text-align: right;
}

.add-word-section {
    background: rgba(139, 90, 43, 0.1);
    padding: 30px;
    border: 1px dashed var(--border-color);
    border-radius: 5px;
}

h2 {
    font-family: 'Cinzel', serif;
    text-align: center;
    color: var(--accent-color);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.5);
    font-family: 'Playfair Display', serif;
    font-size: 1.1em;
    box-sizing: border-box;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.8);
}

button {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    font-family: 'Cinzel', serif;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #6b4420;
}

footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.9em;
    color: #6b533c;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

#formMessage {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-radius: 3px;
}

.hidden {
    display: none;
}

.success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    border: 1px solid #4caf50;
}

@media (max-width: 600px) {
    .parchment {
        padding: 20px;
    }
    h1 {
        font-size: 2em;
    }
}
