/* 아이메이드 3D 양장본 책 뷰어 및 발표 무대 스타일 (오프라인 전용, 외부 리소스 없음) */

.b3d-root {
  --bk-color: #1B4D54;
  --bk-dark: #103136;
  --bk-light: #2B6B74;
  --bk-paper: #FAF6EE;
  --bk-paper-2: #F1EADF;
  --bk-line: #E0D6C5;
  --bk-ink: #23201C;
  --bk-muted: #756D60;
  --page-w: 360px;
  --page-h: 476px;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  box-sizing: border-box;
}

.b3d-root *,
.b3d-root *::before,
.b3d-root *::after {
  box-sizing: border-box;
}

.b3d-viewport {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2200px;
  touch-action: pan-y;
}

/* 양면 펼침 기준 책 본체 */
.b3d-book {
  position: relative;
  width: calc(var(--page-w) * 2);
  height: var(--page-h);
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 0.68, 0.18, 1);
  transform: rotateX(2.5deg);
}

/* 닫힌 표지 상태: 오른쪽 절반에 있는 앞표지가 정가운데 오도록 이동 */
.b3d-root[data-closed="1"]:not([data-single="1"]) .b3d-book {
  transform: translateX(-25%) rotateX(3deg) rotateY(-4deg);
}

/* 펼친 상태 뒤쪽 양장 하드보드 및 종이 두께 */
.b3d-board {
  position: absolute;
  inset: -7px -9px -9px -9px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--bk-dark) 0%, var(--bk-color) 47%, #0c1f22 50%, var(--bk-color) 53%, var(--bk-dark) 100%);
  box-shadow:
    0 26px 52px rgba(0, 0, 0, 0.46),
    0 6px 16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: opacity 0.45s ease, clip-path 0.7s cubic-bezier(0.22, 0.68, 0.18, 1);
  pointer-events: none;
}

/* 닫혀 있을 때는 양장 보드도 오른쪽 절반만 보이게 */
.b3d-root[data-closed="1"]:not([data-single="1"]) .b3d-board {
  clip-path: inset(-40px -40px -40px calc(50% - 14px));
}

/* 가운데 책등 둥근 심 */
.b3d-board-spine {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: calc(50% - 13px);
  width: 26px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.36), rgba(255, 255, 255, 0.14) 35%, rgba(0, 0, 0, 0.28) 75%, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

