/* 나의 재즈 선반 */
.shelf-hero { padding-bottom: clamp(24px, 4vw, 40px); border-bottom: 0; }
.shelf-app { padding-top: 0 !important; }
.shelf-wrap { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.shelf-board { position: sticky; top: 88px; }
.shelf-grid { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--band-bg); border-radius: 16px; }
.shelf-grid li { aspect-ratio: 1; border-radius: 4px; overflow: hidden; }
.shelf-grid li.empty { display: flex; align-items: center; justify-content: center; border: 1px dashed rgba(255,255,255,.18); color: rgba(255,255,255,.35); font-family: "EB Garamond", Georgia, serif; font-size: 22px; }
.shelf-grid button { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.shelf-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shelf-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 22px; text-align: center; opacity: 0; transition: opacity .2s; }
.shelf-grid button:hover .shelf-x, .shelf-grid button:focus-visible .shelf-x { opacity: 1; }
@media (hover: none) { .shelf-x { opacity: 1; } }
.shelf-count { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); text-align: center; }
.shelf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.shelf-actions .btn { cursor: pointer; font: inherit; }
.shelf-actions .btn[disabled] { opacity: .4; cursor: default; }
.shelf-search input { width: 100%; font: inherit; font-size: 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); color: var(--ink); }
.shelf-search input:focus { outline: none; border-color: var(--ink-3); }
.shelf-hint { margin: 12px 4px 16px; font-size: 13px; color: var(--ink-2); }
.shelf-results li { min-width: 0; }
.shelf-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px 12px; }
.shelf-results button { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.shelf-results img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 4px; outline: 3px solid transparent; outline-offset: -3px; transition: opacity .2s; }
.shelf-results button.on img { outline-color: var(--ink); opacity: .55; }
.shelf-results button.on .shelf-t::before { content: "✓ "; }
.shelf-t { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-a { display: block; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#shelf-more { margin-top: 24px; cursor: pointer; font: inherit; }
.shelf-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 20px; }
.shelf-modal[hidden] { display: none; }
.shelf-modal-box { background: var(--bg); border-radius: 16px; padding: 18px; max-width: 440px; width: 100%; max-height: 100%; overflow: auto; }
.shelf-modal-box img { display: block; width: 100%; height: auto; border-radius: 8px; }
body.shelf-open { overflow: hidden; }
@media (max-width: 860px) {
  .shelf-wrap { grid-template-columns: minmax(0, 1fr); }
  .shelf-board { position: static; }
  .shelf-grid { max-width: 300px; margin: 0 auto; padding: 10px; gap: 6px; }
  .shelf-count { margin-top: 8px; }
  .shelf-actions { margin-top: 8px; }
  .shelf-results { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
}
/* 선반 색 (이미지와 같은 느낌으로) */
.shelf-grid { touch-action: none; user-select: none; -webkit-user-select: none; }
.shelf-grid.theme-walnut { background: radial-gradient(circle at 50% 30%, #4b3a2b, #18110c); }
.shelf-grid.theme-oak { background: radial-gradient(circle at 50% 30%, #f5efe5, #d8ccbb); }
.shelf-grid.theme-oak li.empty { border-color: rgba(0,0,0,.18); color: rgba(0,0,0,.35); }
.shelf-grid.theme-black { background: radial-gradient(circle at 50% 30%, #222, #060606); }
.shelf-grid li { position: relative; box-shadow: 0 6px 14px rgba(0,0,0,.35); transition: transform .15s, outline-color .15s; outline: 3px solid transparent; outline-offset: 2px; }
.shelf-grid li.empty { box-shadow: none; }
.shelf-grid li.over { outline-color: #F2C14E; transform: scale(1.04); }
.shelf-results img, .shelf-grid img { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.shelf-ghost { position: fixed; left: 0; top: 0; width: 80px; height: 80px; border-radius: 4px; pointer-events: none; z-index: 200;
  box-shadow: 0 12px 30px rgba(0,0,0,.45); opacity: .92; }
body.shelf-dragging, body.shelf-dragging * { cursor: grabbing !important; }
#shelf-more[hidden] { display: none; }
/* 이름 + 색 고르기: 한 줄 (이름 칸은 남는 폭을 다 쓰고, 색은 작은 동그라미 3개) */
.shelf-opts { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.shelf-name { flex: 1; min-width: 0; }
.shelf-name input { width: 100%; font: inherit; font-size: 15px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); color: var(--ink); }
.shelf-themes { display: flex; gap: 8px; flex: none; }
.shelf-themes button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.shelf-themes button[data-theme="walnut"] { background: linear-gradient(135deg, #8a5c36, #4a2e18); }
.shelf-themes button[data-theme="oak"] { background: linear-gradient(135deg, #ecd0a4, #b98f58); }
.shelf-themes button[data-theme="black"] { background: linear-gradient(135deg, #444, #0a0a0a); }
.shelf-themes button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
/* 만들기 버튼은 크게, 비우기는 작은 글자 버튼 */
.shelf-board .shelf-actions { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 14px; }
.shelf-board .shelf-actions .btn-solid { width: 100%; text-align: center; }
.shelf-clear { align-self: center; font: inherit; font-size: 13px; color: var(--ink-2); background: none; border: 0; padding: 6px 10px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
/* 이미지 창: 닫기는 오른쪽 위 X (선반의 빼기 표시와 같은 모양) */
.shelf-modal-box { position: relative; }
.shelf-modal-x { position: absolute; top: 26px; right: 26px; z-index: 1; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.6); color: #fff; font-size: 22px; line-height: 34px; text-align: center; padding: 0; cursor: pointer; }
.shelf-modal-x:hover { background: rgba(0,0,0,.8); }
.shelf-tip { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); text-align: center; }
.shelf-tip[hidden] { display: none; }
