/* Mental Math — tool-specific styles. Shared styles live in assets/css/.
   Colors by place value: blue units, green tens, purple hundreds
   (the cycle repeats every group of 3 digits). Signs are shown in orange. */

.suite-chrome-activity h1 { color: var(--mod-razonamiento); }
.btn:not(.btn-secondary):not(.btn-audio) { background: var(--mod-razonamiento); }
.instruction { font-size: var(--texto-base); }
.center-row { justify-content: center; }

.difficulty {
  font-size: var(--texto-pequeno);
  color: var(--color-texto-suave, #666);
}




#screenLevels h2 { text-align: center; color: var(--mod-razonamiento); }
#btnBackToMenu { align-self: center; }

/* Color-coded digits by place value */
.num-color { font-weight: 800; letter-spacing: 2px; }
.digit-u { color: var(--mod-coordinacion); }   /* blue — units */
.digit-d { color: var(--mod-secuencia); }      /* green — tens */
.digit-c { color: var(--mod-emocional); }      /* purple — hundreds */
.digit-sep { color: var(--color-texto-suave); }
.sign { color: var(--mod-memoria); }          /* orange */
.highlight { text-decoration: underline; text-underline-offset: 6px; }

.card { border-color: var(--mod-razonamiento-suave); }
.prompt { font-weight: 700 }
.visual { display: flex; flex-direction: column; align-items: center; gap: var(--espacio); }
.legend { font-size: var(--texto-pequeno); font-weight: 700; }
.hint { color: var(--color-texto-suave); font-size: var(--texto-base); }

/* Expressions (subtraction, doubles, round-number strategies) */
.expression {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; font-size: 40px; font-weight: 800; flex-wrap: wrap;
}
.sign { font-size: 40px; font-weight: 800; }
.num-box {
  min-width: 64px; min-height: 64px; padding: 8px 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 3px solid var(--color-borde); border-radius: var(--radio);
  background: var(--color-superficie); font-size: 30px; font-weight: 800;
}
.num-box.empty { border-style: dashed; border-color: var(--mod-razonamiento); color: var(--mod-razonamiento); }

/* Dots for counting */
.dot-array { display: flex; align-items: center; justify-content: center; gap: var(--espacio); flex-wrap: wrap; }
.dot-group { display: grid; grid-template-columns: repeat(5, 18px); gap: 6px; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: var(--mod-razonamiento); }
.dot.pa { background: var(--mod-coordinacion); }
.dot.pb { background: var(--mod-secuencia); }

/* Crossed-out dots when subtracting */
.dot.removed { background: var(--color-superficie); border: 3px solid var(--mod-memoria); position: relative; }
.dot.removed::before, .dot.removed::after {
  content: ''; position: absolute; top: 50%; left: 10%;
  width: 80%; height: 3px; background: var(--mod-memoria);
}
.dot.removed::before { transform: translateY(-50%) rotate(45deg); }
.dot.removed::after { transform: translateY(-50%) rotate(-45deg); }

/* Answer options */
.options .option-btn { text-align: center; font-size: 26px; }

.emoji-large { font-size: 96px; }
#screenEnd { padding-top: 48px; }
#screenEnd .btn { align-self: center; min-width: 280px; }
#screenEnd .transfer {
  margin: 8px auto 24px;
  font-size: 1.1rem;
  color: var(--color-texto-suave, #555);
  max-width: 480px;
}

/* ---- Base-ten pictures: one bar is ten, a loose dot is one ----
   The bar is boxed and laid out 5 + 5 so ten reads as two hands
   rather than a row that has to be counted one by one. */
.ten-bar {
  display: grid;
  grid-template-columns: repeat(5, 18px);
  gap: 6px;
  padding: 6px;
  border: 3px solid var(--color-borde);
  border-radius: 10px;
  background: var(--color-superficie);
}
.unit-group {
  display: grid;
  grid-template-columns: repeat(5, 18px);
  gap: 6px;
  padding: 6px;
  border: 3px dashed var(--color-borde);
  border-radius: 10px;
}

/* ============================================================
   Práctica "grupos" — recorrido tipo números romanos

   Antes vivía en Cantidades. La paleta de los seis grupos es la
   misma que allí, tomada de los tokens del módulo. Cada nombre de
   grupo va SIEMPRE escrito junto a su color (WCAG 1.4.1: el color
   no es la única señal), así que ningún chip se queda en "lo azul".
   El teal del nombre del módulo se reserva para la cabecera; los
   grupos usan los seis tokens restantes, sin colisión con la
   marca.
   ============================================================ */

/* --- Group palette --- Six groups, six distinct module tokens. */
.grp-unit      { color: var(--mod-cuerpo); }
.grp-ten       { color: var(--mod-coordinacion); }
.grp-hundred   { color: var(--mod-secuencia); }
.grp-thousand  { color: var(--mod-emocional); }
.grp-halfdozen { color: var(--mod-lenguaje); }
.grp-dozen     { color: var(--mod-memoria); }

.grp-bg-unit      { background: var(--mod-cuerpo-suave); border-color: var(--mod-cuerpo); }
.grp-bg-ten       { background: var(--mod-coordinacion-suave); border-color: var(--mod-coordinacion); }
.grp-bg-hundred   { background: var(--mod-secuencia-suave); border-color: var(--mod-secuencia); }
.grp-bg-thousand  { background: var(--mod-emocional-suave); border-color: var(--mod-emocional); }
.grp-bg-halfdozen { background: var(--mod-lenguaje-suave); border-color: var(--mod-lenguaje); }
.grp-bg-dozen     { background: var(--mod-memoria-suave); border-color: var(--mod-memoria); }

.reference-card { border-color: var(--mod-razonamiento-suave); }
.reference-title { margin: 0; font-size: var(--texto-grande); color: var(--mod-razonamiento); }
.reference-text { margin: 0; color: var(--color-texto); }

.intro-card, .famosos-card, .symbols-card, .rule-card, .quiz-card {
  align-items: center;
  gap: var(--espacio);
}

/* --- Pantalla 1: carrusel --- */






/* El nombre del grupo en su color y en grande (≥20px bold, así que
   cuenta como texto grande a efectos de contraste AAA), y su valor
   debajo. El color nunca va solo: el nombre siempre está escrito. */

.carousel-value { font-size: var(--texto-grande); font-weight: 700; color: var(--color-texto); font-variant-numeric: tabular-nums; }








/* --- Pantalla 2: ejemplos reales --- */
.famosos-card { border-color: var(--mod-razonamiento-suave); }
.famoso-ejemplo-row { display: flex; align-items: center; justify-content: center; gap: var(--espacio); width: 100%; flex-wrap: wrap; }

.famoso-ejemplo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  padding: var(--espacio) var(--espacio-grande);
  border: 3px solid var(--mod-razonamiento-suave);
  border-radius: var(--radio);
  background: var(--color-superficie);
  text-align: center;
  width: 100%;
  max-width: 480px;
  flex: 1 1 240px;
}
.famoso-group { font-size: 44px; line-height: 1.1; }
.famoso-value { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.famoso-equals { color: var(--color-texto-suave); font-size: var(--texto-grande); }
.famoso-number { font-size: var(--texto-grande); color: var(--color-texto); font-variant-numeric: tabular-nums; }

.famous-text { margin: 0; color: var(--color-texto); text-align: center; }

/* --- Pantalla 3: recordatorio --- */
.reminder-buttons { justify-content: center; margin-top: var(--espacio-grande); }

.groups-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--espacio); width: 100%; }

