/* 배움 놀이터 — 1클릭 오프라인 그림 카드·맞춤 활동지·상장 인쇄소 (/play/print.html)
   - 화면에서는 한눈에 미리보고, 인쇄/PDF 저장 시(@media print) 조작부 없이 깔끔한 A4 교구·학습지로 출력 */

body.print-page {
  margin: 0;
  min-height: 100vh;
  background: #FFF8F0;
  color: #1F2A33;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.print-page [hidden] {
  display: none !important;
}

#printApp {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  box-sizing: border-box;
  padding-bottom: 32px;
}

.print-topbar {
  background: #FFFFFF;
  border-bottom: 3px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
}

.print-topbar .play-title {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  color: #1F2A33;
  text-align: center;
  white-space: nowrap;
}

.print-topbar .top-btn,
.print-do-btn {
  min-width: 64px;
  min-height: 64px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 21px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.print-topbar .top-btn {
  border: 3px solid #334155;
  background: #FFFFFF;
  color: #1F2A33;
}

.print-do-btn {
  border: 4px solid #0F766E;
  background: #0F766E;
  color: #FFFFFF;
  box-shadow: 0 4px 0 #115E59;
}

.print-controls-wrap {
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.print-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.print-tab,
.print-chip,
.print-sub-btn {
  min-width: 64px;
  min-height: 64px;
  padding: 0 12px;
  border-radius: 18px;
  border: 3px solid #334155;
  background: #FFFFFF;
  color: #1F2A33;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.print-tab[aria-selected="true"],
.print-chip[aria-pressed="true"] {
  background: #1F2A33;
  color: #FFFFFF;
  border-color: #1F2A33;
}

.print-subbar {
  background: #FFFFFF;
  border: 3px solid #334155;
  border-radius: 20px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.print-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.print-row-label {
  font-size: 20px;
  font-weight: 900;
  color: #1F2A33;
  margin-right: 4px;
}

.print-sub-btn {
  border-radius: 999px;
  border-color: #0F766E;
  color: #134E4A;
  background: #F0FDFA;
}

.print-sub-btn[aria-pressed="true"] {
  background: #0F766E;
  color: #FFFFFF;
}

.print-name-input {
  min-height: 64px;
  padding: 0 14px;
  border-radius: 14px;
  border: 3px solid #334155;
  background: #FFFFFF;
  color: #1F2A33;
  font-size: 20px;
  font-weight: 800;
  flex: 1;
  min-width: 180px;
  box-sizing: border-box;
}

.print-privacy-note {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #334155;
}

/* A4 용지 미리보기 영역 */
.print-preview-wrap {
  padding: 14px 16px 0;
}

.print-sheet {
  background: #FFFFFF;
  color: #111827;
  border: 3px solid #334155;
  border-radius: 20px;
  padding: 24px;
  max-width: 820px;
  margin: 0 auto;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(31, 42, 51, 0.08);
}

.sheet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 3px solid #111827;
}

.sheet-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  color: #111827;
}

.sheet-meta {
  font-size: 20px;
  font-weight: 800;
  color: #1F2A33;
}

.sheet-guide {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
  color: #334155;
}

/* 1) 한마디 소통 카드 16종 오리기 격자 */
.cut-grid-aac {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cut-card {
  border: 2.5px dashed #334155;
  border-radius: 16px;
  padding: 10px 8px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}

.cut-card-visual {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cut-card-visual img,
.cut-card-visual svg {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.cut-card-cat {
  font-size: 20px;
  font-weight: 800;
  color: #0F766E;
}

.cut-card-label {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  color: #111827;
  word-break: keep-all;
}

/* 1-B) ⭐ 내 카드 4칸 대형 소통판 (2x2 코팅용 도안) */
.aac-jumbo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.aac-jumbo-card {
  border: 3.5px solid #0F766E;
  border-radius: 24px;
  padding: 20px 18px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}

.aac-jumbo-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.aac-jumbo-num {
  padding: 2px 10px;
  border-radius: 999px;
  background: #EFF6FF;
  border: 2px solid #1D4ED8;
  font-size: 20px;
  font-weight: 900;
  color: #1E3A8A;
}

.aac-jumbo-cat {
  padding: 2px 10px;
  border-radius: 999px;
  background: #ECFDF5;
  border: 2px solid #0F766E;
  font-size: 20px;
  font-weight: 900;
  color: #064E3B;
}

.aac-jumbo-visual {
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aac-jumbo-visual img,
.aac-jumbo-visual svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.aac-jumbo-label {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.25;
  color: #111827;
  word-break: keep-all;
}

.aac-jumbo-footer {
  margin-top: 16px;
  padding: 12px 16px;
  border: 2.5px dashed #334155;
  border-radius: 16px;
  background: #F8FAFC;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  color: #1F2A33;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* 2) 먼저-다음 약속 보드판 + 20종 딱지 */
.promise-print-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 3px solid #111827;
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 16px;
  break-inside: avoid;
}

.promise-print-slot {
  border: 3px dashed #334155;
  border-radius: 16px;
  min-height: 120px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.promise-slot-tag {
  font-size: 22px;
  font-weight: 900;
  color: #111827;
}

.promise-slot-hint {
  font-size: 20px;
  font-weight: 700;
  color: #475569;
}

.promise-print-arrow {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  color: #111827;
}

.cut-grid-promise {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

/* 3) 5문항 맞춤 그림 활동지 */
.ws-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-item {
  border: 2.5px solid #334155;
  border-radius: 16px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 36px minmax(140px, 1.1fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.ws-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #111827;
}

.ws-stim {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ws-stim-prompt {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #111827;
  text-align: center;
}

.ws-stim-art {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ws-stim-art img,
.ws-stim-art svg {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.ws-stim-art svg.clock-svg {
  width: 86px;
  height: 86px;
}

.ws-stim-art svg.coins-svg,
.ws-stim-art svg.coin-svg,
.ws-stim-art svg.bill-svg,
.ws-stim-art svg.bills-svg {
  width: 82px;
  height: 82px;
}

.ws-price-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 2.5px solid #B45309;
  background: #FFFBEB;
  color: #78350F;
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

body.a11y-contrast .ws-price-tag {
  border-color: #000000;
  background: #FFFFFF;
  color: #000000;
}

.ws-stim-art svg.row-svg {
  width: 210px;
  height: 46px;
}

.ws-stim-art svg.week-svg {
  width: 240px;
  height: 54px;
  max-width: 100%;
}

.ws-stim-art svg.calendar-svg {
  width: 196px;
  height: 114px;
  max-width: 100%;
}

.ws-stim-art svg.sign-svg {
  width: 78px;
  height: 78px;
}

.ws-hangul-slots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ws-hangul-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  border: 2.5px solid #1E293B;
  background: #F8FAFC;
  font-size: 24px;
  font-weight: 900;
  color: #111827;
}

.ws-hangul-slot.is-blank {
  border-style: dashed;
  border-color: #1D4ED8;
  background: #EFF6FF;
  color: #1E3A8A;
}

.ws-plus-sign {
  font-size: 26px;
  font-weight: 900;
  color: #111827;
  padding: 0 4px;
}

.ws-stim-art.is-compact img,
.ws-stim-art.is-compact svg {
  width: 40px;
  height: 40px;
}

.ws-taken {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: 2px dashed #64748B;
  border-radius: 10px;
  opacity: 0.48;
}

.ws-taken::after {
  content: "✕";
  position: absolute;
  font-size: 24px;
  font-weight: 900;
  color: #B91C1C;
  line-height: 1;
}

.ws-eq-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 14px;
  border: 2.5px solid #1E293B;
  background: #F8FAFC;
  font-size: 28px;
  font-weight: 900;
  color: #111827;
  letter-spacing: 0.02em;
}

.ws-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
}

.ws-choice {
  min-width: 74px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 2.5px solid #334155;
  background: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 900;
  color: #111827;
}

.ws-choice img,
.ws-choice svg {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.ws-choice.is-answer {
  border: 4px solid #B91C1C;
  background: #FEF2F2;
  color: #991B1B;
}

/* 3-B) 점선 따라 쓰기 활동지 */
.trace-print-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trace-print-grid.is-line {
  grid-template-columns: 1fr;
}

.trace-print-item {
  border: 2.5px solid #334155;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.trace-print-clue {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 84px;
  text-align: center;
}

.trace-print-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trace-print-icon img,
.trace-print-icon svg {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.trace-print-label {
  font-size: 20px;
  font-weight: 900;
  color: #111827;
  word-break: keep-all;
}

.trace-print-boxes {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.trace-print-svg {
  width: 104px;
  height: 104px;
  border: 2px solid #475569;
  border-radius: 12px;
  background: #FFFFFF;
  display: block;
}

.trace-print-grid.is-line .trace-print-svg {
  width: 156px;
  height: 112px;
}

.trace-print-cross {
  stroke: #CBD5E1;
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.trace-print-dash {
  fill: none;
  stroke: #1E293B;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 10 12;
}

.trace-print-svg.is-faint .trace-print-dash {
  stroke: #64748B;
  stroke-width: 6;
  stroke-dasharray: 8 14;
}

.trace-print-start {
  fill: #111827;
}

/* 3.5) 스스로 척척 일과 순서표 A4 체크보드 */
.routine-print-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.routine-print-item {
  display: grid;
  grid-template-columns: 44px 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 20px;
  border: 3px solid #111827;
  background: #FFFFFF;
  break-inside: avoid;
}

.routine-print-num {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #0F766E;
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.routine-print-icon {
  width: 78px;
  height: 78px;
  border-radius: 16px;
  border: 2px solid #CBD5E1;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
}

.routine-print-icon img,
.routine-print-icon svg {
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.routine-print-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.routine-print-title {
  font-size: 24px;
  font-weight: 900;
  color: #111827;
  word-break: keep-all;
}

.routine-print-desc {
  font-size: 20px;
  font-weight: 700;
  color: #334155;
  word-break: keep-all;
}

.routine-print-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 2.5px dashed #0F766E;
  background: #ECFDF5;
  color: #064E3B;
  white-space: nowrap;
}

.routine-print-box {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.routine-print-check-label {
  font-size: 20px;
  font-weight: 900;
}

.routine-print-week {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 3px solid #111827;
  background: #FFFBEB;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 21px;
  font-weight: 800;
  color: #111827;
  break-inside: avoid;
}

/* 4) 칭찬 상장 & 10칸 도장판 */
.award-frame {
  border: 6px double #111827;
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  break-inside: avoid;
}

.award-badge-top {
  font-size: 24px;
  font-weight: 900;
  color: #0F766E;
}

.award-main-title {
  margin: 0;
  font-size: 38px;
  font-weight: 900;
  color: #111827;
}

.award-mascot {
  width: 124px;
  height: 124px;
  object-fit: contain;
}

.award-recipient {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  color: #111827;
  border-bottom: 3px solid #111827;
  padding: 4px 20px;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.award-body-text {
  margin: 0;
  max-width: 560px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.5;
  color: #1F2A33;
  word-break: keep-all;
}

.award-sign-row {
  width: 100%;
  max-width: 520px;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  font-size: 22px;
  font-weight: 800;
  color: #111827;
}

.stamp-chart-grid {
  width: 100%;
  max-width: 620px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0;
}

.stamp-chart-cell {
  aspect-ratio: 1 / 1;
  min-height: 88px;
  border: 3px dashed #334155;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #334155;
}

.stamp-goal-box {
  width: 100%;
  max-width: 620px;
  box-sizing: border-box;
  border: 3px solid #111827;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  overflow-wrap: anywhere;
}

.print-topbar .top-btn:focus-visible,
.print-do-btn:focus-visible,
.print-tab:focus-visible,
.print-chip:focus-visible,
.print-sub-btn:focus-visible,
.print-name-input:focus-visible {
  outline: 5px solid #1F2A33;
  outline-offset: 3px;
}

body.a11y-contrast .aac-jumbo-card,
body.a11y-contrast .aac-jumbo-num,
body.a11y-contrast .aac-jumbo-cat,
body.a11y-contrast .aac-jumbo-footer {
  background: #FFFFFF;
  color: #000000;
  border-color: #000000;
}

/* 모바일 반응형 */
@media (max-width: 819.98px) {
  .print-topbar { padding: 6px 10px; gap: 6px; }
  .print-topbar .play-title { font-size: 21px; }
  .print-topbar .top-btn, .print-do-btn { padding: 0 12px; font-size: 20px; }
  .print-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .print-sheet { padding: 14px; }
  .cut-grid-aac { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aac-jumbo-grid { grid-template-columns: 1fr; gap: 12px; }
  .aac-jumbo-card { padding: 14px 12px; gap: 10px; }
  .aac-jumbo-visual { width: 112px; height: 112px; }
  .aac-jumbo-label { font-size: 23px; }
  .cut-grid-promise { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ws-item { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .trace-print-grid { grid-template-columns: 1fr; }
  .trace-print-item { flex-direction: column; justify-content: center; }
  .trace-print-boxes { justify-content: center; }
  .routine-print-item { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .stamp-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 실제 A4 용지 / PDF 출력 모드 */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  body.print-page {
    background: #FFFFFF !important;
    min-height: 0 !important;
  }
  #printApp {
    max-width: none !important;
    padding: 0 !important;
  }
  .no-print {
    display: none !important;
  }
  .print-preview-wrap {
    padding: 0 !important;
  }
  .print-sheet {
    max-width: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .aac-jumbo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
  .aac-jumbo-top {
    display: none !important;
  }
  .aac-jumbo-card {
    padding: 22px 16px !important;
    justify-content: center !important;
    gap: 14px !important;
  }
  .aac-jumbo-visual {
    width: 158px !important;
    height: 158px !important;
  }
  .aac-jumbo-label {
    font-size: 20pt !important;
  }
  .cut-grid-aac {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .cut-grid-promise {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  .cut-card {
    padding: 6px 4px !important;
    gap: 4px !important;
  }
  .cut-card-visual {
    width: 54px !important;
    height: 54px !important;
  }
  .cut-card-visual img,
  .cut-card-visual svg {
    width: 50px !important;
    height: 50px !important;
  }
  .cut-card-cat {
    font-size: 11pt !important;
  }
  .cut-card-label {
    font-size: 13pt !important;
  }
  .ws-item {
    grid-template-columns: 34px minmax(140px, 1.1fr) minmax(0, 1.5fr) !important;
    padding: 8px 12px !important;
  }
  .trace-print-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .trace-print-grid.is-line {
    grid-template-columns: 1fr !important;
  }
  .trace-print-item {
    flex-direction: row !important;
    padding: 6px 10px !important;
  }
  .trace-print-svg {
    width: 92px !important;
    height: 92px !important;
  }
  .trace-print-grid.is-line .trace-print-svg {
    width: 148px !important;
    height: 104px !important;
  }
  .stamp-chart-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
  .routine-print-item {
    grid-template-columns: 40px 76px minmax(0, 1fr) auto !important;
    text-align: left !important;
    justify-items: stretch !important;
    padding: 10px 14px !important;
  }
}
