body {
    font-family: sans-serif;
    background-color: #333;
    color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    background-color: #444;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 800px;
    width: 90%;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}

h1 {
    font-size: 2.5rem;
    color: #ffd700;
}

.challenge-section {
    margin-bottom: 1.5rem;
}

.challenge-section p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #bbb;
}

.english-sentence-display {
    background-color: #222;
    padding: 1rem;
    border-radius: 8px;
    min-height: 50px;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #eee;
}

.sentence-display {
    background-color: #222;
    padding: 1rem;
    border-radius: 8px;
    min-height: 50px;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.particle-words-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #555;
    padding-bottom: 1rem;
}

.word-button {
    background-color: #555;
    color: #fff;
    border: 2px solid #ffd700;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.word-button:hover {
    background-color: #666;
    transform: translateY(-2px);
}

/* **MODIFIED**: Input section and autocomplete */
.input-section {
    position: relative;
    margin-bottom: 1.5rem;
    /* Moved the calc() for width to this parent container */
    width: calc(100% - 40px); 
    max-width: 760px; /* Adjusted max-width to account for padding/margin */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}

#word-input {
    width: 100%; /* Now takes 100% of its parent (.input-section) */
    min-width: 200px; /* **NEW**: Prevents it from getting too small on mobile */
    padding: 12px 15px;
    font-size: 1.3rem;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background-color: #222;
    color: #eee;
    outline: none;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

#word-input::placeholder {
    color: #aaa;
}

.autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0; /* Align to the left of its parent */
    width: 100%; /* Take full width of parent */
    max-height: 200px;
    overflow-y: auto;
    background-color: #222;
    border: 1px solid #ffd700;
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-align: left;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}

.suggestion-item {
    padding: 10px 15px;
    font-size: 1.2rem;
    color: #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #444;
}

.action-buttons {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.action-buttons button {
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

#clear-button {
    background-color: #e74c3c;
}
#clear-button:hover {
    background-color: #c0392b;
}

#hint-button {
    background-color: #f39c12;
}
#hint-button:hover {
    background-color: #e67e22;
}

#check-button {
    background-color: #3498db;
}
#check-button:hover {
    background-color: #2980b9;
}

#next-button {
    background-color: #2ecc71;
}
#next-button:hover {
    background-color: #27ae60;
}

.feedback-message {
    font-size: 1.2rem;
    margin-top: 0.8rem;
    padding: 0.5rem;
    border-radius: 5px;
    min-height: 1.5rem;
}

.feedback-message.correct {
    background-color: #27ae60;
    color: white;
}

.feedback-message.incorrect {
    background-color: #c0392b;
    color: white;
}

.feedback-message.info {
    background-color: #3498db;
    color: white;
}