/* 양옆·아래 종이 두께 단면 (양장본 느낌) */
.b3d-stack-l,
.b3d-stack-r {
  position: absolute;
  top: 2px;
  bottom: -5px;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.b3d-stack-l {
  left: -5px;
  right: 50%;
  border-radius: 5px 0 0 5px;
  background:
    repeating-linear-gradient(90deg, #EFE8DA 0px, #EFE8DA 1.5px, #D8CEBC 1.5px, #D8CEBC 3px);
  box-shadow: -2px 4px 8px rgba(0, 0, 0, 0.22);
}

.b3d-stack-r {
  left: 50%;
  right: -6px;
  border-radius: 0 5px 5px 0;
  background:
    repeating-linear-gradient(90deg, #EFE8DA 0px, #EFE8DA 1.5px, #D8CEBC 1.5px, #D8CEBC 3px);
  box-shadow: 3px 5px 10px rgba(0, 0, 0, 0.26);
}

.b3d-root[data-closed="1"]:not([data-single="1"]) .b3d-stack-l {
  opacity: 0;
}

/* 닫힌 표지 옆에 입체로 보이는 책등(제목 표시) */
.b3d-closed-spine {
  position: absolute;
  top: -7px;
  bottom: -9px;
  left: calc(50% - 24px);
  width: 28px;
  border-radius: 7px 0 0 7px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, var(--bk-light) 24%, var(--bk-color) 62%, var(--bk-dark) 92%, rgba(0, 0, 0, 0.5) 100%);
  box-shadow: -5px 14px 26px rgba(0, 0, 0, 0.42), inset 1px 0 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 2px;
  overflow: hidden;
  z-index: 6;
  transform-origin: right center;
  transform: rotateY(-18deg);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.b3d-root:not([data-closed="1"]) .b3d-closed-spine {
  opacity: 0;
}

.b3d-spine-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(252, 246, 232, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  max-height: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 닫힌 양장본 아래쪽으로 보이는 종이 뭉치 단면 */
.b3d-closed-edge {
  position: absolute;
  left: 50%;
  right: -5px;
  bottom: -7px;
  height: 9px;
  border-radius: 0 0 6px 2px;
  background: repeating-linear-gradient(180deg, #F4EFE4 0px, #F4EFE4 1.5px, #D7CCB8 1.5px, #D7CCB8 3px);
  border-right: 4px solid var(--bk-dark);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.b3d-root:not([data-closed="1"]) .b3d-closed-edge {
  opacity: 0;
}

/* 양면 바탕 슬롯 */
.b3d-half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
}

.b3d-half-l {
  left: 0;
  border-radius: 4px 0 0 4px;
}

.b3d-half-r {
  left: 50%;
  border-radius: 0 4px 4px 0;
}

.b3d-half.is-empty {
  pointer-events: none;
}

/* 앞표지 디자인: 위 2/3 그림, 아래 1/3 제목 띠, 얇은 테두리 선과 광택 */
.b3d-cover {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 2px, transparent 2px, transparent 5px),
    linear-gradient(160deg, var(--bk-light) 0%, var(--bk-color) 55%, var(--bk-dark) 100%);
  border-radius: 2px 10px 10px 2px;
  padding: 14px 15px 15px 22px;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 6px 0 10px rgba(0, 0, 0, 0.34),
    inset 13px 0 2px rgba(0, 0, 0, 0.22),
    inset 15px 0 1px rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

/* 얇은 안쪽 금박 느낌 테두리 선 */
.b3d-cover::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: 17px;
  border: 1px solid rgba(252, 243, 220, 0.38);
  border-radius: 2px 7px 7px 2px;
  pointer-events: none;
  z-index: 3;
}

/* 살짝 비치는 표지 광택 */
.b3d-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.07) 26%,
    rgba(255, 255, 255, 0) 46%,
    rgba(0, 0, 0, 0.08) 82%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
  z-index: 4;
}

/* 표지 위 3분의 2 그림 영역 */
.b3d-cover-art {
  position: relative;
  flex: 0 0 66.5%;
  height: 66.5%;
  width: 100%;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  background: var(--bk-paper);
  border: 1.5px solid rgba(252, 245, 228, 0.65);
  border-bottom: 0;
  z-index: 2;
}

.b3d-cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 표지 아래 3분의 1 제목 띠 (종이색 바탕에 선명한 제목) */
.b3d-cover-band {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  background: var(--bk-paper);
  color: var(--bk-ink);
  border-radius: 0 0 4px 4px;
  border: 1.5px solid rgba(252, 245, 228, 0.65);
  border-top: 3px solid var(--bk-color);
  padding: 10px 14px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 5px;
  z-index: 2;
  box-shadow: inset 0 2px 0 rgba(27, 77, 84, 0.14);
}

.b3d-cover-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-weight: 900;
  font-size: clamp(18px, calc(var(--page-w) * 0.068), 27px);
  line-height: 1.24;
  letter-spacing: -0.025em;
  color: #191816;
  word-break: keep-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.b3d-cover-title.is-long {
  font-size: clamp(15px, calc(var(--page-w) * 0.054), 22px);
  line-height: 1.22;
}

.b3d-cover-by {
  display: block;
  font-size: clamp(11px, calc(var(--page-w) * 0.035), 14px);
  font-weight: 700;
  color: var(--bk-muted);
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 안쪽 앞표지 면지(endpaper) 느낌 */
.b3d-page {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bk-paper);
  color: var(--bk-ink);
  overflow: hidden;
}

/* 왼쪽 쪽: 본문 글 (큰 글씨, 넉넉한 여백, 쪽 번호) */
.b3d-page-l {
  border-right: 1px solid rgba(60, 45, 25, 0.1);
  background:
    linear-gradient(to left, rgba(32, 22, 10, 0.13) 0%, rgba(32, 22, 10, 0.04) 9%, rgba(255, 255, 255, 0) 24%),
    var(--bk-paper);
}

.b3d-page-r {
  background: var(--bk-paper);
}

.b3d-text-sheet {
  width: 100%;
  height: 100%;
  padding: 12% 13% 11% 12%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.b3d-text-body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 0;
}

.b3d-text-p {
  margin: 0;
  width: 100%;
  font-size: clamp(17px, calc(var(--page-w) * 0.056), 24px);
  font-weight: 500;
  line-height: 1.72;
  letter-spacing: -0.01em;
  color: var(--bk-ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* 발표 화면용 큰 글씨 모드 */
.b3d-root[data-present="1"] .b3d-text-p {
  font-size: clamp(19px, calc(var(--page-w) * 0.064), 28px);
  font-weight: 700;
  line-height: 1.65;
}

/* 글이 길 때 단계별 글자 크기 축소 */
.b3d-text-p.len-md,
.b3d-root[data-present="1"] .b3d-text-p.len-md {
  font-size: clamp(15.5px, calc(var(--page-w) * 0.047), 20.5px);
  line-height: 1.62;
}

.b3d-text-p.len-lg,
.b3d-root[data-present="1"] .b3d-text-p.len-lg {
  font-size: clamp(14px, calc(var(--page-w) * 0.041), 17.5px);
  line-height: 1.54;
}

.b3d-text-p.len-xl,
.b3d-root[data-present="1"] .b3d-text-p.len-xl {
  font-size: clamp(12.5px, calc(var(--page-w) * 0.035), 15px);
  line-height: 1.46;
}

.b3d-text-empty {
  color: var(--bk-muted);
  font-size: 15px;
}

.b3d-pno {
  display: block;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #9A9080;
  letter-spacing: 0.06em;
  padding-top: 6px;
}

/* 발표용 [글 가리기]: 책의 글 쪽을 종이로 덮기 */
.b3d-veil {
  position: absolute;
  inset: 7% 8%;
  border-radius: 10px;
  background:
    repeating-linear-gradient(0deg, rgba(160, 140, 110, 0.06) 0px, rgba(160, 140, 110, 0.06) 1px, transparent 1px, transparent 26px),
    #F3EBDD;
  border: 1.5px dashed #C7B99E;
  box-shadow: 0 8px 22px rgba(35, 25, 10, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  gap: 8px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.b3d-root[data-hide-text="1"] .b3d-veil {
  opacity: 1;
  transform: translateY(0);
}

.b3d-veil-pin {
  width: 36px;
  height: 10px;
  border-radius: 99px;
  background: var(--bk-color);
  opacity: 0.65;
  margin-bottom: 4px;
}

.b3d-veil b {
  font-size: clamp(15px, calc(var(--page-w) * 0.048), 20px);
  color: #3A342B;
  font-weight: 800;
}

.b3d-veil small {
  font-size: clamp(12px, calc(var(--page-w) * 0.036), 14.5px);
  color: #746A5A;
  line-height: 1.5;
  word-break: keep-all;
}

/* 오른쪽 쪽: 그림 쪽 가득 + 안쪽 접힌 그림자 */
.b3d-art-sheet {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bk-paper);
  overflow: hidden;
}

.b3d-art-sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 안쪽에 접힌 책등 그림자 (gutter shadow) */
.b3d-art-sheet::after,
.b3d-colophon-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(16, 11, 5, 0.3) 0%,
    rgba(16, 11, 5, 0.11) 6%,
    rgba(255, 255, 255, 0.08) 12%,
    rgba(0, 0, 0, 0) 24%
  );
  pointer-events: none;
  z-index: 3;
}

/* 그림 없음 빈 쪽 (core.js의 .no-pic 교체 및 자체 빈 상태 모두 호환) */
.b3d-empty-pic,
.b3d-root .no-pic {
  width: 100%;
  height: 100%;
  min-height: 120px;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--bk-paper);
  color: #9A9080;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  padding: 20px;
  text-align: center;
}

.b3d-empty-pic span {
  padding: 14px 22px;
  border: 1.5px dashed #CFC5B4;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
}

/* 마지막 펼침: 왼쪽 작가의 말, 오른쪽 판권 */
.b3d-note-sheet {
  width: 100%;
  height: 100%;
  padding: 12% 13% 11% 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.b3d-sec-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--bk-color);
  border-bottom: 1.5px solid var(--bk-line);
  padding-bottom: 6px;
  align-self: flex-start;
}

.b3d-dedicate {
  font-size: clamp(14px, calc(var(--page-w) * 0.044), 18px);
  font-weight: 700;
  color: #4A4236;
  word-break: keep-all;
}

.b3d-note-text {
  font-size: clamp(14.5px, calc(var(--page-w) * 0.046), 19px);
  line-height: 1.7;
  color: var(--bk-ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.b3d-note-text.is-long {
  font-size: clamp(13px, calc(var(--page-w) * 0.038), 15.5px);
  line-height: 1.55;
}

.b3d-fixes-box {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bk-paper-2);
  border-left: 3px solid var(--bk-color);
  font-size: clamp(12px, calc(var(--page-w) * 0.035), 14px);
  line-height: 1.5;
  color: #4A4236;
  word-break: keep-all;
}

.b3d-fixes-box b {
  display: block;
  font-size: 11.5px;
  color: var(--bk-color);
  margin-bottom: 2px;
}

.b3d-colophon-sheet {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 13% 12% 12% 14%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bk-paper);
}

.b3d-colo-top {
  padding-top: 8%;
}

.b3d-colo-mark {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--bk-color);
  margin-bottom: 12px;
}

