/**
 * 유아 시각 수학 — 밝고 부드러운 놀이 학습
 */
:root {
  --bg: #fff5f7;
  --bg-glow-1: #fecdd3;
  --bg-glow-2: #bae6fd;
  --hero-grad: linear-gradient(135deg, #fda4af 0%, #fbcfe8 40%, #a5f3fc 100%);

  --surface-soft: #fff1f2;
  --surface-problem: #fffdfb;

  --accent: #f43f5e;
  --accent-deep: #e11d48;
  --accent-light: #fb7185;
  --accent-glow: rgba(244, 63, 94, 0.3);

  --ink: #4c0519;
  --heading: #9f1239;
  --muted: #9f6780;
  --line: #fecdd3;
  --rule-line: #ffe4e6;
}

.age-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.age-tab {
  border: 3px solid #fff;
  background: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.12);
  color: var(--muted);
}

.age-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 0 #be123c;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.unit-card {
  border: 3px solid #fff;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 18px rgba(190, 18, 60, 0.08);
  transition: transform 0.15s;
  width: 100%;
}

.unit-card:hover { transform: translateY(-3px); }
.unit-card.active {
  border-color: var(--accent);
  background: #fff1f2;
}

.unit-card h3 {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--heading);
}

.unit-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.unit-count {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 900;
  background: #ffe4e6;
  color: #be123c;
  padding: 2px 8px;
  border-radius: 999px;
}

.format-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
}

/* visuals */
.vitem {
  font-size: 1.55rem;
  margin: 3px;
  display: inline-block;
  line-height: 1;
}
.vitem.big { font-size: 2rem; }
.vitem.removed {
  opacity: 0.28;
  filter: grayscale(1);
  text-decoration: line-through;
}

.vgroup {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 240px;
  padding: 8px 10px;
  background: #fff;
  border: 3px dashed var(--line);
  border-radius: 14px;
  vertical-align: middle;
}

.vop {
  display: inline-block;
  margin: 0 10px;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-deep);
  vertical-align: middle;
}

.split-arrow {
  font-weight: 800;
  color: var(--muted);
  margin-left: 8px;
}

.compare-row, .match-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: stretch;
}

.compare-side, .match-side {
  flex: 1;
  min-width: 120px;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

.compare-side .label, .match-side .label {
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 6px;
}

.tenframe {
  display: grid;
  grid-template-columns: repeat(5, 32px);
  gap: 5px;
  width: max-content;
}
.tenframe .cell {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--heading);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  font-size: 14px;
}

.dot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dot-row .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f43f5e;
  border: 2px solid #9f1239;
}
.dot-row.big .dot {
  width: 26px;
  height: 26px;
}

.size-row {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: center;
}
.size-blob {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fda4af;
  border: 3px solid #e11d48;
}
.size-blob.sm { width: 52px; height: 52px; font-size: 1.4rem; }
.size-blob.lg { width: 88px; height: 88px; font-size: 2.2rem; }

.shape-row, .color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.shape-chip, .color-chip {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: #fff;
  border: 2px solid #e2e8f0;
}

.pattern-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 1.8rem;
}
.pattern-ask {
  min-width: 48px;
  height: 48px;
  border: 3px dashed var(--accent);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--accent);
  background: #fff1f2;
}

.plates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.plate {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #94a3b8;
  background: #f8fafc;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.pos-grid {
  display: grid;
  grid-template-columns: 56px 100px 56px;
  grid-template-rows: 56px 100px 56px;
  gap: 6px;
  width: max-content;
  margin: 8px auto;
}
.pos-cell {
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: #fff;
  border-radius: 12px;
  border: 2px dashed #e2e8f0;
}
.pos-box {
  grid-column: 2;
  grid-row: 2;
  background: #fecdd3;
  border: 3px solid #e11d48;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  color: #9f1239;
}

.visual.visual-bars {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.bar-row {
  display: grid;
  grid-template-columns: 7.2em 1fr auto;
  align-items: center;
  column-gap: 10px;
  font-size: 13px;
  font-weight: 800;
}
.bar-name {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-units {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.bar-unit {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  background: linear-gradient(180deg, #fb7185, #e11d48);
  border: 2px solid #9f1239;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}
.bar-num {
  font-size: 13px;
  min-width: 20px;
}
.bar-ruler {
  display: flex;
  gap: 4px;
  margin-left: 82px;
  font-size: 11px;
  font-weight: 800;
  color: #9f6780;
}
.bar-ruler span {
  width: 22px;
  text-align: center;
  flex: 0 0 22px;
}

.place20 {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.bundle {
  padding: 8px;
  border: 2px dashed #38bdf8;
  border-radius: 12px;
  background: #e0f2fe;
}

.story-banner {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: #fff7ed;
  border: 2px dashed #fdba74;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #9a3412;
}

.cubes-compare {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.cube-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cube-stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
}
.cube {
  width: 28px;
  height: 22px;
  background: linear-gradient(180deg, #fb7185, #e11d48);
  border: 2px solid #9f1239;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.cube-ghost {
  background: #fff;
  border: 2px dashed #fb7185;
  box-shadow: none;
}
.cube-fade {
  background: #fecdd3;
  opacity: 0.45;
  border-style: dashed;
}
.cube-label {
  font-size: 12px;
  font-weight: 800;
  color: #9f1239;
}
.cube-arrow {
  font-weight: 900;
  font-size: 18px;
  color: #e11d48;
  padding-bottom: 28px;
}
