/* 아이메이드 스튜디오 v4.4 - 그림책 흐름 개선 (씨앗 주사위, 확인 시트, 확인·고치기 배치, Book3D 꾸미기, 작가 인터뷰·책장 공유) */

/* ================= 1. 이야기 씨앗 화면 ================= */
.seed44-wrap {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.seed44-dice-box {
  display: grid;
  gap: 14px;
}

.seed44-dice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.seed44-dice .die {
  min-height: 156px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel2);
  border: 2px solid var(--line2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.seed44-dice .die.who-die {
  border-style: dashed;
  border-color: var(--teal);
  background: var(--teal-soft);
}

.seed44-dice .die small {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink2);
}

[data-age="junior"] .seed44-dice .die small {
  font-size: 15px;
}

.seed44-dice .die-val,
.seed44-dice .who-fix b {
  font-family: var(--f-kid);
  font-size: clamp(19px, 2.1vw, 24px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--kid-ink);
  word-break: keep-all;
}

[data-age="junior"] .seed44-dice .die-val,
[data-age="junior"] .seed44-dice .who-fix b {
  font-size: clamp(21px, 2.3vw, 26px);
}

.seed44-dice .who-fix {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.seed44-dice .who-fix img {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: contain;
  background: #FBF9F4;
  border: 1px solid var(--line2);
  flex: none;
}

.die-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seed44-dice .die-btn,
[data-age="junior"] .stage .seed44-dice .die-btn {
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13px;
  gap: 4px;
}

.seed44-dice .die-btn .ico {
  width: 14px;
  height: 14px;
}

.seed44-roll-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.seed44-roll-btn {
  min-width: 200px;
}

.seed44-dice .die.rolling {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.seed44-dice .die.rolling .die-val {
  animation: seedSlotSpin 0.12s linear infinite alternate;
}

@keyframes seedSlotSpin {
  from { transform: translateY(-4px) scale(0.97); opacity: 0.72; }
  to   { transform: translateY(4px) scale(1.02); opacity: 1; }
}

.seed44-dice .die.pop-stop,
.seed44-band.pop-stop {
  animation: seedStopPop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes seedStopPop {
  0%   { transform: scale(0.96); }
  55%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* 가운데 문장 띠 */
.seed44-band {
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--panel);
  border: 2px solid var(--teal);
  box-shadow: var(--shadow);
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.seed44-band.rolling .seed44-sent {
  opacity: 0.78;
}

.seed44-sent {
  font-family: var(--f-disp);
  font-weight: var(--disp-w);
  font-size: clamp(21px, 2.6vw, 30px);
  line-height: 1.38;
  color: var(--ink);
  word-break: keep-all;
  max-width: 820px;
}

.seed44-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.seed44-btns .btn.is-picked {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* 씨앗 확정·편집 및 아래 도담 질문 */
.seed44-work {
  display: grid;
  gap: 14px;
}

.seed44-work:empty {
  display: none;
}

.seed44-picked {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: var(--r);
  background: var(--teal-soft);
  border: 1.5px solid var(--teal);
}

.seed44-picked p {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  word-break: keep-all;
}

[data-age="junior"] .seed44-picked p {
  font-size: 20px;
}

.seed44-edit {
  display: grid;
  gap: 10px;
}

.seed44-dodam {
  display: grid;
  gap: 12px;
}

.seed44-qwrap {
  display: grid;
  gap: 10px;
}

.seed44-qrow {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seed44-qbubble {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 18px 18px 18px 6px;
  background: var(--violet-soft);
  border: 1.5px solid var(--violet);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  word-break: keep-all;
}

[data-age="junior"] .seed44-qbubble {
  font-size: 18px;
}

.seed-ans-help {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink2);
  margin-top: 2px;
}

[data-age="junior"] .seed-ans-help {
  font-size: 15.5px;
}

/* 장면 '지금까지 이야기' 둘째 줄 */
.sofar-lines {
  display: grid;
  gap: 4px;
}

.sofar-ans {
  color: var(--teal);
  font-weight: 700;
}

.sofar-prev {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--line2);
}

@media (max-width: 760px) {
  .seed44-dice {
    grid-template-columns: minmax(0, 1fr);
  }
  .seed44-dice .die {
    min-height: 0;
  }
  .seed44-qrow {
    align-items: flex-start;
  }
}

/* ================= 2. 아래에서 올라오는 그리기 확인 시트 ================= */
#sheet:has(.confirm-sheet) {
  align-items: end;
  justify-items: center;
  padding: 16px 12px 0;
}

#sheet:has(.confirm-sheet) .sheet {
  width: min(680px, 100%);
  max-height: min(88dvh, 720px);
  border-radius: 26px 26px 0 0;
  padding: 22px 24px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: cfSheetUp 0.25s cubic-bezier(0.2, 0.85, 0.25, 1);
}

@keyframes cfSheetUp {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0); opacity: 1; }
}

.confirm-sheet {
  display: grid;
  gap: 16px;
}

.cf-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 36px;
}

.cf-head h3 {
  margin: 0;
  padding: 0;
  font-size: clamp(21px, 2.5vw, 26px);
}

.cf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cf-item {
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--panel2);
  border: 1.5px solid var(--line2);
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
}

.cf-item.wide {
  grid-column: 1 / -1;
}

.cf-item.is-empty {
  border-style: dashed;
  background: transparent;
}

.cf-item small {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink3);
}

[data-age="junior"] .cf-item small {
  font-size: 13.5px;
}

.cf-item b {
  font-size: 16px;
  line-height: 1.42;
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

[data-age="junior"] .cf-item b {
  font-size: 18px;
}

.cf-none {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink3);
  opacity: 0.72;
}

