/* Gentle hint */
@keyframes sjWiggle{0%,100%{transform:rotate(0)}20%{transform:rotate(-6deg) scale(1.04)}40%{transform:rotate(5deg) scale(1.04)}60%{transform:rotate(-4deg)}80%{transform:rotate(3deg)}}
#play .tile.sj-wiggle{animation:sjWiggle .65s ease-in-out 3;z-index:3;outline:3px solid #ffe08a;outline-offset:-3px}
#play .tile.sj-home{box-shadow:0 0 0 3px #fff6c9,0 0 18px 6px #ffd45c!important}
body.reduce-effects #play .tile.sj-wiggle{animation:none}
/* Small 2x2 board level grid */
#storyDetail .story-difficulties button{min-width:0}
#storyDetail .story-difficulties button strong,#storyDetail .story-difficulties button small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Storybook */
#storyBook{width:min(560px,calc(100vw - 20px));max-height:calc(100dvh - 20px);display:none;flex-direction:column;gap:8px;overflow:auto}
#storyBook[open]{display:flex}
#storyBook .album-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
#storyBook .sb-img{width:100%;max-height:44dvh;object-fit:contain;border-radius:12px;background:#0003}
#storyBook h2{margin:4px 0;font-size:1.15em}
#storyBook .sb-text{margin:0;line-height:1.5;font-size:17px}
#storyBook .sb-end{text-align:center;font-weight:700;margin:6px 0 0}
#storyBook .sb-tools,#storyBook .sb-nav{display:flex;gap:8px;justify-content:center;align-items:center}
#storyBook .sb-tools button,#storyBook .sb-nav button{flex:1;min-height:44px}
.sj-read-all{width:100%;margin:6px 0}
/* Stickers */
#stickerShelf h3{margin:10px 0 6px}
.sj-sticker-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.sj-sticker{display:flex;flex-direction:column;align-items:center;gap:3px;text-align:center;min-width:0}
.sj-sticker small{font-size:11px;line-height:1.2;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;opacity:.85}
.sj-sticker-face{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;font-size:30px;background:#ffffff1a center/cover;border:3px dashed #ffffff55;color:#ffffffaa;filter:grayscale(1)}
.sj-sticker.got .sj-sticker-face{border:3px solid #ffd45c;filter:none;box-shadow:0 0 0 3px #fff8,0 4px 10px #0006;text-shadow:0 2px 4px #000a;color:#fff}
.sj-sticker.sj-new{margin:6px auto}.sj-sticker.sj-new .sj-sticker-face{width:76px;height:76px;font-size:40px;animation:sjPop .7s ease-out}
@keyframes sjPop{0%{transform:scale(.3) rotate(-20deg)}70%{transform:scale(1.15) rotate(6deg)}100%{transform:none}}
.sj-sticker-tip{font-size:12px;opacity:.8;margin:6px 0 0}
/* Text size */
.sj-textsize{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:6px 0}
.sj-textsize-btns{display:flex;gap:6px}
.sj-textsize-btns button{width:44px;height:44px;padding:0;margin:0!important;line-height:1}
.sj-textsize-btns .sj-ts-s{font-size:13px!important}.sj-textsize-btns .sj-ts-m{font-size:18px!important}.sj-textsize-btns .sj-ts-l{font-size:24px!important}
.sj-textsize-btns button[aria-checked=true]{outline:3px solid #ffd45c;outline-offset:1px}
html[data-text=s] #storyCaption,html[data-text=s] .album-text,html[data-text=s] #storyBook .sb-text,html[data-text=s] #winText,html[data-text=s] .story-dialog p,html[data-text=s] #storyMission{font-size:13px!important}
html[data-text=l] #storyCaption,html[data-text=l] .album-text,html[data-text=l] #storyBook .sb-text,html[data-text=l] #winText,html[data-text=l] #storyMission{font-size:21px!important;line-height:1.45!important}
html[data-text=l] .story-dialog p{font-size:17px!important}
html[data-text=l] #storyLibrary .story-book strong{font-size:17px!important}
/* Banner: keep album clear of the bottom ad slot */
#storyAlbum{max-height:calc(100dvh - 24px - var(--ad-space,0px));margin-bottom:calc(12px + var(--ad-space,0px))}
.sj-read-all,#storyBook button,.sj-textsize-btns button{font-family:inherit}
/* four difficulty buttons in a 2x2 grid: stack label, size and progress */
#storyDetail>.story-difficulties>button{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto auto!important;height:auto!important;min-height:58px!important;padding:5px 9px!important;gap:1px!important;align-content:center}
#storyDetail>.story-difficulties>button strong{font-size:16px;line-height:1.15}
#storyDetail>.story-difficulties>button span{font-size:12px;line-height:1.2;grid-column:1!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#storyDetail>.story-difficulties>button small{font-size:11px;line-height:1.2;grid-column:1!important}
html[data-text=l] #storyBook .sb-img{max-height:32dvh}
#play .play-bg{inset:0!important;transform:none!important}
/* compact sticker shelf inside the album so the picture grid keeps its room */
#storyAlbum #stickerShelf h3{margin:6px 0 4px;font-size:16px}
#storyAlbum .sj-sticker-row{grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
#storyAlbum .sj-sticker small{display:none}
#storyAlbum .sj-sticker-face{width:42px;height:42px;font-size:22px;border-width:2px}
#storyAlbum .sj-sticker-tip{margin:4px 0 6px;font-size:11px}
#storyAlbum{overflow-y:auto}
#storyAlbum .album-page{min-height:92px}
/* Gameplay banner strip: board area shrinks (screen bottom = --ad-space); 16px gap + separator above the ad */
html.sj-play-banner #play{padding-bottom:calc(26px + env(safe-area-inset-bottom,0px))!important;box-sizing:border-box}
html.sj-play-banner #play::after{content:"";position:absolute;left:12px;right:12px;bottom:10px;height:2px;border-radius:2px;background:#ffffff40;pointer-events:none;z-index:2}
html.sj-banner-locked .banner{pointer-events:none!important}
/* Home/title screen: group cover as hero background (sky at top behind the title) */
html body #menu{background:linear-gradient(180deg,#14102366 0%,#141023a0 22%,#0d1b2bdd 48%,#0d1b2bf2 75%),url(branding/cover.webp) center top/cover no-repeat,#2a2c4a!important}
html body #menu #storyLibrary>h1,html body #menu #storyLibrary>small,html body #menu #storyLibrary>p,html body #menu #detailHeading{text-shadow:0 2px 8px #000c,0 0 2px #000}
