/* Quantities — tool-specific styles.

   Three practices: read, write and the points game. The 'groups'
   practice moved to mental-math in 2026-10: its CSS and screens
   travelled with it.

   Contract "actividad aislada": no styles are imported from other
   tools/, so every class used here is defined here. Only .btn,
   .option-btn and .explanation come from components.css. */
.suite-chrome-activity h1 { color: var(--mod-razonamiento); }

/* ============================================================
   Menú de prácticas
   ============================================================ */
.task-icon { font-size: 42px; line-height: 1; }
.practice-stars { font-size: var(--texto-pequeno); letter-spacing: 2px; }
.practice-done {
  font-size: var(--texto-pequeno);
  font-weight: 700;
  background: var(--color-acierto-suave);
  color: var(--color-acierto);
  border-radius: var(--radio);
  padding: 2px 12px;
  margin-top: 4px;
}

/* ============================================================
   Prácticas de escritura
   ============================================================ */
.task-card { display: flex; flex-direction: column; align-items: center; gap: var(--espacio); text-align: center }
.task-card h2 { margin: 0; color: var(--mod-razonamiento); font-size: var(--texto-grande); }
.task-detail { margin: 0; color: var(--color-texto-suave); }

#nextTask { align-self: center; }

.number-shown {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  padding: 12px 16px;
  border-radius: var(--radio);
  background: var(--mod-razonamiento-suave);
  border: 3px solid var(--mod-razonamiento);
  min-width: 220px;
  word-break: break-word;
}

/* ============================================================
   Juego de los puntos
   El número se ve SIN separadores. La persona toca los huecos
   entre cifras para poner los puntos que tiene en la bandeja.
   ============================================================ */
.points-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espacio);
  width: 100%;
}

.points-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: var(--radio);
  border: 3px solid var(--mod-razonamiento);
  background: var(--color-superficie);
  font-size: clamp(22px, 6.8vw, 46px);
  font-weight: 800;
  line-height: 1.2;
}

.pt-digit {
  display: inline-block;
  min-width: 0.6em;
  text-align: center;
}

/* Hueco entre dos cifras. El dibujo es estrecho. El área de toque
   crece sobre todo en alto: en horizontal no puede invadir al hueco
   vecino (las cifras de un número largo están muy juntas en un móvil). */
.pt-gap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.45em;
  height: 1.4em;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--mod-razonamiento);
  font: inherit;
  cursor: pointer;
}

.pt-gap::before {
  content: '';
  position: absolute;
  inset: -14px -6px;
}

.pt-gap:focus-visible {
  outline: 3px solid var(--mod-razonamiento);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Empty gaps have no line or circle: the hover tint shows where a
   point can go. */
.pt-gap:hover:not(:disabled) {
  background: var(--mod-razonamiento-suave);
  border-radius: 6px;
}

.pt-gap:disabled { cursor: default; }

/* A point is picked from the tray: the empty gaps show as places to put it. */
.points-board.is-picking .pt-gap:not(.is-placed):not(:disabled) {
  background: var(--mod-razonamiento-suave);
  border-radius: 6px;
}

.pt-gap.is-placed { overflow: visible; }

.pt-point {
  display: inline-block;
  font-size: 1.2em;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

/* Punto mal colocado: fondo, borde macizo y una marca ✗. El color no
   es lo único que lo dice (WCAG 1.4.1). */
/* Wrong place: the gap turns red and the point sits in a red circle.
   The ✗ mark and the text say it too, not only the colour. */
.pt-gap.is-wrong,
.pt-gap.is-wrong:hover:not(:disabled) {
  background: #FDECEA;
  border-radius: 6px;
}

.pt-gap.is-wrong .pt-point {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1.3em;
  height: 1.3em;
  border: 3px solid #C62828;
  border-radius: 50%;
  color: #C62828;
}

.pt-mark {
  position: absolute;
  top: -0.9em;
  right: -0.3em;
  font-size: 0.5em;
  font-weight: 800;
  color: #C62828;
  line-height: 1;
}

/* The number and the tray of points sit side by side; on a narrow
   screen the tray wraps under the number. */
.points-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--espacio);
  width: 100%;
}

.points-tray {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
}

/* A point being dragged: it follows the pointer. */
.pt-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 3px solid var(--mod-razonamiento);
  background: var(--mod-razonamiento-suave);
  color: var(--mod-razonamiento);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

/* The gap a dragged point would drop into. */
.pt-gap.is-target {
  background: var(--mod-razonamiento-suave);
  border-radius: 6px;
}

.tray-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 3px solid var(--mod-razonamiento);
  background: var(--mod-razonamiento-suave);
  color: var(--mod-razonamiento);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

/* Picked from the tray: a thick outline and a lifted chip, so the
   selection shows without relying on colour alone. */
.tray-chip.is-selected {
  outline: 4px solid var(--mod-razonamiento);
  outline-offset: 4px;
  transform: translateY(-4px);
}


.answer-input {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  padding: 12px 16px;
  min-width: 240px;
  min-height: var(--boton-min);
  border: 3px solid var(--mod-razonamiento);
  border-radius: var(--radio);
  background: var(--color-superficie);
  color: var(--color-texto);
  font-family: inherit;
}

.answer-input:focus {
  outline: 3px solid var(--mod-razonamiento);
  outline-offset: 2px;
}

#listenBtn {
  font-size: 28px;
  min-width: var(--boton-min);
  min-height: var(--boton-min);
  align-self: center;
}

/* Color por grupo de tres cifras (los que separa el punto): todas las
   cifras de un grupo llevan el mismo color y el grupo siguiente cambia.
   Así el color dice a qué grupo pertenece cada cifra. */
.dot-group-0 { color: var(--mod-cuerpo); }
.dot-group-1 { color: var(--mod-coordinacion); }
.dot-group-2 { color: var(--mod-secuencia); }
.dot-group-3 { color: var(--mod-emocional); }
.digit-sep { color: var(--color-texto-suave); }
.sign { color: var(--mod-memoria); }

/* Caja de la respuesta en palabras: ancha, como un procesador de
   texto. Las palabras de un número de 9 cifras son largas: el texto
   va a la izquierda y salta de línea. */
.write-input {
  display: block;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  font-size: clamp(18px, 4.8vw, 24px);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  text-align: left;
  min-height: 8em;
  resize: vertical;
}

/* --- Pantalla final de las prácticas de escritura --- */
.big-emoji { font-size: 96px; }

.transfer { color: var(--color-texto-suave); max-width: 480px; }
.contexto, .explanation { color: var(--color-texto-suave); }

/* ============================================================
   Responsive — 320 / 375 / 768 / desktop
   ============================================================ */
@media (max-width: 480px) {
  .task-card { padding: var(--espacio); }
  .number-shown { min-width: 0; width: 100%; font-size: 40px; }
  .answer-input { min-width: 0; width: 100%; }
  .big-emoji { font-size: 64px; }
  .points-tray { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