[data-age="junior"] .cf-none {
  font-size: 16px;
}

.cf-thumb {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 10px;
  background: #FBF9F4;
  border: 1px solid var(--line2);
}

.cf-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.cf-btns .btn.lg {
  min-width: 148px;
}

@media (max-width: 560px) {
  .cf-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cf-btns .btn.lg {
    flex: 1 1 auto;
  }
}

/* ================= 3. 이상한 점 말·글로 알려 주기 ================= */
.odd-tell-box {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--coral-soft);
  border: 1.5px solid var(--coral);
  display: grid;
  gap: 8px;
}

.odd-tell-q {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.42;
  word-break: keep-all;
}

[data-age="junior"] .odd-tell-q {
  font-size: 17px;
}

.rv-btns .btn.is-active {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

.sr-odd-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line2);
}

/* ================= 4. 장면 확인·고치기 두 칸 가운데 배치 & 칩 정렬 ================= */
@media (min-width: 1100px) {
  #stage #page-panel .split.scene-rf {
    grid-template-columns: minmax(0, 720px) minmax(380px, 420px);
    gap: 20px;
    justify-content: center;
    max-width: 1160px;
    margin-left: auto;
    margin-right: auto;
    align-items: start;
  }
  #stage #page-panel .split.scene-rf > div:first-child {
    width: 100%;
    max-width: 720px;
  }
  #stage #page-panel .split.scene-rf .gen {
    width: 100%;
    max-width: 720px;
  }
}

@media (max-width: 1099px) {
  #stage #page-panel .split.scene-rf {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
  #stage #page-panel .split.scene-rf > div:first-child,
  #stage #page-panel .split.scene-rf .gen {
    width: 100%;
    max-width: 720px;
  }
}

/* 380~420px 오른쪽 확인 칸 안에서 저학년 확인 버튼 셋이 가로로 넘치지 않게 세로 배치 */
#stage #page-panel .split.scene-rf.rv-jr .rv-btns {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

#stage #page-panel .split.scene-rf.rv-jr .rv-btns .btn.sm {
  grid-column: auto;
  justify-self: center;
}

