/* Frames board v2 (17 Nov 2026): a neat gallery wall.
   Only released paintings, all the same size (2:3) in gold frames, tiled as big as the screen allows.
   Drag to look around, pinch or ctrl + scroll to zoom. Tap a painting: its name shows at the top
   and its notes open underneath. Owner reorders with gallery.html?edit plus the admin password. */
html:has(body.board-page), body.board-page { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.board-page { background: #120f0b; }
body.board-page .mini-foot { display: none; }

/* The wall: plain, warm and dark, softly lit from the top */
.board { position: fixed; inset: 0; z-index: 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: radial-gradient(130% 80% at 50% 18%, #2b241b 0%, #18140f 52%, #0b0907 100%); }
.board.dragging { cursor: grabbing; }
.board-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.board-world.glide { transition: transform .45s cubic-bezier(.2,.75,.2,1); }

/* A painting in its gold frame (sizes are board units; the board scales them) */
.bd-item { position: absolute; width: 332px; padding: 16px; border: 0; border-radius: 2px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: linear-gradient(135deg, #fff2c6 0%, #e6bb5f 14%, #a87828 34%, #f4d488 52%, #b8862f 72%, #e9c46f 86%, #7a5419 100%);
  box-shadow: 0 30px 60px rgba(0,0,0,.6), 0 8px 18px rgba(0,0,0,.45),
    inset 0 0 0 1.5px rgba(255,244,210,.8), inset 0 0 0 5px rgba(122,84,25,.38), inset 0 0 0 7px rgba(255,236,186,.28);
  transition: left .3s ease, top .3s ease, box-shadow .3s ease; }
/* Soft spotlight on the wall above each frame */
.bd-item::before { content: ""; position: absolute; z-index: -1; left: -32%; right: -32%; top: -26%; height: 80%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,226,160,.20), rgba(255,226,160,0) 70%); }
.bd-item img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: #1a1712; pointer-events: none; -webkit-user-drag: none;
  box-shadow: 0 0 0 2px #3a2709, 0 0 0 4px rgba(250,222,150,.75); }
/* Brass name plate under the frame */
.bd-plate { position: absolute; left: 50%; top: calc(100% + 14px); transform: translateX(-50%); padding: 3px 16px; border-radius: 3px;
  background: linear-gradient(180deg, #2c2318, #17120b); border: 1px solid rgba(233,199,126,.55); box-shadow: 0 6px 14px rgba(0,0,0,.5);
  color: #f3d48a; font: 600 24px/1.25 "Playfair Display", Georgia, serif; letter-spacing: .14em; white-space: nowrap; }
.bd-item.sel { box-shadow: 0 0 0 5px rgba(243,212,138,.5), 0 0 70px rgba(243,212,138,.45), 0 30px 60px rgba(0,0,0,.6),
    inset 0 0 0 1.5px rgba(255,244,210,.8), inset 0 0 0 5px rgba(122,84,25,.38), inset 0 0 0 7px rgba(255,236,186,.28); }
.editing .bd-item { cursor: grab; outline: 3px dashed rgba(243,212,138,.55); outline-offset: 12px; }
.bd-item.lifted { z-index: 5; transition: none; cursor: grabbing; }
.bd-empty { position: fixed; z-index: 1; inset: 0; display: grid; place-items: center; margin: 0; color: rgba(243,233,214,.6); font-size: 15px; pointer-events: none; }

/* Title over the board: shows the latest frame, or the painting you tapped */
.bd-head { position: fixed; z-index: 2; left: 18px; right: 18px; top: 72px; pointer-events: none; text-shadow: 0 2px 12px rgba(0,0,0,.85); }
.bd-head h1 { margin: 0; font: 400 36px/1 "Playfair Display", Georgia, serif; color: #f3d48a; letter-spacing: .04em; }
.bd-head h1 small { margin-right: 8px; font-size: 13px; letter-spacing: .32em; color: #f3e9d6; vertical-align: 7px; }
.bd-head .fr-sub { margin: 6px 0 0; font: italic 400 17px/1.3 "Playfair Display", Georgia, serif; color: #f3e9d6; transition: color .3s; }
.bd-head.picked .fr-sub { color: #f8dc97; font-size: 19px; }
.bd-head .fr-next { margin: 4px 0 0; font-size: 12.5px; color: rgba(243,233,214,.7); }

/* Zoom buttons and first-visit hint */
.bd-tools { position: fixed; z-index: 2; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.bd-tools button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(233,199,126,.4); background: rgba(14,11,10,.86); color: #f3e9d6;
  font: 500 22px/1 "Inter Tight", system-ui, sans-serif; cursor: pointer; }
.bd-hint { position: fixed; z-index: 2; left: 14px; bottom: calc(22px + env(safe-area-inset-bottom)); margin: 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(14,11,10,.86); color: rgba(243,233,214,.85); font-size: 12.5px; pointer-events: none; transition: opacity .8s; }
.bd-hint.gone { opacity: 0; }

/* Notes panel under the painting (no dark cover, so the wall and title stay visible) */
.bd-sheet { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; pointer-events: none; }
.bd-sheet[hidden] { display: none; }
.bd-sheet-in { position: relative; pointer-events: auto; width: min(560px, 100%); max-height: 46vh; overflow-y: auto; padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  background: rgba(21,19,15,.97); border: 1px solid rgba(233,199,126,.3); border-bottom: 0; border-radius: 20px 20px 0 0; color: #f3e9d6;
  box-shadow: 0 -12px 40px rgba(0,0,0,.55); animation: bd-up .3s cubic-bezier(.2,.8,.2,1); }
@keyframes bd-up { from { transform: translateY(100%); } to { transform: none; } }
.bd-x { position: absolute; top: 10px; right: 12px; z-index: 1; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: 21px; line-height: 1; cursor: pointer; }
.sh-label { margin: 2px 0 0; font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: #e9c77e; }
.sh-notes { margin: 6px 44px 0 0; font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; color: rgba(243,233,214,.92); }
.sh-notes.empty { color: rgba(243,233,214,.5); font-style: italic; }
.sh-owner { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(233,199,126,.08); border: 1px solid rgba(233,199,126,.28); font-size: 14.5px; color: #f3e9d6; }
.sh-owner b { color: #f3d48a; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.sh-actions a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px;
  color: #1c1408; background: linear-gradient(180deg, #f8dc97, #dca64b); }
.sh-actions a.ghost { color: #f3e9d6; font-weight: 600; background: transparent; border: 1px solid rgba(243,233,214,.35); }
.sh-actions a[hidden] { display: none; }

/* Owner editing */
.sh-edit { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(233,199,126,.35); display: grid; gap: 10px; }
.sh-edit[hidden] { display: none; }
.sh-edit label { display: grid; gap: 4px; font-size: 12.5px; color: rgba(243,233,214,.7); }
.sh-edit textarea, .sh-edit input, .bd-login input { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; color: #f3e9d6; background: #0f0e0b; border: 1px solid rgba(233,199,126,.3); }
.bd-editbar button, .bd-editbar a, .bd-login button { font: inherit; font-weight: 600; font-size: 14px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid rgba(233,199,126,.45); background: rgba(14,11,10,.92); color: #f3e9d6; cursor: pointer; text-decoration: none; }
.bd-editbar { position: fixed; z-index: 3; left: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 6px; align-items: center; max-width: calc(100vw - 84px);
  padding: 6px; border-radius: 999px; background: rgba(14,11,10,.92); border: 1px solid rgba(233,199,126,.45); }
.bd-editbar span { padding: 0 6px 0 8px; font-size: 12.5px; color: #f3d48a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-editbar .save, .bd-login button { background: linear-gradient(180deg, #f8dc97, #dca64b); color: #1c1408; border: 0; }
.bd-login { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.7); }
.bd-login[hidden] { display: none; }
.bd-login form { display: grid; gap: 12px; width: min(360px, 100%); padding: 20px; border-radius: 18px; background: #15130f; border: 1px solid rgba(233,199,126,.3); color: #f3e9d6; }
.bd-login p { margin: 0; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .board-world.glide, .bd-item { transition: none; } .bd-sheet-in { animation: none; } }
