

.calc-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 150px;
}

/* ---- Rows of dots ----
   A short last row is what "it does not come out even" looks like, so it
   is dashed as well as short: never shape alone, never colour alone. */
.row-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 2px solid var(--color-borde);
  border-radius: 8px;
  background: var(--color-superficie);
}
.dot-row {
  display: flex;
  gap: 4px;
}
.is-short {
  padding: 2px;
  border: 2px dashed var(--color-texto);
  border-radius: 6px;
  margin: -2px;
}
.dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-texto);
}
.tone-1 .dot { background: var(--mod-secuencia, var(--color-texto)); }
.tone-2 .dot { background: var(--mod-razonamiento, var(--color-texto)); }

/* ---- A number shown big, with what the rule looks at picked out ---- */
.big-number {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.last-digit {
  padding: 0 0.1em;
  border-bottom: 5px solid var(--mod-secuencia, var(--color-texto));
}
.digit-sum {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

/* ---- The three attempts, for primes ---- */
.try-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0.9rem;
  min-height: 150px;
}
.try {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.try-label {
  font-size: 0.9rem;
  font-weight: 600;
}
.try-verdict { font-size: 1.05rem; }

/* ---- Two things that repeat ---- */
.cycle-stage {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  min-height: 130px;
  justify-content: center;
}
.cycle-line {
  display: flex;
  gap: 2px;
  width: 100%;
}
.tick {
  position: relative;
  flex: 1 1 0;
  height: 1.7rem;
  border: 1px solid var(--color-borde);
  border-radius: 3px;
  background: var(--color-superficie);
}
.tick.is-on { background: var(--mod-secuencia, var(--color-texto)); }
.tone-2 .tick.is-on { background: var(--mod-razonamiento, var(--color-texto)); }
/* The meeting point carries a star as well as the fill, so it does not
   depend on colour (WCAG 1.4.1). */
.tick.is-meet { outline: 3px solid var(--color-texto); }
.meet-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* ---- Two lengths to compare ---- */
.bar-stage {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  min-height: 130px;
  justify-content: center;
}
.length-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.unit {
  display: block;
  width: 14px;
  height: 22px;
  border: 1px solid var(--color-texto);
  background: var(--mod-secuencia, var(--color-superficie));
}
.tone-2 .unit { background: var(--mod-razonamiento, var(--color-superficie)); }
.bar-len {
  margin-left: 0.4rem;
  font-weight: 700;
}

/* ---- A square, drawn square ---- */
.square-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cell {
  display: block;
  width: 17px;
  height: 17px;
  border: 1px solid var(--color-texto);
  background: var(--mod-secuencia, var(--color-superficie));
}

.answer-name { display: block; }

/* A cube drawn layer by layer, so its side can be counted. */
.cube-layer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 2px solid var(--color-borde);
  border-radius: 6px;
  background: var(--color-superficie);
}
.cube-cell {
  display: block;
  width: 16px;
  height: 16px;
  border: 1px solid var(--color-texto);
  background: var(--mod-razonamiento, var(--color-superficie));
}

/* A big number with all its zeros written out, and the short form. */
.long-number {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}
.short-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
}

/* A square with one length drawn over it: the side lands on a corner, the
   diagonal never does. */
.exact-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
}
.exact-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.exact-cell {
  display: block;
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-borde);
  background: var(--color-superficie);
  box-sizing: border-box;
}
.measure-svg {
  position: absolute;
  overflow: visible;
}
.measure-line {
  stroke: var(--mod-secuencia, var(--color-texto));
  stroke-width: 5;
  stroke-linecap: round;
}

/* ---- Minus signs, paired off two at a time ----
   A pair is boxed; the odd one left over is boxed AND dashed, so which one
   has no partner does not depend on colour (WCAG 1.4.1). */
.minus-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.minus-pair {
  display: inline-flex;
  gap: 0.15rem;
  padding: 0.15rem 0.4rem;
  border: 2px solid var(--color-borde);
  border-radius: 8px;
  background: var(--color-superficie);
}
.minus-pair.is-lonely {
  border-style: dashed;
  border-color: var(--color-texto);
  border-width: 3px;
}
.minus {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}

/* ---- A chain of multiplying ----
   Each arrow says what it multiplies by, so how many times can be counted
   instead of worked out. */
.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.chain-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.2rem 0.35rem;
  border: 2px solid var(--color-texto);
  border-radius: 8px;
  background: var(--color-superficie);
  font-size: 1rem;
  font-weight: 700;
}
.chain-step {
  font-size: 0.85rem;
  font-weight: 700;
}
.chain-step::before { content: '→ '; }
/* A cube is drawn as a row of layers; without this the layers stack
   vertically and the cube reads as a flat wall. Same rule as geometry. */
.layer-row { display: flex; gap: 2px; }

.emoji-large { font-size: 96px; }
.transfer { margin: 8px auto 24px; font-size: 1.1rem; color: var(--color-texto-suave, #555); max-width: 480px; }
/* The rule of a shortcut: the title of its card, above the question. */
.rule-title { margin: 0; font-size: var(--texto-grande); font-weight: 700; text-align: center; line-height: 1.3; }
/* The number of points a dot drawing stands for, written above the rows. */
.dots-count { display: block; width: 100%; margin-bottom: 6px; font-size: var(--texto-pequeno); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
