/* Flashcards */

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 var(--s-4); }

.study-top { display: flex; justify-content: space-between; gap: var(--s-3); color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
#study .progress { margin: var(--s-2) 0 var(--s-5); }
#progressBar { width: 0; }

.card-stage { perspective: 1400px; }
.flashcard {
  display: block;
  width: 100%;
  min-height: clamp(280px, 48vh, 380px);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: center;
  cursor: pointer;
  border-radius: var(--r-md);
}
.flashcard:focus-visible { box-shadow: var(--focus); }
.flashcard__inner {
  position: relative;
  display: block;
  width: 100%;
  min-height: inherit;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(.2, .7, .2, 1);
}
.flashcard.is-flipped .flashcard__inner { transform: rotateY(180deg); }
.flashcard.no-anim .flashcard__inner { transition: none; }
.flashcard.is-new .flashcard__inner { animation: fc-in 0.22s ease-out; }
@keyframes fc-in { from { opacity: 0.4; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.flashcard__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flashcard__back { transform: rotateY(180deg); background: var(--surface); border-color: var(--line-strong); }
@media (prefers-reduced-motion: reduce) {
  .flashcard__inner { transition: none; }
  .flashcard.is-new .flashcard__inner { animation: none; }
}

.fc-klass { color: var(--muted); font-size: var(--step--1); }
.fc-word { font-size: clamp(2.2rem, 8vw, 3.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; overflow-wrap: anywhere; }
.fc-word--small { font-size: var(--step-2); background: linear-gradient(to bottom, transparent 60%, var(--highlight-soft) 60%, var(--highlight-soft) 90%, transparent 90%); padding: 0 0.1em; }
.fc-def { font-family: var(--font-read); font-size: var(--step-1); line-height: 1.45; max-width: 34ch; }
.fc-row { color: var(--muted); font-size: var(--step--1); max-width: 46ch; }
.fc-label { font-weight: 600; color: var(--text); }
.fc-ex { font-family: var(--font-read); font-style: italic; color: var(--muted); max-width: 44ch; }

.hint { text-align: center; color: var(--muted); font-size: var(--step--1); margin: var(--s-3) 0 0; }
.answer-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-4); }
.answer-btn { min-height: 52px; font-size: var(--step-0); }
.answer-btn kbd { margin-right: var(--s-1); }
.answer-btn--yes kbd { background: transparent; color: inherit; border-color: currentColor; }
.study-tools { display: flex; justify-content: space-between; margin-top: var(--s-5); }

.summary-big { font-size: var(--step-2); font-weight: 700; }
.missed { list-style: none; padding: 0; margin: 0 0 var(--s-2); }
.missed li { padding: var(--s-2) 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.missed span { color: var(--muted); font-family: var(--font-read); font-size: 0.97rem; }
#summary .btn-row { margin-top: var(--s-5); }
