:root {
    --background: #ffffff;
    --text: #000000;
    --primary: #4CAF50;
    --secondary: #FFA726;
    --error: #f44336;
    --surface: #f5f5f5;
    --border: #e0e0e0;
}

[data-theme="dark"] {
    --background: #121212;
    --text: #ffffff;
    --primary: #81C784;
    --secondary: #FFB74D;
    --error: #E57373;
    --surface: #1E1E1E;
    --border: #424242;
}

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

body {
    font-family: Helvetica, Arial, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    background-color: var(--background);
    color: var(--text);
    transition: background-color 0.3s, color 0.3s;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
}

h1 a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

h1 a:hover {
    opacity: 0.9;
}

.section {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

textarea, input[type="text"] {
    width: 100%;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--background);
    color: var(--text);
    font-size: 1rem;
}

textarea {
    min-height: 200px;
    resize: vertical;
    font-family: inherit;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.3s;
}

button:hover {
    opacity: 0.9;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--border);
}

#themeToggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.game-info {
    margin-bottom: 2rem;
    text-align: center;
}

#currentDefinition {
    font-size: 1.2rem;
    margin: 1rem 0;
}

#progress {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.guess-input {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.guess-input input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--background);
    color: var(--text);
}

#guessHistory {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.guess-display {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
    width: 100%;
}

.guess-history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.letter {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.5rem;
    text-transform: uppercase;
    margin: 0;
}

.letter.correct {
    background-color: var(--primary);
    color: white;
}

.letter.wrong-position {
    background-color: var(--secondary);
    color: white;
}

.letter.incorrect {
    background-color: var(--error);
    color: white;
}

.hidden {
    display: none;
}

.feedback-area {
    text-align: center;
    margin-top: 1rem;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem 0;
    color: var(--text);
    opacity: 0.7;
}

.format-instructions {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.format-example {
    margin: 1rem 0;
}

.format-example h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.format-example pre {
    background-color: var(--surface);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    border: 1px solid var(--border);
}

.format-example p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.8;
}

@media (max-width: 600px) {
    .app-container {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .section {
        padding: 1rem;
    }
    
    .guess-input {
        flex-direction: column;
    }

    .letter {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
        border-width: 1px;
    }
}