/* Family album: rotating 3D banner + Facebook-style viewer with reactions and comments */
.album-block { background: radial-gradient(1200px 500px at 50% 0%, #ffe9f3 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #dff5ff 0%, transparent 60%), linear-gradient(180deg, #fff, #f6f3ff); overflow: hidden; }
.album { position: relative; margin: 10px auto 0; user-select: none; -webkit-user-select: none; }
.album-stage { position: relative; height: clamp(330px, 56vw, 470px); perspective: 1500px; perspective-origin: 50% 42%; touch-action: pan-y; cursor: grab; }
.album-stage.grabbing { cursor: grabbing; }
.album-ring { position: absolute; left: 50%; top: 50%; width: var(--cw, 210px); height: var(--ch, 290px); margin: calc(var(--ch, 290px) / -2) 0 0 calc(var(--cw, 210px) / -2); transform-style: preserve-3d; will-change: transform; }
.album-card { position: absolute; inset: 0; padding: 0; border: 0; border-radius: 22px; overflow: hidden; background: #fff; cursor: pointer; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(60, 40, 120, .28), 0 0 0 5px #fff; transition: filter .3s, box-shadow .3s; filter: saturate(.9) brightness(.94); }
.album-card.front { filter: none; box-shadow: 0 26px 60px rgba(124, 58, 237, .38), 0 0 0 5px #fff, 0 0 0 9px rgba(255, 193, 7, .75); }
.album-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ac-shine { position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.38) 0%, rgba(255,255,255,0) 38%, rgba(255,255,255,0) 100%); pointer-events: none; }
.ac-cap { position: absolute; inset-inline: 0; bottom: 0; padding: 38px 12px 38px; color: #fff; font-weight: 700; font-size: .95rem; text-align: start; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  background: linear-gradient(transparent, rgba(20, 10, 50, .78)); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ac-meta { position: absolute; inset-inline: 10px; bottom: 9px; display: flex; gap: 8px; }
.ac-meta > span { background: rgba(255,255,255,.92); color: #3b2a66; border-radius: 20px; padding: 2px 10px; font-size: .85rem; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.album-ctrl { display: flex; justify-content: center; gap: 14px; margin-top: 6px; }
.album-ctrl button { width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.7rem; line-height: 1; color: #6d28d9; background: #fff; box-shadow: 0 8px 20px rgba(109, 40, 217, .25); transition: transform .15s; }
.album-ctrl button:hover { transform: translateY(-3px) scale(1.06); background: #6d28d9; color: #fff; }
@media (max-width: 640px) { .album-ctrl button { width: 46px; height: 46px; } }

/* ----- glossy "3D" emoji orbs ----- */
.orb { --tint: #ffd54a; display: inline-flex; align-items: center; justify-content: center; width: 1.9em; height: 1.9em; border-radius: 50%; font-size: 1em; line-height: 1; position: relative; flex: 0 0 auto;
  background: radial-gradient(circle at 32% 24%, #fff 0, #fff 8%, var(--tint) 62%, color-mix(in srgb, var(--tint) 70%, #000) 100%);
  box-shadow: inset 0 -4px 7px rgba(0,0,0,.16), inset 0 3px 5px rgba(255,255,255,.8), 0 5px 10px rgba(0,0,0,.22); transition: transform .18s cubic-bezier(.3,1.6,.5,1); }
.orb > i { font-style: normal; font-size: 1.05em; filter: drop-shadow(0 2px 1px rgba(0,0,0,.25)); }
.orb.like { --tint: #6bb4ff; } .orb.love { --tint: #ff7a9c; } .orb.haha { --tint: #ffd54a; } .orb.wow { --tint: #ffc83a; } .orb.sad { --tint: #ffcf5a; } .orb.care { --tint: #ffb74a; }
.orb.sm { font-size: .72em; margin-inline-end: -6px; box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0,0,0,.25); }
.orb.t { --tint: #e6e0ff; }

/* ----- viewer ----- */
.av { position: fixed; inset: 0; z-index: 9400; display: none; background: rgba(12, 8, 30, .88); backdrop-filter: blur(6px); }
.av.open { display: flex; animation: avIn .25s ease; }
@keyframes avIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.av-media { position: relative; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-width: 0; padding: 18px; }
.av-media img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.av-nav, .av-x { position: absolute; border: 0; cursor: pointer; border-radius: 50%; width: 52px; height: 52px; font-size: 1.8rem; line-height: 1; background: rgba(255,255,255,.92); color: #4c1d95; box-shadow: 0 6px 18px rgba(0,0,0,.35); z-index: 2; }
.av-nav:hover, .av-x:hover { background: #ffc107; }
.av-prev { inset-inline-start: 14px; top: 50%; margin-top: -26px; } .av-next { inset-inline-end: 14px; top: 50%; margin-top: -26px; } .av-x { top: 14px; inset-inline-start: 14px; font-size: 1.4rem; }
.av-side { flex: 0 0 410px; max-width: 100%; background: #fff; display: flex; flex-direction: column; min-height: 0; }
.av-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px 8px; }
.av-ava { width: 46px; height: 46px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; flex: 0 0 auto; background: linear-gradient(135deg, var(--a, #7c3aed), var(--b, #ec4899)); }
.av-head b { display: block; font-size: 1.05rem; } .av-head small { color: #6b7280; }
.av-cap { padding: 2px 18px 10px; font-size: 1.05rem; line-height: 1.6; }
.av-stats { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; border-top: 1px solid #eee; color: #4b5563; font-size: .95rem; min-height: 44px; }
.av-sum { display: flex; align-items: center; gap: 4px; }
.av-react { display: flex; justify-content: space-around; padding: 10px 8px 12px; border-top: 1px solid #eee; border-bottom: 1px solid #eee; background: linear-gradient(180deg, #faf7ff, #fff); }
.av-react button { border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 1.5rem; padding: 2px 4px; color: #4b5563; }
.av-react button span.l { font-size: .72rem; font-weight: 600; }
.av-react button:hover .orb, .av-react button:focus-visible .orb { transform: translateY(-7px) scale(1.28) rotate(-6deg); }
.av-react button.on .orb { transform: translateY(-4px) scale(1.2); box-shadow: inset 0 -4px 7px rgba(0,0,0,.16), 0 0 0 3px #7c3aed, 0 8px 16px rgba(124,58,237,.4); }
.av-react button.on span.l { color: #6d28d9; }
.av-react.locked button { opacity: .55; }
.av-list { flex: 1 1 auto; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; min-height: 120px; }
.av-c { display: flex; gap: 10px; align-items: flex-start; }
.av-c .av-ava { width: 36px; height: 36px; font-size: .95rem; }
.av-bub { background: #f1eefb; border-radius: 18px; padding: 8px 14px; max-width: 100%; word-break: break-word; }
.av-bub b { font-size: .92rem; display: inline-block; margin-inline-end: 6px; } .av-bub p { margin: 2px 0 0; font-size: 1rem; line-height: 1.55; }
.av-bub.congrats { background: linear-gradient(135deg, #fff3c4, #ffe0ec); } .av-bub.condolence { background: #e8eef5; }
.av-tag { font-size: .75rem; background: #fff; border-radius: 10px; padding: 1px 8px; color: #6d28d9; }
.av-meta { font-size: .78rem; color: #6b7280; padding: 2px 10px; } .av-meta button { border: 0; background: none; color: #b91c1c; cursor: pointer; font-size: .78rem; }
.av-empty { text-align: center; color: #6b7280; padding: 26px 8px; }
.av-compose { border-top: 1px solid #eee; padding: 10px 14px 14px; background: #fff; }
.av-kinds { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.av-kinds button { border: 1.5px solid #ddd; background: #fff; border-radius: 20px; padding: 4px 12px; cursor: pointer; font-size: .9rem; }
.av-kinds button.on { border-color: #7c3aed; background: #f3ecff; color: #5b21b6; font-weight: 700; }
.av-phr { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; padding-bottom: 2px; } .av-phr button { white-space: nowrap; border: 0; background: #fff3c4; border-radius: 14px; padding: 4px 10px; cursor: pointer; font-size: .85rem; }
.av-row { display: flex; gap: 8px; align-items: flex-end; }
.av-row textarea { flex: 1; resize: none; border: 1.5px solid #ddd; border-radius: 20px; padding: 10px 14px; font: inherit; font-size: 1rem; min-height: 46px; max-height: 120px; }
.av-row textarea:focus { outline: 0; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.18); }
.av-send { border: 0; border-radius: 50%; width: 46px; height: 46px; background: linear-gradient(135deg, #7c3aed, #ec4899); color: #fff; font-size: 1.2rem; cursor: pointer; flex: 0 0 auto; }
.av-send:disabled { opacity: .5; }
.av-emo { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; } .av-emo button { border: 0; background: none; cursor: pointer; font-size: 1.15rem; padding: 2px; } .av-emo button:hover .orb { transform: translateY(-4px) scale(1.25) rotate(8deg); }
.av-err { color: #b91c1c; font-size: .85rem; min-height: 1.1em; }
.av-guest { text-align: center; padding: 16px; background: #faf7ff; border-top: 1px solid #eee; } .av-guest p { margin: 0 0 10px; font-weight: 600; } .av-guest a { margin: 0 4px; }
.av-del { margin: 0 18px 8px; } .av-del button { border: 0; background: none; color: #b91c1c; cursor: pointer; font-size: .85rem; }
@media (max-width: 820px) {
  .av.open { flex-direction: column; overflow-y: auto; }
  .av-media { flex: 0 0 auto; height: 44vh; padding: 56px 10px 8px; } .av-side { flex: 1 0 auto; max-width: none; } .av-list { max-height: none; overflow: visible; }
  .av-nav { width: 44px; height: 44px; } .av-x { top: 8px; }
}
body.av-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .orb, .album-card, .av.open { transition: none; animation: none; } }
