@font-face{font-family:shantell;src:url(shantell-regular.ttf) format('truetype');font-display:swap;font-weight:400}@font-face{font-family:shantell;src:url(shantell-semibold.ttf) format('truetype');font-display:swap;font-weight:600}
:root{--paper:#fcf9ef;--blue:#d5e6ec;--blue-ink:#537b8c;--pink:#edc9d3;--ink:#654d42;--line:#c1d2d6;--font:shantell,system-ui,sans-serif;--safe:env(safe-area-inset-bottom,0px);color-scheme:light}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--paper);color:var(--ink)}body{font-family:var(--font);font-size:14px;background-image:radial-gradient(#ad958414 .65px,transparent .9px);background-size:5px 7px}button,a,input{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button,input{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.45}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,canvas:focus-visible,summary:focus-visible{outline:3px solid var(--blue-ink);outline-offset:3px}button{border:0;background:none}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}h1,h2,p{margin:0}img{max-width:100%;display:block}h1{font-weight:600;font-size:clamp(26px,4vw,39px);line-height:1.2;letter-spacing:-1px}h2{font-size:24px;font-weight:600}p{line-height:1.65}
.game-header{height:66px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px max(20px,calc((100vw - 1080px)/2));border-bottom:1px dotted #9ab9c6;background:#fcf9efef;position:relative;z-index:3}.return-link{display:flex;align-items:center;min-height:44px;gap:8px;font-size:13px;min-width:95px}.return-link span{font-family:Georgia,serif;font-size:24px}.game-brand{display:flex;justify-content:center;align-items:center;min-height:44px}.game-brand img{width:70px;height:46px;object-fit:contain;filter:invert(1);mix-blend-mode:multiply}.chapter-label{font-size:13px;text-align:right;min-width:95px}.stage{max-width:1080px;margin:0 auto;padding:25px 24px 32px}.stage-intro{text-align:center;margin-bottom:24px}.eyebrow{display:block;font-family:Georgia,serif;font-style:italic;font-size:13px;color:#826e62;margin-bottom:7px}.stage-intro p{font-size:13px;margin-top:10px}.button{display:inline-flex;align-items:center;justify-content:center;text-align:center;gap:6px;min-height:48px;padding:11px 23px;border:1px solid #d6c4b5;background:#fffaf0;box-shadow:0 2px 3px #79604b12;border-radius:5px;font-size:15px;line-height:1.3}.button.primary{background:#d7a1b1;border-color:#be8b9a;color:#fff;box-shadow:inset 0 0 0 3px #f5dce4,0 3px 4px #79604b16;padding:13px 23px}.button.subtle{border:0;background:transparent;box-shadow:none;font-size:13px;min-height:44px;text-decoration:underline;text-underline-offset:4px}.button.compact{min-height:44px;padding:8px 16px;font-size:13px;background:#f0d8df}.button:not(:disabled):hover{filter:brightness(.98)}.loading-note{text-align:center;padding:30px}.shelf-stage{max-width:720px}.shelf{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:26px 18px;padding:22px 28px 24px;background:linear-gradient(90deg,#b7d2df40,#e2eef48c 4%,#d7e8ef80 96%,#9bbac840);border:1px solid #afcad5;border-radius:4px;box-shadow:inset 0 1px 5px #3c697c14,0 7px 10px #6b5b4510;position:relative;isolation:isolate}.shelf::before{content:'';position:absolute;inset:0;background-image:radial-gradient(#a6c3cf44 1px,transparent 1px);background-size:17px 17px;z-index:-1}.shelf-pack{padding:0 0 13px;position:relative;min-width:0;display:flex;justify-content:center;isolation:isolate}.shelf-pack::before{content:'';position:absolute;height:13px;left:-29px;right:-29px;bottom:-8px;background:linear-gradient(#e4f0f4 45%,#9bb8c699);box-shadow:0 6px 6px #567a8b22;z-index:-1}.shelf-pack::after{content:'';position:absolute;top:-9px;left:calc(50% - 3px);width:6px;height:21px;border-radius:5px;background:linear-gradient(90deg,#b6b5ac,#fff,#c3c3b7);box-shadow:1px 1px 2px #5b4a3a30;z-index:2}.pack{display:flex;flex-direction:column;background:#ffffff5c;border:1px solid #fdfdfdcf;padding:4px;box-shadow:2px 5px 6px #6b594b24,inset 1px 0 2px #fff;border-radius:1px 1px 4px 4px;width:100%;max-width:165px;transition:transform .22s,box-shadow .22s;position:relative}.pack-header{width:100%;height:auto;aspect-ratio:591/302;object-fit:contain}.pack-window{background:linear-gradient(118deg,#fff7 0%,#fff1 27%,#fff6 29%,#fff1 31%,#f7faf939 75%,#fff8);padding:5px 3px;border:1px solid #fff9;border-top:0}.pack-window img{width:100%;aspect-ratio:780/530;object-fit:contain}.shelf-pack[aria-pressed=true] .pack{transform:translateY(-5px) rotate(-1deg);outline:3px solid #d49aac;outline-offset:4px;box-shadow:3px 10px 14px #67504730}.shelf-pack[aria-pressed=true] .pack::after{content:'✓';position:absolute;bottom:7px;right:6px;background:#ce92a5;color:#fff;width:23px;height:23px;border-radius:50%;line-height:23px;font-size:14px;box-shadow:0 2px 4px #63483d22}.shelf-actions{display:flex;flex-direction:column;align-items:center;gap:7px;margin-top:25px}.shelf-actions>.primary{min-width:250px}
.opening-stage{max-width:620px}.opening-pack{position:relative;width:min(270px,68vw);margin:32px auto 24px;touch-action:pan-y}.opening-pack-art{position:relative;transition:transform .6s,opacity .5s}.opening-pack .pack{max-width:none;padding:7px;box-shadow:3px 12px 18px #69584d25}.opening-pack .pack-window{padding-top:18px}.loose-stickers{position:absolute;inset:25% -15% 0;pointer-events:none;z-index:3}.loose-stickers img{position:absolute;width:40%;filter:drop-shadow(1px 4px 3px #70514424);opacity:0;transform:translateY(30px) rotate(var(--turn));transition:transform .65s .1s,opacity .4s .1s}.loose-stickers img:nth-child(1){left:2%;top:15%;--turn:-15deg}.loose-stickers img:nth-child(2){right:0;top:40%;--turn:14deg;width:32%}.loose-stickers img:nth-child(3){left:30%;top:59%;--turn:6deg;width:37%}.opening-pack.is-open .opening-pack-art{transform:translateY(30px);opacity:.25}.opening-pack.is-open .loose-stickers img{opacity:1;transform:translateY(0) rotate(var(--turn))}.opening-actions{display:flex;align-items:center;flex-direction:column;gap:5px}.opening-actions>.primary{min-width:235px}@keyframes strip-away{to{transform:translate(100px,-90px) rotate(23deg);opacity:0}}
body[data-stage=editor]{height:100svh;overflow:hidden}body[data-stage=editor] #game{height:calc(100svh - 66px)}.editor-stage{height:100%;max-width:1120px;padding:16px 26px 20px;display:grid;grid-template-columns:minmax(0,1fr) 320px;grid-template-rows:60px minmax(0,1fr);column-gap:36px;position:relative}.editor-heading{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:15px}.editor-heading h1{font-size:27px}.editor-heading .eyebrow{font-size:12px;margin-bottom:3px}.notebook-space{grid-column:1;grid-row:2;min-height:0;min-width:0;display:flex;align-items:center;justify-content:center;padding:14px 16px 17px;position:relative;isolation:isolate}.notebook-space::before{content:'';position:absolute;inset:7% 3% 0 7%;background:var(--blue);transform:rotate(-2deg);box-shadow:0 4px 8px #6b5a4520;z-index:-2;background-image:radial-gradient(#fff8 1.7px,transparent 2px);background-size:16px 16px}.notebook-space::after{content:'';position:absolute;inset:65% -2% 1% 75%;background:repeating-linear-gradient(90deg,#ecc8d1,#ecc8d1 5px,#f7e5e9 5px,#f7e5e9 8px);transform:rotate(3deg);z-index:-1}.notebook{max-width:100%;max-height:100%;aspect-ratio:4/5;position:relative;border-radius:7px;box-shadow:0 4px 5px #6b584b25,0 10px 20px #6b584b0d;width:var(--notebook-width,100%);flex-shrink:0;overflow:hidden}#book-canvas{width:100%;height:100%;display:block;touch-action:none;cursor:crosshair;border-radius:7px}.empty-hint{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;pointer-events:none;color:#907c6d}.empty-hint span{font-family:Georgia,serif;font-size:22px;font-style:italic}.empty-hint small{font-size:12px}.sticker-dock{grid-column:2;grid-row:2;align-self:center;background:#efd7de;border:1px solid #e6c9d3;padding:20px 13px 13px;box-shadow:3px 5px 9px #69574a15;border-radius:5px;min-width:0}.placement-hint{font-size:12px;text-align:center;line-height:1.45;min-height:35px;padding:0 6px;margin-bottom:8px;color:#6c4d48}.category-tabs{display:flex;gap:4px;border-bottom:1px solid #c9a9b3;padding-bottom:3px}.category-tabs button{min-height:44px;padding:6px 12px;font-size:12px;border-radius:3px 3px 0 0}.category-tabs button[aria-selected=true]{background:#fffaf1;box-shadow:0 -1px 3px #7354480a}.sticker-tray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:12px 0;max-height:330px;overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain}.sticker-choice{background:#fffaf2;border:1px solid #dfcbb9;border-radius:4px;min-width:0;height:93px;display:flex;align-items:center;justify-content:center;padding:9px;position:relative}.sticker-choice img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 2px #634b301a)}.sticker-choice[aria-pressed=true]{border:2px solid #658da0;background:#ecf5f7;padding:8px}.sticker-choice::after{content:'+';position:absolute;bottom:1px;right:5px;font-size:13px;opacity:.55}.adjustments{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:8px 5px}.adjustments label{font-size:12px;display:flex;align-items:center;gap:7px}.adjustments input{min-width:0;width:100%;height:32px;accent-color:#6e91a3;cursor:pointer}.adjustments input:disabled{opacity:.4}.tool-row{display:flex;align-items:center;flex-wrap:wrap;gap:4px}.tool-button{height:44px;min-width:44px;padding:5px 6px;display:inline-flex;align-items:center;justify-content:center;gap:4px;font-size:21px}.tool-button span{font-size:11px}.place-button{width:100%;font-size:14px;min-height:48px!important;margin-top:3px}
.finish-stage{max-width:590px;padding-top:22px}.finish-stage .stage-intro{margin-bottom:20px}.finished-paper{max-width:375px;margin:auto;box-shadow:0 4px 5px #6b584b25,0 10px 20px #6b584b0d;border-radius:6px;position:relative;isolation:isolate}.finished-paper::before{content:'';position:absolute;inset:-6px -15px -12px 7px;background:var(--blue);transform:rotate(2deg);z-index:-1}.finished-paper img{width:100%;height:auto;border-radius:6px;user-select:auto;-webkit-touch-callout:default}.finish-actions{margin:25px auto 0;max-width:375px;display:flex;flex-direction:column;gap:9px}.finish-actions>.button{width:100%}.finish-actions .subtle{margin-top:0}dialog{border:1px solid #ccbfb0;padding:35px 25px 25px;max-width:min(440px,calc(100vw - 32px));width:100%;max-height:90svh;overflow:auto;border-radius:7px;background:var(--paper);color:var(--ink);box-shadow:0 10px 45px #30201730}dialog::backdrop{background:#3c4f565c;backdrop-filter:blur(3px)}dialog h2{margin-bottom:12px}dialog p{font-size:13px;margin-bottom:20px}dialog>.button{display:flex;width:100%;margin-top:10px}.dialog-close{position:absolute;right:5px;top:5px;min-width:44px;min-height:44px;font-size:26px}#save-preview{margin:0 auto 20px;width:100%;height:auto;border:1px solid #e1d3c5;-webkit-touch-callout:default}.small-note{font-size:11px!important;margin:10px 0!important}
@media(max-width:700px){
 .game-header{height:56px;padding:4px 17px}.game-brand img{width:62px;height:43px}.chapter-label,.return-link{font-size:12px;min-width:80px}.stage{padding:22px 18px calc(22px + var(--safe))}.stage-intro{margin-bottom:20px}.stage-intro p{font-size:12px}.stage-intro h1{font-size:29px}.shelf-stage{max-width:470px}.shelf{gap:29px 17px;padding:20px 20px 19px}.shelf-pack::before{left:-21px;right:-21px}.shelf-pack{padding-bottom:8px}.pack{padding:3px}.pack-window{padding:3px 2px}.shelf-actions{margin-top:23px}.shelf-actions>.primary{width:min(100%,300px)}
 body[data-stage=editor] #game{height:calc(100svh - 56px)}.editor-stage{padding:6px 10px 0;grid-template-columns:1fr;grid-template-rows:52px minmax(150px,1fr) auto;gap:0;max-width:520px}.editor-heading{grid-column:1;grid-row:1;padding:0 7px}.editor-heading h1{font-size:23px}.editor-heading .eyebrow{font-size:11px;margin-bottom:1px}.editor-heading .compact{padding:8px 12px;font-size:12px;min-height:44px}.notebook-space{grid-row:2;grid-column:1;padding:11px 18px 13px}.notebook-space::before{inset:7% 7% 1% 8%;transform:rotate(-2deg)}.notebook-space::after{inset:65% 1% 1% 75%}.notebook{border-radius:5px}.empty-hint span{font-size:20px}.empty-hint small{font-size:11px}.sticker-dock{grid-row:3;grid-column:1;align-self:stretch;border-radius:5px 5px 0 0;padding:5px 7px calc(5px + var(--safe));margin:0 -10px;border-width:1px 0 0;box-shadow:0 -3px 8px #7052440a}.placement-hint{font-size:10px;min-height:16px;line-height:1.35;padding:0 3px;margin:1px 0 2px}.category-tabs{justify-content:center;gap:10px;padding:0;border:0}.category-tabs button{font-size:11px;min-height:35px;padding:6px 15px}.sticker-tray{display:flex;gap:8px;padding:6px 7px 4px;overflow-x:auto;overflow-y:hidden;max-height:none;scrollbar-width:none;scroll-snap-type:x proximity}.sticker-tray::-webkit-scrollbar{display:none}.sticker-choice{width:64px;height:64px;flex:0 0 64px;padding:6px;scroll-snap-align:start}.sticker-choice[aria-pressed=true]{padding:5px}.adjustments{padding:0 8px;gap:20px;min-height:34px}.adjustments label{font-size:10px;gap:7px}.adjustments input{height:32px}.tool-row{flex-wrap:nowrap;gap:2px;padding:0 1px}.tool-button{flex:0 0 39px;min-width:39px;height:45px;padding:3px 0;font-size:21px;flex-direction:column;gap:0;line-height:1}.tool-button span{font-size:8px;line-height:1.3}.tool-row #book-menu{flex-basis:35px;min-width:35px}.place-button{flex:1;width:auto;min-width:0;font-size:12px;margin:0;min-height:45px!important;padding:9px 12px!important}.finish-stage{padding:18px 26px calc(20px + var(--safe));max-width:450px}.finish-stage .stage-intro{margin-bottom:18px}.finish-stage .stage-intro h1{font-size:28px}.finish-stage .stage-intro p{margin-top:6px}.finished-paper{max-width:min(100%,calc((100svh - 310px)*.8))}.finish-actions{max-width:340px;margin-top:22px;gap:7px}.finish-actions .button{min-height:44px;font-size:13px;padding:10px 16px}.opening-stage{padding-top:27px}.opening-stage .stage-intro{margin-bottom:5px}.opening-pack{width:min(245px,62vw);margin:25px auto 20px}.opening-pack .pack-window{padding-top:18px}.opening-actions>.primary{min-height:48px}.opening-actions .subtle{min-height:44px}
}
@media(max-width:360px){.shelf{gap:25px 13px;padding-inline:15px}.stage-intro p{font-size:11px}.editor-heading h1{font-size:21px}.sticker-choice{width:57px;height:57px;flex-basis:57px}.category-tabs button{min-height:33px;padding-inline:12px}.tool-button{flex-basis:35px;min-width:35px}.tool-row #book-menu{flex-basis:29px;min-width:29px}.place-button{font-size:11px}.placement-hint{font-size:9px}}
@media(max-height:700px) and (max-width:700px){.editor-heading .eyebrow{display:none}.editor-stage{grid-template-rows:44px minmax(145px,1fr) auto}.sticker-choice{height:53px;width:57px;flex-basis:57px}.category-tabs button{min-height:30px}.sticker-dock{padding-top:3px}.placement-hint{min-height:14px;font-size:9px}.adjustments{min-height:30px}.adjustments input{height:28px}.finished-paper{max-width:min(100%,calc((100svh - 270px)*.8))}.finish-stage .stage-intro{margin-bottom:12px}.finish-actions{margin-top:15px}.finish-stage .eyebrow{display:none}}
/* Keep paper and tear animations within the phone viewport. */
html,body{overflow-x:hidden}
h1[tabindex="-1"]:focus{outline:none}
@media(max-width:700px){.category-tabs button{min-height:44px}.tool-row .tool-button,.tool-row #book-menu{min-width:44px;flex-basis:44px}.tool-button span{font-size:9px}}
@media(max-width:360px){.tool-row .tool-button,.tool-row #book-menu{min-width:44px;flex-basis:44px}.place-button{font-size:10px;padding-inline:6px!important}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* A dotted seam and a moving cursor replace the large pull button. */
.tear-line{position:absolute;top:var(--seam,44%);left:9px;right:9px;height:56px;transform:translateY(-50%);z-index:6;--tear:0}
.tear-tab{position:absolute;inset:0;width:100%;height:56px;padding:0;border:0;box-shadow:none;background:transparent;touch-action:none;cursor:ew-resize;border-radius:0;color:#886c5a}
.tear-trace{position:absolute;left:0;right:0;top:50%;border-top:1.5px dashed #a58b79}
.tear-trace::before{content:'';position:absolute;left:0;top:-4px;width:6px;height:6px;background:var(--paper);border:1px solid #9e8372;border-radius:50%}
.tear-trace::after{content:'';position:absolute;right:1px;top:-4px;width:6px;height:6px;border-right:1px solid #9e8372;border-top:1px solid #9e8372;transform:rotate(45deg)}
.tear-cursor{position:absolute;left:10px;top:calc(50% - 8px);width:28px;height:35px;overflow:visible;filter:drop-shadow(0 1px 1px #785a3d18);animation:cursor-drag 2.6s ease-in-out infinite;pointer-events:none}
.cursor-click{animation:cursor-press 2.6s ease-in-out infinite;transform-origin:4px 4px}
.is-tearing .tear-cursor{animation:none;left:calc(8px + var(--tear)*78%)}
.is-tearing .cursor-click{animation:none;opacity:0}
.tear-strip{position:absolute;top:0;left:0;right:0;height:var(--seam,44%);z-index:7;pointer-events:none;opacity:0;transform-origin:0% 95%}
.tear-strip span{display:block;width:100%;height:100%;background-color:#fffaf1;background-size:100% auto;background-repeat:no-repeat;border-bottom:1px dashed #8d6d5b}
.tear-tab:focus-visible{outline:2px dashed #7597a5;outline-offset:3px;border-radius:4px}
@keyframes cursor-drag{0%,17%{left:10px;opacity:0}22%{opacity:1}28%{left:10px;opacity:1}75%{left:calc(100% - 32px);opacity:1}85%,100%{left:calc(100% - 32px);opacity:0}}
@keyframes cursor-press{0%,21%,36%,100%{opacity:0;transform:scale(.75)}26%,30%{opacity:.7;transform:scale(1)}}
/* The list is now a dismissible dialog, rather than a moving details box. */
.placed-access{position:absolute;bottom:0;right:28px;width:315px;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;font-size:11px;background:var(--paper);border:1px solid #e0d3c6;z-index:5;border-radius:4px;text-align:left}
#placed-count{display:inline-flex;align-items:center;justify-content:center;min-width:23px;min-height:23px;background:#e0ebee;border-radius:50%;font-size:10px}
#placed-list{display:grid;grid-template-columns:1fr;gap:8px;max-height:52svh;overflow:auto;overscroll-behavior:contain;padding:4px}
#placed-list>button{display:flex;align-items:center;gap:13px;min-height:64px;padding:8px 14px;background:#fffdf7;border:1px solid #d7c5b2;border-radius:3px;text-align:left;font-size:13px}
#placed-list>button>img{width:45px;height:45px;object-fit:contain;order:0}
#placed-list>button[aria-pressed=true]{background:#e2edf0;border-color:#8faebd}
#placed-dialog>p{padding-right:20px;font-size:12px}
@media(max-width:700px){.placed-access{top:57px;right:19px;bottom:auto;width:auto;max-width:90%;min-height:44px;padding:5px 9px;font-size:9px}.category-tabs{gap:4px}.category-tabs button{padding-inline:12px}}
@media(max-height:700px) and (max-width:700px){.placed-access{top:47px}}
@media(max-width:360px){.category-tabs button{padding-inline:10px;font-size:10px}}
@media(prefers-reduced-motion:reduce){.tear-cursor{left:10px;opacity:1}.cursor-click{opacity:0}}

.opening-pack.is-open .tear-strip{opacity:1;animation:strip-away .6s forwards}.opening-pack.is-open .tear-line{display:none}
@media(prefers-reduced-motion:reduce){.opening-pack.is-open .tear-strip{display:none}}