.b3d-colo-title {
  font-size: clamp(17px, calc(var(--page-w) * 0.054), 23px);
  font-weight: 900;
  color: var(--bk-ink);
  line-height: 1.3;
  word-break: keep-all;
}

.b3d-colo-list {
  border-top: 1px solid var(--bk-line);
  padding-top: 14px;
  display: grid;
  gap: 7px;
  font-size: clamp(12px, calc(var(--page-w) * 0.036), 14.5px);
  line-height: 1.5;
  color: #4E473C;
}

.b3d-colo-list p {
  margin: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.b3d-colo-list b {
  color: var(--bk-ink);
  min-width: 52px;
}

.b3d-colo-pub {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--bk-line);
  font-weight: 800;
  color: var(--bk-color);
  letter-spacing: 0.01em;
}

/* ---------- 3D 종이 넘김 레이어 (0.7초 rotateY + 그림자 + 끝 눌림) ---------- */
.b3d-shade {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 7;
}

.b3d-shade-l {
  left: 0;
  background: linear-gradient(to left, rgba(12, 8, 4, 0.42), rgba(12, 8, 4, 0.12));
}

.b3d-shade-r {
  left: 50%;
  background: linear-gradient(to right, rgba(12, 8, 4, 0.44), rgba(12, 8, 4, 0.12));
}

