/* Shared styles for the LanguageBasics flashcard engine.
   Extracted unchanged from the original 6 standalone lesson files
   (they were byte-for-byte identical) and unified here. */

:root {
  --bg: #0f172a;
  --card: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --accent: #2563eb;
  --accent2: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e3a8a, var(--bg));
  color: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.app { width: min(480px, 100%); text-align: center; }

h1 { font-size: 1.25rem; font-weight: 700; margin: 0 0 14px; }

/* Visually hide but keep for screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Lesson selector */
.lesson-select {
  margin: 0 0 14px;
}
.lesson-select select {
  font: inherit;
  padding: 8px 12px;
  border-radius: 10px;
  border: 0;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.card {
  background: var(--card);
  color: var(--text);
  border-radius: 28px;
  min-height: 360px;
  padding: 28px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.label { color: var(--muted); font-size: 1rem; margin-bottom: 8px; }

/* Active-recall instruction shown on the prompt side of each card. */
.recall { color: var(--accent2); font-size: 1rem; font-weight: 600; margin-bottom: 14px; }

.number { font-size: clamp(7rem, 32vw, 11rem); line-height: 1; font-weight: 800; }

.word { font-size: clamp(3rem, 14vw, 5rem); line-height: 1.05; font-weight: 800; color: var(--accent); margin-top: 16px; }

/* Stacked multi-part answer lines (lessons 2 and 6). Each <br>-separated
   line just wraps naturally; matches the original word-line look. */

.pronunciation { font-size: 1.4rem; color: var(--muted); margin-top: 10px; }

.timer { margin: 18px auto 0; width: 100%; height: 10px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; }

/* The bar duration is set inline by engine.js to match each lesson's
   revealMs so the shrink animation and the setTimeout stay in sync. */
.bar { width: 100%; height: 100%; background: var(--accent2); transform-origin: left; animation: shrink 5s linear forwards; }

@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

button {
  border: 0;
  border-radius: 14px;
  padding: 14px 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  color: white;
  background: var(--accent);
}

button.secondary { background: #475569; }

.hint { color: #cbd5e1; font-size: .95rem; margin-top: 12px; }
