/* ============ Shenanigo v9: memory books (the reel, the collage, every moment) ============ */
.mb-page { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; padding-bottom: 60px; }
.mb-loading { min-height: 50vh; display: grid; place-content: center; text-align: center; gap: 10px; color: var(--muted); }
.mb-spin { font-size: 54px; animation: mbFlip 1.6s var(--ease) infinite; }
@keyframes mbFlip { 0%, 100% { transform: rotateY(0) } 50% { transform: rotateY(180deg) } }
.mb-back { align-self: flex-start; font: 600 14px var(--f-body); color: var(--muted); text-decoration: none; }
.mb-back:hover { color: var(--text); }
.mb-head { display: flex; flex-direction: column; gap: 10px; }
.mb-title { font-size: clamp(38px, 6vw, 72px); line-height: 1; overflow-wrap: anywhere; }
.mb-sub { color: var(--muted); font-size: 16px; margin: 0; }
.mb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mb-chips span { padding: 6px 12px; border-radius: 99px; font: 600 13px var(--f-mono); color: #f5e2b0; background: rgba(216, 178, 90, 0.12); box-shadow: inset 0 0 0 1px rgba(240, 211, 138, 0.3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-warn { margin: 4px 0 0; padding: 10px 14px; border-radius: 14px; background: rgba(233, 169, 79, 0.12); box-shadow: inset 0 0 0 1px rgba(233, 169, 79, 0.35); font-size: 14px; }
.mb-page h2 { font-size: clamp(28px, 3.6vw, 42px); margin: 8px 0 10px; }

/* ---------- the reel ---------- */
.mb-reel, .mb-collage { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 32px; padding: 26px; align-items: center; }
.mb-collage { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
.mb-stage { position: relative; aspect-ratio: 9 / 16; width: 100%; max-height: 76vh; margin: 0 auto; border-radius: 22px; overflow: hidden; background: #0b0d12; box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.mb-canvas, .mb-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.mb-playbig { position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 248, 234, 0.92); color: #1f2632; font-size: 36px; box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), 0 0 0 10px rgba(255, 248, 234, 0.18); transition: transform 0.3s var(--spring); animation: mbPulse 2.4s ease-in-out infinite; }
.mb-playbig span { transform: translateX(4px); }
.mb-playbig:hover { transform: scale(1.06); }
.mb-playbig:active { transform: scale(0.94); }
@keyframes mbPulse { 0%, 100% { box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), 0 0 0 10px rgba(255, 248, 234, 0.18); } 50% { box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), 0 0 0 20px rgba(255, 248, 234, 0.06); } }
.mb-side, .mb-cside { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mb-label { font: 700 12px var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-top: 8px; }
.mb-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mb-pills button { padding: 9px 15px; min-height: 42px; border-radius: 99px; border: 0; cursor: pointer; font: 600 14px var(--f-body); color: var(--text); background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--line); transition: background 0.2s, box-shadow 0.2s, transform 0.2s var(--spring); }
.mb-pills button:active { transform: scale(0.95); }
.mb-pills button.on { color: #1d1100; background: linear-gradient(115deg, #f5e2b0, #ffb56b); box-shadow: 0 10px 24px -12px rgba(255, 150, 90, 0.9); }
.mb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.mb-hint { margin: 2px 0 0; color: var(--dim); font-size: 13.5px; line-height: 1.45; min-height: 1.4em; }

/* ---------- the collage ---------- */
.mb-cprev { position: relative; order: 2; width: 100%; max-width: 440px; margin: 0 auto; transition: opacity 0.25s; }
.mb-cprev.busy { opacity: 0.45; }
.mb-cprev img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 60px -26px rgba(0, 0, 0, 0.9); transform: rotate(-1deg); }
.mb-skel { aspect-ratio: 4 / 5; border-radius: 10px; background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 70%); background-size: 300% 100%; animation: mbShimmer 1.4s linear infinite; }
@keyframes mbShimmer { to { background-position: -150% 0; } }

