:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

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

.alternative-clues {
    display: block;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 600px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

header .subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* New Instructions Section */
.instructions {
    background: #eef2ff;
    /* Light indigo tint */
    border: 1px solid #e0e7ff;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    text-align: center;
}

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

.instructions>p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.instruction-grid {
    display: flex;
    gap: 1rem;
    text-align: left;
}

.instruction-step {
    flex: 1;
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: 8px;
}

.instruction-step h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-icon {
    font-size: 1.2rem;
}

.instruction-step p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

input[type="text"] {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: 'Courier New', Courier, monospace;
    /* Monospace for mask alignment clearly */
}

#mask {
    letter-spacing: 3px;
}

input[type="text"]#meaning {
    font-family: 'Inter', sans-serif;
}

input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
    margin: 0 1rem;
}

button {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"] {
    background-color: var(--primary);
    color: white;
}

button[type="submit"]:hover {
    background-color: var(--primary-hover);
}

button.secondary {
    background-color: transparent;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

button.secondary:hover {
    color: var(--text-main);
    background-color: #f9fafb;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease-up;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 480px) {
    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .letter-count {
        align-self: flex-start;
        margin-top: 0.5rem;
        margin-left: 0;
        /* Reset any margin if it existed */
    }
}

.word-info strong {
    font-size: 1.4rem;
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

.word-info span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.letter-count {
    background: var(--bg-color);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Old footer styles not needed to be explicitly replaced if I append, 
   but replacing works better to keep order clean */
footer {
    text-align: center;
    margin-top: 3rem;
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Latest Solutions */
.latest-solutions {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.latest-solutions h2 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary);
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.latest-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.latest-item:hover {
    transform: translateY(-2px);
}

.latest-word {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.latest-clue {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Benefits Article */
.benefits-article {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    box-shadow: var(--shadow);
    border-top: 5px solid #10b981;
    /* Green accent for health/benefits */
}

.benefits-article h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.benefits-article p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.benefits-article ul {
    list-style-type: none;
    padding-left: 0;
}

.benefits-article li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-muted);
}

.benefits-article li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Autocomplete Suggestions */
.autocomplete-suggestions {
    position: absolute;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1000;
    display: none;
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-suggestions li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--bg-color);
}

.autocomplete-suggestions li:last-child {
    border-bottom: none;
}

.autocomplete-suggestions li:hover {
    background-color: var(--bg-color);
    color: var(--primary);
}