/**
 * 기초 연산 문제은행 — 따뜻한 민트·피치 (유치~초등)
 */
:root {
  --bg: #fff4e8;
  --bg-glow-1: #ffe4c4;
  --bg-glow-2: #d8f5ee;
  --hero-grad: linear-gradient(135deg, #ffd6a8 0%, #ffe8cc 45%, #c8f0e6 100%);

  --surface-soft: #fff9f2;
  --surface-problem: #fffefb;

  --accent: #f59e0b;
  --accent-deep: #d97706;
  --accent-light: #fcd34d;
  --accent-glow: rgba(245, 158, 11, 0.35);

  --ink: #3b2a1a;
  --heading: #5c3d1e;
  --muted: #8a6a4a;
  --line: #f5d9b8;
  --rule-line: #fff0dd;

  --teal: #0d9488;
}

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

.stage-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.stage-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.stage-card.active {
  border-color: var(--accent-deep);
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.stage-card.done {
  border-color: #5eead4;
  background: #f0fdfa;
}

.stage-no {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-deep);
}

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

.stage-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.stage-count {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  background: #ffedd5;
  color: #c2410c;
  padding: 2px 8px;
  border-radius: 999px;
}

.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.page-tab {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
}

.page-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.format-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: var(--teal);
  background: #ccfbf1;
  padding: 2px 7px;
  border-radius: 6px;
  margin-bottom: 6px;
}

/* visuals */
.vitem {
  font-size: 1.35rem;
  line-height: 1;
  margin: 2px;
  display: inline-block;
}

.vitem.removed {
  opacity: 0.25;
  text-decoration: line-through;
  filter: grayscale(1);
}

.vgroup {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 220px;
  padding: 6px 8px;
  background: #fff;
  border: 2px dashed var(--line);
  border-radius: 12px;
  vertical-align: middle;
}

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

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

.tenframe {
  display: grid;
  grid-template-columns: repeat(5, 28px);
  gap: 4px;
  width: max-content;
}

.tenframe .cell {
  width: 28px;
  height: 28px;
  border: 2px solid var(--heading);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: #fff;
}

.dot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dot-row .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #b45309;
}

.vertical-sum {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: right;
  line-height: 1.45;
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 90px;
}

.vertical-sum .op-line {
  border-top: 2px solid var(--ink);
  margin-top: 2px;
  padding-top: 2px;
}

.bond {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 800;
}

.bond-total {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.bond-parts {
  display: flex;
  gap: 24px;
}

.bond-parts span {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.visual.visual-nl {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.nl-svg {
  display: block;
  width: 100%;
  max-width: min(420px, 100%);
  height: auto;
}

.place-box {
  display: flex;
  gap: 8px;
  font-weight: 900;
  font-size: 1.3rem;
}

.place-box span {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
}

.place-box .hl {
  border-color: var(--accent);
  background: #fffbeb;
  color: var(--accent-deep);
}

.progress-bar {
  height: 10px;
  background: #ffe4c4;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #0d9488);
  border-radius: 999px;
}

.countup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.countup-cell {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  font-size: 13px;
  background: #fff;
}
.countup-cell.is-on {
  background: #fef3c7;
  border-color: #f59e0b;
}
.countup-cell.is-ask {
  background: #ecfdf5;
  border-style: dashed;
  border-color: #0d9488;
  color: #0d9488;
}
.place20 {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.bundle {
  padding: 8px;
  border: 2px dashed #38bdf8;
  border-radius: 12px;
  background: #e0f2fe;
}