.b3d-flipper {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  z-index: 10;
  pointer-events: none;
}

.b3d-flipper[hidden] {
  display: none !important;
}

.b3d-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background: var(--bk-paper);
}

.b3d-flip-front {
  border-radius: 0 4px 4px 0;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.12);
}

.b3d-flip-back {
  transform: rotateY(180deg);
  border-radius: 4px 0 0 4px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.12);
}

/* 넘어가는 종이 표면의 휘어짐 음영 */
.b3d-flip-gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  opacity: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.24) 0%, rgba(255, 255, 255, 0.22) 38%, rgba(0, 0, 0, 0.12) 100%);
}

.b3d-book.anim-next .b3d-flipper {
  animation: b3dFlipNext 0.7s cubic-bezier(0.3, 0.08, 0.18, 1) forwards;
}

.b3d-book.anim-prev .b3d-flipper {
  animation: b3dFlipPrev 0.7s cubic-bezier(0.3, 0.08, 0.18, 1) forwards;
}

.b3d-book.anim-next .b3d-flip-gloss,
.b3d-book.anim-prev .b3d-flip-gloss {
  animation: b3dGloss 0.7s ease-in-out forwards;
}

.b3d-book.anim-next .b3d-shade-r {
  animation: b3dShadeOut 0.7s ease-out forwards;
}

.b3d-book.anim-next .b3d-shade-l {
  animation: b3dShadeIn 0.7s ease-in forwards;
}

.b3d-book.anim-prev .b3d-shade-l {
  animation: b3dShadeOut 0.7s ease-out forwards;
}

.b3d-book.anim-prev .b3d-shade-r {
  animation: b3dShadeIn 0.7s ease-in forwards;
}

