:root {
    --primary: #4a90e2;
    --secondary: #357abd;
    --text: #333;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --red: #e74c3c;
    --green: #2ecc71;
}

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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: var(--text);
}

.timer {
    color: var(--primary);
    font-weight: bold;
}

.game-content {
    text-align: center;
}

.word-display {
    margin-bottom: 2rem;
}

.current-word {
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: bold;
    margin: 1rem 0;
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.input-section {
    margin-bottom: 2rem;
}

input[type="text"] {
    width: 70%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    margin-right: 0.5rem;
}

button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: var(--secondary);
}

.word-history {
    text-align: left;
    margin-top: 2rem;
}

.word-history h3 {
    color: var(--text);
    margin-bottom: 1rem;
}

.word-history ul {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
}

.word-history li {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.game-instructions {
    text-align: center;
    padding: 2rem;
}

.game-instructions h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.game-instructions ul {
    list-style: none;
    margin-bottom: 2rem;
}

.game-instructions li {
    margin: 1rem 0;
    font-size: 1.2rem;
    color: var(--text);
}

.start-btn {
    font-size: 1.5rem;
    padding: 1rem 3rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.start-btn:hover {
    background: var(--secondary);
}

.game-play {
    width: 100%;
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.game-over h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.game-over p {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.hidden {
    display: none;
}

.word-input-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.error-message {
    color: #ff4444;
    font-size: 0.9em;
    margin-top: 5px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.error-message.hidden {
    opacity: 0;
}

#wordInput {
    padding: 10px;
    font-size: 1.1em;
    border: 2px solid #4a90e2;
    border-radius: 5px;
    margin-right: 10px;
    width: 200px;
}

#submitWord {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#submitWord:hover {
    background-color: #357abd;
}
