/* =========================================================
   미니 자석블럭 도안 만들기 (mini-maker.html 전용)
   - 도안 한 장은 실제 A4(210×297mm)로 그리고, 화면에서는 줄여서 보여 줘요.
   - 칸 하나 = 20mm = 블록 하나. 인쇄할 때 '실제 크기(100%)'면 블록과 꼭 맞아요.
   ========================================================= */

.maker-head { background: var(--mini-cream); padding: 24px 0 28px; }
.maker-head .lead { margin-top: 12px; color: #4A4A4A; max-width: 640px; }
.maker { padding: 24px 0 80px; }
.maker-grid { display: grid; gap: 24px; }

/* ---------- 고르는 칸 ---------- */
.maker-panel { display: flex; flex-direction: column; gap: 20px; }
.maker-q { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--mini-ink); margin-bottom: 10px; }
.maker-q .mini-num { width: 28px; height: 28px; font-size: 15px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px 6px 6px;
  border-radius: 999px; border: 1.5px solid #DCE1EA; background: #fff; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--mini-ink);
}
.chip-btn img { width: 34px; height: 34px; border-radius: 8px; }
.chip-btn[aria-pressed="true"] { border-color: var(--mini-ink); background: var(--mini-ink); color: #fff; }
.hero-mini { display: inline-flex; flex-direction: column; gap: 1px; }
.hero-mini span { display: flex; gap: 1px; }
.hero-mini img { width: 20px; height: 20px; border-radius: 4px; }

.type-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-btn {
  text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid #E5E0D6; background: #fff;
  cursor: pointer; font: inherit; color: var(--color-text); display: flex; flex-direction: column; gap: 2px;
}
.type-btn b { font-size: 15.5px; color: var(--mini-ink); }
.type-btn b em { font-style: normal; font-size: 11px; color: #fff; background: var(--mini-accent); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 2px; }
.type-btn span { font-size: 13px; line-height: 1.45; color: var(--color-text-sub); }
.type-btn.wide { grid-column: span 2; }
.type-btn[aria-pressed="true"] { border-color: var(--mini-ink); box-shadow: inset 0 0 0 1.5px var(--mini-ink); background: #F4F6FA; }
.maker-step[hidden], .maker-check[hidden] { display: none; }
.maker-check { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.maker-check input { width: 20px; height: 20px; accent-color: var(--mini-ink); }
.maker-actions { display: grid; gap: 10px; }
.maker-actions .btn-primary { background: var(--mini-ink); }
.maker-actions .btn-primary:hover { background: #1C2840; }
.maker-actions .btn-secondary { color: var(--mini-ink); border-color: var(--mini-ink); }

/* ---------- 미리 보기 ---------- */
.maker-preview { min-width: 0; }
.maker-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.maker-preview-label { font-size: 13px; font-weight: 600; color: var(--color-text-sub); }
.maker-preview-label span { font-weight: 400; }
.zoom-ctl { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid #DCE1EA; border-radius: 999px; padding: 3px; }
.zoom-ctl button {
  min-width: 40px; height: 40px; border: 0; border-radius: 999px; background: #EEF1F6; color: var(--mini-ink);
  font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; line-height: 1;
}
.zoom-ctl button.fit { font-size: 13px; padding: 0 12px; background: transparent; }
.zoom-ctl button:hover { background: #DCE3EE; }
.zoom-ctl [data-zoom-label] { min-width: 48px; text-align: center; font-size: 13px; font-weight: 600; color: var(--mini-ink); }
.maker-out { --s: 0.45; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px; border-radius: 18px; background: #EEF0F4; }
.maker-out .sheet-wrap { cursor: zoom-in; }
/* 크게 볼 때: 미리 보기 창 안에서 마우스로 끌어 옮겨 보고(휴대폰은 손가락으로 밀기), 한 번 누르면 원래대로 */
.maker-out.is-zoomed {
  display: block; overflow: auto; max-height: 78vh; cursor: grab;
  overscroll-behavior: contain; -webkit-user-select: none; user-select: none;
}
.maker-out.is-zoomed.is-dragging { cursor: grabbing; }
.maker-out.is-zoomed .sheet-wrap { cursor: inherit; margin: 0 0 16px; }
.maker-out.is-zoomed img { -webkit-user-drag: none; pointer-events: none; }
.maker-out.is-map { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 12px; }
.maker-out.is-map .sheet-wrap:first-child { grid-column: span 2; justify-self: center; }
.sheet-wrap {
  width: calc(210mm * var(--s)); height: calc(297mm * var(--s)); overflow: hidden; flex: none;
  background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.12); border-radius: 4px;
}
.sheet-wrap > .sheet { transform: scale(var(--s)); transform-origin: 0 0; }

/* ---------- 도안 한 장 (실제 크기, mm) ---------- */
.sheet {
  width: 210mm; height: 297mm; padding: 13mm 14mm 10mm; box-sizing: border-box; background: #fff;
  display: flex; flex-direction: column; color: #222; font-family: var(--font); overflow: hidden; position: relative;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sh-head { display: flex; align-items: center; gap: 3mm; flex-wrap: wrap; }
.sh-badge { font-size: 3.2mm; font-weight: 700; color: #fff; background: #E8743B; border-radius: 99mm; padding: 0.8mm 3mm; }
.sh-title { font-family: "Jua", var(--font); font-weight: 400; font-size: 7.4mm; line-height: 1.2; color: #2B3A55; }
.sh-stars { color: #E9A23B; font-size: 4.2mm; letter-spacing: 0.3mm; }
.sh-chip { margin-left: auto; font-size: 3.2mm; font-weight: 700; color: var(--c); border: 0.35mm solid var(--c); border-radius: 99mm; padding: 0.6mm 3mm; }
.sh-intro { margin-top: 3mm; font-size: 3.9mm; line-height: 1.6; color: #333; }
.sh-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2mm; padding: 4mm 0; }
.cap { font-family: "Jua", var(--font); font-size: 4mm; color: #E8743B; margin: 1mm 0 1.5mm; align-self: flex-start; }
.sh-body > .cap { align-self: center; width: 140mm; }

/* 칸 */
.g { display: grid; gap: 0; border: 0.3mm solid #C9CED8; background: #fff; }
.gc { position: relative; width: 20mm; height: 20mm; box-sizing: border-box; border: 0.25mm dashed #C9CED8; display: grid; place-items: center; }
.gc .blk { width: 19.2mm; height: 19.2mm; border-radius: 1.6mm; display: block; }
.gl { position: absolute; left: 0.8mm; top: 0.6mm; font-size: 2.8mm; font-weight: 700; color: #fff; background: #2B3A55; border-radius: 1mm; padding: 0 1.2mm; line-height: 1.5; }
.gc.start .gl { background: #2F8F46; }
.gc.goal .gl { background: #D9542B; }
.gc.off { background: #F6F7F9; border-color: transparent; }
.gc.haz .blk { opacity: 0.92; }
.gc.ask { background: #FFFBF2; }
.g.blank .gc { background: #FFFBF2; }
.pair { display: flex; gap: 10mm; align-items: flex-start; justify-content: center; }
.pair.fold { gap: 6mm; }
.fold-line { align-self: stretch; border-left: 0.4mm dashed #999; position: relative; margin-top: 8mm; }
.fold-line span { position: absolute; top: 50%; left: 1mm; font-size: 2.8mm; color: #888; writing-mode: vertical-rl; transform: translateY(-50%); }
.mirror { position: relative; }
.mirror-line { position: absolute; left: 50%; top: -3mm; bottom: -3mm; width: 0.9mm; margin-left: -0.45mm; background: #E5484D; border-radius: 1mm; }

/* 세어 보기 질문 */
.qs { display: flex; gap: 6mm; margin-top: 5mm; flex-wrap: wrap; justify-content: center; }
.q { display: flex; align-items: center; gap: 2mm; font-size: 3.8mm; }
.q .blk { width: 10mm; height: 10mm; border-radius: 1mm; }
.q .line { display: inline-block; min-width: 14mm; border-bottom: 0.3mm solid #555; text-align: right; padding-left: 10mm; }

/* 놀이 방법·필요한 블록·바닥글 */
.sh-how { border: 0.3mm solid #E5DCCB; border-radius: 3mm; padding: 2.6mm 4mm; background: #FFFBF4; font-size: 3.5mm; line-height: 1.55; margin-top: 2mm; }
.sh-how b { font-family: "Jua", var(--font); font-weight: 400; font-size: 4mm; color: #2B3A55; }
.sh-how ol { margin: 1mm 0 0; padding-left: 5mm; }
.sh-need { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5mm 3.5mm; margin-top: 3mm; font-size: 3.1mm; }
.sh-need b { font-family: "Jua", var(--font); font-weight: 400; font-size: 3.8mm; color: #2B3A55; margin-right: 1mm; }
.nd { display: inline-flex; align-items: center; gap: 1mm; }
.nd .blk { width: 7mm; height: 7mm; border-radius: 0.8mm; }
.nd-ok { margin-left: auto; font-size: 2.9mm; font-weight: 700; color: #2F8F46; }
.sh-foot { margin-top: 3mm; border-top: 0.3mm solid #EEE; padding-top: 2.5mm; }
.sh-check { display: flex; align-items: center; gap: 3mm; font-size: 2.9mm; color: #555; }
.sh-2cm { width: 20mm; height: 20mm; flex: none; border: 0.4mm solid #886A60; border-radius: 1mm; box-sizing: border-box; }
.sh-tip { margin-top: 2mm; font-size: 3.1mm; color: #555; }
.sh-legal { margin-top: 1mm; font-size: 2.5mm; color: #999; }

/* ---------- 큰 놀이 지도 ---------- */
.map-sheet { padding: 0; }
.map-grid {
  position: absolute; left: 15mm; top: 18.5mm; display: grid;
  grid-template-columns: repeat(9, 20mm); grid-template-rows: repeat(13, 20mm);
  outline: 0.3mm solid #9AA3AF;
}
.mc { position: relative; width: 20mm; height: 20mm; box-sizing: border-box; border: 0.2mm solid rgba(255,255,255,0.75); background: var(--base0); display: grid; place-items: center; }
.mc.g1 { background: var(--base1); }
.mc.g2 { background: var(--base2); }
.mc.deco { background: var(--base0); }
.mc.deco .blk { width: 13mm; height: 13mm; border-radius: 1.4mm; opacity: 0.95; }
.mc.pool { background: var(--pool); border-color: rgba(255,255,255,0.4); }
.mc.pool .ml { left: 1mm; top: 1mm; font-size: 3mm; color: rgba(0,0,0,0.5); white-space: nowrap; z-index: 2; }
.mc.path { background: var(--path); border: 0.2mm solid rgba(0,0,0,0.08); }
.mc.path::after { content: ""; width: 1.6mm; height: 1.6mm; border-radius: 50%; background: rgba(0,0,0,0.18); }
.mc.path.pstop, .mc.path.start, .mc.path.goal { background: #FFE7A3; }
.mc.path.pstop::after, .mc.path.start::after, .mc.path.goal::after { display: none; }
.mc.stop .blk, .mc.goal .blk { width: 17.5mm; height: 17.5mm; border-radius: 1.6mm; box-shadow: 0 0 0 0.6mm #fff; }
.mc .ml { position: absolute; left: 0.6mm; top: 0.4mm; font-size: 2.5mm; color: rgba(0,0,0,0.45); font-weight: 700; }
.mc.stop .ml, .mc.pstop .ml { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 7mm; height: 7mm; border-radius: 50%; background: #E8743B; color: #fff; font-size: 3.8mm; display: grid; place-items: center; }
.mc.stop .ml { left: auto; right: -1mm; top: -1mm; transform: none; width: 5.5mm; height: 5.5mm; font-size: 3mm; z-index: 2; }
.mc.start .ml, .mc.goal .ml { left: 50%; top: auto; bottom: 0.8mm; transform: translateX(-50%); font-size: 3mm; color: #fff; background: #2F8F46; border-radius: 1mm; padding: 0 1.4mm; z-index: 2; }
.mc.goal .ml { background: #D9542B; }
.map-no { position: absolute; right: 15mm; top: 7mm; font-family: "Jua", var(--font); font-size: 6mm; color: #2B3A55; }
.join { position: absolute; font-size: 2.8mm; color: #888; }
.join-r { right: 2mm; top: 50%; writing-mode: vertical-rl; transform: translateY(-50%); }
.join-b { left: 50%; bottom: 4mm; transform: translateX(-50%); }
.map-legal { position: absolute; left: 15mm; bottom: 4mm; font-size: 2.3mm; color: #AAA; }
/* 색칠 놀이용: 땅은 하얗게, 선만 */
.map-sheet.lines .mc { background: #fff; border-color: #D5D9E0; }
.map-sheet.lines .mc.pool { background: #fff; background-image: repeating-linear-gradient(45deg, transparent 0 2mm, #D5E7F3 2mm 2.4mm); }
.map-sheet.lines .mc.path { background: #fff; border: 0.3mm solid #B8BEC8; }
.map-sheet.lines .mc.path.pstop, .map-sheet.lines .mc.path.start, .map-sheet.lines .mc.path.goal { background: #fff; }

/* 놀이 카드 쪽 */
.guide-top { display: flex; gap: 10mm; margin-top: 5mm; align-items: flex-start; }
.guide-top .small { font-size: 3.1mm; color: #555; margin-top: 2mm; max-width: 70mm; }
.assemble { display: grid; grid-template-columns: repeat(2, 16mm); grid-template-rows: repeat(2, 22mm); gap: 1mm; }
.assemble span { display: grid; place-items: center; border: 0.4mm solid #2B3A55; border-radius: 1mm; font-family: "Jua", var(--font); font-size: 6mm; color: #2B3A55; background: #F4F6FA; }
.missions { list-style: none; padding: 0; margin: 3mm 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 5mm; flex: 1; align-content: start; }
.missions li { display: flex; align-items: center; gap: 2mm; font-size: 3.2mm; line-height: 1.4; }
.missions .blk { width: 10mm; height: 10mm; border-radius: 1mm; flex: none; }
.missions .num { flex: none; width: 6mm; height: 6mm; border-radius: 50%; background: #E8743B; color: #fff; font-size: 3.2mm; font-weight: 700; display: grid; place-items: center; }
.missions .num.goal { width: auto; padding: 0 1.5mm; border-radius: 1mm; background: #D9542B; font-size: 2.8mm; }
.guide-sheet .sh-how { margin-top: 3mm; font-size: 3.9mm; padding: 2.8mm 4.5mm; }
.guide-sheet .sh-how b { font-size: 4.6mm; }
.guide-sheet .sh-title { font-size: 7.8mm; }
.guide-sheet .cap { font-size: 5mm; }
.guide-sheet .guide-top .small { font-size: 3.8mm; max-width: 80mm; }
.guide-sheet .assemble { grid-template-columns: repeat(2, 18mm); grid-template-rows: repeat(2, 24mm); }
.guide-sheet .assemble span { font-size: 8mm; }
.guide-sheet .missions { margin-top: 4mm; gap: 3mm 6mm; flex: none; }
.guide-sheet .missions li { font-size: 4mm; line-height: 1.4; gap: 2.5mm; }
.guide-sheet .missions .blk { width: 12.5mm; height: 12.5mm; border-radius: 1.3mm; }
.guide-sheet .missions .num { width: 8mm; height: 8mm; font-size: 4.2mm; }
.guide-sheet .missions .num.goal { font-size: 3.6mm; padding: 0.5mm 2mm; }
.guide-sheet .sh-check, .guide-sheet .sh-tip { font-size: 3.4mm; }
.guide-sheet .sh-foot { margin-top: auto; }

/* ---------- 넓은 화면 ---------- */
@media (min-width: 1024px) {
  .maker-head { padding: 40px 0 36px; }
  .maker-grid { grid-template-columns: 400px 1fr; gap: 40px; align-items: start; }
  .maker-panel { position: sticky; top: calc(var(--mini-top) + 72px); }
}

/* ---------- 인쇄: 도안만 실제 크기로 ---------- */
@page { size: A4; margin: 0; }
@media print {
  body > *:not(main), .mini-bar, .maker-head, .maker-panel, .maker-preview-label, .site-footer { display: none !important; }
  main > *:not(.mini) { display: none !important; }
  body, .maker, .maker-out { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  .maker-grid, .container { display: block !important; padding: 0 !important; max-width: none !important; }
  .maker-out { display: block !important; border-radius: 0; }
  .sheet-wrap { width: 210mm !important; height: 297mm !important; box-shadow: none; border-radius: 0; break-after: page; page-break-after: always; overflow: hidden; }
  .sheet-wrap:last-child { break-after: auto; page-break-after: auto; }
  .sheet-wrap > .sheet { transform: none !important; }
}