@keyframes b3dFlipNext {
  0%   { transform: translateZ(2px) rotateY(0deg); }
  44%  { transform: translateZ(8px) rotateY(-92deg); }
  85%  { transform: translateZ(2px) rotateY(-180deg); }
  93%  { transform: translateZ(3px) rotateY(-177deg); }
  100% { transform: translateZ(1px) rotateY(-180deg); }
}

@keyframes b3dFlipPrev {
  0%   { transform: translateZ(2px) rotateY(-180deg); }
  44%  { transform: translateZ(8px) rotateY(-88deg); }
  85%  { transform: translateZ(2px) rotateY(0deg); }
  93%  { transform: translateZ(3px) rotateY(-3deg); }
  100% { transform: translateZ(1px) rotateY(0deg); }
}

@keyframes b3dGloss {
  0%   { opacity: 0; }
  45%  { opacity: 0.85; }
  85%  { opacity: 0.12; }
  100% { opacity: 0; }
}

@keyframes b3dShadeOut {
  0%   { opacity: 0.65; }
  75%  { opacity: 0.08; }
  100% { opacity: 0; }
}

@keyframes b3dShadeIn {
  0%   { opacity: 0; }
  30%  { opacity: 0.06; }
  85%  { opacity: 0.55; }
  100% { opacity: 0; }
}

/* ---------- 좁은 화면: 한 쪽씩 보기 (그림 위, 글 아래) ---------- */
.b3d-root[data-single="1"] .b3d-book {
  width: var(--page-w);
  height: var(--page-h);
  transform: rotateX(1.5deg);
}

.b3d-root[data-single="1"] .b3d-board {
  inset: -6px -7px -8px -7px;
  clip-path: none;
  background: linear-gradient(90deg, var(--bk-dark) 0%, var(--bk-color) 14%, var(--bk-color) 100%);
}

.b3d-root[data-single="1"] .b3d-board-spine,
.b3d-root[data-single="1"] .b3d-stack-l,
.b3d-root[data-single="1"] .b3d-closed-spine,
.b3d-root[data-single="1"] .b3d-closed-edge,
.b3d-root[data-single="1"] .b3d-half-l,
.b3d-root[data-single="1"] .b3d-shade-l {
  display: none;
}

.b3d-root[data-single="1"] .b3d-stack-r {
  left: 6px;
  right: -5px;
}

.b3d-root[data-single="1"] .b3d-half-r,
.b3d-root[data-single="1"] .b3d-shade-r,
.b3d-root[data-single="1"] .b3d-flipper {
  left: 0;
  width: 100%;
  border-radius: 3px 8px 8px 3px;
}

.b3d-single-card {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bk-paper);
  color: var(--bk-ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 2px 6px 6px 2px;
}

.b3d-single-art {
  position: relative;
  flex: 0 0 54%;
  height: 54%;
  width: 100%;
  overflow: hidden;
  background: var(--bk-paper-2);
  border-bottom: 1px solid var(--bk-line);
}

