/* Fractions — tool-specific styles. Shared styles live in assets/css/. */

.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 legend text (parts painted / parts total) */
.digit-u { color: var(--mod-coordinacion); }
.digit-d { color: var(--mod-secuencia); }

.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); }

/* Fractions */
.frac { display: inline-flex; flex-direction: column; align-items: center; font-weight: 800; font-size: 28px; line-height: 1.2; }
.frac-num { color: var(--mod-coordinacion); border-bottom: 4px solid var(--color-texto); padding: 0 10px; }
.frac-den { color: var(--mod-secuencia); padding: 0 10px; }
.op-frac { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }

/* Measurements */
.measure-picto { font-size: 64px; }
.measure-text { font-size: var(--texto-grande); font-weight: 800; }

/* 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;
}

/* ---- Equivalent fractions: the reference amount ---- */
.frac-ref {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Adding and subtracting fractions ----
   The notation row states the sum; the pie row underneath shows the same
   thing as amounts, so the person can check the rule by looking. */
.frac-expression {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.frac-visual-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.frac-sign {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--mod-coordinacion, var(--color-texto));
}
/* Empty slot for the answer: reads as "something goes here". */
.frac-gap {
  min-width: 2.4rem;
  padding: 2px 10px;
  font-size: 1.7rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-texto-suave);
  border: 3px dashed var(--color-borde);
  border-radius: var(--radio);
  background: var(--color-superficie);
}

/* ---- Decimals: the number itself is the content, so it is set large ---- */
.decimal-value {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---- Intro and real-life carousels (before the first round) ---- */
.reference-card, .real-card {
  align-items: center;
  border-color: var(--mod-razonamiento-suave);
}
.reference-title { text-align: center; color: var(--mod-razonamiento); }
.reference-text { text-align: center; font-size: var(--texto-base); }
.intro-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
}
.intro-notation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.intro-compare {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
}


.real-object { font-size: 96px; line-height: 1.1; }

/* A fraction OF an amount: equal piles, one of them taken. */
.frac-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.frac-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  max-width: 7rem;
  padding: 0.35rem;
  border: 2px solid var(--color-borde);
  border-radius: 10px;
  background: var(--color-superficie);
}
/* The pile being taken is dashed and thicker, never colour alone. */
.is-taken {
  border-style: dashed;
  border-width: 3px;
  border-color: var(--color-texto);
}
.frac-token {
  font-size: 1.4rem;
  line-height: 1.1;
}

/* ============================================================
   Poner la coma decimal (actividad 'coma')
   ============================================================ */
.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); }

#comaNext { align-self: center; }

/* Tablero: el número sin separadores y un hueco entre cifras.
   El hueco es el sitio donde va la coma. */
.comma-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espacio);
  width: 100%;
}

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

.comma-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;
}

.comma-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, para no invadir al hueco vecino. */
.comma-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;
}

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

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

/* Los huecos vacíos no tienen dibujo: el tono al pasar el dedo o el
   ratón muestra dónde puede ir la coma. */
.comma-gap:hover:not(:disabled) {
  background: var(--mod-razonamiento-suave);
  border-radius: 6px;
}

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

.comma-gap.is-placed { overflow: visible; cursor: grab; touch-action: none; }

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

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

/* Coma mal colocada: fondo, borde macizo y una marca ✗. El color no es lo
   único que lo dice (WCAG 1.4.1). */
.comma-gap.is-wrong,
.comma-gap.is-wrong:hover:not(:disabled) {
  background: #FDECEA;
  border-radius: 6px;
}

.comma-gap.is-wrong .comma-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;
}

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

/* La coma que falta por colocar: una ficha fuera del número. */
.comma-tray {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
}

.comma-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;
}

/* The comma being dragged: it follows the pointer. */
.comma-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;
}

@media (max-width: 480px) {
  .comma-tray { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
