:root {
    --bg: #ffffff;
    --fg: #1a1a1b;
    --muted: #6b6b6e;
    --border: #d3d6da;
    --gray: #787c7e;
    --yellow: #c9b458;
    --green: #6aaa64;
    --error: #c0392b;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121213;
        --fg: #f5f5f5;
        --muted: #a1a1a6;
        --border: #3a3a3c;
        --gray: #3a3a3c;
        --yellow: #b59f3b;
        --green: #538d4e;
        --error: #ff6b5b;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#content {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 16px;
    text-align: center;
}

h1 {
    margin: 0 0 4px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.help {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

#guessForm {
    display: flex;
    gap: 8px;
    justify-content: center;
}

#guessInput {
    width: 140px;
    padding: 8px 10px;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
}

button {
    font: inherit;
    cursor: pointer;
}

#guessForm button,
#reset {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
}

#error {
    min-height: 20px;
    margin: 6px 0;
    color: var(--error);
    font-size: 14px;
}

#board {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tile {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-size: 26px;
    font-weight: bold;
    text-transform: uppercase;
}

.match0 { background: var(--gray); }
.match1 { background: var(--yellow); }
.match2 { background: var(--green); }

.remove {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 22px;
}

#reset {
    margin-top: 12px;
}

#remaining {
    margin: 24px 0 8px;
    color: var(--muted);
}

#suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.suggestion {
    padding: 6px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.suggestion:hover,
#guessForm button:hover,
#reset:hover {
    border-color: var(--muted);
}