.group-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--espacio);
  min-width: 140px;
  border: 3px solid var(--mod-razonamiento-suave);
  border-radius: var(--radio);
  background: var(--color-superficie);
}
.group-chip-name { font-size: var(--texto-base); font-weight: 800; }
.group-chip-size { font-size: var(--texto-grande); font-weight: 700; color: var(--color-texto); font-variant-numeric: tabular-nums; }

.rule-card { border-color: var(--mod-razonamiento-suave); }
.rule-title { font-weight: 700; margin: 0; text-align: center; font-size: var(--texto-base); color: var(--color-texto); }

/* "3 decenas = 3 × 10 = 30". Cada pieza que pertenece al grupo
   conserva su color (viene de la clase grp-* que app.js añade); el
   total va en color de texto, para que el resultado no compita con
   el multiplicando. ex-count y ex-size son las dos piezas que el
   color por sí solo no distingue — el número de grupos y lo que
   vale cada uno—, así que se les fija la anchura de cifras para
   que no bailen al cambiar de grupo. */
.rule-example {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--texto-grande);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ex-phrase { font-size: var(--texto-grande); }
.ex-count, .ex-size { min-width: 2ch; text-align: center; }
.ex-op { color: var(--color-texto-suave); }
.ex-total { color: var(--color-texto); }

