:root {
  --bg: #1a2332;
  --panel: #243044;
  --text: #e8eef7;
  --muted: #9aa8bc;
  --tile: #2c3b52;
  --border: #3d516d;
  --correct: #2f9e6b;
  --present: #7b5ea7;
  --absent: #4a5568;
  --accent: #e07a3a;
  --key: #3a4d68;
  --danger: #c44b4b;
  --font: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% 0%, #2a3f5c 0%, transparent 50%),
    radial-gradient(ellipse at 90% 20%, #3a2a1f 0%, transparent 40%),
    var(--bg);
}

#game-container {
  max-width: 420px;
  margin: 56px auto 24px;
  padding: 16px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
}

.tagline {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.diff-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

#difficulty {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}

#timer {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

#board {
  display: grid;
  gap: 6px;
  margin: 0 auto 12px;
}

.row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile);
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: clamp(0.95rem, 4.2vw, 1.35rem);
  font-weight: 700;
  user-select: none;
}

.cell.filled {
  border-color: #6b829f;
}

.cell.correct {
  background: var(--correct);
  border-color: var(--correct);
}

.cell.present {
  background: var(--present);
  border-color: var(--present);
}

.cell.absent {
  background: var(--absent);
  border-color: var(--absent);
}

#status {
  min-height: 1.4em;
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.95rem;
}

#keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

.key {
  min-width: 36px;
  height: 44px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: var(--key);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.key.wide {
  min-width: 64px;
  font-size: 0.85rem;
}

.key.correct { background: var(--correct); }
.key.present { background: var(--present); }
.key.absent { background: var(--absent); }

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.actions button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #1a120c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#reveal {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

@media (max-width: 420px) {
  #game-container {
    margin-top: 48px;
    padding: 12px;
  }

  .key {
    min-width: 30px;
    height: 40px;
    padding: 0 7px;
  }
}
