/* Ache's scrapbook page (/scrapbook): a ring-bound paper book on the sand, stickers you can drag, the save file under it. */
.scrap{position:relative;z-index:1;padding-block:28px 64px}
.scrap-hero{max-width:760px;margin:0 auto 34px;text-align:center}
.scrap-hero .kicker{font-family:var(--mono);font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:#d7182a}
.scrap-hero h1{font-family:var(--display);font-weight:800;font-size:clamp(34px,6vw,60px);line-height:1.02;letter-spacing:-.03em;margin:10px 0 14px;color:#13224b;text-wrap:balance}
.scrap-intro{font-family:"Caveat",cursive;font-size:clamp(22px,2.6vw,27px);line-height:1.2;color:#13224b;margin:0 auto;max-width:620px}
.scrap-count{display:inline-flex;flex-wrap:wrap;align-items:baseline;justify-content:center;gap:4px 10px;margin-top:20px;padding:10px 18px;border-radius:99px;background:#fff;box-shadow:0 10px 24px -14px rgba(19,34,75,.45);font-family:var(--mono);font-size:13px;color:#13224b}
.scrap-count b{font-family:var(--display);font-size:28px;font-weight:800;color:#d7182a;line-height:1}
.scrap-stars{display:flex;gap:3px;margin:0;padding:0;list-style:none;align-self:center}
.scrap-stars li{width:10px;height:10px;background:rgba(19,34,75,.15);clip-path:polygon(50% 0,61% 39%,100% 50%,61% 61%,50% 100%,39% 61%,0 50%,39% 39%)}
.scrap-stars li.on{background:#d7182a}
.scrap-count.done{background:linear-gradient(135deg,#fffaf0,#fff0b8);box-shadow:0 0 0 2px #e8c35a,0 10px 24px -14px rgba(19,34,75,.45)}

/* the book: pages in pairs, rings down the middle on wide screens */
.book{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:26px 0;align-items:stretch;max-width:1080px;margin:0 auto;filter:drop-shadow(0 26px 30px rgba(19,34,75,.22))}
.page{position:relative;min-height:420px;padding:30px clamp(18px,3vw,36px) 46px;background:#fffaf0;
  background-image:radial-gradient(circle,rgba(19,34,75,.09) 1px,transparent 1.4px);background-size:22px 22px;background-position:11px 11px}
.page.pl{border-radius:14px 4px 4px 14px;box-shadow:inset -18px 0 24px -20px rgba(19,34,75,.35)}
.page.pr{border-radius:4px 14px 14px 4px;box-shadow:inset 18px 0 24px -20px rgba(19,34,75,.35)}
.page.pl::after{content:"";position:absolute;right:-9px;top:26px;bottom:26px;width:18px;z-index:2;
  background:radial-gradient(circle at 50% 50%,#fff 0 3px,#8a93ad 3.5px 5.5px,transparent 6px) 0 0/18px 34px repeat-y}
.page-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:18px}
.page h2{margin:0;font-family:"Caveat",cursive;font-weight:700;font-size:34px;line-height:1;color:#13224b}
.page-n{font-family:var(--mono);font-size:12px;color:#d7182a}
.page-no{position:absolute;bottom:14px;left:0;right:0;text-align:center;font-family:"Caveat",cursive;font-size:20px;color:rgba(19,34,75,.4)}

.sb-slots{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:18px 12px}
.sb-slot{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center;min-height:150px}
.sb-slot:not(.got){justify-content:flex-start;padding:10px 6px;border:2px dashed rgba(19,34,75,.22);border-radius:16px}
.slot-q{font-family:"Caveat",cursive;font-size:42px;line-height:1;color:rgba(19,34,75,.25)}
.slot-hint{font-family:"Caveat",cursive;font-size:17px;line-height:1.08;color:#47648c}
.slot-name{font-family:"Caveat",cursive;font-size:20px;line-height:1;color:#13224b;margin-top:2px}
.slot-date{font-family:var(--mono);font-size:10px;color:rgba(19,34,75,.5)}

/* a sticker: lifts when dragged, wobbles when clicked */
.stk{position:relative;z-index:1;width:100%;max-width:120px;aspect-ratio:1;padding:0;border:0;background:none;cursor:grab;touch-action:none;
  transform:rotate(var(--r,0deg));transition:transform .3s cubic-bezier(.3,1.5,.5,1),filter .2s;filter:drop-shadow(0 4px 5px rgba(19,34,75,.25))}
.stk img{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none}
.stk:hover{transform:rotate(var(--r,0deg)) scale(1.06)}
.stk.lift{z-index:5;cursor:grabbing;transition:filter .2s;transform:rotate(var(--r,0deg)) scale(1.14);filter:drop-shadow(0 16px 14px rgba(19,34,75,.35))}
.stk.boop{animation:stk-wobble .7s ease-in-out}
.stk:focus-visible{outline:2px solid #d7182a;outline-offset:4px;border-radius:14px}

/* the last page: the crown */
.crown-page{grid-column:1/-1;min-height:0;border-radius:14px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px}
.crown-page h2{margin:0}
.crown-page .sb-slot{min-height:0}
.crown-page .stk{max-width:200px}
.crown-page.got{background-color:#fff6d8;box-shadow:inset 0 0 0 3px #e8c35a}
.crown-note{max-width:520px;margin:0;font-family:"Caveat",cursive;font-size:24px;line-height:1.15;color:#13224b}
.crown-lock{display:flex;align-items:center;gap:16px;max-width:560px;text-align:left}
.crown-lock p{margin:0;font-family:"Caveat",cursive;font-size:22px;line-height:1.15;color:#47648c}
.crown-q{flex:none;display:grid;place-items:center;width:84px;height:84px;border:2px dashed rgba(232,195,90,.9);border-radius:50%;font-size:40px;color:#e8c35a}

.book-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 16px;margin:22px auto 0;max-width:1080px}
.scrap-tip{font-family:"Caveat",cursive;font-size:20px;color:#47648c}

/* house rules */
.rules{max-width:760px;margin:52px auto 0;padding:26px clamp(20px,4vw,36px);background:#13224b;color:#fff;border-radius:16px;box-shadow:0 24px 40px -24px rgba(19,34,75,.7)}
.rules .tag{background:#d7182a;color:#fff}
.rules h2{margin:10px 0 12px;font-family:var(--display);font-weight:800;font-size:clamp(24px,3.4vw,32px);letter-spacing:-.02em}
.rules ul{margin:0;padding-left:20px;display:grid;gap:6px;line-height:1.45}
.rules-sign{margin:16px 0 0;font-family:"Caveat",cursive;font-size:23px;color:#ffd56b}

/* the save file */
.savefile{max-width:1080px;margin:52px auto 0;padding:clamp(22px,4vw,40px);background:#fff;border-radius:16px;box-shadow:0 24px 40px -26px rgba(19,34,75,.55);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 40px}
.save-head,.save-stats,.save-tools{grid-column:1/-1}
.save-head h2{margin:10px 0 8px;font-family:var(--display);font-weight:800;font-size:clamp(24px,3.4vw,32px);letter-spacing:-.02em;color:#13224b}
.save-head p{margin:0;max-width:680px;color:#47648c}
.save-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin:0}
.save-stats div{padding:12px 14px;border-radius:12px;background:#f5f7fc}
.save-stats dt{font-family:var(--mono);font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#47648c}
.save-stats dd{margin:4px 0 0;font-family:var(--display);font-weight:800;font-size:22px;color:#13224b}
.save-open[hidden]{display:none}
.save-open{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:14px 16px;border-radius:12px;background:#fff1f2}
.save-open p{margin:0;color:#13224b}
.save-open .btn{font-family:var(--mono);font-size:13px;color:#fff;background:#d7182a;padding:8px 14px;border-radius:99px}
.save-open .btn:hover{background:#13224b}
.save-read{grid-column:1/-1}
.savefile h3{margin:0 0 10px;font-family:var(--display);font-size:18px;color:#13224b}
.save-read ol{margin:0;padding-left:22px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 28px;max-height:340px;overflow:auto}
.save-read li{color:#13224b}
.save-read li a{display:block;font-weight:600}
.save-read li a:hover{color:#d7182a}
.save-read li .meta{font-family:var(--mono);font-size:11px;color:#47648c}
.save-read li.empty{list-style:none;margin-left:-22px;font-family:"Caveat",cursive;font-size:21px;color:#47648c}
.save-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 40px;padding-top:20px;border-top:1px solid rgba(19,34,75,.12)}
.save-tools p{margin:0 0 10px;color:#47648c;font-size:14px}
.save-code textarea{width:100%;resize:vertical;padding:10px 12px;border-radius:10px;border:1px solid rgba(19,34,75,.2);font-family:var(--mono);font-size:12px;color:#13224b;background:#f9fafc;user-select:text;-webkit-user-select:text}
.save-btns{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.save-msg{min-height:1.4em;margin:8px 0 0!important;font-family:"Caveat",cursive;font-size:20px!important;color:#d7182a!important}
.skin.wipe{border-color:#d7182a;color:#d7182a}
.skin.wipe:hover{background:#fff1f2}

@media (max-width:860px){
  .book{grid-template-columns:minmax(0,1fr);gap:22px}
  .page,.page.pl,.page.pr{border-radius:14px;box-shadow:none;margin-top:0!important}
  .page.pl::after{display:none}
  .page::before{content:"";position:absolute;left:26px;right:26px;top:-9px;height:18px;background:radial-gradient(circle at 50% 50%,#fff 0 3px,#8a93ad 3.5px 5.5px,transparent 6px) 0 0/34px 18px repeat-x}
  .crown-page{margin-top:0}
}
@media (max-width:560px){
  .sb-slots{grid-template-columns:repeat(2,minmax(0,1fr))}
  .savefile,.save-tools{grid-template-columns:minmax(0,1fr)}
  .save-read ol{grid-template-columns:minmax(0,1fr)}
  .crown-lock{flex-direction:column;text-align:center}
}
@media (prefers-reduced-motion:reduce){.stk,.stk.boop{transition:none;animation:none}}
