:root {
  --bg: #faf9f7;
  --fg: #1c1c1e;
  --muted: #8a8a8e;
  --accent: #2f6fed;
  --accent-soft: #e6efff;
  --know: #34c759;
  --repeat: #ff9500;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}
.screen.active {
  display: flex;
}

/* Стартовый экран */
.start-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin: 40px 0 8px;
}
.start-progress {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 32px;
}
.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
  margin-bottom: auto;
}
.mode-button {
  border: none;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
  text-align: center;
  cursor: pointer;
}
.mode-button .flags {
  font-size: 32px;
}
.mode-button .name {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 600;
}
.mode-button .count {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

/* Экран карточки */
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.card-mode-flags {
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  padding: 4px 8px;
  margin: -4px -8px;
  cursor: pointer;
}
.card-mode-flags:active {
  opacity: 0.6;
}
.card-words {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  text-align: center;
}
.word {
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}
.word .text {
  font-size: 34px;
  font-weight: 700;
}
.word .translit {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 18px;
}
.word.speaking .text {
  color: var(--accent);
  transform: scale(1.06);
}
.replay-button {
  align-self: center;
  margin: 8px 0 24px;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  width: 56px;
  height: 56px;
  font-size: 24px;
  cursor: pointer;
}
.answer-buttons {
  display: flex;
  gap: 16px;
}
.answer-button {
  flex: 1;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}
.answer-button.know {
  background: var(--know);
}
.answer-button.repeat {
  background: var(--repeat);
}

/* Экран итога */
.end-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}
.end-title {
  font-size: 26px;
  font-weight: 700;
}
.end-stats {
  font-size: 18px;
  color: var(--muted);
}
.end-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 24px;
}
.end-button {
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}
.end-button.primary {
  background: var(--accent);
  color: #fff;
}
.end-button.secondary {
  background: #fff;
  color: var(--fg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
