/* ==========================================================================
   Calculia — Operaciones: styles
   The drawings are rows of small icons. Crossed-out items and empty
   places must read at a glance, so they have their own marks.
   ========================================================================== */

.suite-chrome-activity h1 { color: var(--mod-razonamiento); }

.op-sym { font-size: 40px; font-weight: 800; line-height: 1; }
.ops-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.ops-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ops-group-stack { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* Two arrangements of the same total side by side; they wrap to one column on a narrow screen. */
.ops-compare { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 28px; }
.ops-compare-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* The number on an item, in a small pill over its lower edge. */
.ops-num { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); padding: 0 4px; border-radius: 999px; background: var(--color-superficie); color: var(--color-texto); font-size: var(--texto-pequeno); font-weight: 900; line-height: 1.3; }
/* An empty group to be filled in: a dashed frame with room for the items. */
.ops-empty-box { min-width: 150px; min-height: 52px; border-style: dashed; }

/* A total, a down arrow and the groups it is divided into, one above the other at any width. */
.ops-divide { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* One group that repeats: a frame around its items, so the group reads as one unit. */
.ops-group-box { display: flex; justify-content: center; padding: 6px 12px; border: 2px solid var(--mod-razonamiento); border-radius: var(--radio); }
.ops-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  font-size: 36px;
  line-height: 1;
}
/* A second group of the same object, tinted a little, so the groups read apart (real-life examples). */
.ops-alt { filter: hue-rotate(-25deg); }
/* An empty place: a dashed outline, so it reads as «falta». */
.ops-empty { border: 2px dashed var(--color-texto-suave); border-radius: var(--radio); background: transparent; }
/* A crossed-out item (taken away): dimmed, with a heavy cross on top. */
.ops-cross { opacity: 0.4; }
.ops-cross::after {
  content: '✕';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: var(--color-texto);
  text-shadow: 0 0 3px var(--color-superficie), 0 0 3px var(--color-superficie);
}
/* The parts of a division under their numbers (the names slide): 7 ÷ 3 = 2, sobra 1. */
.div-names { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 12px; }
.div-part { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.div-num { font-size: 40px; font-weight: 800; line-height: 1; color: var(--color-texto); font-variant-numeric: tabular-nums; }
.div-name { font-size: var(--texto-pequeno); font-weight: 700; color: var(--color-texto-suave); }

/* What is left over after the full groups (division with remainder). */
.ops-left { outline: 2px dashed var(--mod-razonamiento); outline-offset: 2px; border-radius: 50%; }
.ops-left-row { padding-top: 4px; border-top: 2px dotted var(--color-texto-suave); }
.ops-sign { font-size: var(--texto-grande); font-weight: 800; color: var(--color-texto-suave); }
.ops-expr { margin: 0; font-size: var(--texto-grande); font-weight: 700; color: var(--mod-razonamiento); font-variant-numeric: tabular-nums; text-align: center; }
.ops-story { margin: 0; font-size: var(--texto-grande); text-align: center; line-height: 1.4; }
/* An answer drawn as groups: the drawing above its «g × e» name. Small icons, so three answers fit one row or wrap. */
.ops-option { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; }
.ops-mini { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 100%; }
.ops-mini-group { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 1px; padding: 2px 4px; border: 2px solid var(--mod-razonamiento); border-radius: var(--radio); }
.ops-mini .ops-item { min-width: 18px; min-height: 18px; font-size: 16px; }
.ops-option-name { font-size: var(--texto-pequeno); font-weight: 700; font-variant-numeric: tabular-nums; }

/* One slice of a pizza: the inline SVG from app.js, at a size that reads on a phone. */
.ops-slice { display: inline-block; width: 40px; height: 40px; }

/* The deal drawing: a pool of pieces, the groups to fill, and the buttons under them. */
.ops-deal { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ops-deal-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 80px; }
.ops-deal-groups { justify-content: center; gap: 12px; }
/* Each friend: a name above the box that receives the slices. */
.ops-deal-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
/* The name of a group (Amigo, Paquete, Estante, Caja): a small auxiliary style, uppercase and spaced, so the names
   identify the groups without competing with the numbers of the drawing. */
.ops-tag { font-family: var(--fuente); font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-texto); line-height: 1.2; }
.ops-group-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ops-deal-group { min-width: 120px; min-height: 80px; flex-wrap: wrap; align-content: flex-start; gap: 4px; }
.ops-deal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* «Empezar de nuevo» is hidden until the first slice is dealt. The hidden attribute must win over .btn's display. */
.ops-deal-actions [hidden] { display: none; }
/* A slide with no picture on the left: its empty drawing box takes no room. */
.ops-visual:empty { display: none; }
/* The grouping drawing (the frame beside the division slides): the instruction, the pool of balls, the boxes. */
.ops-pack { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ops-pack-instruction { margin: 0; }
/* The pool keeps room for two rows of balls, and the boxes stay on one row, so the button does not move while dealing. */
.ops-pack-pool { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 8px; min-height: 144px; }
.ops-pack .ops-deal-groups { flex-wrap: nowrap; }
.ops-pack .ops-deal-group { min-width: 96px; min-height: 80px; }
.ops-pack .ops-deal-piece { cursor: default; }

/* The join and take games (the frames beside the first addition and subtraction slides). */
.ops-join, .ops-take { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ops-join-groups { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.ops-join-total { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ops-join-total[hidden] { display: none; }
/* The effect below, shown on click: the swapped sum (swap game) and the balls left (take game). */
.ops-swap-total, .ops-take-rest { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.ops-swap-total[hidden], .ops-take-rest[hidden] { display: none; }
.ops-take-left { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ops-fill-from { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 4px; }
/* An apple in a group (the addition games). */
.ops-apple { font-size: 40px; }
.ops-fill-apple { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; font-size: 40px; line-height: 1; }
.ops-join-a, .ops-join-b, .ops-join-all { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 4px; }
/* A ball taken away: light, with a dashed edge and a cross; its number stays readable under the cross. */
.ops-take .ops-cross { opacity: 1; background: var(--color-superficie); border: 3px dashed var(--color-texto-suave); }
.ops-take .ops-cross b { color: var(--color-texto-suave); }
.ops-take .ops-cross::after { color: var(--color-texto); text-shadow: none; }
/* A coin in the take game: a 64px touch target, so the cross sits over the whole coin. */
.ops-take-coin { width: 64px; height: 64px; margin-bottom: 0; justify-content: center; align-items: center; }
.ops-take-coin .ops-coin { width: 56px; height: 56px; font-size: 28px; }

/* The fill game (the frames beside the second addition and subtraction slides): places filled one by one. */
.ops-fill, .ops-swap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ops-fill-row { gap: 8px; }
.ops-fill-left { margin: 0; }
.ops-fill-empty { display: inline-block; width: 64px; height: 64px; box-sizing: border-box; border: 2px dashed var(--color-texto-suave); border-radius: 50%; }
.ops-fill-coin { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; }
/* The swap game: the two groups side by side, with the plus between them. */
.ops-swap-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.ops-swap-box { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 4px; min-width: 120px; min-height: 80px; }

/* The names game (the frame beside the first division slide): the names to tap, and the empty places under the numbers. */
.ops-names { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ops-names-msg, .ops-names-done { margin: 0; }
.ops-names-chips { min-height: 44px; gap: 8px; }
.ops-name-chip.is-selected { outline: 3px solid var(--mod-razonamiento); outline-offset: 2px; }
.ops-name-chip.is-placed { visibility: hidden; }
.ops-name-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 44px;
  padding: 4px 8px;
  border: 2px dashed var(--color-texto-suave);
  border-radius: var(--radio);
  font-size: var(--texto-pequeno);
  font-weight: 700;
}
.ops-name-slot.is-ok { border: 2px solid var(--mod-razonamiento); background: var(--mod-razonamiento-suave); }
.ops-name-slot.is-wrong { animation: ops-shake 0.35s; border-style: solid; }
@keyframes ops-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .ops-name-slot.is-wrong { animation: none; }
}
/* A slice in the deal is drawn large, with its number on the lower edge. It is a tap target to deal it. */
.ops-deal-piece { display: inline-flex; position: relative; margin-bottom: 8px; cursor: pointer; border-radius: var(--radio); }
.ops-deal-piece:focus-visible { outline: 3px solid var(--mod-razonamiento); outline-offset: 3px; }
/* The numbered balls of the sharing game beside the division slides: 64px touch targets, the number inside. */
.ops-deal-ball { width: 64px; height: 64px; margin-bottom: 0; justify-content: center; align-items: center; border-radius: 50%; background: var(--mod-razonamiento); color: var(--texto-sobre-acento); font-size: var(--texto-grande); font-weight: 800; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.ops-deal-ball b { font-weight: 800; }
.ops-deal-piece .ops-slice { width: 64px; height: 64px; }
/* The grouping game: each group's balls take one colour (data-group 1…4). The number stays on the ball, so the colour
   is never the only way to read the group. White text on each colour keeps at least 4.5:1 contrast. */
.ops-pack .ops-deal-ball[data-group="1"] { background: #b42318; color: #fff; }
.ops-pack .ops-deal-ball[data-group="2"] { background: #1d4ed8; color: #fff; }
.ops-pack .ops-deal-ball[data-group="3"] { background: #047857; color: #fff; }
.ops-pack .ops-deal-ball[data-group="4"] { background: #7c4a03; color: #fff; }
/* The single ball left over after the last group blinks, and its «resto» label sits beside it. */
.ops-blink { animation: ops-blink 0.8s ease-in-out 3; }
.ops-rest-tag { color: var(--color-texto); }
@keyframes ops-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .ops-blink { animation: none; }
}

/* A numbered drawing: room under each row for the number on its lower edge. */
.ops-numbered .ops-row { padding-bottom: 10px; }
/* The test's share drawing: the slices large and numbered, the friends named above their empty boxes. */
.ops-share .ops-row { gap: 10px; padding-bottom: 10px; }
.ops-share .ops-item { min-width: 64px; min-height: 64px; }
.ops-share .ops-slice { width: 64px; height: 64px; }
.ops-deal-result { margin-top: 4px; }
.ops-deal-result[hidden] { display: none; }

/* A coin for money drawings: the currency sign of the locale (€ or $) on a round gold coin. */
.ops-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #b8860b;
  background: radial-gradient(circle at 35% 35%, #ffe38a, #d4a017);
  color: #5c4300;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

/* The operations icon (assets/img/operaciones.svg) beside the title in the header. */
.suite-chrome-activity .activity-icon { width: 48px; height: 48px; flex: none; }

/* Factorials and powers: numbers in framed boxes, the growth cards, and the empty places to count. */
.fac-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.fac-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 4px 10px;
  border: 2px solid var(--mod-razonamiento);
  border-radius: var(--radio);
  font-size: var(--texto-grande);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.fac-result { background: var(--mod-razonamiento-suave); }
.fac-growth { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.fac-card { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 72px; padding: 8px 10px; border: 2px solid var(--mod-razonamiento); border-radius: var(--radio); }
.fac-name { font-size: var(--texto-pequeno); font-weight: 700; color: var(--color-texto-suave); }
.fac-value { font-size: var(--texto-grande); font-weight: 800; font-variant-numeric: tabular-nums; }
.fac-big { margin: 0; font-size: var(--texto-enorme, 2rem); font-weight: 800; color: var(--mod-razonamiento); font-variant-numeric: tabular-nums; text-align: center; }
.fac-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fac-chips .fac-chip { min-width: 0; font-size: var(--texto-pequeno); font-weight: 700; }
.fac-note { margin: 0; text-align: center; color: var(--color-texto-suave); }
.fac-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.fac-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fac-slot-count { font-size: var(--texto-grande); font-weight: 800; color: var(--mod-razonamiento); font-variant-numeric: tabular-nums; }
.fac-box { display: inline-block; width: 52px; height: 52px; border: 2px dashed var(--color-texto-suave); border-radius: var(--radio); }
.fac-expr { margin: 0; font-size: var(--texto-grande); font-weight: 700; color: var(--mod-razonamiento); font-variant-numeric: tabular-nums; text-align: center; }
/* The calculator's answer under the grouping drawing: the whole part is marked, the rest reads as the decimal part. */
.ops-calc { margin-top: 4px; }
.ops-int { color: var(--mod-razonamiento); font-weight: 900; }
.ops-calc-parts { margin: 0; }