/* --- Pantalla 4: juego --- */
.quiz-card { border-color: var(--mod-razonamiento-suave); }

.quiz-shown {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
}

/* Cuando el prompt es una frase ("4 decenas") y no una cifra, 72px
   no cabe en 320px de ancho. Este es el único caso en que se
   necesita el texto más pequeño. */
.quiz-shown--phrase { font-size: var(--texto-titulo); letter-spacing: 1px; }

.context-text {
  margin: 0;
  text-align: center;
  color: var(--color-texto-suave);
  font-size: var(--texto-pequeno);
  max-width: 480px;
}

.question { color: var(--color-texto-suave); font-size: var(--texto-grande); }

.groups-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espacio);
  flex-wrap: wrap;
}
.progress-step { font-size: var(--texto-pequeno); font-weight: 700; color: var(--color-texto-suave); }

/* Cabecera de la mini-ronda encadenada: sólo aparece al pasar de un
   sub-nivel al siguiente dentro de un grupo, para que se entienda
   que el nivel cambió a propósito y no por error. */
.round-header {
  margin: 0;
  padding: var(--espacio);
  border-radius: var(--radio);
  background: var(--mod-razonamiento-suave);
  color: var(--color-texto);
  font-weight: 700;
  text-align: center;
}

/* minmax(110px) en vez de tres columnas fijas: a 375px, tres
   columnas de ~90px obligaban a partir la frase ("4 dece/nas"), y
   una frase de grupo partida se lee mal. Con 110px mínimos salen
   dos columnas cómodas a 320-375px y tres en tablet y escritorio. */
.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--espacio); width: min(100%, 480px); }

/* Opciones de texto: `break-word` y no `anywhere` — `anywhere` parte
   la frase aunque haya sitio; `break-word` sólo corta si de verdad
   no cabe. */
.option-btn--word { font-size: var(--texto-base); overflow-wrap: break-word; padding: 12px 10px; }

.big-emoji { font-size: 96px; }
.transfer-groups { color: var(--color-texto-suave); max-width: 480px; }

/* ============================================================
   Responsive — 320 / 375 / 768 / desktop
   ============================================================ */
@media (max-width: 480px) {
  .famoso-group { font-size: 32px; }
  .quiz-shown { font-size: 56px; min-height: 72px; }
  .quiz-shown--phrase { font-size: var(--texto-grande); }
  .rule-example { font-size: var(--texto-base); }
  .group-chip { min-width: 0; flex: 1 1 120px; }
  .big-emoji { font-size: 64px; }
}

/* Muy estrecho (320px): tres opciones en fila se quedan sin sitio,
   así que bajan a una columna. El mínimo táctil de 64px se
   mantiene en las dos direcciones. */
@media (max-width: 360px) {
  .quiz-shown { font-size: 44px; letter-spacing: 2px; }
}

/* The word of a chosen option (the rule words of mental maths). */
.option-word { font-weight: 700; }
