:root {
    --bg: #121213;
    --panel: #1e1e22;
    --border: #3a3a3e;
    --text: #e8e8ea;
    --muted: #9a9a9f;
    --correct: #2e8b57;
    --close: #c9a227;
    --absent: #3a3a3e;
    --accent: #1db954;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    position: relative;
    text-align: center;
    padding: 24px 16px 8px;
}

.lang-switch {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 4px;
}

.lang-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--panel);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.lang-btn.active {
    background: var(--accent);
    color: #03240f;
    border-color: var(--accent);
}

header h1 { margin: 0; font-size: 2rem; letter-spacing: 1px; }
.tagline { color: var(--muted); margin: 4px 0 0; }

main {
    width: 100%;
    max-width: 760px;
    padding: 16px;
    flex: 1;
}

.input-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.autocomplete { position: relative; flex: 1; }

#guess-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font-size: 1rem;
}

#guess-input:focus { outline: 2px solid var(--accent); }

.suggestions {
    position: absolute;
    z-index: 10;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    padding: 4px;
    list-style: none;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.suggestions li {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.suggestions li.active,
.suggestions li:hover { background: var(--accent); color: #03240f; }

button {
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #03240f;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.attempts { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

.message { min-height: 1.2em; margin: 4px 2px; color: #e57373; }

.board { margin-top: 8px; }

/* Each guess is a card: bold centered artist name, then rectangular field boxes. */
.guess-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 12px 14px;
    margin-bottom: 12px;
}

.guess-name {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}

.guess-fields {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--absent);
    min-height: 58px;
    word-break: break-word;
}

.field-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.7;
}

.field-value { font-size: 0.9rem; font-weight: 600; }

.cell.correct { background: var(--correct); border-color: var(--correct); color: #fff; }
.cell.close { background: var(--close); border-color: var(--close); color: #1a1500; }
.cell.absent { background: var(--absent); border-color: var(--border); color: var(--text); }

.arrow { margin-left: 3px; font-size: 0.85em; opacity: 0.9; }

.guess-card.reveal .cell { animation: pop 0.25s ease; }
@keyframes pop { from { transform: scale(0.92); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }

.result {
    margin-top: 20px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

.result h2 { margin: 0 0 8px; }
.share-grid { font-size: 1.4rem; line-height: 1.3; margin: 12px 0; }
.result-actions { display: flex; gap: 8px; justify-content: center; }

footer { padding: 12px; }
.legend { color: var(--muted); font-size: 0.8rem; text-align: center; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.swatch.correct { background: var(--correct); }
.swatch.close { background: var(--close); }
.swatch.absent { background: var(--absent); border: 1px solid var(--border); }

@media (max-width: 560px) {
    .guess-fields { grid-template-columns: repeat(3, 1fr); }
    .field-value { font-size: 0.82rem; }
}
