/* styles.css — "Les verbes au présent" (Francés 6º).
   Diseño alegre y claro, pensado para un niño de 10 años. */

:root {
  --bleu: #1971c2;
  --blanc: #ffffff;
  --rouge: #e03131;
  --ok: #2f9e44;
  --ko: #e03131;
  --casi: #f08c00;
  --ink: #212529;
  --muted: #868e96;
  --bg: #f1f5fb;
  --card: #ffffff;
  --line: #dee2e6;
  --radius: 16px;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

/* ── Cabecera con la bandera francesa ── */
.topbar {
  text-align: center;
  padding: 20px 16px 0;
  background: linear-gradient(90deg, var(--bleu) 0 33%, var(--blanc) 33% 66%, var(--rouge) 66% 100%);
  border-bottom: 4px solid rgba(0, 0, 0, 0.05);
}
.topbar h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  display: inline-block;
  padding: 6px 16px;
  border-radius: 12px;
}
.topbar .sub {
  margin: 8px 0 14px;
  font-weight: 600;
  color: #495057;
  background: rgba(255, 255, 255, 0.75);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 10px;
}

/* ── Pestañas de módulo ── */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding-bottom: 12px;
}
.tab {
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 18px;
  border: none;
  border-radius: 12px 12px 0 0;
  background: rgba(255, 255, 255, 0.6);
  color: #495057;
  cursor: pointer;
}
.tab.active {
  background: var(--card);
  color: var(--bleu);
  box-shadow: var(--shadow);
}

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.hidden { display: none !important; }

.intro {
  background: #e7f5ff;
  border-left: 5px solid var(--bleu);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 0;
}

/* ── Selector de verbos ── */
.verb-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 18px;
}
.verb-btn {
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 16px;
  border: 3px solid transparent;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s ease;
  min-width: 108px;
}
.verb-btn .em { font-size: 1.5rem; display: block; }
.verb-btn .es { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.verb-btn:hover { transform: translateY(-2px); }
.verb-btn.active { border-color: currentColor; }

/* ── Panel del verbo ── */
.verb-panel { margin-bottom: 26px; }
.verb-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.verb-card .head {
  color: #fff;
  padding: 14px 18px;
}
.verb-card .head h2 { margin: 0; font-size: 1.5rem; }
.verb-card .head .tr { opacity: 0.9; font-weight: 600; }

table.conj {
  width: 100%;
  border-collapse: collapse;
}
table.conj td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
table.conj tr:last-child td { border-bottom: none; }
.conj .pron { color: var(--muted); font-weight: 700; width: 34%; }
.conj .forma { font-weight: 800; font-size: 1.15rem; }
.conj .forma .end { color: var(--rouge); }        /* terminación resaltada */
.conj .es-tr { color: var(--muted); font-size: 0.85rem; }
.speak {
  border: none;
  background: #f1f3f5;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
}
.speak:hover { background: #e9ecef; }

.truco {
  background: #fff9db;
  border-left: 5px solid var(--casi);
  margin: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
}

/* ── Modo tarjetas ── */
.flash-zone {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.flash-head { display: flex; align-items: center; justify-content: space-between; }
.flash-head h3 { margin: 0; }
.flashcard {
  margin-top: 14px;
  text-align: center;
  border: 3px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 16px;
}
.flashcard .prompt { font-size: 1.1rem; color: var(--muted); }
.flashcard .big { font-size: 2rem; font-weight: 900; margin: 8px 0; }
.flashcard .answer { font-size: 1.8rem; font-weight: 900; color: var(--ok); margin: 8px 0; }
.flash-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

/* ── Botones ── */
.btn {
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.btn-primary { background: var(--bleu); color: #fff; }
.btn-secondary { background: #e9ecef; color: var(--ink); }
.btn:hover { filter: brightness(0.95); }

/* ── Ejercicios ── */
.ejercicio {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 22px;
}
.ejercicio h2 {
  margin-top: 0;
  font-size: 1.25rem;
  border-bottom: 3px solid var(--bleu);
  padding-bottom: 6px;
}
.ejercicio .enun { color: #495057; font-weight: 600; }
.fila {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.fila:last-child { border-bottom: none; }
.fila .num { color: var(--muted); font-weight: 800; min-width: 22px; }
.hueco {
  font: inherit;
  padding: 6px 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  width: 110px;
  text-align: center;
}
.hueco:focus { outline: none; border-color: var(--bleu); }
.hueco.ok { border-color: var(--ok); background: #ebfbee; }
.hueco.ko { border-color: var(--ko); background: #fff0f0; }
.hueco.casi { border-color: var(--casi); background: #fff9db; }
.es-hint { color: var(--muted); font-style: italic; }

/* Vrai / Faux */
.vf-choices { display: inline-flex; gap: 6px; }
.vf-choices button {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
  font-weight: 700;
}
.vf-choices button.sel { border-color: var(--bleu); background: #e7f5ff; }

/* Emparejar */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-col h4 { margin: 4px 0; color: var(--muted); }
.match-item {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
}
.match-item.sel { border-color: var(--bleu); background: #e7f5ff; }
.match-item.done { border-color: var(--ok); background: #ebfbee; cursor: default; }
.match-item.done .badge { color: var(--ok); font-weight: 800; }

.acciones { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.resultado { font-weight: 800; }
.resultado.ok { color: var(--ok); }
.resultado.ko { color: var(--ko); }

.corr {
  font: inherit;
  padding: 4px 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  width: 130px;
}

.foot {
  text-align: center;
  color: var(--muted);
  padding: 20px;
  font-size: 0.9rem;
}
.foot a { color: var(--bleu); font-weight: 700; }

@media (max-width: 520px) {
  .match-grid { grid-template-columns: 1fr; }
  .verb-btn { min-width: 88px; }
}
