/* ============ Elementary Heroes: grades 1-5 math visuals ============
 * Comic-book idiom from style.css: white cards, 16-22px corners, bold
 * SHAPE_COLORS accents, hard drop shadows (0 4px 0 rgba(0,0,0,0.12)).
 * Base sizes are phone-portrait (375px safe); >=700px scales up.
 */

/* ---------- equation banner ---------- */
.cm-eq {
  width: 100%;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
  letter-spacing: 1px;
}

/* operator boxes inside a seq-row (missing number, unknown factor) */
.seq-num.cm-opbox {
  background: transparent;
  box-shadow: none;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
  min-width: 34px;
  padding: 14px 2px;
}
.cm-seq-tight .seq-num { min-width: 56px; padding: 12px 6px; font-size: 1.9rem; }

/* counting pips added during the missing-number walkthrough */
.cm-pips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 10px; width: 100%; }
.cm-pip { font-size: 1.7rem; animation: ghostIn 0.3s; }

/* ---------- base-ten blocks ---------- */
.cm-bt { display: flex; gap: 12px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.cm-bt-group {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 10px 12px 6px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  text-align: center;
}
.cm-bt-inner { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: flex-end; max-width: 190px; }
.cm-bt-label {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-top: 5px;
}
.cm-block { border-radius: 4px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.cm-block.bt-flat {
  width: 52px; height: 52px;
  background:
    repeating-linear-gradient(0deg, transparent 0 4.5px, rgba(255, 255, 255, 0.55) 4.5px 5.5px),
    repeating-linear-gradient(90deg, transparent 0 4.5px, rgba(255, 255, 255, 0.55) 4.5px 5.5px),
    #3b82f6;
  border-radius: 7px;
}
.cm-block.bt-rod {
  width: 13px; height: 52px;
  background:
    repeating-linear-gradient(0deg, transparent 0 4.4px, rgba(255, 255, 255, 0.55) 4.4px 5.4px),
    #22c55e;
}
.cm-block.bt-cube { width: 15px; height: 15px; background: #f59e0b; }
.cm-block.hl-block { outline: 4px solid #facc15; outline-offset: 2px; transform: scale(1.12); transition: transform 0.15s; }

/* ---------- column arithmetic ---------- */
.cm-col {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  padding: 10px 22px 16px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  display: inline-block;
}
.cm-col-row { display: flex; justify-content: flex-end; }
.cm-col-op {
  width: 34px;
  font-size: 2rem;
  font-weight: 900;
  color: #db2777;
  text-align: left;
  align-self: center;
}
.cm-digit {
  width: 40px;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 900;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.cm-digit.dot { width: 18px; color: #db2777; }
.cm-digit.slot { color: #db2777; }
.cm-digit.hl { background: #fef9c3; border-radius: 8px; }
.cm-digit.hl2 { background: #dcfce7; border-radius: 8px; color: #15803d; }
.cm-col-row.carry .cm-digit {
  font-size: 1.05rem;
  height: 20px;
  line-height: 20px;
  color: #d97706;
  opacity: 0;
}
.cm-col-row.carry .cm-digit.show { opacity: 1; animation: ghostIn 0.3s; }
.cm-col-line { border-top: 5px solid #1e293b; border-radius: 3px; margin: 4px 0 2px; }

/* ---------- fraction bars & circles ---------- */
.cm-fbar {
  display: flex;
  width: min(320px, 84vw);
  height: 54px;
  background: #fff;
  border: 3px solid #334155;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}
.cm-fseg { flex: 1; border-right: 3px solid #334155; }
.cm-fseg:last-child { border-right: none; }
.cm-fseg.on { background: #f59e0b; }
.cm-fbar.dec .cm-fseg.on { background: #a855f7; }
.cm-fseg.cnt { box-shadow: inset 0 0 0 4px #60a5fa; }
.cm-fseg.hl { filter: brightness(1.25); box-shadow: inset 0 0 0 4px #16a34a; }
.cm-fcircle { width: 190px; height: 190px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.12)); }
.cm-fcircle svg { width: 100%; height: 100%; display: block; }
.cm-slice { fill: #fff; stroke: #334155; stroke-width: 2.5; }
.cm-slice.on { fill: #f59e0b; }
.cm-slice.cnt { stroke: #60a5fa; stroke-width: 4; }
.cm-slice.hl { stroke: #16a34a; stroke-width: 4.5; }

.cm-frac-stack { display: flex; flex-direction: column; gap: 12px; align-items: center; width: 100%; }
.cm-frac-row { display: flex; align-items: center; gap: 12px; max-width: 100%; }
.cm-frac-row .cm-fbar { width: min(240px, 60vw); height: 46px; }
.cm-frac-lab {
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
  min-width: 62px;
  text-align: center;
}
.cm-frac-plus { font-size: 2.2rem; font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); line-height: 1; }
.cm-frac-slot:empty { display: none; }
.cm-frac-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.35);
  border: 4px dashed rgba(79, 70, 229, 0.55);
  border-radius: 20px;
  padding: 12px 16px;
  cursor: pointer;
}
.cm-frac-pick .cm-fbar { width: min(250px, 62vw); height: 46px; }
.cm-frac-pick:active { transform: scale(0.97); }
.cm-frac-pick.win { border: 5px solid #16a34a; background: #dcfce7; }
.cm-frac-pick.win .cm-frac-lab, .cm-frac-pick.wrong-pick .cm-frac-lab { color: #1e293b; text-shadow: none; }
.cm-frac-pick.wrong-pick { border: 5px solid #f87171; background: #fee2e2; animation: shake 0.4s; }
.cm-frac-pick.hl-pick { border: 5px solid #f59e0b; background: #fef9c3; }
.cm-frac-pick.hl-pick .cm-frac-lab { color: #1e293b; text-shadow: none; }

/* ---------- fraction number line ---------- */
.cm-fl { width: min(340px, 88vw); }
.cm-fl-bar {
  position: relative;
  display: flex;
  height: 34px;
  background: #fff;
  border: 3px solid #334155;
  border-radius: 10px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  margin-top: 30px;
}
.cm-fl-seg { flex: 1; border-right: 3px solid #334155; }
.cm-fl-seg:last-child { border-right: none; }
.cm-fl-seg.hl { background: #fef08a; }
.cm-fl-star {
  position: absolute;
  top: -32px;
  transform: translateX(-50%);
  font-size: 1.9rem;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25));
}
.cm-ends { display: flex; justify-content: space-between; margin-top: 6px; }
.cm-end {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

/* ---------- rounding line ---------- */
.cm-round { width: min(340px, 88vw); }
.cm-round-bar {
  position: relative;
  height: 14px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  margin-top: 44px;
}
.cm-round-half {
  position: absolute;
  left: 50%; top: -8px;
  width: 4px; height: 30px;
  background: #cbd5e1;
  border-radius: 2px;
  transform: translateX(-50%);
}
.cm-round-mark {
  position: absolute;
  top: -44px;
  transform: translateX(-50%);
  background: #db2777;
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  border-radius: 12px;
  padding: 5px 10px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}
.cm-round-mark::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -8px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #db2777;
}
.cm-round-mark.hl { animation: pulse 1s infinite; }

/* ---------- unit grids: arrays, area, volume layers, decimals ---------- */
.cm-grid {
  --cm-cell: 32px;
  display: grid;
  grid-template-columns: repeat(var(--cm-cols, 5), var(--cm-cell));
  gap: 3px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}
.cm-cell {
  width: var(--cm-cell);
  height: var(--cm-cell);
  background: #93c5fd;
  border-radius: 6px;
  position: relative;
}
.cm-cell.tap { cursor: pointer; }
.cm-cell.hl { background: #fbbf24; }
.cm-grid.dec { --cm-cell: 20px; gap: 2px; padding: 8px; }
.cm-grid.dec .cm-cell { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 3px; }
.cm-grid.dec .cm-cell.on { background: #a855f7; border-color: #7c3aed; }
.cm-grid.dec .cm-cell.hl { background: #fbbf24; border-color: #d97706; }
.cm-grid.vol { --cm-cell: 22px; padding: 8px; }
.cm-grid.vol .cm-cell { background: #f9a8d4; }

/* area & perimeter wrapper with flashing edge bars */
.cm-ap { position: relative; display: inline-block; }
.cm-side { position: absolute; background: #16a34a; border-radius: 5px; opacity: 0; }
.cm-side.show { opacity: 1; animation: ghostIn 0.3s; }
.cm-side.top { top: 2px; left: 10px; right: 10px; height: 7px; }
.cm-side.bottom { bottom: 2px; left: 10px; right: 10px; height: 7px; }
.cm-side.left { left: 2px; top: 10px; bottom: 10px; width: 7px; }
.cm-side.right { right: 2px; top: 10px; bottom: 10px; width: 7px; }
.cm-ap-lab {
  width: 100%;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

/* volume: one layer at a time */
.cm-vol { display: flex; gap: 12px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.cm-vol-layer { text-align: center; }
.cm-vol-layer.hl-layer .cm-grid { outline: 5px solid #facc15; }
.cm-vol-lab {
  font-size: 0.85rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  margin-top: 5px;
}

/* ---------- clock ---------- */
.cm-clock { width: 200px; height: 200px; }
.cm-clock svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.12)); }
.cm-clock-face { fill: #fff; stroke: #1e293b; stroke-width: 3.5; }
.cm-clock-num { font-size: 9.5px; font-weight: 900; fill: #1e293b; font-family: inherit; }
.cm-clock-dot { fill: #94a3b8; }
.cm-hand-h { stroke: #1e293b; stroke-width: 5.5; stroke-linecap: round; }
.cm-hand-m { stroke: #db2777; stroke-width: 3.5; stroke-linecap: round; }
.cm-hand-h.hl { stroke: #f59e0b; }
.cm-hand-m.hl { stroke: #f59e0b; }
.cm-clock-pin { fill: #1e293b; }

/* ---------- coins ---------- */
.cm-coin-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 340px; }
.cm-coin {
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #1e293b;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18), inset 0 0 0 4px rgba(255, 255, 255, 0.55);
}
.cm-coin.coin-q { width: 62px; height: 62px; background: #cbd5e1; font-size: 1.05rem; }
.cm-coin.coin-n { width: 54px; height: 54px; background: #d1d5db; font-size: 0.95rem; }
.cm-coin.coin-d { width: 42px; height: 42px; background: #e2e8f0; font-size: 0.85rem; }
.cm-coin.coin-p { width: 46px; height: 46px; background: #d9a066; font-size: 0.85rem; }

/* ---------- equal groups & sharing ---------- */
.cm-groups { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.obj-group.cm-hl-group { outline: 5px solid #facc15; background: #fef9c3; }
.cm-plate-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; width: 100%; }
.cm-plate {
  width: 78px;
  min-height: 78px;
  border: 4px dashed #4f46e5;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px;
}
.cm-plate.win { border: 5px solid #16a34a; background: #dcfce7; }
.cm-plate-obj { font-size: 1.05rem; line-height: 1; animation: ghostIn 0.3s; }

/* divRem grouping rings */
.obj.cm-chunk { border-radius: 12px; }
.obj.cm-chunk.ck0 { background: #dbeafe; }
.obj.cm-chunk.ck1 { background: #dcfce7; }
.obj.cm-chunk.ck2 { background: #fef9c3; }
.obj.cm-chunk.ck3 { background: #fce7f3; }
.obj.cm-left { background: #fee2e2; border-radius: 12px; outline: 3px dashed #ef4444; }

/* unknown factor: columns of dots built during teaching */
.cm-uf-anchor { display: flex; gap: 7px; align-items: flex-end; justify-content: center; width: 100%; min-height: 10px; }
.cm-uf-col { display: flex; flex-direction: column; gap: 4px; animation: ghostIn 0.3s; }
.cm-uf-dot { width: 17px; height: 17px; border-radius: 50%; background: #4f46e5; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }

/* ---------- area model ---------- */
.cm-am { display: flex; align-items: stretch; gap: 8px; width: min(340px, 88vw); }
.cm-am-side {
  display: flex;
  align-items: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}
.cm-am-boxes { display: flex; gap: 6px; flex: 1; }
.cm-am-box {
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid #4f46e5;
  border-radius: 14px;
  padding: 8px 6px;
  text-align: center;
  min-width: 64px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}
.cm-am-box.hl-box { border-color: #f59e0b; background: #fef9c3; }
.cm-am-top { font-size: 1.2rem; font-weight: 900; color: #4f46e5; border-bottom: 3px solid #e2e8f0; padding-bottom: 4px; }
.cm-am-val { font-size: 1.9rem; font-weight: 900; color: #db2777; padding-top: 6px; }
.cm-am-val.hl-num { color: #15803d; background: none; box-shadow: none; }

/* ---------- order of operations ---------- */
.cm-expr {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}
.cm-tok { font-size: 2.4rem; font-weight: 900; color: #1e293b; padding: 2px 6px; border-radius: 10px; }
.cm-tok.hl-tok { background: #fef08a; box-shadow: 0 0 0 3px #f59e0b; }
.cm-expr-work {
  width: 100%;
  text-align: center;
  min-height: 30px;
  font-size: 1.9rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}

/* ---------- coordinate plane ---------- */
.cm-cp {
  --cp-cell: 36px;
  display: grid;
  grid-template-columns: repeat(var(--cp-cols, 7), var(--cp-cell));
  background: rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}
.cp-lab {
  width: var(--cp-cell);
  height: var(--cp-cell);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 900;
  color: #64748b;
}
.cp-dot {
  width: var(--cp-cell);
  height: var(--cp-cell);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
}
/* faint grid lines through each dot */
.cp-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(#e2e8f0, #e2e8f0) center / 100% 2px no-repeat,
    linear-gradient(#e2e8f0, #e2e8f0) center / 2px 100% no-repeat;
}
.cp-pip {
  position: relative;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #94a3b8;
  transition: transform 0.12s;
}
.cp-dot:active .cp-pip { transform: scale(1.5); }
.cp-dot.path .cp-pip { background: #f59e0b; transform: scale(1.35); }
.cp-dot.win .cp-pip { background: #16a34a; transform: scale(1.9); box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.3); }
.cp-dot.wrong-pick .cp-pip { background: #ef4444; transform: scale(1.5); animation: shake 0.4s; }

/* ---------- two-step story card ---------- */
.cm-story {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  max-width: min(340px, 88vw);
}
.cm-story-emoji { font-size: 2.3rem; line-height: 1; }
.cm-story-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.35;
  text-align: left;
}
.cm-ts-anchor {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  min-height: 10px;
}
.cm-ts-anchor .obj-group { animation: ghostIn 0.3s; }

/* ---------- factor pairs: teach builds the array here ---------- */
.cm-fp-anchor { display: flex; justify-content: center; width: 100%; min-height: 10px; }
.cm-fp-anchor .cm-grid { animation: ghostIn 0.3s; }

/* ---------- angle types ---------- */
.cm-ang { width: min(300px, 78vw); }
.cm-ang svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.12)); }
.cm-ang-ray { stroke: #1e293b; stroke-width: 4; stroke-linecap: round; }
.cm-ang-dot { fill: #db2777; }
.cm-ang-arc { fill: none; stroke: #f59e0b; stroke-width: 3.5; stroke-linecap: round; }
.cm-ang-square { fill: none; stroke: #16a34a; stroke-width: 2.5; opacity: 0; }
.cm-ang-ref { stroke: #16a34a; stroke-width: 2; stroke-dasharray: 5 4; opacity: 0; }
.cm-ang-square.show, .cm-ang-ref.show { opacity: 1; }
.cm-ang-arc.sweep { stroke-dasharray: 1; animation: cmSweep 1.4s ease-out; }
@keyframes cmSweep { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- symmetry picks ---------- */
.cm-sym-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.cm-sym-pick {
  width: 96px;
  height: 96px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 4px dashed rgba(79, 70, 229, 0.55);
  border-radius: 20px;
  cursor: pointer;
}
.cm-sym-pick svg { width: 100%; height: 100%; display: block; transition: transform 0.8s; }
.cm-sym-pick svg.cm-sym-flip { transform: scaleX(-1); }
.cm-sym-pick:active { transform: scale(0.95); }
.cm-sym-pick.win { border: 5px solid #16a34a; background: #dcfce7; }
.cm-sym-pick.wrong-pick { border: 5px solid #f87171; background: #fee2e2; animation: shake 0.4s; }
.cm-sym-pick.hl-sym { border: 5px solid #f59e0b; background: #fef9c3; }
.cm-sym-line { stroke: #db2777; stroke-width: 3; stroke-dasharray: 6 5; opacity: 0; }
.cm-sym-pick.show-line .cm-sym-line { opacity: 1; }

/* ---------- unit conversion ladder ---------- */
.cm-ladder { display: flex; flex-direction: column; gap: 8px; align-items: stretch; width: min(300px, 80vw); }
.cm-rung {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}
.cm-rung-emoji { font-size: 1.5rem; line-height: 1; }
.cm-rung-lab { font-size: 1.1rem; font-weight: 900; color: #1e293b; }
.cm-rung.hl-rung { outline: 4px solid #facc15; }

/* ============ form factors ============ */

/* small phones: shrink the wide pieces so nothing scrolls sideways */
@media (max-width: 400px) {
  .cm-grid { --cm-cell: 26px; }
  .cm-grid.dec { --cm-cell: 17px; }
  .cm-grid.vol { --cm-cell: 19px; }
  .cm-cp { --cp-cell: 30px; padding: 8px; }
  .cm-digit { width: 34px; font-size: 2.1rem; }
  .cm-digit.dot { width: 15px; }
  .cm-clock { width: 175px; height: 175px; }
  .cm-block.bt-flat { width: 44px; height: 44px; }
  .cm-block.bt-rod { height: 44px; }
  .cm-bt-inner { max-width: 160px; }
  .cm-eq { font-size: 1.7rem; }
  .cm-tok { font-size: 2rem; }
  .cm-seq-tight .seq-num { min-width: 48px; font-size: 1.6rem; padding: 10px 4px; }
  .cm-story-text { font-size: 1.02rem; }
  .cm-sym-pick { width: 84px; height: 84px; }
  .cm-rung-lab { font-size: 0.98rem; }
}

/* iPad and up: bigger play pieces, like style.css does for the K stage */
@media (min-width: 700px) {
  .cm-eq { font-size: 2.6rem; }
  .cm-grid { --cm-cell: 42px; gap: 4px; }
  .cm-grid.dec { --cm-cell: 26px; }
  .cm-grid.vol { --cm-cell: 28px; }
  .cm-cp { --cp-cell: 46px; }
  .cm-digit { width: 52px; font-size: 3.2rem; }
  .cm-digit.dot { width: 22px; }
  .cm-clock { width: 260px; height: 260px; }
  .cm-fbar { width: 420px; height: 64px; }
  .cm-frac-pick .cm-fbar { width: 330px; }
  .cm-frac-row .cm-fbar { width: 330px; height: 56px; }
  .cm-fl, .cm-round, .cm-am { width: 420px; }
  .cm-fcircle { width: 240px; height: 240px; }
  .cm-block.bt-flat { width: 62px; height: 62px; }
  .cm-block.bt-rod { width: 15px; height: 62px; }
  .cm-block.bt-cube { width: 18px; height: 18px; }
  .cm-bt-inner { max-width: 260px; }
  .cm-coin.coin-q { width: 74px; height: 74px; font-size: 1.25rem; }
  .cm-coin.coin-n { width: 64px; height: 64px; }
  .cm-coin.coin-d { width: 50px; height: 50px; font-size: 0.95rem; }
  .cm-coin.coin-p { width: 55px; height: 55px; font-size: 0.95rem; }
  .cm-plate { width: 96px; min-height: 96px; }
  .cm-plate-obj { font-size: 1.3rem; }
  .cm-uf-dot { width: 22px; height: 22px; }
  .cm-tok { font-size: 3rem; }
  .cm-pip { font-size: 2.1rem; }
  .cm-story { max-width: 480px; }
  .cm-story-text { font-size: 1.35rem; }
  .cm-ang { width: 360px; }
  .cm-sym-pick { width: 120px; height: 120px; }
  .cm-ladder { width: 360px; }
  .cm-rung-lab { font-size: 1.3rem; }
}

/* short landscape phones: compress tall pieces */
@media (max-height: 470px) {
  .cm-eq { font-size: 1.3rem; }
  .cm-clock { width: 130px; height: 130px; }
  .cm-grid { --cm-cell: 20px; padding: 6px; }
  .cm-grid.dec { --cm-cell: 12px; }
  .cm-grid.vol { --cm-cell: 15px; }
  .cm-cp { --cp-cell: 22px; padding: 6px; }
  .cm-digit { width: 26px; font-size: 1.5rem; }
  .cm-fbar { height: 34px; }
  .cm-fcircle { width: 120px; height: 120px; }
  .cm-block.bt-flat { width: 34px; height: 34px; }
  .cm-block.bt-rod { height: 34px; }
  .cm-coin.coin-q { width: 46px; height: 46px; font-size: 0.85rem; }
  .cm-coin.coin-n { width: 40px; height: 40px; font-size: 0.75rem; }
  .cm-coin.coin-d { width: 32px; height: 32px; font-size: 0.7rem; }
  .cm-coin.coin-p { width: 34px; height: 34px; font-size: 0.7rem; }
  .cm-plate { width: 56px; min-height: 56px; }
  .cm-vol-lab { font-size: 0.7rem; }
  .cm-seq-tight .seq-num { min-width: 42px; font-size: 1.3rem; padding: 8px 4px; }
  .cm-story { padding: 8px 12px; }
  .cm-story-text { font-size: 0.95rem; }
  .cm-ang { width: 200px; }
  .cm-sym-pick { width: 70px; height: 70px; padding: 5px; }
  .cm-ladder { gap: 5px; }
  .cm-rung { padding: 4px 10px; }
  .cm-rung-lab { font-size: 0.9rem; }
}
