:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #000;
  color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#app { width: 100%; max-width: 460px; padding-top: 56px; }
.card { text-align: center; }
h1 { margin: 8px 0 16px; font-size: 1.5rem; font-weight: 600; }
.progress {
  color: #8a8a8a;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 20px;
}
.prompt {
  font-family: inherit;
  font-size: 1.9rem;
  font-weight: 600;
  min-height: 3.4rem;
  margin: 12px 0 4px;
  white-space: pre-wrap;
}
.prompt.stacked {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 2.5rem;
  letter-spacing: .3em;
}
.feedback {
  min-height: 3.6rem;
  font-size: 1rem;
  color: #9a9a9a;
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.answer-row { display: flex; gap: 8px; }
.answer-input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-align: center;
  background: #050505;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  color: #f5f5f5;
  padding: 10px 8px;
  outline: none;
}
.answer-input:focus { border-color: #5a5a5a; }
.answer-input::placeholder { color: #444; }
.check-btn {
  padding: 10px 22px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: #f5f5f5;
  color: #000;
  cursor: pointer;
}
.check-btn:active { background: #d4d4d4; }
.digit-strip { display: none; margin-top: 10px; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (pointer: coarse) {
  .digit-strip { display: grid; }
}
.digit-btn {
  padding: 14px 0;
  font-size: 1.25rem;
  font-weight: 600;
  border: 1px solid #222;
  border-radius: 12px;
  background: #0a0a0a;
  color: #f5f5f5;
  cursor: pointer;
}
.digit-btn:active { background: #181818; transform: scale(.98); }
/* removed: .display, .keypad, .key */
.primary {
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid #333;
  border-radius: 999px;
  cursor: pointer;
  display: block;
  width: 100%;
  margin-top: 14px;
  background: #0a0a0a;
  color: #f5f5f5;
}
.primary:active { background: #181818; }
.next {
  background: #f5f5f5;
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 8px;
}
.next:active { background: #d4d4d4; }
.stars { font-size: 2.6rem; letter-spacing: .18em; margin: 18px 0 6px; }
.result p { color: #9a9a9a; }
.shake { animation: shake .35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* Hamburger + topic menu */
.menu-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: #000;
  border: 1px solid #222;
  border-radius: 10px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.menu-btn span {
  display: block;
  height: 2px;
  background: #f5f5f5;
  border-radius: 1px;
}
.menu-btn:active { background: #181818; }
.menu-panel {
  position: fixed;
  top: 62px;
  right: 14px;
  width: 240px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.menu-panel[hidden] { display: none; }
.menu-item {
  text-align: left;
  padding: 11px 12px;
  font-size: .95rem;
  color: #d4d4d4;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.menu-item:hover { background: #181818; }
.menu-item.active { color: #fff; }
.menu-item.active::after { content: ' ✓'; }