/* [이상한 데가 있어!] 를 눌러 글 칸이 열렸을 때는 확인 버튼을 한 줄로 줄여 글 칸과 [알려 주기] 가 한 화면에 보이게 한다 */
#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .box {
  padding: 12px 14px;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .myreq {
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 14.5px;
  line-height: 1.35;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .rv-q {
  margin: 2px 0 6px;
  font-size: 15.5px;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .rv-btns {
  grid-template-columns: 1fr 1.18fr auto;
  gap: 6px;
  align-items: center;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .rv-btns .btn {
  min-height: 38px;
  height: 38px;
  padding: 0 8px;
  font-size: 13.5px;
  gap: 4px;
  white-space: nowrap;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .rv-btns .btn .ico {
  width: 14px;
  height: 14px;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .odd-tell-box {
  margin-top: 8px;
  padding: 10px 12px;
  gap: 6px;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .odd-tell-q {
  font-size: 15px;
  line-height: 1.35;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .odd-tell-box .inwrap input {
  min-height: 42px;
  padding-top: 7px;
  padding-bottom: 7px;
}

#stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) #rv-tell-btn {
  min-height: 46px;
}

/* 장면 쓰기 화면: 오른쪽 [도담에게 그려 달라고 하기] 가 기분 칩 줄 위로 떠오르며 덮지 않게 고정 해제 */
body[data-class="1"] #page-panel .jr-write .act-row,
body[data-class="1"] #page-panel .jr-write .row:has(> [data-act="draw"]),
body[data-class="1"].has-pip #page-panel .jr-write .act-row,
body[data-class="1"].has-pip #page-panel .jr-write .row:has(> [data-act="draw"]),
body[data-class="1"] #page-panel .wide-l > .box .act-row,
body[data-class="1"].has-pip #page-panel .wide-l > .box .act-row {
  position: static;
  bottom: auto;
  z-index: auto;
  padding: 4px 0 0;
  background: transparent;
}

body[data-class="1"].has-pip .st-foot .hint:empty {
  display: none;
}

/* 고치기 칩: 한 줄에 두 개씩 같은 폭, 한 줄 유지 */
#stage #page-panel .fix-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#stage #page-panel .fix-chips .chip {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 0 10px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-age="junior"] #stage #page-panel .fix-chips .chip {
  font-size: 15px;
  padding: 0 8px;
}

@media (max-width: 420px) {
  #stage #page-panel .fix-chips .chip,
  [data-age="junior"] #stage #page-panel .fix-chips .chip {
    font-size: 13.5px;
    padding: 0 6px;
  }
}

.fix-custom-wrap {
  margin-top: 12px;
}

/* 이유 칩 세 개: 한 줄에 하나씩 같은 폭 */
#stage #page-panel .reason-chips {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

#stage #page-panel .reason-chips .chip {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= 5. 책 꾸미기 단계 (Book3D) ================= */
.book44-split {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.book-title-ask {
  font-family: var(--f-disp);
  font-weight: var(--disp-w);
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.28;
  color: var(--ink);
  margin: 0 0 4px;
}

.book44-preview {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}

.book44-stage {
  width: 100%;
  height: clamp(336px, calc(100dvh - 410px), 500px);
  min-height: 336px;
}

.book44-stage .b3d-root {
  min-height: 0;
  gap: 8px;
}

.book44-stage .b3d-ctrl {
  z-index: 2;
}

.story-make .st-foot,
body[data-class="1"] .story-make .st-foot {
  z-index: 15;
}

.book44-stage .b3d-nav-arrow {
  display: none;
}

.book44-flipbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.book44-pos {
  min-width: 132px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink2);
}

[data-age="junior"] .book44-pos {
  font-size: 16px;
}

/* 저학년 밝은 배경에서도 Book3D 하단 컨트롤이 선명하게 보이도록 보강 */
[data-age="junior"] .b3d-nav-arrow,
[data-age="junior"] .b3d-reset {
  background: var(--panel);
  border-color: var(--line2);
  color: var(--ink);
}

[data-age="junior"] .b3d-nav-arrow:hover:not(:disabled),
[data-age="junior"] .b3d-reset:hover:not(:disabled) {
  background: var(--panel3);
}

@media (max-width: 1099px) {
  .book44-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ================= 6. 작가 인터뷰 & 완성 화면 ================= */
.iv-wrap {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.iv-card {
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1.5px solid var(--line2);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.iv-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.iv-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.iv-kicker {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border-radius: 99px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
}

[data-age="junior"] .iv-kicker {
  font-size: 15.5px;
}

.iv-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.iv-dot,
[data-age="junior"] .stage .iv-dot {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  background: var(--panel2);
  border: 1.5px solid var(--line2);
  font-size: 13px;
  font-weight: 900;
  color: var(--ink3);
  display: grid;
  place-items: center;
}

.iv-dot.done {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

.iv-dot.cur {
  background: var(--amber);
  border-color: var(--amber);
  color: #2a1a02;
}

.iv-ask-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.iv-reporter {
  position: relative;
  flex: none;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.iv-mic-badge {
  position: absolute;
  right: -4px;
  bottom: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--amber);
  color: #2a1a02;
  border: 2px solid var(--panel);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.iv-mic-badge .ico {
  width: 16px;
  height: 16px;
}

.iv-role {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink3);
}

.iv-qbubble {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 20px 20px 20px 6px;
  background: var(--panel2);
  border: 2px solid var(--teal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.iv-q-txt {
  font-family: var(--f-disp);
  font-weight: var(--disp-w);
  font-size: clamp(19px, 2.3vw, 24px);
  line-height: 1.38;
  color: var(--ink);
  word-break: keep-all;
}

.iv-fav-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.iv-fav-item {
  padding: 8px;
  border-radius: 14px;
  background: var(--panel2);
  border: 2px solid var(--line2);
  text-align: left;
  display: grid;
  gap: 6px;
  align-content: start;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.iv-fav-item:hover {
  transform: translateY(-2px);
  border-color: var(--ink3);
}

.iv-fav-item.on {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.iv-fav-th {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel3);
}

.iv-fav-th img,
.iv-fav-th .no-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.iv-fav-no {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(10, 16, 22, 0.74);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
}

.iv-fav-ck {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--teal-ink);
  display: grid;
  place-items: center;
}

.iv-fav-ck .ico {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}

.iv-fav-item small {
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}

.iv-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.iv-actions-r {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* 완성 뒤 화면 Book3D 및 책장 공유 */
.done-book-stage {
  width: 100%;
  max-width: 900px;
  height: clamp(360px, calc(100dvh - 340px), 500px);
  min-height: 350px;
  margin: 12px auto 8px;
}

.share-res-wrap {
  margin-top: 14px;
  display: grid;
  justify-items: center;
}

.share-res-wrap:empty {
  display: none;
}

.share-done-box {
  width: min(560px, 100%);
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--panel);
  border: 1.5px solid var(--teal);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.share-done-msg {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--ink);
  word-break: keep-all;
}

[data-age="junior"] .share-done-msg {
  font-size: 18px;
}

.share-done-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-done-row a.btn {
  text-decoration: none;
}

.share-qr {
  text-align: left;
}

.share-url-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.share-local-note {
  margin: -4px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink2);
}

[data-age="junior"] .share-local-note {
  font-size: 15px;
}

.share-closed {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line2);
  font-weight: 700;
}

@media (max-width: 720px) {
  .iv-fav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .iv-ask-row {
    align-items: flex-start;
  }
  .iv-card {
    padding: 16px;
  }
}


/* ================= 7. 모험 길 · 별 주머니 · 미션 · 축하 · 화실 놀이 ================= */
/* 주 행동 버튼(56px 이상 · 한 화면 하나만 강조 · 열릴 때 통 튐) · 잠금 버튼 · 조건 안내 한 줄 */
.btn.btn-main-cta,
.story-make .stage .btn.btn-main-cta,
[data-age="junior"] .story-make .stage .btn.btn-main-cta {
  min-height: 56px;
  height: auto;
  padding: 10px 26px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 800;
  gap: 9px;
}

[data-age="junior"] .btn.btn-main-cta,
[data-age="junior"] .story-make .stage .btn.btn-main-cta {
  min-height: 58px;
  font-size: 19px;
}

.btn.btn-main-cta .ico,
.story-make .stage .btn.btn-main-cta .ico {
  width: 20px;
  height: 20px;
}

.story-make .stage .btn.ghost:not(.btn-main-cta):not(.is-picked):not(.is-active) {
  background: transparent;
  color: var(--ink2);
  border-color: var(--line2);
  box-shadow: none;
}

.story-make .stage .btn.ghost:not(.btn-main-cta):hover {
  background: var(--panel2);
  color: var(--ink);
}

.btn.is-locked {
  opacity: 0.56;
  border-style: dashed;
}

.story-make .st-foot .hint,
[data-age="junior"] .story-make .st-foot .hint {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

[data-age="junior"] .story-make .st-foot .hint {
  font-size: 13.5px;
}

.cta-pop {
  animation: ctaPopBounce 0.36s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes ctaPopBounce {
  0%   { transform: scale(0.92); }
  55%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.seed44-qbubble.is-thinking {
  opacity: 0.85;
  border-style: dashed;
}

/* 모험 길 & 별 주머니 & 아래 쪽 표시(#bookbar) 정리 */
.story-make .make-main,
[data-age="junior"] body[data-class="1"] .story-make .make-main,
[data-age="junior"] body[data-class="1"] .make-main:has(#bookbar) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.steps.adv-steps,
[data-age="junior"] body[data-class="1"] .steps.adv-steps {
  position: relative;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 22px 6px;
  border-bottom: 1px solid var(--line);
  overflow: visible;
  flex: none;
}

.adv-road {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 700px;
  padding-top: 26px;
}

.adv-stops {
  position: static;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.steps.adv-steps .stp.adv-stop {
  flex: 1 1 0;
  min-width: 0;
  max-width: 84px;
  height: auto;
  padding: 0 2px;
  background: transparent;
  border: 0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  color: var(--ink3);
}

.steps.adv-steps .stp.adv-stop:disabled {
  opacity: 0.64;
}

.steps.adv-steps .stp.adv-stop:not(:disabled):hover > .adv-node {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.steps.adv-steps .stp.adv-stop > .adv-node {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel2);
  border: 2px solid var(--line2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  display: grid !important;
  place-items: center;
  color: var(--ink3);
  z-index: 2;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.steps.adv-steps .stp.adv-stop > .adv-node > .ico {
  width: 17px;
  height: 17px;
}

.steps.adv-steps .stp.adv-stop.done > .adv-node {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

.steps.adv-steps .stp.adv-stop.done {
  color: var(--ink2);
}

.steps.adv-steps .stp.adv-stop.cur > .adv-node {
  background: var(--amber);
  border-color: var(--amber);
  color: #2a1a02;
  box-shadow: 0 0 0 4px var(--amber-soft), 0 3px 8px rgba(0, 0, 0, 0.18);
  transform: scale(1.08);
}

.steps.adv-steps .stp.adv-stop.cur {
  color: var(--ink);
}

.steps.adv-steps .stp.adv-stop > .adv-name {
  display: block !important;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

[data-age="junior"] .steps.adv-steps .stp.adv-stop > .adv-name {
  font-size: 12.5px;
}

.adv-star {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--amber);
  color: #2a1a02;
  border: 1.5px solid var(--panel);
  display: grid;
  place-items: center;
  font-style: normal;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.adv-star .ico {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.adv-line {
  position: absolute;
  top: 41px;
  left: 24px;
  width: 0;
  height: 5px;
  border-radius: 99px;
  background: var(--line2);
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

#adv-line-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal) 0%, var(--amber) 100%);
  border-radius: 99px;
}

.adv-pup-walker {
  position: absolute;
  top: -2px;
  left: 24px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.adv-pup-walker.flip-x {
  transform: translateX(-50%) scaleX(-1);
}

.adv-pup-walker.walking {
  animation: advPupHop 0.24s ease-in-out infinite alternate;
}

@keyframes advPupHop {
  from { margin-top: 0; }
  to   { margin-top: -5px; }
}

.star-bag {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 15px;
  border-radius: 99px;
  background: var(--amber-soft);
  border: 2px solid var(--amber);
  box-shadow: 0 3px 0 rgba(180, 120, 20, 0.26);
  color: var(--amber);
  font-weight: 900;
  font-size: 15px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
}

.star-bag:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.star-bag:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(180, 120, 20, 0.26);
}

[data-age="junior"] .star-bag {
  color: #8A5400;
}

.star-bag-ico {
  display: inline-grid;
  place-items: center;
}

.star-bag-ico .ico {
  width: 19px;
  height: 19px;
  fill: var(--amber);
  stroke: var(--amber);
}

.star-bag.bag-pop {
  animation: ctaPopBounce 0.36s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* 모험 길 아래 슬림한 내 책 조각 줄 (#bookbar): 길·별 주머니와 겹치지 않게 정리 */
.story-make .bookbar,
.make-main:has(#bookbar) .bookbar,
[data-age="junior"] body[data-class="1"] .story-make .bookbar,
[data-age="junior"] body[data-class="1"] .make-main:has(#bookbar) .bookbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  padding: 5px 22px 2px;
  margin: 0;
  flex: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.story-make .bookbar[hidden],
.make-main:has(#bookbar) .bookbar[hidden] {
  display: none !important;
}

.story-make .bookbar .bb,
.make-main:has(#bookbar) .bookbar .bb {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 2px 9px 2px 3px;
  border-radius: 99px;
  background: var(--panel);
  border: 1.5px solid var(--line2);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink3);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.story-make .bookbar .bb.empty,
.make-main:has(#bookbar) .bookbar .bb.empty {
  border-style: dashed;
  background: transparent;
  opacity: 0.78;
}

.story-make .bookbar .bb.has,
.story-make .bookbar .bb.fin,
.story-make .bookbar .bb.mine,
.make-main:has(#bookbar) .bookbar .bb.has,
.make-main:has(#bookbar) .bookbar .bb.fin,
.make-main:has(#bookbar) .bookbar .bb.mine {
  border-color: var(--teal);
  color: var(--ink);
  background: var(--panel);
}

.story-make .bookbar .bb.check,
.make-main:has(#bookbar) .bookbar .bb.check {
  border-color: var(--coral);
  color: var(--ink);
}

.story-make .bookbar .bb .bb-th,
.make-main:has(#bookbar) .bookbar .bb .bb-th,
[data-age="junior"] body[data-class="1"] .story-make .bookbar .bb .bb-th {
  width: 24px;
  height: 22px;
  border-radius: 99px;
  border-width: 1px;
  flex: none;
}

.story-make .bookbar .bb .bb-th b,
.make-main:has(#bookbar) .bookbar .bb .bb-th b {
  font-size: 11px;
}

.story-make .bookbar .bb .bb-th .ico,
.make-main:has(#bookbar) .bookbar .bb .bb-th .ico {
  width: 13px;
  height: 13px;
}

.story-make .bookbar .bb .bb-ok,
.make-main:has(#bookbar) .bookbar .bb .bb-ok {
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
}

.story-make .bookbar .bb .bb-ok .ico,
.make-main:has(#bookbar) .bookbar .bb .bb-ok .ico {
  width: 9px;
  height: 9px;
}

.story-make .bookbar .bb .bb-dot,
.make-main:has(#bookbar) .bookbar .bb .bb-dot {
  right: 0;
  top: 0;
  width: 8px;
  height: 8px;
}

.flying-star {
  position: fixed;
  z-index: 85;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  color: var(--amber);
  pointer-events: none;
  filter: drop-shadow(0 3px 8px rgba(245, 185, 66, 0.65));
  animation: starFlyToBag 0.65s cubic-bezier(0.25, 0.8, 0.35, 1) forwards;
}

.flying-star.is-big {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
}

.flying-star.is-sparkle {
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  color: #FFD24C;
  filter: drop-shadow(0 0 8px rgba(255, 214, 76, 0.95)) drop-shadow(0 0 18px rgba(60, 192, 180, 0.72));
}

.flying-star .ico {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

@keyframes starFlyToBag {
  0%   { transform: translate(0, 0) scale(0.7) rotate(0deg); opacity: 1; }
  30%  { transform: translate(calc(var(--tx, 0px) * 0.25), calc(var(--ty, 0px) * 0.25 - 18px)) scale(1.2) rotate(60deg); opacity: 1; }
  100% { transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0.45) rotate(200deg); opacity: 0.2; }
}

/* 별 주머니 시트 */
.star-bag-sheet {
  display: grid;
  gap: 16px;
}

.star-empty-box {
  padding: 28px 20px;
  border-radius: 16px;
  background: var(--panel2);
  border: 1.5px dashed var(--line2);
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--ink2);
  font-weight: 700;
}

.star-empty-box .ico {
  width: 34px;
  height: 34px;
  color: var(--amber);
}

.star-sheet-list {
  display: grid;
  gap: 9px;
}

.star-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--panel2);
  border: 1.5px solid var(--line2);
}

.star-item.is-big {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.star-item.is-sparkle {
  border-width: 2px;
  border-color: var(--amber);
  background: linear-gradient(135deg, var(--amber-soft) 0%, var(--teal-soft) 100%);
  box-shadow: 0 4px 16px rgba(245, 185, 66, 0.24);
}

.star-item.is-big .star-item-badge .ico {
  width: 25px;
  height: 25px;
}

.star-item.is-sparkle .star-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--amber);
  filter: drop-shadow(0 0 6px rgba(245, 185, 66, 0.55));
  animation: starTwinkle 1.4s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  from { transform: scale(0.96); filter: drop-shadow(0 0 4px rgba(245, 185, 66, 0.45)); }
  to   { transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(245, 185, 66, 0.85)); }
}

.star-item-th {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel3);
  flex: none;
  display: grid;
  place-items: center;
}

.star-item-th img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.star-item-th.is-ico {
  color: var(--teal);
}

.star-item-txt {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.star-item-txt b {
  font-size: 15px;
  color: var(--ink);
  word-break: keep-all;
}

.star-item-txt small {
  font-size: 12.5px;
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.star-item-badge {
  flex: none;
  color: var(--amber);
}

.star-item-badge .ico {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 단계 미션 모달 & 축하 모달 */
.mission-overlay,
.celeb-overlay {
  position: fixed;
  inset: 0;
  z-index: 62;
  background: rgba(6, 12, 20, 0.68);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: fade 0.18s ease;
}

[data-age="junior"] .mission-overlay,
[data-age="junior"] .celeb-overlay {
  background: rgba(24, 36, 48, 0.54);
}

.celeb-overlay {
  z-index: 64;
  cursor: pointer;
}

@keyframes missionCardPop {
  0%   { transform: translateY(18px) scale(0.86); opacity: 0; }
  62%  { transform: translateY(-5px) scale(1.04); opacity: 1; }
  82%  { transform: translateY(2px) scale(0.99); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

.mission-card,
.celeb-card {
  width: min(490px, calc(100vw - 32px));
  padding: 28px 28px 24px;
  border-radius: 30px;
  background: var(--panel);
  border: 2.5px solid var(--teal);
  box-shadow: 0 20px 48px rgba(8, 16, 26, 0.36), 0 6px 0 rgba(42, 156, 146, 0.26);
  display: grid;
  justify-items: center;
  gap: 15px;
  text-align: center;
  animation: missionCardPop 0.34s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.mission-pup {
  width: 142px;
  height: 142px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--teal-soft) 0%, transparent 72%);
  display: grid;
  place-items: center;
}

.celeb-card {
  width: min(430px, calc(100vw - 32px));
  border-color: var(--amber);
  box-shadow: 0 20px 48px rgba(8, 16, 26, 0.36), 0 6px 0 rgba(210, 145, 28, 0.28);
  gap: 10px;
}

.celeb-card.big-celeb {
  width: min(500px, calc(100vw - 32px));
  padding: 32px 28px 26px;
  border-color: var(--teal);
  box-shadow: 0 24px 56px rgba(8, 16, 26, 0.42), 0 7px 0 rgba(42, 156, 146, 0.32);
  gap: 13px;
  cursor: default;
}

.mission-txt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
}

.mission-txt {
  font-family: var(--f-disp);
  font-weight: var(--disp-w);
  font-size: clamp(21px, 2.6vw, 27px);
  line-height: 1.38;
  color: var(--ink);
  word-break: keep-all;
}

.mission-go-btn {
  min-width: 192px;
  min-height: 58px;
  font-size: 19px;
  border-radius: 18px;
}

.celeb-stars {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
}

.celeb-stars .ico {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.celeb-title {
  font-family: var(--f-disp);
  font-weight: var(--disp-w);
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.3;
  color: var(--ink);
  word-break: keep-all;
}

.celeb-sub {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink2);
}

/* 작은 화실 카드 (#genpip.atelier-card) 및 이젤·대기 놀이 */
.easel {
  --fill: 15%;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex: none;
}

.easel-top {
  width: 10px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: #9A6B43;
}

.easel-board {
  position: relative;
  width: 34px;
  height: 26px;
  border-radius: 4px;
  background: #FAF6EE;
  border: 2px solid #8A5D38;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.easel-paint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fill, 15%);
  background: linear-gradient(180deg, #FFE49E 0%, #7EDDB0 52%, #6CC4F0 100%);
  opacity: 0.88;
  overflow: hidden;
  transition: height 0.55s ease;
}

.easel.fix .easel-paint {
  background: linear-gradient(180deg, #FFE08A 0%, #F5B942 48%, #F27B5E 100%);
}

.easel-paint .stroke {
  position: absolute;
  left: -10%;
  height: 4px;
  border-radius: 99px;
  font-style: normal;
  opacity: 0.88;
  animation: brushSweep 1.6s ease-in-out infinite alternate;
}

.easel-paint .stroke.s1 {
  bottom: 2px;
  width: 92%;
  background: #3CC0B4;
  animation-delay: 0s;
}

.easel-paint .stroke.s2 {
  bottom: 7px;
  left: 8%;
  width: 86%;
  background: #F5B942;
  animation-delay: 0.28s;
}

.easel-paint .stroke.s3 {
  bottom: 13px;
  left: -4%;
  width: 88%;
  background: #F27B5E;
  animation-delay: 0.56s;
}

.easel-paint .stroke.s4 {
  bottom: 18px;
  left: 10%;
  width: 82%;
  background: #A48EFF;
  animation-delay: 0.84s;
}

.easel.done .easel-paint .stroke {
  animation: none;
}

@keyframes brushSweep {
  from { transform: translateX(-3px) scaleX(0.92); }
  to   { transform: translateX(4px) scaleX(1.04); }
}

.easel-ok {
  position: relative;
  z-index: 2;
  color: #103136;
  display: grid;
  place-items: center;
}

.easel-ok .ico {
  width: 16px;
  height: 16px;
  stroke-width: 2.8;
}

.easel-dot {
  position: relative;
  z-index: 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1.2s infinite;
}

.easel-legs {
  width: 24px;
  height: 6px;
  border-left: 2.5px solid #8A5D38;
  border-right: 2.5px solid #8A5D38;
}

.genpip.atelier-card {
  border-radius: 22px;
  padding: 7px 16px 7px 9px;
  gap: 10px;
  min-height: 58px;
  border-width: 2px;
  box-shadow: 0 12px 28px rgba(10, 20, 30, 0.24), 0 3px 0 rgba(0, 0, 0, 0.14);
}

.genpip.atelier-card.arrive {
  box-shadow: 0 14px 32px rgba(42, 156, 146, 0.38), 0 4px 0 var(--btn-depth);
}

.at-scene {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
}

.at-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.at-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.32;
}

.at-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.16);
  font-size: 11.5px;
  font-weight: 800;
}

.at-queue {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink2);
}

.mini-easel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 5px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line2);
  font-weight: 800;
}

.mini-easel i {
  display: inline-block;
  width: 13px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(180deg, #FAF6EE 55%, #BEECE6 55%);
  border: 1.5px solid #8A5D38;
  box-shadow: 0 1.5px 0 #8A5D38;
  flex: none;
}

/* 그리는 중 기다리는 동안 도담 놀이 카드 */
.gen.loading.wait-gen-host {
  aspect-ratio: auto;
  min-height: 220px;
  padding: 18px;
}

.wait-play-card {
  padding: 20px 18px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 2px solid var(--line2);
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.gen.loading .wait-play-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 6px;
}

.wait-play-stage {
  display: inline-flex;
  align-items: flex-end;
  gap: 12px;
}

.wait-play-stage .easel {
  width: 58px;
}

.wait-play-stage .easel-board {
  width: 54px;
  height: 42px;
}

.wait-play-stage .easel-paint .stroke {
  height: 5px;
}

.wait-play-stage .easel-legs {
  width: 38px;
  height: 10px;
}

.wait-pup-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  padding: 6px;
  background: radial-gradient(circle, var(--amber-soft) 0%, transparent 72%);
  transition: transform 0.15s ease;
}

.wait-pup-btn:hover {
  transform: scale(1.05);
}

.wait-pup-btn.hop {
  animation: waitPupHop 0.48s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes waitPupHop {
  0%   { transform: translateY(0) scale(1); }
  45%  { transform: translateY(-16px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}

.pup-dust-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 4;
}

.dust-star {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  color: var(--amber);
  animation: dustBurst 0.68s ease-out forwards;
}

.dust-star .ico {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

@keyframes dustBurst {
  from { transform: translate(0, 0) scale(0.5); opacity: 1; }
  to   { transform: translate(var(--dx, 0px), var(--dy, -40px)) scale(1.1); opacity: 0; }
}

.wait-play-copy {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.wait-play-bubble {
  padding: 7px 14px;
  border-radius: 99px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
}

[data-age="junior"] .wait-play-bubble {
  font-size: 16px;
}

.wait-play-bubble.pop {
  animation: ctaPopBounce 0.3s ease;
}

/* ================= 8. 화면 마무리 (통통한 카드 · 칩 눌림과 체크 · 활성 글 칸 · 1366x768 & 800px · 모션 줄이기) ================= */
/* 8-1. 카드 모서리와 그림자를 통통하게 */
.story-make .box,
.story-make .card,
.story-make .iv-card,
.story-make .seed44-band {
  border-radius: 22px;
  border-width: 1.5px;
  border-color: var(--line2);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24), 0 4px 0 rgba(255, 255, 255, 0.06);
}

[data-age="junior"] .story-make .box,
[data-age="junior"] .story-make .card,
[data-age="junior"] .story-make .iv-card,
[data-age="junior"] .story-make .seed44-band {
  border-radius: 24px;
  border-width: 2px;
  box-shadow: 0 10px 24px rgba(30, 43, 56, 0.09), 0 4px 0 var(--line2);
}

.story-make .seed44-band {
  border-color: var(--teal);
}

[data-age="junior"] .story-make .seed44-band {
  box-shadow: 0 12px 26px rgba(30, 43, 56, 0.11), 0 4px 0 rgba(51, 126, 135, 0.28);
}

.story-make .seed44-dice .die {
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 3px 0 var(--line2);
}

[data-age="junior"] .story-make .seed44-dice .die {
  box-shadow: 0 5px 14px rgba(30, 43, 56, 0.07), 0 3px 0 var(--line2);
}

/* 8-2. 고르는 칩: 눌렀을 때 살짝 눌리고, 고른 칩은 체크와 색으로 분명하게 */
.story-make .chip,
.story-make .words button {
  border-radius: 99px;
  border-width: 2px;
  box-shadow: 0 2px 0 var(--line2);
  transition: transform 0.1s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.1s ease;
}

.story-make .chip:hover:not(:disabled),
.story-make .words button:hover:not(:disabled) {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.story-make .chip:active:not(:disabled),
.story-make .words button:active:not(:disabled),
.story-make .sty:active:not(:disabled),
.story-make .iv-fav-item:active:not(:disabled) {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 0 0 transparent;
}

.story-make .chip.on {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--teal-ink);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--btn-depth);
}

.story-make .chip.on:not(.add)::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 5px;
  border-left: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(-45deg) translateY(-1px);
  flex: none;
}

.story-make .sty {
  position: relative;
  border-radius: 20px;
  border-width: 2.5px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16), 0 3px 0 var(--line2);
  transition: transform 0.14s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.story-make .sty:hover {
  transform: translateY(-2px);
  border-color: var(--ink3);
}

.story-make .sty.on {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 10px 24px rgba(42, 156, 146, 0.24), 0 4px 0 var(--teal);
}

.story-make .sty.on span {
  color: var(--teal);
  font-weight: 900;
}

.story-make .sty.on::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--teal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  background-size: 16px 16px;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--panel);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

/* 8-3. 글 칸은 지금 쓸 칸만 테두리가 진하게 */
.story-make #stage .field:not(.is-active-field) .inwrap input:not(:focus),
.story-make #stage .field:not(.is-active-field) .inwrap textarea:not(:focus) {
  border-color: var(--line);
  border-width: 1.5px;
  box-shadow: none;
}

.story-make #stage .field.is-filled-field:not(.is-active-field) .inwrap input:not(:focus),
.story-make #stage .field.is-filled-field:not(.is-active-field) .inwrap textarea:not(:focus) {
  border-color: var(--line2);
  background: var(--panel2);
}

.story-make #stage .field.is-active-field > label,
.story-make #stage .field:focus-within > label {
  color: var(--teal);
  font-weight: 800;
}

.story-make #stage .field.is-active-field .inwrap input,
.story-make #stage .field.is-active-field .inwrap textarea,
.story-make #stage .field .inwrap input:focus,
.story-make #stage .field .inwrap textarea:focus {
  border-color: var(--teal);
  border-width: 2.5px;
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

/* 8-4. 폭 1366x768 노트북 기준 주요 버튼이 스크롤 없이 한눈에 보이게 조율 */
@media (min-width: 1000px) {
  .story-make .hero-pad {
    max-width: none;
    display: grid;
    grid-template-columns: auto minmax(240px, 300px);
    column-gap: 24px;
    row-gap: 12px;
    justify-content: center;
    align-items: start;
  }
  .story-make .hero-pad .draw {
    display: contents;
  }
  .story-make .hero-pad .draw.big canvas,
  [data-age="junior"] body[data-class="1"] .story-make .hero-pad .draw.big canvas {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: clamp(260px, calc(100dvh - 285px), 470px);
    min-width: 0;
  }
  .story-make .hero-pad .draw-tools {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
  }
  .story-make .hero-pad .draw > .btn {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }
  .story-make .hero-pad .hero-go {
    grid-column: 2;
    grid-row: 3;
    align-items: flex-start;
  }
}

@media (min-width: 900px) {
  .story-make .split .draw:not(.big) canvas {
    width: min(100%, clamp(210px, calc(100dvh - 365px), 350px));
    justify-self: center;
  }
}

@media (max-height: 830px) {
  .story-make .stage {
    padding-top: 8px;
    padding-bottom: 14px;
  }
  .story-make .st-h {
    margin-bottom: 8px;
  }
  .story-make .st-h h2 {
    font-size: 22px;
  }
  .story-make .st-foot {
    margin-top: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .seed44-wrap {
    gap: 10px;
  }
  .seed44-dice-box {
    gap: 10px;
    padding: 13px 15px;
  }
  .seed44-dice .die {
    min-height: 108px;
    padding: 10px 14px;
    gap: 6px;
  }
  .seed44-band {
    padding: 13px 18px;
    gap: 10px;
  }
  .seed44-mine {
    padding: 11px 15px;
  }
  .book44-preview {
    gap: 5px;
    padding-bottom: 4px;
  }
  .book44-stage {
    height: clamp(334px, calc(100dvh - 432px), 420px);
    min-height: 334px;
  }
  .book44-stage .b3d-root {
    gap: 6px;
  }
  .book44-flipbar .icon-btn,
  [data-age="junior"] .stage .book44-flipbar .icon-btn {
    width: 40px;
    height: 40px;
  }
  .story-make #stage > .ptn {
    padding: 8px 14px;
    margin-bottom: 8px;
  }
  .story-make .scene-band {
    padding: 6px 12px;
    margin-bottom: 6px;
    font-size: 15.5px;
  }
  .story-make .pages-strip,
  body[data-class="1"] .story-make .pages-strip {
    margin-bottom: 6px;
  }
  body[data-class="1"] .story-make .pages-strip .pg .th {
    height: 54px;
  }
  .story-make #page-panel .jr-write .box {
    padding: 13px 16px;
  }
  .story-make #page-panel .jr-write .stack {
    gap: 10px;
  }
  .story-make #page-panel .sofar-box {
    margin-top: 8px;
    padding: 10px 14px;
  }
  #stage #page-panel .split.scene-rf.rv-jr:has(.odd-tell-box) .gen {
    max-width: min(100%, calc((100dvh - 340px) * 4 / 3));
  }
  .story-make .styles .sty img {
    max-height: calc(100dvh - 350px);
  }
  .iv-card {
    padding: 15px 20px;
    gap: 12px;
  }
}

/* 8-5. 폭 800px 짜리 좁은 창 및 모바일 반응형 마감 */
@media (max-width: 900px) {
  .steps.adv-steps,
  [data-age="junior"] body[data-class="1"] .steps.adv-steps {
    padding: 5px 14px 5px;
    gap: 10px;
  }
  .adv-road {
    padding-top: 24px;
  }
  .steps.adv-steps .stp.adv-stop > .adv-node {
    width: 31px;
    height: 31px;
  }
  .steps.adv-steps .stp.adv-stop > .adv-node > .ico {
    width: 15px;
    height: 15px;
  }
  .adv-line {
    top: 37px;
  }
  .adv-pup-walker {
    top: -4px;
  }
  .steps.adv-steps .stp.adv-stop > .adv-name,
  [data-age="junior"] .steps.adv-steps .stp.adv-stop > .adv-name {
    font-size: 11px;
  }
  .star-bag {
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
  }
  .story-make .bookbar,
  .make-main:has(#bookbar) .bookbar,
  [data-age="junior"] body[data-class="1"] .story-make .bookbar,
  [data-age="junior"] body[data-class="1"] .make-main:has(#bookbar) .bookbar {
    padding: 4px 14px 2px;
    gap: 5px;
  }
  .story-make .hero-pad .draw.big canvas {
    width: min(380px, 100%, calc(100dvh - 340px));
    min-width: 220px;
  }
  body[data-class="1"] .genpip.atelier-card {
    left: 12px;
    max-width: min(310px, calc(100vw - 380px));
  }
}

@media (max-width: 699px) {
  body[data-class="1"] .genpip.atelier-card {
    left: 12px;
    right: auto;
    bottom: 78px;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 640px) {
  .steps.adv-steps,
  [data-age="junior"] body[data-class="1"] .steps.adv-steps {
    padding: 5px 10px 4px;
    gap: 6px;
  }
  .steps.adv-steps .stp.adv-stop {
    padding: 0 1px;
  }
  .steps.adv-steps .stp.adv-stop > .adv-name,
  [data-age="junior"] .steps.adv-steps .stp.adv-stop > .adv-name {
    font-size: 10px;
  }
  .mission-card,
  .celeb-card,
  .celeb-card.big-celeb {
    padding: 22px 18px 20px;
    border-radius: 24px;
  }
}

/* 8-6. 움직임 줄이기 (prefers-reduced-motion) */
@media (prefers-reduced-motion: reduce) {
  .mission-overlay,
  .celeb-overlay,
  .mission-card,
  .celeb-card,
  .cta-pop,
  .star-bag.bag-pop,
  .adv-pup-walker.walking,
  .flying-star,
  .star-item.is-sparkle .star-item-badge,
  .easel-paint .stroke,
  .easel-dot,
  .wait-pup-btn.hop,
  .dust-star,
  .wait-play-bubble.pop {
    animation: none !important;
    transition: none !important;
  }
  .story-make .chip:hover:not(:disabled),
  .story-make .chip:active:not(:disabled),
  .story-make .sty:hover,
  .story-make .sty:active:not(:disabled),
  .star-bag:hover,
  .star-bag:active,
  .wait-pup-btn:hover {
    transform: none !important;
  }
}

@media print {
  .mission-overlay,
  .celeb-overlay,
  .flying-star {
    display: none !important;
  }
}
