/* ============================================================
   flashcard.css — Flashcard-Overlay + Grundform + Fallback
   Setzt colors.css, grid.css und theme.css voraus.
   ============================================================ */

.fc-overlay[hidden] { display: none !important; }

/* ── Overlay ──────────────────────────────────────────────── */
@keyframes fc-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fc-face-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fc-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  font-family: var(--sans);
  touch-action: manipulation;
  animation: fc-enter 0.22s ease;
}

/* ── Header ───────────────────────────────────────────────── */
.fc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.fc-close-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-56);
  border-radius: var(--r-sm);
  transition: background 160ms ease, color 160ms ease;
}

.fc-close-btn:hover {
  background: var(--ink-06);
  color: var(--ink-82);
}

.fc-progress {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-56);
  font-variant-numeric: tabular-nums;
  min-height: 1.2em;
}

/* ── Stage ────────────────────────────────────────────────── */
.fc-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px) clamp(14px, 4vw, 24px);
  overflow: hidden;
}

/* ── Tap-Zonen ────────────────────────────────────────────── */
.fc-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fc-zone--left  { left:  0; }
.fc-zone--right { right: 0; }

/* ── Karte ────────────────────────────────────────────────── */
.fc-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  min-height: 280px;
  border-radius: var(--r-lg);
  background: linear-gradient(
    180deg,
    var(--surface-panel),
    var(--surface-panel-2)
  );
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 36px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.fc-card button {
  pointer-events: auto;
}

/* ── Kartengesichter ──────────────────────────────────────── */
.fc-face {
  width: 100%;
  animation: fc-face-in 0.18s ease;
}

/* Vorderseite: Koreanisches Wort */
.fc-word {
  font-size: clamp(1.6rem, 8vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--accent);
  word-break: keep-all;
  margin-bottom: .5rem;
}

/* Wortart / Grammatik-Badge */
.fc-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent-08);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-78);
  white-space: nowrap;
  margin-bottom: .8rem;
}

/* Grundform unter der konjugierten Form */
.fc-base-form {
  font-size: 14px;
  color: var(--ink-50);
  margin-top: 0.2rem;
  margin-bottom: 0.6rem;
  font-weight: 400;
}

.fc-flip-hint {
  font-size: 12px;
  color: var(--ink-38);
  margin-top: 1.2rem;
  letter-spacing: .03em;
}

/* Rückseite: Deutsche Übersetzung + Beispielsätze */
.fc-translation {
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: .8rem;
}

.fc-example-ko {
  font-size: 14px;
  color: var(--ink-72);
  font-style: italic;
  margin-bottom: .3rem;
  line-height: 1.5;
}

.fc-example-de {
  font-size: 13px;
  color: var(--ink-50);
  line-height: 1.5;
}

/* ── Mode-Select ──────────────────────────────────────────── */
.fc-mode-screen {
  width: 100%;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  animation: fc-face-in 0.18s ease;
  max-height: 70vh;
  overflow-y: auto;
}

.fc-mode-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-72);
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.fc-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-btn);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.fc-mode-btn:hover {
  border-color: var(--accent-30);
  background: var(--surface-btn-hover);
  transform: translateY(-1px);
}

.fc-mode-btn:active {
  transform: translateY(0);
}

.fc-mode-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 1px;
}

.fc-mode-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-92);
}

.fc-mode-count {
  font-size: 12px;
  color: var(--ink-56);
}

/* ── Abschluss-Screen ─────────────────────────────────────── */
.fc-done-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  width: 100%;
  animation: fc-face-in 0.22s ease;
}

.fc-done-emoji {
  font-size: 56px;
  line-height: 1;
}

.fc-done-text {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.fc-done-sub {
  font-size: 13px;
  color: var(--ink-56);
  margin-bottom: 8px;
}

/* ── Footer ───────────────────────────────────────────────── */
.fc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.fc-nav-hint {
  font-size: 12px;
  color: var(--ink-38);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.fc-nav-hint--kb {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--ink-28);
}

@media (hover: none) {
  .fc-nav-hint--kb { display: none; }
}

/* ── Utility ──────────────────────────────────────────────── */
.btn--hidden { display: none !important; }

/* ── Startbildschirm: Lade-Buttons ────────────────────────── */
.ls-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.ls-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  cursor: pointer;
  color: #fff;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ls-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.ls-action-btn:active {
  transform: translateY(0);
}

.ls-action-btn--secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.ls-action-icon {
  font-size: 26px;
  line-height: 1;
}

.ls-action-label {
  font-size: 15px;
  font-weight: 700;
}

.ls-action-sub {
  font-size: 12px;
  opacity: 0.6;
}

/* ── Fallback-Hinweis (API-Ausfall) ───────────────────────── */
.meta-fallback {
  color: var(--warning, #c27800);
  font-weight: 500;
}