/* ferbot-guia.css — Estilos de la guía interactiva (Unidades) */

/* ─── Root scope ───────────────────────────────────────── */
#fer-guia-root {
  position: relative;
  width: 100%; height: 100%;
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  color: var(--fer-ink, #2A2F4A);
  overflow: hidden;
}
#fer-guia-root *,
#fer-guia-root *::before,
#fer-guia-root *::after { box-sizing: border-box; }

#fer-guia-root .fg-screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--fer-cream, #FFF8E8);
  overflow-y: auto;
  opacity: 1;
}
@keyframes fgFadeIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes fgPopIn  { from { opacity: 0; transform: scale(.6) } to { opacity: 1; transform: scale(1) } }
@keyframes fgBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
@keyframes fgShake  { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
@keyframes fgWiggle { 0%,100%{transform:rotate(-3deg)} 50%{transform:rotate(3deg)} }
@keyframes fgFall   { to { transform: translateY(900px) rotate(720deg); opacity: 0.3 } }
@keyframes fgGlow   { 0%,100%{box-shadow: 0 0 0 0 rgba(91,206,126,0)} 50%{box-shadow: 0 0 0 12px rgba(91,206,126,0.2)} }

.fg-pop   { animation: fgPopIn .4s cubic-bezier(.2,1.5,.4,1) both; }
.fg-bounce{ animation: fgBounce 1.2s ease-in-out infinite; }
.fg-shake { animation: fgShake .35s ease; }
.fg-glow  { animation: fgGlow 1.4s ease-in-out infinite; }
.fg-wiggle{ animation: fgWiggle .5s ease-in-out infinite; }

/* ─── Botones primarios ────────────────────────────────── */
.fg-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit;
  border-radius: 999px; font-weight: 800;
  padding: 11px 22px; font-size: 16px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
  transition: transform .08s, box-shadow .08s;
  -webkit-tap-highlight-color: transparent;
}
.fg-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }
.fg-btn.fg-blue   { background: var(--fer-blue);   color: #fff; }
.fg-btn.fg-green  { background: var(--fer-green);  color: #fff; }
.fg-btn.fg-yellow { background: var(--fer-yellow); color: var(--fer-ink); }
.fg-btn.fg-red    { background: var(--fer-red);    color: #fff; }
.fg-btn.fg-white  { background: #fff; color: var(--fer-ink); }
.fg-btn.fg-lg { padding: 14px 28px; font-size: 19px; }
.fg-btn.fg-sm { padding: 7px 14px;  font-size: 13px; }
.fg-btn[disabled] { opacity: .4; cursor: default; }
.fg-btn[disabled]:active { transform: none; box-shadow: 0 4px 0 rgba(0,0,0,0.15); }

/* ─── Pills ────────────────────────────────────────────── */
.fg-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--fer-ink);
  padding: 7px 16px; border-radius: 999px;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.10);
  white-space: nowrap;
}
.fg-pill.fg-yellow { background: var(--fer-yellow); color: var(--fer-ink); }
.fg-pill.fg-blue   { background: var(--fer-blue);   color: #fff; }
.fg-pill.fg-red    { background: var(--fer-red);    color: #fff; }
.fg-pill.fg-green  { background: var(--fer-green);  color: #fff; }
.fg-pill.fg-dark   { background: var(--fer-ink);    color: #fff; }

/* ─── Tarjeta blanca ───────────────────────────────────── */
.fg-card {
  background: #fff; border-radius: 22px; padding: 18px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.06), 0 12px 28px rgba(0,0,0,0.05);
}

/* ─── Estrellas ────────────────────────────────────────── */
.fg-stars { display: inline-flex; gap: 3px; }
.fg-star {
  width: 22px; height: 22px;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2l3 7h7l-5.5 4.5L18.5 21 12 17l-6.5 4 2-7.5L2 9h7z' fill='rgba(0,0,0,0.12)'/%3E%3C/svg%3E");
}
.fg-star.fg-on {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2l3 7h7l-5.5 4.5L18.5 21 12 17l-6.5 4 2-7.5L2 9h7z' fill='%23FFC83D' stroke='%23E89F00' stroke-width='1.2'/%3E%3C/svg%3E");
}

/* ─── Mascota helper ───────────────────────────────────── */
.fg-mascot { display: inline-block; }
.fg-mascot.fg-bounce svg { animation: fgBounce 1s ease-in-out infinite; }

/* ─── Bocadillo de FERBOT ──────────────────────────────── */
.fg-speech {
  position: relative; background: #fff; padding: 18px 22px;
  border-radius: 24px; box-shadow: 0 6px 0 rgba(0,0,0,0.06), 0 12px 28px rgba(0,0,0,0.05);
  font-size: 17px; font-weight: 700; line-height: 1.3;
}
.fg-speech::before {
  content: ''; position: absolute; left: -14px; top: 24px;
  width: 0; height: 0;
  border-right: 16px solid #fff;
  border-top: 10px solid transparent; border-bottom: 10px solid transparent;
}
.fg-highlight { background: #FFF1B0; padding: 1px 8px; border-radius: 6px; }

/* ─── HOME ────────────────────────────────────────────── */
.fg-home {
  background: radial-gradient(circle at 20% 0%, #FFEEC2 0%, var(--fer-cream) 60%);
}
.fg-home-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 8px;
}
.fg-home-greeting { font-size: 14px; color: var(--fer-ink-soft); font-weight: 700; }
.fg-home-name { font-size: 22px; font-weight: 800; line-height: 1.1; }

.fg-home-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 22px;
}
.fg-home-hero .fg-speech { flex: 1; }

.fg-units-wrap {
  flex: 1; padding: 24px 16px 24px;
  position: relative;
}
.fg-units-path {
  position: absolute; left: 0; right: 0; top: 60px; height: 6px;
  pointer-events: none;
}
.fg-units-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 12px;
  padding: 0 8px;
  position: relative; z-index: 2;
}
@media (min-width: 760px) { .fg-units-grid { grid-template-columns: repeat(8, 1fr); } }

.fg-unit {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.fg-unit-bubble {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; position: relative;
  border: 5px solid #fff;
}
.fg-unit-bubble.fg-locked { background: #E8E2D2; }
.fg-unit-bubble.fg-locked .fg-unit-icon { filter: grayscale(1) opacity(.5); }
.fg-unit.fg-current .fg-unit-bubble {
  width: 110px; height: 110px; font-size: 50px;
}
.fg-unit-badge {
  position: absolute; top: -8px; left: -8px;
  background: #fff; font-weight: 800;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.fg-unit-play {
  position: absolute; bottom: -4px; right: -4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #FFC83D; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 3px solid #fff;
  animation: fgBounce 1.5s ease-in-out infinite;
}
.fg-unit-medal {
  position: absolute; top: -8px; right: -8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--fer-green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; border: 3px solid #fff;
}
.fg-unit-name { font-weight: 800; font-size: 14px; text-align: center; }
.fg-unit-sub  { font-size: 10px; color: var(--fer-ink-soft); text-align: center; line-height: 1.2; max-width: 100px; }
.fg-unit-stars-label { font-weight: 800; font-size: 12px; margin-top: 2px; }

/* ─── UNIT SCREEN ──────────────────────────────────────── */
.fg-unit-screen { padding-bottom: 30px; }
.fg-unit-header {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px;
}
.fg-back-btn {
  width: 52px; height: 52px; border-radius: 16px;
  background: #fff; border: none; cursor: pointer;
  font-size: 24px; color: var(--fer-ink);
  box-shadow: 0 4px 0 rgba(0,0,0,0.08);
}
.fg-back-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
.fg-unit-header-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; border: 4px solid #fff;
}
.fg-unit-header-title { font-family: 'Fredoka', sans-serif; font-size: 28px; font-weight: 800; }
.fg-unit-header-num   { font-size: 13px; font-weight: 700; color: var(--fer-ink-soft); }
.fg-unit-header-sub   { font-size: 14px; color: var(--fer-ink-soft); font-weight: 600; }
.fg-unit-stars-pill { margin-left: auto; }

.fg-unit-intro {
  display: flex; align-items: center; gap: 16px; padding: 4px 22px 18px;
}
.fg-unit-intro .fg-speech { flex: 1; }

.fg-lessons-grid {
  padding: 0 22px;
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 600px) { .fg-lessons-grid { grid-template-columns: repeat(3, 1fr); } }

.fg-lesson-card {
  background: #fff; border-radius: 22px; padding: 18px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.06), 0 12px 24px rgba(0,0,0,0.05);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  position: relative; border: 4px solid transparent;
  transition: transform .12s;
}
.fg-lesson-card:active { transform: translateY(2px); }
.fg-lesson-card.fg-locked { opacity: .55; cursor: default; }
.fg-lesson-card.fg-locked:active { transform: none; }
.fg-lesson-num {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.fg-lesson-num-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: #F3EBD5; color: var(--fer-ink-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; border: 3px solid #fff;
}
.fg-lesson-num-circle.fg-done { background: var(--fer-green); color: #fff; }
.fg-lesson-num-label { font-size: 13px; font-weight: 700; color: var(--fer-ink-soft); }
.fg-lesson-title { font-size: 19px; font-weight: 800; line-height: 1.2; min-height: 50px; }
.fg-lesson-stars { margin-top: 10px; }

/* ─── LESSON SCREEN ────────────────────────────────────── */
.fg-lesson-screen { padding-bottom: 90px; }
.fg-lesson-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
}
.fg-lesson-header-left { display: flex; align-items: center; gap: 14px; }
.fg-lesson-unit-label { font-size: 12px; font-weight: 700; color: var(--fer-ink-soft); }
.fg-lesson-title-large {
  font-family: 'Fredoka', sans-serif; font-size: 22px; font-weight: 800; line-height: 1.1;
}
.fg-progress-track { display: flex; gap: 5px; }
.fg-progress-bar {
  width: 42px; height: 8px; border-radius: 4px;
  background: rgba(0,0,0,0.08); transition: background .25s;
}
.fg-progress-bar.fg-current { background: var(--fer-blue); }
.fg-progress-bar.fg-done    { background: var(--fer-green); }

.fg-concept {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 22px 18px;
}
.fg-concept .fg-mascot { flex-shrink: 0; }
.fg-concept-bubble { flex: 1; }
.fg-concept-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

.fg-activity { padding: 4px 22px; }
.fg-activity-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  flex-wrap: wrap;
}
.fg-activity-question { font-size: 20px; font-weight: 800; flex: 1; min-width: 0; }
.fg-activity-counter { font-size: 13px; font-weight: 700; color: var(--fer-ink-soft); white-space: nowrap; }

/* ─── Footer de lección ────────────────────────────────── */
.fg-lesson-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px 20px;
  background: linear-gradient(180deg, transparent, var(--fer-cream) 30%);
}

/* ─── Activities ──────────────────────────────────────── */
.fg-grid-6 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 480px) { .fg-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .fg-grid-6 { grid-template-columns: repeat(6, 1fr); } }
.fg-grid-3 { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.fg-grid-3 > * { flex: 1; min-width: 130px; max-width: 220px; }

.fg-option-card {
  background: #fff; border: 4px solid transparent;
  border-radius: 20px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.06);
  cursor: pointer; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.fg-option-card:active { transform: translateY(2px); }
.fg-option-card.fg-right { background: rgba(91,206,126,0.15); border-color: var(--fer-green); }
.fg-option-card.fg-wrong { background: #FFE3E5; border-color: var(--fer-red); }
.fg-option-emoji { font-size: 48px; }
.fg-option-label { font-weight: 800; font-size: 13px; text-align: center; }
.fg-mark {
  position: absolute; top: -10px; right: -10px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  border: 3px solid #fff; animation: fgPopIn .4s ease both;
}
.fg-mark.fg-ok   { background: var(--fer-green); }
.fg-mark.fg-no   { background: var(--fer-red); }
.fg-mark.fg-done { background: var(--fer-green); }

/* Hero swatch (color sensor) */
.fg-hero-color {
  width: 110px; height: 110px; border-radius: 20px;
  margin: 0 auto 14px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), inset 0 -8px 20px rgba(0,0,0,0.18);
}

/* Match pairs */
.fg-match {
  display: grid; grid-template-columns: 1fr 30px 1fr; gap: 16px; align-items: center;
}
.fg-match-col { display: flex; flex-direction: column; gap: 10px; }
.fg-match-item {
  background: #fff; border: 4px solid transparent; border-radius: 18px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.06); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fg-match-item:active { transform: translateY(2px); }
.fg-match-item.fg-picked { border-color: var(--fer-blue); }
.fg-match-item.fg-paired { opacity: .9; }
.fg-match-icon { font-size: 28px; }
.fg-match-label { font-weight: 800; font-size: 16px; }
.fg-match-divider { text-align: center; font-size: 22px; color: #ccc; }

/* Sort bins */
.fg-sort-items {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 14px; min-height: 90px;
}
.fg-sort-item {
  width: 90px; background: #fff; border-radius: 16px; padding: 8px;
  text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,0.08);
}
.fg-sort-emoji { font-size: 30px; }
.fg-sort-label { font-weight: 700; font-size: 12px; }
.fg-sort-btns { display: flex; gap: 4px; margin-top: 6px; justify-content: center; }
.fg-sort-btn {
  border: none; padding: 3px 10px; border-radius: 999px;
  color: #fff; font-weight: 800; cursor: pointer; font-size: 12px;
}
.fg-bins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.fg-bin {
  border-radius: 22px; padding: 14px; min-height: 130px;
  border: 4px dashed currentColor;
}
.fg-bin-label { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.fg-bin-items { display: flex; flex-wrap: wrap; gap: 6px; }
.fg-bin-chip {
  background: #fff; border-radius: 12px; padding: 4px; width: 64px; text-align: center;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.fg-bin-chip .fg-sort-emoji { font-size: 24px; }
.fg-bin-chip .fg-sort-label { font-size: 11px; }

/* Gallery */
.fg-gallery-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px) { .fg-gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .fg-gallery-grid { grid-template-columns: repeat(6, 1fr); } }
.fg-gallery-item {
  background: #fff; border-radius: 18px; padding: 10px;
  border: 4px solid transparent;
  box-shadow: 0 5px 0 rgba(0,0,0,0.06);
  cursor: pointer; position: relative;
  -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.fg-gallery-item:active { transform: translateY(2px); }
.fg-gallery-item.fg-visited { border-color: var(--fer-green); }
.fg-gallery-item.fg-active  { border-color: var(--fer-blue); }
.fg-gallery-img {
  width: 100%; height: 90px;
  background: repeating-linear-gradient(45deg, #F3EBD5 0 8px, #FFF8E8 8px 16px);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--fer-ink-soft);
  text-align: center; padding: 6px;
  border: 2px dashed rgba(0,0,0,0.15);
  font-family: ui-monospace, monospace;
  white-space: pre-line;
}
.fg-gallery-img img { width: 100%; height: 100%; object-fit: contain; border: none; }
.fg-gallery-item.fg-has-img .fg-gallery-img { background: #fff; border: none; padding: 0; }
.fg-gallery-name { font-weight: 800; font-size: 13px; text-align: center; }
.fg-gallery-desc-card {
  margin-top: 14px; padding: 14px;
  background: #fff; border-radius: 18px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
  display: flex; align-items: center; gap: 14px;
  animation: fgFadeIn .35s ease both;
}

/* Checklist */
.fg-checklist { display: flex; flex-direction: column; gap: 10px; }
.fg-check-row {
  background: #fff; border: 4px solid transparent;
  border-radius: 18px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.06); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fg-check-row.fg-done {
  background: rgba(91,206,126,0.15);
  border-color: var(--fer-green);
}
.fg-check-box {
  width: 38px; height: 38px; border-radius: 50%;
  background: #F3EBD5; color: var(--fer-ink-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; border: 3px solid #fff;
  flex-shrink: 0;
}
.fg-check-row.fg-done .fg-check-box { background: var(--fer-green); color: #fff; }
.fg-check-icon { font-size: 26px; flex-shrink: 0; }
.fg-check-label { flex: 1; font-size: 16px; font-weight: 700; }
.fg-check-row.fg-done .fg-check-label { text-decoration: line-through; opacity: .7; }

/* Choose branch (Auto/Grúa) */
.fg-branches { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.fg-branch {
  width: 240px; background: #fff; border-radius: 24px; padding: 16px;
  border: 5px solid transparent;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08), 0 12px 24px rgba(0,0,0,0.05);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.fg-branch:active { transform: translateY(2px); }
.fg-branch.fg-picked { border-color: var(--fer-blue); }
.fg-branch-img {
  width: 180px; height: 120px;
  background: repeating-linear-gradient(45deg, #F3EBD5 0 8px, #FFF8E8 8px 16px);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--fer-ink-soft); white-space: pre-line; text-align: center;
  border: 2px dashed rgba(0,0,0,0.15);
}
.fg-branch-name { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; }
.fg-branch-desc { font-size: 13px; font-weight: 600; color: var(--fer-ink-soft); text-align: center; }

/* ─── Bloques + grid del simulador ─────────────────────── */
.fg-blocks-wrap { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
@media (min-width: 680px) { .fg-blocks-wrap { grid-template-columns: 1fr auto; } }
.fg-blocks-panel {
  background: #fff; border-radius: 22px; padding: 14px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.06);
}
.fg-blocks-panel-title { font-weight: 700; font-size: 13px; color: var(--fer-ink-soft); margin-bottom: 10px; }
.fg-blocks-list { display: flex; flex-direction: column; gap: 8px; }
.fg-block {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 12px;
  font-weight: 800; font-size: 14px; color: #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,0.18);
  max-width: max-content;
}
.fg-block.fg-yellow { background: var(--fer-yellow); color: var(--fer-ink); }
.fg-block.fg-blue   { background: var(--fer-blue); }
.fg-block.fg-red    { background: var(--fer-red); }
.fg-block.fg-green  { background: var(--fer-green); }
.fg-block-icon { font-size: 16px; }
.fg-block-val {
  background: rgba(255,255,255,0.5); border-radius: 8px;
  padding: 1px 6px; color: var(--fer-ink); font-weight: 900;
}
.fg-block-nested {
  background: rgba(0,0,0,0.12); border-radius: 8px; padding: 5px; margin-left: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.fg-block-row { display: flex; align-items: center; gap: 6px; }
.fg-block-mv { display: flex; gap: 4px; margin-left: auto; }
.fg-block-mv button {
  width: 26px; height: 26px; border: none; background: #F3EBD5;
  border-radius: 8px; font-weight: 800; cursor: pointer;
}
.fg-block-mv button:disabled { opacity: .35; cursor: default; }

.fg-grid {
  background: #FFFCEC; border: 4px solid #F3E6B8;
  border-radius: 18px; position: relative; overflow: hidden;
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.05);
}
.fg-grid-cell-line { stroke: rgba(0,0,0,0.06); }
.fg-bot-marker {
  position: absolute; transition: left .5s, top .5s, transform .35s;
  pointer-events: none;
}

/* Coloring matrix */
.fg-color-row { display: flex; gap: 24px; justify-content: center; align-items: center; flex-wrap: wrap; }
.fg-color-palette {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: #fff; border-radius: 18px; box-shadow: 0 5px 0 rgba(0,0,0,0.06);
}
.fg-color-palette-title { font-size: 11px; font-weight: 800; color: var(--fer-ink-soft); text-align: center; }
.fg-color-swatch {
  width: 36px; height: 36px; border-radius: 8px;
  border: 4px solid transparent; cursor: pointer;
}
.fg-color-swatch.fg-active { border-color: var(--fer-ink); }
.fg-color-swatch.fg-white  { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }
.fg-color-matrix {
  background: #0E1B3A; border-radius: 20px; padding: 14px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.2), inset 0 4px 12px rgba(0,0,0,0.4);
}
.fg-color-grid { display: grid; gap: 6px; }
.fg-color-cell {
  border-radius: 8px; transition: background .15s;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
}
.fg-color-cell.fg-painted { border: none; }
.fg-color-model {
  padding: 12px; background: #fff; border-radius: 18px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.06); text-align: center;
}
.fg-color-model-title { font-size: 11px; font-weight: 800; color: var(--fer-ink-soft); margin-bottom: 6px; }
.fg-color-model-grid { display: grid; gap: 3px; }
.fg-color-model-cell { width: 18px; height: 18px; border-radius: 4px; }

/* ─── Confeti ──────────────────────────────────────────── */
.fg-confetti-host {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1000;
}
.fg-confetti-piece { position: absolute; }

/* ─── COMPLETE SCREEN ──────────────────────────────────── */
.fg-complete {
  background: radial-gradient(circle at 50% 30%, #FFEEC2 0%, var(--fer-cream) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 32px;
}
.fg-complete-title { font-size: 44px; font-weight: 800; font-family: 'Fredoka', sans-serif; }
.fg-complete-message {
  font-size: 17px; font-weight: 600; color: var(--fer-ink-soft);
  text-align: center; max-width: 500px;
}
.fg-complete-stars {
  background: #fff; padding: 16px 26px; border-radius: 22px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.06), 0 12px 24px rgba(0,0,0,0.05);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.fg-complete-stars .fg-star { width: 50px; height: 50px; }
.fg-complete-stars-label { font-size: 18px; font-weight: 800; }

/* ─── ONBOARDING ──────────────────────────────────────── */
.fg-onboarding {
  background: radial-gradient(circle at 50% 30%, #FFEEC2 0%, var(--fer-cream) 70%);
  align-items: center; justify-content: center; gap: 20px; padding: 32px;
}
.fg-onboarding-title { font-family: 'Fredoka', sans-serif; font-size: 32px; font-weight: 800; }
.fg-onboarding-sub { font-size: 17px; color: var(--fer-ink-soft); font-weight: 600; text-align: center; }
.fg-onboarding-form { display: flex; gap: 10px; align-items: center; }
.fg-name-input {
  border: none; border-radius: 18px; padding: 14px 22px;
  font-size: 22px; font-weight: 700; font-family: inherit;
  background: #fff; box-shadow: 0 5px 0 rgba(0,0,0,0.08);
  width: 260px; outline: none; color: var(--fer-ink); text-align: center;
}

/* ─── Figuras / imágenes en lecciones ───────────────────── */
.fg-concept { align-items: flex-start; }
.fg-concept-bubble { max-height: 600px; overflow-y: auto; }
.fg-figures {
  display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.fg-figures-multi .fg-figure { flex: 1 1 0; min-width: 0; }
.fg-figure {
  margin: 0; flex: 0 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.fg-figure-frame {
  position: relative; border-radius: 16px; overflow: hidden;
  background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,0.06);
  min-height: 130px;
}
.fg-figure-frame img {
  display: block; width: 100%; max-height: 220px; object-fit: contain;
}
.fg-figure-ph {
  flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 22px 16px; min-height: 130px;
  background: repeating-linear-gradient(45deg, #F3EBD5 0 10px, #FFF8E8 10px 20px);
  border: 2px dashed rgba(0,0,0,0.16); border-radius: 16px;
  text-align: center;
}
.fg-figure-ph-emoji { font-size: 40px; line-height: 1; }
.fg-figure-ph-name {
  font-size: 12px; font-weight: 800; color: var(--fer-ink);
  background: #fff; padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.06); word-break: break-all;
}
.fg-figure-ph-label { font-size: 12px; font-weight: 600; color: var(--fer-ink-soft); max-width: 240px; }
.fg-figure-cap { font-size: 12.5px; font-weight: 600; color: var(--fer-ink-soft); line-height: 1.3; text-align: center; }

/* Caja de solución (oculta tras botón) */
.fg-solution-wrap {
  margin: 12px 22px 0; max-width: 460px;
}

/* ─── Toast ────────────────────────────────── */
.fg-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 80px);
  background: var(--fer-ink, #2A2F4A); color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-family: 'Fredoka','Nunito',sans-serif; font-weight: 700; font-size: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3); z-index: 9999;
  opacity: 0; pointer-events: none; transition: transform .3s ease, opacity .3s ease;
  max-width: 80vw; text-align: center;
}
.fg-toast.fg-toast-show { transform: translate(-50%, 0); opacity: 1; }