.b3d-single-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.b3d-single-txt {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.b3d-single-txt .b3d-text-p {
  font-size: clamp(14.5px, 4.1vw, 18px);
  line-height: 1.55;
}

.b3d-single-txt .b3d-text-p.len-lg,
.b3d-single-txt .b3d-text-p.len-xl {
  font-size: 13px;
  line-height: 1.42;
}

.b3d-single-end {
  width: 100%;
  height: 100%;
  padding: 16px 18px;
  background: var(--bk-paper);
  color: var(--bk-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  overflow-y: auto;
}

.b3d-root[data-single="1"] .b3d-book.anim-next .b3d-flipper {
  animation: b3dSingleNext 0.7s cubic-bezier(0.3, 0.08, 0.18, 1) forwards;
}

.b3d-root[data-single="1"] .b3d-book.anim-prev .b3d-flipper {
  animation: b3dSinglePrev 0.7s cubic-bezier(0.3, 0.08, 0.18, 1) forwards;
}

@keyframes b3dSingleNext {
  0%   { transform: translateZ(2px) rotateY(0deg); opacity: 1; }
  68%  { transform: translateZ(6px) rotateY(-102deg); opacity: 0.92; }
  88%  { transform: translateZ(2px) rotateY(-116deg); opacity: 0; }
  100% { transform: translateZ(1px) rotateY(-116deg); opacity: 0; }
}

@keyframes b3dSinglePrev {
  0%   { transform: translateZ(2px) rotateY(-112deg); opacity: 0; }
  22%  { transform: translateZ(6px) rotateY(-88deg); opacity: 0.95; }
  86%  { transform: translateZ(2px) rotateY(0deg); opacity: 1; }
  93%  { transform: translateZ(3px) rotateY(-2.6deg); opacity: 1; }
  100% { transform: translateZ(1px) rotateY(0deg); opacity: 1; }
}

/* ---------- 하단 점 표시와 [처음으로] 막대 ---------- */
.b3d-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  z-index: 12;
}

.b3d-nav-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(128, 138, 150, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.b3d-nav-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.b3d-nav-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.b3d-nav-arrow svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.b3d-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.b3d-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  border: 0;
  padding: 0;
  background: rgba(140, 152, 166, 0.42);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.b3d-dot.on {
  width: 24px;
  background: #3CC0B4;
}

.b3d-reset {
  height: 30px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid rgba(140, 152, 166, 0.38);
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.b3d-reset:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
}

.b3d-reset:disabled {
  opacity: 0.36;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .b3d-book,
  .b3d-board,
  .b3d-veil,
  .b3d-dot {
    transition: none !important;
  }
  .b3d-book.anim-next .b3d-flipper,
  .b3d-book.anim-prev .b3d-flipper,
  .b3d-book.anim-next .b3d-flip-gloss,
  .b3d-book.anim-prev .b3d-flip-gloss,
  .b3d-book.anim-next .b3d-shade-r,
  .b3d-book.anim-next .b3d-shade-l,
  .b3d-book.anim-prev .b3d-shade-l,
  .b3d-book.anim-prev .b3d-shade-r {
    animation: none !important;
  }
}

/* ================================================================
   발표 무대 (extras.js 의 VIEWS.present 전용 무대 디자인)
   ================================================================ */
.present.pt-v44 {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(ellipse 68% 52% at 50% -4%, rgba(120, 178, 245, 0.28) 0%, rgba(56, 98, 158, 0.13) 44%, rgba(11, 20, 40, 0) 76%),
    radial-gradient(ellipse 54% 18% at 50% 92%, rgba(60, 192, 180, 0.1) 0%, rgba(11, 20, 40, 0) 75%),
    linear-gradient(180deg, #12213F 0%, #0C162B 58%, #080F1E 100%);
  color: #F3F6FA;
  padding: 12px 20px 12px;
  gap: 8px;
  overflow: hidden;
}

.present.pt-v44 .pt-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  z-index: 20;
}

.present.pt-v44 .pt-bar-l {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.present.pt-v44 .pt-bar-c {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.present.pt-v44 .pt-bar-r {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.present.pt-v44 .pt-bar .btn {
  color: #EEF3F8;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.present.pt-v44 .pt-bar .btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.present.pt-v44 .pt-bar .btn.on {
  background: rgba(245, 185, 66, 0.22);
  border-color: #F5B942;
  color: #FFE08A;
}

.present.pt-v44 .pt-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.present.pt-v44 .pt-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.3);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.present.pt-v44 .pt-dot.on {
  width: 24px;
  background: #3CC0B4;
}

.present.pt-v44 .pt-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 10px;
  border-radius: 12px;
  background: rgba(8, 14, 26, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.present.pt-v44 .pt-timer b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  min-width: 46px;
  text-align: right;
  color: #FFE6A3;
}

/* 무대 중앙 영역 */
.present.pt-v44 .pt-stage {
  position: relative;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: default;
}

.pt-intro-head {
  text-align: center;
  margin-bottom: 6px;
  z-index: 15;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pt-intro-head[hidden] {
  display: none !important;
}

.pt-intro-title {
  font-size: clamp(20px, 3vh, 30px);
  font-weight: 900;
  color: #FFF8E8;
  letter-spacing: -0.02em;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.45);
  word-break: keep-all;
}

.pt-book-host {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-book-host[hidden] {
  display: none !important;
}

.pt-start-wrap {
  margin-top: 8px;
  z-index: 16;
  display: flex;
  justify-content: center;
}

.pt-start-wrap[hidden] {
  display: none !important;
}

.present.pt-v44 .pt-start-btn {
  min-width: 210px;
  height: 54px;
  padding: 0 30px;
  border-radius: 99px;
  font-size: 18px;
  font-weight: 900;
  background: #3CC0B4;
  color: #052320;
  border: 0;
  box-shadow: 0 6px 0 #1E7D74, 0 12px 28px rgba(0, 0, 0, 0.4);
}

.present.pt-v44 .pt-start-btn:hover {
  filter: brightness(1.06);
}

/* 양옆 넘기기 화살표 */
.present.pt-v44 .pt-side-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 18;
  transition: background 0.15s, opacity 0.15s;
}

.present.pt-v44 .pt-side-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.present.pt-v44 .pt-side-btn:disabled {
  opacity: 0.22;
  pointer-events: none;
}

.present.pt-v44 .pt-side-btn.prev {
  left: 4px;
}

.present.pt-v44 .pt-side-btn.next {
  right: 4px;
}

/* 마지막 쪽 다음: "끝! 박수" 화면 */
.pt-finale {
  position: relative;
  width: min(680px, 94vw);
  padding: clamp(24px, 4.5vh, 44px) clamp(20px, 4vw, 42px);
  border-radius: 26px;
  background: rgba(20, 34, 62, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 14px;
  z-index: 16;
}

.pt-finale[hidden] {
  display: none !important;
}

.pt-finale-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border-radius: 99px;
  background: rgba(245, 185, 66, 0.18);
  border: 1px solid rgba(245, 185, 66, 0.45);
  color: #FFD97D;
  font-size: 13px;
  font-weight: 800;
}

.pt-finale h2 {
  font-family: 'Black Han Sans', 'Noto Sans KR', sans-serif;
  font-weight: 400;
  font-size: clamp(36px, 6.5vh, 62px);
  line-height: 1.15;
  color: #FFF9EB;
  margin: 0;
}

.pt-finale-sub {
  font-size: clamp(16px, 2.4vh, 22px);
  color: #D4E0EE;
  font-weight: 700;
  word-break: keep-all;
}

.pt-finale-next {
  margin-top: 4px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(60, 192, 180, 0.13);
  border: 1px solid rgba(60, 192, 180, 0.34);
  font-size: clamp(15px, 2.2vh, 20px);
  color: #FFF7E6;
  max-width: 540px;
  word-break: keep-all;
}

.pt-finale-next small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #8ADCD3;
  margin-bottom: 3px;
}

.pt-finale-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.pt-finale-btns .btn {
  min-width: 140px;
  height: 48px;
  font-size: 16px;
}

/* 무대 아래 가운데: 자는 강아지 + "도담은 쉬는 중 · 내 말로 발표" 딱지 */
.present.pt-v44 .pt-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 18;
}

.present.pt-v44 .pt-rest-dock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 16px 4px 12px;
  min-height: 40px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #DCE6F2;
  font-size: 13.5px;
  font-weight: 700;
}

.present.pt-v44 .pt-pup-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  margin: -10px 0 -8px;
}