/* ---------- every moment ---------- */
.mb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px 22px; margin-top: 18px; }
.mb-pol { margin: 0; padding: 12px 12px 14px; background: #fcfaf4; color: #1f2632; border-radius: 4px; transform: rotate(var(--r)); box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.85); transition: transform 0.35s var(--spring); }
.mb-pol:hover { transform: rotate(0) scale(1.03); z-index: 1; }
.mb-pol > img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #ddd; }
.mb-pol figcaption { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; }
.mb-pol figcaption b { font: 700 14px var(--f-body); }
.mb-pol figcaption small { color: #5b6270; font-size: 12px; }
.mb-pol figcaption i { font-style: normal; color: #b8452f; }
.hand { font-family: 'Caveat', 'Chewy', cursive; font-size: 22px; line-height: 1.1; }
.mb-tn { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mb-tn div { position: relative; }
.mb-tn img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #ddd; }
.mb-tn div:first-child img { filter: sepia(0.85) contrast(1.05); }
.mb-tn span { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 6px; font: 700 11px var(--f-mono); color: #fff; background: rgba(0, 0, 0, 0.6); }
.mb-note { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; min-height: 180px; border-radius: 4px; color: #2b2410; background: #f7e7a1; transform: rotate(var(--r)); box-shadow: 0 18px 36px -20px rgba(0, 0, 0, 0.85); }
.mb-note:nth-child(3n) { background: #f9cfd0; }
.mb-note:nth-child(3n + 1) { background: #cfe6f5; }
.mb-note .ic { font-size: 32px; }
.mb-note b { font: 700 14px var(--f-body); }
.mb-note p { margin: 0; font-size: 26px; }
.mb-note small { margin-top: auto; color: rgba(43, 36, 16, 0.65); font-size: 12px; }

/* ---------- the premiere (full screen, recording) ---------- */
body.mb-theater-on { overflow: hidden; }
.mb-theater { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); background: #050608; animation: fadeIn 0.3s both; }
.mb-th-frame { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.mb-th-frame canvas { height: 100%; max-width: 100%; aspect-ratio: 9 / 16; object-fit: contain; border-radius: 16px; }
.mb-th-bar { width: min(420px, 100%); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.mb-th-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f5e2b0, #ffb56b); }
.mb-th-ctl { width: min(420px, 100%); display: flex; align-items: center; gap: 10px; }
.mb-th-rec { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font: 600 12.5px var(--f-mono); color: rgba(255, 255, 255, 0.75); }
.mb-th-rec i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; animation: mbBlink 1s steps(2) infinite; }
@keyframes mbBlink { 50% { opacity: 0.2; } }

/* ---------- the celebration's memory-book button, and the journal tag ---------- */
.cel6-book { width: 100%; margin-top: 18px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px 12px 12px; border: 0; border-radius: 20px; text-align: left; cursor: pointer; color: #1f2632;
  background: linear-gradient(115deg, #fbf4e3, #f1e0b8); box-shadow: 0 20px 44px -18px rgba(240, 211, 138, 0.75); animation: fadeUp 0.6s var(--ease) 1.25s both; transition: transform 0.3s var(--spring); }
.cel6-book:active { transform: scale(0.97); }
.cel6-book-th { width: 58px; height: 72px; display: grid; place-items: center; font-size: 30px; border-radius: 6px; background: #fff; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.5); transform: rotate(-4deg); overflow: hidden; }
.cel6-book-th.has { animation: mbPop 0.5s var(--spring); }
.cel6-book-th img { width: 100%; height: 100%; object-fit: cover; }
@keyframes mbPop { from { transform: rotate(-4deg) scale(0.6); } }
.cel6-book b { display: block; font: 800 17px/1.2 var(--f-display); }
.cel6-book small { display: block; font-size: 13px; opacity: 0.75; }
.cel6-book .go { font: 700 13px var(--f-body); white-space: nowrap; }
.polaroid .ph { position: relative; }
.mb-tag { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.6); }

@media (max-width: 820px) {
  .mb-reel, .mb-collage { grid-template-columns: minmax(0, 1fr); padding: 18px; gap: 20px; }
  .mb-stage { max-height: 70vh; width: auto; }
  .mb-cprev { order: -1; }
  .mb-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
  .mb-note p { font-size: 21px; }
  .cel6-book { grid-template-columns: 48px minmax(0, 1fr); } .cel6-book .go { display: none; } .cel6-book-th { width: 48px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) { .mb-playbig, .mb-spin, .mb-th-rec i { animation: none; } }

/* ---------- snaps: the camera button beside the main action, and its save sheet ---------- */
.p6-dock-in.has-snap { display: flex; gap: 6px; align-items: stretch; }
.p6-dock-in.has-snap .p6-go { flex: 1; min-width: 0; }
.p6-dock-in.has-snap.only { display: flex; justify-content: flex-end; width: max-content; margin-left: auto; }
.p6-snap { position: relative; flex: none; width: 60px; min-height: 60px; display: grid; place-items: center; border-radius: 18px; cursor: pointer; font-size: 26px;
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line-2); transition: transform 0.25s var(--spring), background 0.2s; -webkit-tap-highlight-color: transparent; }
.p6-snap:hover { background: rgba(255, 255, 255, 0.1); }
.p6-snap:active { transform: scale(0.92); }
.p6-snap:focus-within { outline: 2px solid #f0d38a; outline-offset: 2px; }
.p6-snap b { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; font: 800 11.5px var(--f-mono); color: #1d1100; background: #f0d38a; box-shadow: 0 4px 10px -4px #000; }
.p6-snapsheet { display: flex; flex-direction: column; gap: 12px; }
.p6-snapsheet img { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 14px; background: #000; }
.p6-snapsheet p { margin: 0; font-size: 13.5px; }
.mb-pol { position: relative; }
.mb-del { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; font-size: 15px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.2s; }
.mb-pol:hover .mb-del, .mb-del:focus-visible { opacity: 1; }
@media (hover: none) { .mb-del { opacity: 1; } }
.mb-snaptag { color: #6f7d3e; font-style: normal; }
.mb-add { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin-top: 14px; }

/* ---------- optional photo / written steps (proof review off) ---------- */
.p6-optrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.p6-optrow span { flex: 1 1 200px; }

/* ---------- sharing: the memory-book switch, and community memories on the quest page ---------- */
.mb-share { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.cm-sec { display: flex; flex-direction: column; gap: 6px; }
.cm-h { font-size: clamp(26px, 3vw, 36px); margin: 8px 0 2px; }
.cm-sub a { color: var(--amber); }
.cm-locked { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.cm-locked p { margin: 4px 0 0; font-size: 14px; }
.cm-lock { flex: none; width: 56px; height: 56px; display: grid; place-items: center; font-size: 26px; border-radius: 16px; background: rgba(240, 211, 138, 0.1); box-shadow: inset 0 0 0 1px rgba(240, 211, 138, 0.3); }
.cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.cm-tile { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: #111; box-shadow: 0 12px 26px -16px #000; transition: transform 0.3s var(--spring); }
.cm-tile:hover { transform: translateY(-3px) rotate(-0.6deg); }
.cm-tile img, .cm-tile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cm-kind { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 99px; font: 700 11px var(--f-mono); color: #1d1100; background: #f0d38a; }
.cm-meta { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: 6px; padding: 22px 9px 8px; font: 600 12px var(--f-body); color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.78)); text-align: left; }
.cm-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-soc { display: flex; gap: 8px; white-space: nowrap; }
.cm-view { display: flex; flex-direction: column; gap: 12px; }
.cm-media img, .cm-media video { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 14px; background: #000; display: block; }
.cm-info { display: flex; flex-direction: column; gap: 2px; }
.cm-info small { color: var(--dim); }
.cm-info p { margin: 6px 0 0; }
.cm-reacts { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-reacts button { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 99px; cursor: pointer; font-size: 19px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s var(--spring); }
.cm-reacts button:active { transform: scale(0.9); }
.cm-reacts button.on { background: rgba(240, 211, 138, 0.18); box-shadow: inset 0 0 0 1.5px #f0d38a; }
.cm-reacts b { font: 700 13px var(--f-mono); color: var(--text); }
.cm-comments { display: flex; flex-direction: column; gap: 10px; max-height: 32vh; overflow: auto; }
.cm-c { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.cm-c p { margin: 2px 0 0; font-size: 14.5px; overflow-wrap: anywhere; }
.cm-cact { display: flex; gap: 2px; opacity: 0.6; }
.cm-say { display: flex; gap: 8px; }
.cm-say .input { flex: 1; min-width: 0; }
.cm-mod { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.mb-others { align-self: flex-start; margin-top: 4px; }
