:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --card: #ffffff;
  --border: #ddd;
  --correct: #1a7f37;
  --incorrect: #cf222e;
}

* { box-sizing: border-box; }

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

.layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  min-height: 100vh;
  padding: 24px;
}

.app {
  width: 100%;
  max-width: 420px;
}

.screen[hidden] { display: none; }

.known-learners {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.known-learners[hidden] { display: none; }

.continue-btn {
  background: var(--card);
  color: var(--text);
}

#name-form {
  display: flex;
  gap: 8px;
}

#name-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
}

#name-input:focus {
  outline: 2px solid var(--correct);
  outline-offset: 2px;
}

button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--text);
  color: var(--card);
  font-size: 16px;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--correct);
  outline-offset: 2px;
}

button:hover {
  opacity: 0.85;
}

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

.swatch {
  height: 180px;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice-btn {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  text-transform: capitalize;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.choice-btn.correct { background: var(--correct); color: white; }
.choice-btn.incorrect { background: var(--incorrect); color: white; }

.feedback { text-align: center; font-weight: 600; margin-top: 14px; }
.stats { text-align: center; color: #555; margin-top: 10px; font-size: 14px; }
.error { color: var(--incorrect); }

.spectrum[hidden] { display: none; }

#spectrum-canvas {
  width: 28px;
  height: 70vh;
  border-radius: 14px;
  border: 1px solid var(--border);
  image-rendering: auto;
}

@media (max-width: 720px) {
  .layout {
    flex-direction: column;
  }

  #spectrum-canvas {
    width: 90vw;
    height: 28px;
  }
}