.present.pt-v44 .pt-pup-slot:empty {
  display: none;
}

/* 발표 무대 3초 색종이 */
.pt-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 25;
}

.pt-confetti i {
  position: absolute;
  top: -20px;
  width: 11px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.95;
  animation: ptConfettiFall var(--dur, 2.5s) cubic-bezier(0.22, 0.45, 0.36, 1) var(--delay, 0s) forwards;
}

@keyframes ptConfettiFall {
  0% {
    transform: translate3d(0, -20px, 0) rotate(0deg);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--dx, 30px), 102vh, 0) rotate(var(--rot, 520deg));
    opacity: 0;
  }
}

@media (max-width: 1024px) {
  .present.pt-v44 {
    padding: 10px 12px;
  }
  .present.pt-v44 .pt-bar {
    grid-template-columns: auto 1fr;
    row-gap: 6px;
  }
  .present.pt-v44 .pt-bar-c {
    justify-self: end;
  }
  .present.pt-v44 .pt-bar-r {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .present.pt-v44 .pt-side-btn {
    width: 36px;
    height: 36px;
  }
  .present.pt-v44 .pt-timer b {
    font-size: 15px;
    min-width: 38px;
  }
  .present.pt-v44 .pt-rest-dock {
    font-size: 12px;
    padding: 4px 12px;
  }
}
