.pins-app {
  --ink: #202a37;
  --paper: #f8f4eb;
  --gold: #dac08c;
  --navy: #14233d;
  background: radial-gradient(ellipse at 45% 0%, #fffdf7, transparent 63%), var(--paper);
}

#pinRoom { max-width: 1310px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 64px); }
.room-head { margin-bottom: clamp(18px, 4vh, 46px); }
.profile-back { margin: 0; color: #6c5638; border-color: #b99c634e; background: #fffdf7; }
.room-head #pinCount { color: #6c5638; font-variant-numeric: tabular-nums; }
.collection-title { margin-bottom: clamp(24px, 4vw, 54px); }
.collection-title p { margin: 0 0 8px; color: #795d35; font: 600 12px/1.3 system-ui, sans-serif; letter-spacing: .22em; text-transform: uppercase; }
.collection-title h1 { margin: 0; font: 500 clamp(34px, 5vw, 66px)/1.16 Georgia, "Noto Serif SC", "Songti SC", SimSun, serif; letter-spacing: .055em; }
.collection-layout { display: grid; grid-template-columns: minmax(0, 2.7fr) minmax(204px, 1fr); gap: clamp(16px, 2.5vw, 36px); align-items: start; }
.display-case {
  padding: clamp(12px, 1.8vw, 24px);
  border: 1px solid #aa8954;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff8e7, #ede0c7 55%, #fbf2de);
  box-shadow: 0 1px 0 #fff inset, 0 0 0 4px #d5bb8130, 0 18px 34px #58422220;
}
.display-case header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 3px 12px; }
.display-case h2 { margin: 0; font: 500 15px/1.4 Georgia, "Songti SC", SimSun, serif; letter-spacing: .12em; }
.display-case progress { width: clamp(64px, 17%, 112px); height: 4px; border: 0; background: #cfba94; color: #866537; accent-color: #866537; }
.display-case progress::-webkit-progress-bar { background: #cfba94; }
.display-case progress::-webkit-progress-value { background: #866537; }
.pin-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  align-content: start;
  gap: clamp(10px, 2vw, 26px);
  min-height: 0;
  padding: clamp(12px, 2.4vw, 30px);
  border: 1px solid #b99c65;
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% -10%, #fff9e8 4%, #fff5daa3 34%, transparent 70%),
    repeating-linear-gradient(90deg, #8f73490b 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, #fff3 0 1px, transparent 1px 3px), #e0cfac;
  box-shadow: inset 0 5px 16px #75593d42, inset 0 -1px 4px #87663730;
}
#pinRoom .badge-button { display: grid; grid-template-rows: auto auto auto 1fr; justify-items: center; gap: 6px; color: var(--ink); text-align: center; }
.badge-mount { display: block; width: 100%; max-width: 210px; margin-bottom: 6px; background: radial-gradient(ellipse at 50% 48%, #fff9e7a8, transparent 72%); }
.badge-button img { width: 100%; max-width: none; height: auto; filter: drop-shadow(0 9px 6px #62462454); }
.badge-button.unowned img {
  filter: grayscale(1) sepia(.34) contrast(.76) brightness(1.04) drop-shadow(0 1px 1px #fff6d8) drop-shadow(1px 5px 3px #6756388c);
}
.badge-button strong { font: 600 clamp(12px, 1.5vw, 16px)/1.45 Georgia, "Songti SC", SimSun, serif; text-wrap: balance; overflow-wrap: anywhere; padding-inline: 2px; }
.badge-button .catalog-number { font-size: 10px; letter-spacing: .16em; color: #644c2e; }
.badge-button .catalog-state { color: #625137; font-size: 11px; }

#pinRoom .collection-entry {
  width: 100%; padding: clamp(14px, 2.2vw, 28px); border: 1px solid #c4a87665; border-radius: 10px;
  background: #fffaf0; color: #2d3140; box-shadow: 0 10px 24px #58422213;
}
.entry-book {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  min-height: 230px; padding: 32px 16px; border-radius: 4px 10px 10px 4px; color: #f1d9a5;
  background: linear-gradient(90deg, #090f1b, #344561 4%, #14233d 9%, transparent 26%), radial-gradient(ellipse at 40% 20%, #334866, #111e34 74%);
  box-shadow: inset 1px 0 #91a0b04f, inset -3px 0 #090e18, 3px 5px 0 #c9ad7c, 5px 13px 15px #2122354a;
  transition: transform .28s ease;
}
.entry-book::after { content: ""; position: absolute; inset: 9% 8% 8% 11%; border: 1px solid #d7b87e9a; border-radius: 2px 5px 5px 2px; pointer-events: none; }
.collection-entry:hover .entry-book { transform: translateY(-4px) rotate(-2deg); }
.entry-book > span, .cover-title small { font: 500 8px/1.2 system-ui, sans-serif; letter-spacing: .24em; }
.entry-book > strong { font: 500 clamp(18px, 2.5vw, 34px)/1.02 Georgia, serif; }
.entry-label { display: flex; justify-content: space-between; gap: 5px; margin: 24px 0 0; font-size: 14px; }

.book-view { min-height: auto; }
.album-topbar .quiet-action, .album-topbar .round-action { border-color: #b99c634e; background: #fffdf7; }
.is-editing #editMode { color: #f8e5bc; background: var(--navy); }
.book-view:not(.is-editing) .album-menu button:not([data-action="export"]) { display: none; }
.book-stage { min-height: 0; padding: clamp(34px, 6vw, 82px) 0 clamp(30px, 5vw, 74px); }
.memory-book { --book-w: 100%; max-width: 810px; height: auto; max-height: none; transform: none; filter: none; }
.memory-book::before { content: ""; display: block; padding-top: 62.5%; }
.book-stage.is-front-closed .memory-book { transform: translateX(-25%) rotateY(-5deg); filter: none; }
.book-stage.is-back-closed .memory-book { transform: translateX(25%) rotateY(5deg); filter: none; }
.book-board {
  border: 0; border-radius: 10px 4px 4px 10px;
  background: linear-gradient(150deg, #353f52, #10192a 45%, #202e45);
  box-shadow: inset 0 0 0 1px #c7a87591, inset 0 0 0 5px #101a2e, 0 13px 25px #1419313d;
}
.book-board-right { border-radius: 4px 10px 10px 4px; }
.book-leaf { border-radius: 8px; }
.leaf-face {
  border: 0; border-radius: 3px 8px 8px 3px;
  background: radial-gradient(ellipse at 31% 12%, #e3eeff25, transparent 77%), linear-gradient(130deg, transparent 35%, #060b1a5c), var(--page-color, #14233d);
  box-shadow: inset 0 0 12px #080c1780, 2px 3px 8px #090f1a65;
}
.leaf-back { border-radius: 8px 3px 3px 8px; }
.leaf-face[data-texture="velvet"]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url('/web/v3/assets/pins/texture-velvet.jpg') center / 260px repeat;
  opacity: .24; mix-blend-mode: soft-light;
}
.leaf-face[data-texture="satin"] { background: linear-gradient(143deg, #effaff26 3%, #e2eaff0a 36%, #fff2 54%, #0207145c 93%), var(--page-color); }
.leaf-face::after { inset: 3.5%; border-color: #d2b37e85; border-radius: 3px; }
.cover-face {
  background: linear-gradient(145deg, #c1d5fa29, transparent 50%, #0b112b72), var(--cover-color, #14233d);
  border: 0; box-shadow: inset 0 0 0 1px #c5a477, inset 0 0 14px #0a10258c, 3px 4px 0 #977e55, 6px 12px 25px #11192f5c;
}
.cover-face::after { inset: 6.5% 7.5%; border-color: #d2b37eab; border-radius: 4px; }
.cover-title { display: grid; gap: 10px; text-align: center; color: #f0d6a0; text-shadow: 0 1px 2px #1a1329; padding: 12%; }
.cover-title strong { font: 500 clamp(13px, 4vw, 48px)/1.02 Georgia, serif; }
.cover-decoration { position: absolute; top: 20%; width: 46%; height: 42%; border: 1px solid #d3b984; border-radius: 3px; }
.cover-decoration + .cover-title { align-self: end; padding-bottom: 15%; }
.cover-decoration + .cover-title strong { font-size: clamp(12px, 2.8vw, 32px); }
.page-mark { color: #e2c58c; z-index: 0; font-size: clamp(8px, 1.2vw, 13px); right: 7%; bottom: 5%; }
.page-number { margin: -17px 0 0; color: #6c5638; }
.book-view:not(.is-editing) .album-item { cursor: inherit; pointer-events: none; }
.book-view:not(.is-editing) .leaf-face { touch-action: pan-y; }
.album-item { isolation: isolate; }
.album-item img { box-sizing: border-box; }
.album-item.is-selected { outline-offset: 2px; }
.item-handle.handle-delete { left: 0; top: 0; }
.item-handle.handle-flip { left: 0; bottom: 0; }
.item-handle.handle-transform { right: 0; bottom: 0; }
.badge-tray { max-width: 810px; margin: 20px auto 0; border: 1px solid #b99c635d; border-radius: 8px; background: #fffaf0; }
.badge-tray summary { min-height: 44px; padding: 12px 16px; cursor: pointer; color: #674d28; }
.tray-content { padding: 0 16px 14px; }
.tray-content select, .finish-field select { min-height: 44px; margin-left: 8px; padding: 4px 9px; border: 1px solid #b99c635d; border-radius: 4px; background: #fffdf7; color: #202a37; }
.tray-items { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tray-items button { display: flex; gap: 8px; align-items: center; padding: 4px 10px; border: 1px solid #b99c634f; border-radius: 6px; background: #fffdf7; color: #302d35; }
.tray-items img { width: 42px; height: 42px; object-fit: contain; }
.finish-dialog { max-width: 420px; }
.finish-field { display: block; margin: 14px 0; }
.color-choice[aria-pressed="true"] { box-shadow: 0 0 0 3px #927040; }

@media (max-width: 820px) {
  .collection-layout { grid-template-columns: minmax(0, 2fr) minmax(152px, 1fr); }
  .entry-book { min-height: 154px; }
}
@media (max-width: 599px) {
  .collection-layout { grid-template-columns: 1fr; }
  .pin-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #pinRoom .collection-entry { display: grid; grid-template-columns: 106px 1fr; align-items: center; gap: 22px; text-align: left; }
  .entry-book { min-height: 102px; padding: 14px 8px; gap: 7px; }
  .entry-label { margin: 0; }
  .album-topbar { gap: 5px; }
  .album-state { gap: 5px; }
  .album-state > span { max-width: 100px; text-align: right; }
  .book-stage { padding-block: 52px; }
  .item-handle { width: 20px !important; height: 20px !important; min-height: 20px !important; font-size: 12px !important; }
}
