

/* ---- The balance ----
   Drawn level, because that is the idea: the two sides weigh the same.
   It stacks at narrow widths rather than overflowing. */
.balance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 150px;
}
.pan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 6.5rem;
  min-height: 3.6rem;
  padding: 0.5rem;
  border: 3px solid var(--color-texto);
  border-radius: 10px 10px 22px 22px;
  background: var(--color-superficie);
}
.beam {
  font-size: 2rem;
  font-weight: 700;
}
.weight {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--color-texto);
  border-radius: 4px;
  background: var(--mod-secuencia, var(--color-superficie));
  font-size: 0.8rem;
  font-weight: 700;
}
/* The bag is the unknown, and it says so with a question mark as well as
   its shape: never colour alone (WCAG 1.4.1). */
.bag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.4rem;
  border: 3px solid var(--color-texto);
  border-radius: 6px 6px 14px 14px;
  background: var(--mod-razonamiento, var(--color-superficie));
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---- Letters ---- */
.letter-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 140px;
}
.letter-key {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border: 2px dashed var(--color-borde);
  border-radius: 10px;
}
.letter-expr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 2rem;
  font-weight: 700;
}

/* ---- The graph ----
   Bars by the hour with the hours written underneath, so going up or down
   is visible. The marked hours carry a thicker outline as well as a
   different fill. */
.graph {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 160px;
  padding-bottom: 1.2rem;
  border-bottom: 3px solid var(--color-texto);
  position: relative;
}
.graph-col {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}
.graph-bar {
  display: block;
  width: 100%;
  border: 1px solid var(--color-texto);
  background: var(--mod-secuencia, var(--color-texto));
}
.is-marked .graph-bar {
  border-width: 3px;
  background: var(--mod-razonamiento, var(--color-texto));
}
.graph-hour {
  position: absolute;
  bottom: -1.15rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.is-marked .graph-hour { text-decoration: underline; }

.trend-name { display: block; }
.answer-name { display: block; }

/* How something grows: the jump between each pair is written above, so
   "by the same each time" is read and not felt. */
.growth {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 150px;
  border-bottom: 3px solid var(--color-texto);
}
.growth.is-small { height: 78px; gap: 2px; }
.growth-col {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}
.growth-bar {
  display: block;
  width: 100%;
  border: 1px solid var(--color-texto);
  background: var(--mod-secuencia, var(--color-texto));
}
.growth-jump {
  position: absolute;
  top: -0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.is-small .growth-jump { display: none; }

/* The second unknown, so a system can have two. It carries its own letter
   as well as its shape. */
.box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 3px solid var(--color-texto);
  border-radius: 4px;
  background: var(--mod-secuencia, var(--color-superficie));
  font-size: 1.1rem;
  font-weight: 700;
}

/* Two balances, one under the other: that is what a system looks like. */
.two-balances {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
}
.and-also {
  font-size: 0.95rem;
  font-weight: 700;
}
.pair-name { display: block; }

/* A tilted balance: the heavier side is drawn lower AND the beam says which
   way, so the tilt is never the only cue (WCAG 1.4.1). */
.is-tilted-left .pan:first-of-type { transform: translateY(6px); }
.is-tilted-right .pan:last-of-type { transform: translateY(6px); }

/* x times x, drawn as the square it is. */
.square-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 150px;
}
.sq-of-x {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sq-row { display: flex; gap: 2px; }
.sq-cell {
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid var(--color-texto);
  background: var(--mod-razonamiento, var(--color-superficie));
}

/* ---- The pieces ----
   Three shapes: a big square whose side is x, a strip x long, and a little
   1. They are told apart by size AND by what is written on them, so the
   tint is only a help and never the only difference (WCAG 1.4.1). */
.tile-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 150px;
}
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 2px solid var(--color-texto);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}
.tile sup { font-size: 0.7em; }

/* Loose pieces: each one keeps its own size, because the size IS the
   piece. 2.6 and not 3, so the long side is not a whole number of the
   little ones. */
.tile-pile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
}
.tile-pile .is-sq { width: 2.6rem; height: 2.6rem; }
.tile-pile .is-str { width: 2.6rem; height: 1rem; }
.tile-pile .is-one { width: 1rem; height: 1rem; }
.is-sq { background: var(--mod-razonamiento, var(--color-superficie)); }
.is-str { background: var(--mod-secuencia, var(--color-superficie)); }
.is-one { background: var(--color-superficie); }

/* Pieces put together: the tracks give every piece its size, so the sides
   of the rectangle can be read straight off the picture. */
.tile-grid {
  display: grid;
  gap: 2px;
  width: min(100%, 13rem);
}
.tile-grid .tile {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  /* The little cells are under 1rem across at 320px, so their label has to
     come down with them or it spills out of its piece. */
  font-size: 0.6rem;
}
.tile-grid .is-sq { font-size: 1rem; }
.tile-pile .is-str,
.tile-pile .is-one { font-size: 0.7rem; }

/* One side already known, written next to the edge it measures. */
.tile-sided { gap: 0.4rem; }
.side-label {
  font-size: 1.2rem;
  font-weight: 700;
}

.emoji-large { font-size: 96px; }
.transfer { margin: 8px auto 24px; font-size: 1.1rem; color: var(--color-texto-suave, #555); max-width: 480px; }