/* 리딩룸 연도 앨범 — 폰(HTML·CSS) 화면. 동작은 bookshelf-phone.js. 데스크톱은 3D(bookshelf-3d.js) 그대로. */
.sp-stage { position: relative; overflow: hidden; }
.sp-stage.is-moving { pointer-events: none; }

/* 책장에서 빠져나오는 책(책장 책을 복제) */
.sp-book {
  position: absolute;
  z-index: 50;
  transform-origin: 0 0;
  transform-style: preserve-3d;
  transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
  will-change: transform;
}
.sp-book .shelf-year-face { transform-origin: left center; transition: transform .42s cubic-bezier(.3, .7, .2, 1); }
.sp-book.is-open .shelf-year-face { transform: translateZ(3px) rotateY(-112deg); }
.sp-book.is-behind { z-index: 1; }
.sp-book.is-gone { opacity: 0; }

/* 월 파일: 서리 낀 파스텔 유리 속 표지 사진(Blender 월 파일을 CSS 로) */
.sp-card {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  border: 1px solid #ffffffd0;
  border-radius: 12px;
  overflow: visible;
  background: color-mix(in srgb, var(--tone) 88%, #fff);
  box-shadow: inset 2px 2px 6px #ffffffb0, inset -2px -3px 7px #6d8fa440, 4px 8px 16px #24394b3a;
  transform-origin: 50% 60%;
  transition: transform .46s cubic-bezier(.2, .8, .2, 1), opacity .3s ease, box-shadow .2s;
  will-change: transform;
  cursor: pointer;
}
.sp-card .sp-photo {
  position: absolute;
  inset: 12% 8% 16% 8%;
  width: 84%;
  height: 72%;
  object-fit: cover;
  border-radius: 7px;
  filter: blur(1px) saturate(1.05);
}
.sp-card .sp-photo:not([src]) { display: none; }   /* 사진을 못 불러오면 유리만 */
.sp-card .sp-frost {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background:
    linear-gradient(135deg, #ffffff80 0%, #ffffff26 30%, #ffffff12 62%, #ffffff55 100%),
    linear-gradient(112deg, #f9cbd62e, #d9f2ff30);
  box-shadow: inset 0 0 0 1px #ffffff70, inset 4px 4px 10px #ffffff66;
  pointer-events: none;
}
/* 탭·이름은 오른쪽에 둔다: 왼쪽 파일이 위에 겹쳐 오른쪽 부분만 보이기 때문이다. */
.sp-card .sp-tab {
  position: absolute;
  top: 10%;
  right: -9px;
  width: 14px;
  height: 22px;
  border-radius: 0 7px 7px 0;
  border: 1px solid #ffffffc7;
  border-left: 0;
  background: linear-gradient(90deg, var(--tone), #ffffffc0);
  color: transparent;
  font-size: 0;
}
.sp-card .sp-label {
  position: absolute;
  right: 8%;
  bottom: 4%;
  font: 600 13px Georgia, serif;
  letter-spacing: -.3px;
  color: #5d4f63;
  text-shadow: 0 1px 0 #fff9;
  white-space: nowrap;
}
.sp-card .sp-count {
  position: absolute;
  top: 5%;
  right: 8%;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ffffffc0;
  color: #5d4f63;
  font: 700 11px/18px "Pretendard", sans-serif;
  text-align: center;
}
.sp-card .sp-label em { font-style: normal; }
/* 달이 많아 깊게 겹칠 때: 보이는 띠에 들어가도록 연도는 빼고 달 숫자만. 앞으로 나온 파일은 전체 이름. */
.sp-stage.is-tight .sp-card:not(.is-focused) .sp-label em { display: none; }
.sp-card.is-focused { box-shadow: inset 2px 2px 6px #ffffffc0, inset -2px -3px 7px #6d8fa440, 0 0 0 2px var(--info, #60a5fa), 6px 14px 24px #24394b55; }

/* 다이얼: 좌우로 밀어 날짜 파일을 고른다. 가운데 바늘이 고른 날짜. 위에 넘김 시계. */
.sp-dial-wrap { position: absolute; left: 0; right: 0; padding: 0 12px; opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.sp-dial-wrap.is-shown { opacity: 1; transform: none; }

/* 넘김 시계(년 · 월 · 일 · 요일). 글자 이름표 없이 값만. 누르면 그 날짜 파일이 열린다.
   한 장은 위·아래 반쪽으로 나뉘고, 바뀔 때 옛 윗장이 꺾여 내려간 뒤 새 아랫장이 내려와 덮는다(bookshelf-phone.js flip). */
.sp-clock { display: flex; justify-content: center; gap: 6px; margin: 0 auto 8px; padding: 0; border: 0; background: none; cursor: pointer; }
.sp-clock:focus-visible { outline: 2px solid var(--info, #60a5fa); outline-offset: 3px; border-radius: 8px; }
.sp-flap { position: relative; width: 42px; height: 40px; perspective: 160px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px #0000002e; }
.sp-flap-year { width: 68px; }
/* 판 색은 리딩룸 바탕(--surface)보다 한 단계 밝게 — 어두운 테마에서 윗장이 바탕에 묻히지 않게. 아랫장은 조금 더 어둡게. */
.sp-half { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; background: var(--fill); }
.sp-top { top: 0; border-radius: 7px 7px 0 0; }
.sp-bottom { bottom: 0; border-radius: 0 0 7px 7px; background: color-mix(in srgb, var(--fill) 90%, #000); }
.sp-half b {
  position: absolute;
  left: 0;
  right: 0;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 21px/1 "Pretendard", Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
  color: var(--ink);
}
.sp-top b { top: 0; }
.sp-bottom b { bottom: 0; }
.sp-flap-week b { font-size: 17px; }
/* 가운데 접히는 선 */
.sp-flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; margin-top: -.5px; background: var(--bg); opacity: .7; z-index: 3; pointer-events: none; }
.sp-leaf { z-index: 2; backface-visibility: hidden; }
.sp-leaf-down { transform-origin: 50% 100%; animation: sp-fold-down 115ms cubic-bezier(.5, 0, 1, 1) forwards; }
.sp-leaf-up { transform-origin: 50% 0; transform: rotateX(90deg); animation: sp-fold-up 115ms 115ms cubic-bezier(0, 0, .3, 1) forwards; }
@keyframes sp-fold-down { to { transform: rotateX(-90deg); filter: brightness(.7); } }
@keyframes sp-fold-up { from { transform: rotateX(90deg); filter: brightness(.8); } to { transform: rotateX(0); filter: none; } }
.sp-dial {
  /* 돌리기는 스크립트가 직접 한다(손가락 따라가기 + 가속 관성, bookshelf-phone.js). 기본 스크롤·스냅은 끈다. */
  position: relative;   /* 눈금 위치(offsetLeft)를 다이얼 기준으로 잰다 */
  overflow: hidden;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  touch-action: none;
}
.sp-dial::-webkit-scrollbar { display: none; }
.sp-dial-track { display: flex; width: max-content; will-change: transform; }   /* 다이얼은 이 띠를 transform 으로 민다(bookshelf-phone.js spinDial) */
.sp-edge { flex: 0 0 131px; }
.sp-stop {
  flex: 0 0 15px;
  height: 36px;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: end;
  padding: 0 0 6px;
  border: 0;
  background: none;
  color: var(--ink-dim);
  scroll-snap-align: center;
}
.sp-stop.is-gap { margin-left: 12px; }   /* 달 사이 틈 */
.sp-stop i { width: 2px; height: 10px; border-radius: 1px; background: currentColor; opacity: .55; }
.sp-stop.is-month i { height: 18px; opacity: .85; }
.sp-stop[aria-selected="true"] { color: var(--ink); }
.sp-stop[aria-selected="true"] i { height: 24px; opacity: 1; }
.sp-needle { position: absolute; left: 50%; bottom: 6px; width: 3px; height: 28px; margin-left: -1.5px; border-radius: 2px; background: var(--info, #60a5fa); pointer-events: none; }

/* 폰 화면에서는 뒤따르는 빈 월 목록 자리(데스크톱 3D 대체용)의 위 여백이 다이얼 아래 빈 곳으로 남았다. */
.sp-stage + .shelf-open-book { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .sp-book, .sp-card, .sp-dial-wrap, .sp-book .shelf-year-face { transition: none !important; }
  .sp-leaf { animation: none !important; }
}

/* ── 책등 책장(폰, bookshelf-phone.js shelf) ──
   년도 앨범을 앞표지 대신 책등으로 한 줄에 세운다. 유리·색은 bookshelf.css 의 년도 앨범(.shelf-year-face·.shelf-year-spine)과 같다.
   책등 폭 = 앨범 두께(추억 점수). 고른 년도는 들어올려진다. */
.shelf-row.sp-shelf { display: block; min-height: 0; padding: 0; overflow: visible; border-bottom: 0; box-shadow: none; perspective: none; }
.sp-spines {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  padding: 34px 8px 0;
  border-bottom: 9px solid var(--surface-3);
  box-shadow: 0 8px 8px -6px #0004, inset 0 -1px #fff8;
  touch-action: pan-y;
}
.sp-spine {
  position: relative;
  flex: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffffc9;
  border-radius: 10px 10px 8px 8px;
  background: linear-gradient(90deg, #f2c6d680, #ffffffb0 45%, #b9dcec80);
  box-shadow: inset 3px 3px 6px #ffffffa0, inset -3px -3px 7px #7aa5bd55, 0 0 0 1px #d8edf58c, 3px 6px 9px #24394b2b;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, opacity .3s, filter .3s;
  /* 책등마다 따로 된 판(레이어)으로 그린다. 안 그러면 년도를 바꿀 때 들어올리는 동안 매 프레임 책등 전체(빛나는 년도 글자의
     text-shadow·filter 가 무겁다)를 다시 그려 다이얼이 끊겼다(2026-09-27 아이폰 13: 년도 한 번에 끊긴 시간 0.28초 → 0.06초). */
  will-change: transform;
  touch-action: pan-y;
  cursor: pointer;
}
/* 유리 반사(앞표지 :after 와 같은 결) */
.sp-spine::after { content: ""; position: absolute; inset: 2px; border-radius: 8px; background: linear-gradient(90deg, #fff7 0 10%, transparent 30% 70%, #bddff033 88%, #f3cadb40); pointer-events: none; }
/* 유리 너머 월별 낱장(옆에서 본 모습). 앞표지의 낱장처럼 월 색을 채도 올려 파스텔로. 최근 고른 달은 조금 솟는다. */
.sp-spine-leaf { position: absolute; top: 12px; bottom: 10px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--month-tone); filter: saturate(6) brightness(.86); opacity: .5; pointer-events: none; }
.sp-spine-leaf.is-recent-month { top: 5px; width: 3px; opacity: .95; }
/* 밝게: 밝은 유리 너머라 낱장이 희미해 몇 달이 들었는지 보기 어려웠다. 밝게에서만 색을 올린다. */
[data-theme="light"] .sp-spine-leaf { filter: saturate(6) brightness(.8); opacity: .66; }
[data-theme="light"] .sp-spine-leaf.is-recent-month { opacity: .95; }
/* 어둡게: 년도 글자에 분홍 그림자(bookshelf.css)가 비쳐 보였다. 속은 비우고 흰 윤곽만 남긴 투명 유리 글자로. */
[data-theme="dark"] .sp-spine .shelf-crystal-year { color: transparent; -webkit-text-stroke: .8px #ffffffc0; text-shadow: none; filter: drop-shadow(0 1px 1px #0009); }
.sp-spine .sp-spine-year {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--digit, 18px);
  line-height: 1.04;
  letter-spacing: 0;
  pointer-events: none;
}
.sp-spine-year i { font-style: normal; }
.sp-spine.is-selected { transform: translateY(-20px); box-shadow: inset 3px 3px 6px #ffffffc0, inset -3px -3px 7px #7aa5bd55, 0 0 0 2px var(--info, #60a5fa), 4px 16px 18px #24394b45; }
.sp-spine.is-lifted { visibility: hidden; }
[data-theme="dark"] .sp-spine { background: linear-gradient(90deg, #9c718a66, #d9e0e580 45%, #8cc5dc66); border-color: #c8e4ef80; box-shadow: inset 3px 3px 6px #ffffff70, inset -3px -3px 7px #243a4a8c, 0 0 0 1px #c8e4ef66, 3px 6px 10px #0006; }
[data-theme="dark"] .sp-spine.is-selected { box-shadow: inset 3px 3px 6px #ffffff90, inset -3px -3px 7px #243a4a8c, 0 0 0 2px var(--info, #60a5fa), 4px 16px 20px #0008; }

/* 년도 넘김 시계(네 자리) + 다이얼(년도마다 긴 눈금, 사이 잔 눈금) */
.sp-yearctl { padding: 14px 12px 2px; }
.sp-flap-digit { width: 34px; }
.sp-yeardial { position: relative; }
.sp-stop.sp-year-stop { flex-basis: 50px; display: flex; justify-content: space-evenly; align-items: flex-end; }
.sp-year-stop i { height: 8px; }
.sp-year-stop i.is-major { height: 18px; opacity: .85; }
.sp-year-stop[aria-selected="true"] i:not(.is-major) { height: 8px; opacity: .55; }
.sp-year-stop[aria-selected="true"] i.is-major { height: 24px; opacity: 1; }

/* 년도 앨범이 열려 있는 동안: 나머지 책등은 흐리게, 년도 시계·다이얼은 감춘다(월 파일 화면이 그 위에 겹친다). */
.shelf-host.is-shelf-open .sp-spine:not(.is-lifted):not(.is-turning) { opacity: .3; filter: blur(1px); }   /* is-turning: 열리며 옆으로 도는 책등(bookshelf-phone.js) */
.shelf-host.is-shelf-open .sp-yearctl { visibility: hidden; }
/* 월 파일 줄은 좌우로 밀어 달을 고른다(세로 스크롤은 그대로) */
.sp-card { touch-action: pan-y; }

@media (prefers-reduced-motion: reduce) {
  .sp-spine { transition: none !important; }
}

/* 마지막으로 열었다 다시 꽂은 앨범: 오른쪽 아래 모서리를 딛고 옆 책에 살짝 기대 선다(ㅣㅣㅣ/ㅣㅣㅣ). 다시 고르면 곧게 들어올린다. */
.sp-spine { transform-origin: right bottom; transition: transform .32s cubic-bezier(.2, .8, .2, 1), margin .32s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, opacity .3s, filter .3s; }
.sp-spine.is-leaning { margin-right: 14px; transform: rotate(6deg); }
.sp-spine.is-leaning.is-selected { transform: translateY(-20px); }

/* 년도 책장 미리 채우기(bookshelf-phone.js shelf, 2026-10-07): 아직 분류 중인 해는 흐리고, 분류된 만큼 아래에서 차오른다(--fill 0~1). */
.sp-spine.is-filling { opacity: calc(.4 + .6 * var(--fill, 0)); }
.sp-spine.is-filling::before {
  content: ""; position: absolute; left: 3px; right: 3px; bottom: 3px;
  height: calc((100% - 6px) * var(--fill, 0)); border-radius: 6px;
  background: linear-gradient(180deg, #bfe3ff40, #8fc2f070); pointer-events: none;
}
.sp-spine.is-pending { border-style: dashed; background: linear-gradient(90deg, #f2c6d633, #ffffff55 45%, #b9dcec33); }
.sp-spine.is-pending .sp-spine-year { opacity: .7; }
.sp-progress { margin: 6px 0 0; color: var(--ink-dim, #888); font-size: 12.5px; text-align: center; font-variant-numeric: tabular-nums; }
.sp-progress.is-flash { animation: sp-progress-flash .9s ease; }
@keyframes sp-progress-flash { 0%, 100% { color: var(--ink-dim, #888); } 30% { color: var(--info, #60a5fa); } }

/* 년도 시계를 책장 뒤로(bookshelf-phone.js, 2026-10-11 사용자): 책등 줄 뒤 벽에 큰 숫자로 깔고, 유리 책등은 더 투명하게 해 비치게 한다. */
.sp-spines { position: relative; }
.sp-clock-back {
  position: absolute; left: 0; right: 0; top: 34px; height: 180px; z-index: 0;
  display: flex; justify-content: center; align-items: center; gap: 0; margin: 0;
  pointer-events: none;
}
.sp-clock-back .sp-flap { width: 23%; height: 100%; perspective: 700px; border-radius: 0; box-shadow: none; }
.sp-clock-back .sp-flap::after { display: none; }
.sp-clock-back .sp-half, .sp-clock-back .sp-bottom { background: transparent; border-radius: 0; }
.sp-clock-back .sp-half b {
  font: 700 clamp(96px, 32vw, 140px)/1 "Pretendard", Inter, sans-serif; letter-spacing: -.04em;
  color: color-mix(in srgb, var(--ink) 28%, transparent);
}
.sp-spine { z-index: 1; background: linear-gradient(90deg, #f2c6d655, #ffffff4d 45%, #b9dcec55); }
[data-theme="dark"] .sp-spine { background: linear-gradient(90deg, #9c718a55, #d9e0e54d 45%, #8cc5dc55); }
.shelf-host.is-shelf-open .sp-clock-back { visibility: hidden; }
.sp-yearctl { padding-top: 8px; }
/* 책장 뒤 큰 년도는 위·아래 칸으로 나뉘지 않은 한 글자로(칸 선·넘김 움직임 없음, 2026-10-11 사용자). 값은 바로 바뀐다. */
.sp-clock-back .sp-flap { overflow: visible; }
.sp-clock-back .sp-top { top: 0; height: 100%; overflow: visible; }
.sp-clock-back .sp-half b { height: 100%; }
.sp-clock-back .sp-bottom, .sp-clock-back .sp-leaf { display: none; }

/* 월별 파일 왼쪽 위 뒤로 가기: 아이콘만, 상자 없음 */
.sp-back { position: absolute; left: 0; top: 0; z-index: 20; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink); }
.sp-back svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
