/* Hattie's Scrapbook (SCRAPBOOK flag). Kraft pages, washi tape, stickers, handwritten titles. */
@font-face{font-family:"Patrick Hand";src:url("/fonts/patrick-hand-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
#mScrap.open{z-index:12;background:rgba(40,26,12,.55);padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom));align-items:center;justify-content:center}
#mScrap .scrap-book{position:relative;outline:none;width:min(440px,100%);max-height:100%;display:flex;flex-direction:column;gap:8px;padding:14px 12px 10px;border-radius:14px;
  background:#8a5a34 radial-gradient(circle at 20% 10%,rgba(255,255,255,.08),transparent 60%);box-shadow:0 18px 40px rgba(20,10,0,.45),inset 0 0 0 3px #6e4526,inset 0 0 0 5px rgba(255,220,170,.18)}
#mScrap .scrap-book:focus-visible{box-shadow:0 18px 40px rgba(20,10,0,.45),0 0 0 3px #ffe08a}
#mScrap .scrap-spread{position:relative;display:grid;grid-template-columns:1fr;gap:0;perspective:1400px;min-height:0;flex:1 1 auto;overflow:hidden;border-radius:8px;touch-action:pan-y}
#mScrap .scrap-spread.two{grid-template-columns:1fr 1fr}
#mScrap .scrap-spread.two::after{content:"";position:absolute;top:0;bottom:0;left:50%;width:18px;margin-left:-9px;background:linear-gradient(90deg,rgba(60,35,10,0),rgba(60,35,10,.28),rgba(60,35,10,0));pointer-events:none}
.scrap-page{position:relative;box-sizing:border-box;min-height:min(520px,calc(100dvh - 120px));max-height:calc(100dvh - 110px);overflow:auto;padding:30px 18px 16px;color:#3f2a14;
  background-color:#e6cc9c;background-image:radial-gradient(rgba(120,80,30,.10) 1px,transparent 1.4px),radial-gradient(rgba(255,255,255,.18) 1px,transparent 1.6px),linear-gradient(180deg,rgba(255,255,255,.18),rgba(120,80,30,.08));
  background-size:7px 7px,11px 11px,100% 100%;background-position:0 0,3px 5px,0 0;font:600 15px/1.5 Georgia,"Times New Roman",serif;display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;transform-origin:left center}
.scrap-spread.two .scrap-page:first-child{box-shadow:inset -10px 0 18px -12px rgba(60,35,10,.5)}
.scrap-spread.two .scrap-page:last-child{box-shadow:inset 10px 0 18px -12px rgba(60,35,10,.5)}
.scrap-page .tape{position:absolute;top:8px;width:74px;height:20px;opacity:.82;background:repeating-linear-gradient(45deg,rgba(255,255,255,.35) 0 5px,transparent 5px 10px),#e88b9a;box-shadow:0 1px 2px rgba(60,30,10,.18)}
.scrap-page .tape.t1{left:14px;transform:rotate(-8deg)}
.scrap-page .tape.t2{right:14px;transform:rotate(7deg);background:repeating-linear-gradient(-45deg,rgba(255,255,255,.4) 0 4px,transparent 4px 9px),#8cc7b4}
.scrap-page.cover .tape.t1{background:repeating-linear-gradient(90deg,rgba(255,255,255,.35) 0 6px,transparent 6px 12px),#f2c14e}
.scrap-page .hand{font-family:"Patrick Hand","Comic Sans MS","Segoe Print",cursive;font-weight:400;color:#5a2e12;margin:2px 0 0;line-height:1.1}
.scrap-page h2.hand{font-size:34px}
.scrap-page h3.hand{font-size:27px}
.scrap-page .pno{position:absolute;top:10px;left:50%;transform:translateX(-50%);font:800 11px Nunito,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:#7a5532}
.scrap-page .new-tag{position:absolute;top:34px;right:12px;font:800 11px Nunito,sans-serif;background:#c0392b;color:#fff;padding:3px 8px;border-radius:99px;transform:rotate(6deg)}
.scrap-page .sticker{margin:6px 0 2px;width:112px;height:112px;padding:6px;background:#fffaf0;border-radius:18px;box-shadow:0 2px 0 rgba(60,30,10,.12),0 6px 14px rgba(60,30,10,.22);transform:rotate(-3deg)}
.scrap-page.found:nth-child(2n) .sticker{transform:rotate(3deg)}
.scrap-page .sticker-svg{width:100%;height:100%;display:block}
.scrap-page.locked{background-color:#dcc293;color:#6b5236}
.scrap-page.locked .sticker{background:transparent;box-shadow:none;border:2px dashed rgba(110,75,40,.45);color:rgba(90,58,26,.2)}
.scrap-page.locked h3.hand{color:#8a6a48}
.scrap-page .dateline{margin:0;font-style:italic;font-size:13px;color:#7a5532}
.scrap-page .lore{margin:0;max-width:34ch;white-space:normal;font-weight:400;font-size:16px}
.scrap-page .hint{margin:4px 0 0;max-width:32ch;font-size:16px;font-weight:400}
.scrap-page .rw{margin:4px 0 0;font:700 12px Nunito,sans-serif;color:#6e4a22}
.scrap-page .sub{margin:0;max-width:32ch;font-size:14px;font-weight:400}
.scrap-page .soft{margin:0;max-width:32ch;font-size:13px;font-weight:400;color:#6e4a22}
.scrap-page .hints{font:700 13px Nunito,sans-serif;color:#5a3a1a;display:flex;align-items:center;gap:6px;margin-top:4px;min-height:32px}
.scrap-page .hints input{width:18px;height:18px}
.scrap-page .scrap-share{margin-top:auto;font-size:13px}
#mScrap .scrap-x{position:absolute;top:-10px;right:-6px;z-index:2;width:40px;height:40px;border-radius:50%;border:2px solid #6e4526;background:#fff6e6;color:#5a2e12;font:800 22px/1 Nunito,sans-serif;cursor:pointer;box-shadow:0 3px 8px rgba(30,15,0,.35)}
#mScrap .scrap-nav{display:flex;align-items:center;justify-content:space-between;gap:8px}
#mScrap .scrap-turn{min-width:52px;height:44px;border-radius:12px;border:2px solid #6e4526;background:#f3dfb6;color:#5a2e12;font:800 26px/1 Nunito,sans-serif;cursor:pointer}
#mScrap .scrap-turn:disabled{opacity:.35;cursor:default}
#mScrap .scrap-turn:focus-visible,#mScrap .scrap-x:focus-visible,.scrap-page .btn:focus-visible,.scrap-page input:focus-visible{outline:3px solid #ffe08a;outline-offset:2px}
#mScrap .scrap-where{font:800 13px Nunito,sans-serif;color:#fbe7c4;text-align:center;flex:1}
/* page turn: the new page swings in from the spine */
@keyframes scrapFwd{from{transform:rotateY(-80deg);opacity:.2}to{transform:rotateY(0);opacity:1}}
@keyframes scrapBack{from{transform:rotateY(80deg);opacity:.2}to{transform:rotateY(0);opacity:1}}
.scrap-spread.turn-fwd .scrap-page:last-child{animation:scrapFwd .42s ease-out;transform-origin:left center}
.scrap-spread.turn-back .scrap-page:first-child{animation:scrapBack .42s ease-out;transform-origin:right center}
@media (prefers-reduced-motion: reduce){.scrap-spread .scrap-page{animation:none !important}}
body.reduce-motion .scrap-spread .scrap-page{animation:none !important}
@media (min-width: 820px) and (min-height: 560px){
  #mScrap .scrap-book{width:min(860px,100%)}
  .scrap-page{min-height:min(540px,calc(100dvh - 140px));padding:34px 26px 18px}
}
@media (max-width: 360px){
  .scrap-page{padding:28px 12px 12px;font-size:14px}
  .scrap-page h2.hand{font-size:29px}
  .scrap-page h3.hand{font-size:24px}
  .scrap-page .sticker{width:92px;height:92px}
  #mScrap .scrap-book{padding:12px 8px 8px}
}
/* "New scrapbook page!" card (reuses the docked #mLore spot so it never covers the Treats button) */
#mLore.scrap-toast .card{background:#e6cc9c;border:2px solid #b8925e;box-shadow:0 10px 24px rgba(40,20,0,.3);padding:12px 12px 12px;animation:sbIn .5s cubic-bezier(.2,1.4,.4,1)}
#mLore.scrap-toast.open .card{max-height:none;overflow:visible}
#mLore.scrap-toast .sb-toast{display:flex;gap:10px;align-items:center;text-align:left}
#mLore.scrap-toast .sb-copy{padding-right:26px;min-width:0}
#mLore.scrap-toast .sticker{flex:0 0 auto;width:58px;height:58px;margin:0;padding:4px;background:#fffaf0;border-radius:12px;box-shadow:0 4px 10px rgba(60,30,10,.25);transform:rotate(-5deg)}
#mLore.scrap-toast .sticker-svg{width:100%;height:100%;display:block}
#mLore.scrap-toast .sticker.pop{animation:sbPop .7s ease-out}
#mLore.scrap-toast .sb-new{margin:0;font:800 12px Nunito,sans-serif;letter-spacing:.04em;text-transform:uppercase;color:#a0381f}
#mLore.scrap-toast .sb-title{margin:2px 0 6px;font-family:"Patrick Hand","Comic Sans MS",cursive;font-size:20px;line-height:1.1;color:#5a2e12}
#mLore.scrap-toast .sb-note{margin:0 0 6px;font:700 12px Nunito,sans-serif;color:#6e4a22}
#mLore.scrap-toast .sb-open{font-size:13px;padding:6px 10px}
@media (max-width: 420px){#mLore.scrap-toast.open{padding-left:8px}#mLore.scrap-toast.open .card{width:min(300px,calc(100vw - 16px))}#mLore.scrap-toast .sticker{width:46px;height:46px}#mLore.scrap-toast .sb-title{font-size:18px}}
@keyframes sbIn{from{transform:translateY(-8px) rotate(-2deg);opacity:0}to{transform:none;opacity:1}}
@keyframes sbPop{0%{transform:scale(.4) rotate(-20deg)}60%{transform:scale(1.12) rotate(4deg)}100%{transform:scale(1) rotate(-5deg)}}
@media (prefers-reduced-motion: reduce){#mLore.scrap-toast .card,#mLore.scrap-toast .sticker.pop{animation:none}}
body.tray-open #mScrap{visibility:hidden}
/* the reset confirmation adds "Your scrapbook pages stay." so let it wrap on phones */
body.scrapbook-on #bReset{white-space:normal;max-width:100%;height:auto;min-height:36px;line-height:1.25;text-align:center}
