/* album.css — the sticker album, the secret celebrations and the living backgrounds (js/album.js).
   Inside the book every size is a multiple of --u (1% of the book's width, set from JS), so the
   spread keeps its proportions from a phone to a laptop. */

/* ================= album screen ================= */
.album-host { display: flex; flex-direction: column; }
.al-root { flex: 1 0 auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 8px; }
.al-root button { font-family: inherit; color: inherit; }

/* page tabs */
.al-strip { flex: none; display: flex; gap: 8px; align-items: stretch; }
.al-tabs { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.al-tabs::-webkit-scrollbar { display: none; }
.al-tab {
  position: relative; flex: none; width: 88px; min-height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
  padding: 6px 4px 5px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #e6d9f6; border: 3px solid transparent; transition: transform .15s;
}
.al-tab:active { transform: translateY(2px); }
.al-tabpic { display: block; width: 42px; height: 42px; flex: none; }
.al-tabpic svg { display: block; width: 100%; height: 100%; }
.al-tab b { font-size: 12.5px; font-weight: 600; line-height: 1.1; text-align: center; color: #5b4a86; max-height: 2.2em; overflow: hidden; }
.al-tab small { font-size: 11.5px; font-weight: 600; color: #a892c9; line-height: 1; margin-top: auto; }
.al-tab[aria-selected="true"] { border-color: var(--pink); background: #fff3f9; box-shadow: 0 4px 0 #ffb3d3; }
.al-tab[aria-selected="true"] b { color: var(--pink-d); }
.al-tab.full small { color: #c8860a; }
.al-tab.full::after { content: ""; position: absolute; top: -5px; inset-inline-start: -4px; width: 24px; height: 24px; background: #ffd24d; border: 2px solid #fff; clip-path: polygon(50% 2%, 63% 34%, 98% 37%, 71% 60%, 80% 95%, 50% 76%, 20% 95%, 29% 60%, 2% 37%, 37% 34%); }
.al-sectab { margin: 4px 0 8px; background: linear-gradient(160deg, #efe6ff, #ffe6f3); box-shadow: 0 4px 0 #cdbcf0; }
.al-sectab[aria-selected="true"] { border-color: var(--purple); background: linear-gradient(160deg, #e6dcff, #ffe0f0); box-shadow: 0 4px 0 #b9a3f0; }
.al-sectab[aria-selected="true"] b { color: var(--purple-d); }

/* the spread */
.al-main { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.al-main.sec { align-items: flex-start; }
.al-arrow { flex: none; width: 54px; height: 54px; border-radius: 50%; background: #fff; color: var(--purple-d); box-shadow: 0 4px 0 #dccbee; display: grid; place-items: center; transition: transform .12s; }
.al-arrow svg { width: 26px; height: 26px; display: block; }
.al-arrow:active { transform: translateY(3px); box-shadow: 0 1px 0 #dccbee; }
.al-book {
  --u: 7px; position: relative; flex: 0 1 auto; min-width: 0; width: min(100%, calc((var(--vh) - 262px) * 1.5)); aspect-ratio: 3 / 2; display: flex;
  padding: calc(var(--u) * 1.1); border-radius: calc(var(--u) * 3.4); background: #ff8fbd; box-shadow: 0 calc(var(--u) * .9) 0 #e0679d, 0 calc(var(--u) * 2.2) calc(var(--u) * 3) calc(var(--u) * -1.2) rgba(90, 45, 110, .5);
}
.al-book.flip-n { animation: al-flip-n .32s cubic-bezier(.3, 1.3, .5, 1); }
.al-book.flip-p { animation: al-flip-p .32s cubic-bezier(.3, 1.3, .5, 1); }
.al-page { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--u) * 1.3); padding: calc(var(--u) * 2) calc(var(--u) * 2.4) calc(var(--u) * 1.8); background: radial-gradient(#f3dfe9 0 calc(var(--u) * .16), transparent calc(var(--u) * .2)) 0 0 / calc(var(--u) * 2.6) calc(var(--u) * 2.6), #fffaf3; }
.al-pr { border-radius: calc(var(--u) * .6) calc(var(--u) * 2.4) calc(var(--u) * 2.4) calc(var(--u) * .6); box-shadow: inset calc(var(--u) * 2.6) 0 calc(var(--u) * 2.4) calc(var(--u) * -2.2) rgba(122, 60, 154, .28); }
.al-pl { border-radius: calc(var(--u) * 2.4) calc(var(--u) * .6) calc(var(--u) * .6) calc(var(--u) * 2.4); box-shadow: inset calc(var(--u) * -2.6) 0 calc(var(--u) * 2.4) calc(var(--u) * -2.2) rgba(122, 60, 154, .28); }
.al-rings { position: absolute; top: calc(var(--u) * 4); bottom: calc(var(--u) * 4); left: 50%; width: calc(var(--u) * 3.2); margin-left: calc(var(--u) * -1.6); display: flex; flex-direction: column; justify-content: space-between; z-index: 2; }
.al-rings i { display: block; height: calc(var(--u) * 1.5); border-radius: calc(var(--u) * 1); background: linear-gradient(#f4eeff, #bfa9ee); box-shadow: 0 calc(var(--u) * .3) 0 #8f7bc9; }
.al-tape { position: absolute; top: calc(var(--u) * -.9); width: calc(var(--u) * 11); height: calc(var(--u) * 2.8); z-index: 1; background: repeating-linear-gradient(90deg, rgba(159, 227, 208, .85) 0 calc(var(--u) * 1.2), rgba(201, 241, 228, .85) calc(var(--u) * 1.2) calc(var(--u) * 2.4)); }
.al-t1 { right: calc(var(--u) * 4); transform: rotate(4deg); }
.al-t2 { left: calc(var(--u) * 5); transform: rotate(-5deg); background: repeating-linear-gradient(90deg, rgba(255, 208, 96, .85) 0 calc(var(--u) * 1.2), rgba(255, 230, 160, .85) calc(var(--u) * 1.2) calc(var(--u) * 2.4)); }
.al-head { display: flex; align-items: center; gap: calc(var(--u) * 1.4); height: calc(var(--u) * 7.2); flex: none; }
.al-head svg { width: calc(var(--u) * 6.6); height: calc(var(--u) * 6.6); flex: none; }
.al-head span { display: block; font-size: calc(var(--u) * 2.3); font-weight: 500; color: #b08cc9; line-height: 1; }
.al-head b { display: block; font-size: calc(var(--u) * 4.3); font-weight: 700; color: var(--pink-d); line-height: 1.15; white-space: nowrap; }
.al-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: calc(var(--u) * 1.4); }
.al-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: calc(var(--u) * .5); min-width: 0; min-height: 0;
  padding: calc(var(--u) * 1) calc(var(--u) * .6) calc(var(--u) * .9); border-radius: calc(var(--u) * 2.2); background: rgba(255, 255, 255, .6);
  outline: calc(var(--u) * .36) dashed #ecc9dc; outline-offset: calc(var(--u) * -.36);
}
.al-stk { display: block; }
.al-art { display: block; width: 100%; height: 100%; overflow: visible; }
.al-slot .al-stk {
  flex: 1; min-height: 0; width: 86%; transform: rotate(var(--r, 0deg)); transition: transform .25s cubic-bezier(.34, 1.7, .64, 1);
  filter: drop-shadow(calc(var(--u) * .32) 0 0 #fff) drop-shadow(calc(var(--u) * -.32) 0 0 #fff) drop-shadow(0 calc(var(--u) * .32) 0 #fff) drop-shadow(0 calc(var(--u) * -.32) 0 #fff) drop-shadow(0 calc(var(--u) * .5) calc(var(--u) * .5) rgba(90, 45, 110, .28));
}
.al-stk.ghost, .al-slot .al-stk.ghost { filter: none; }
.al-stk.ghost .al-art { filter: brightness(0); opacity: .11; }
.al-slot small { flex: none; max-width: 100%; font-size: calc(var(--u) * 2.2); font-weight: 600; color: #7a5a9a; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-slot.got { background: #fff; outline-color: transparent; box-shadow: 0 calc(var(--u) * .4) 0 #f1d6e6; }
.al-slot.got:active .al-stk, .al-slot.got.peel .al-stk { animation: al-peel .5s cubic-bezier(.34, 1.7, .64, 1); }
.al-slot.miss small { font-size: calc(var(--u) * 3); color: #cbb3dd; }
.al-slot.miss.no { animation: al-no .4s; }
.al-rare { position: absolute; top: calc(var(--u) * .7); inset-inline-end: calc(var(--u) * .7); width: calc(var(--u) * 3.4); height: calc(var(--u) * 3.4); }
.al-rare svg { display: block; width: 100%; height: 100%; }
.al-slot.miss .al-rare { opacity: .55; }
.al-prog { flex: none; display: flex; align-items: center; gap: calc(var(--u) * 1.4); height: calc(var(--u) * 3.4); font-size: calc(var(--u) * 2.5); font-weight: 600; color: #7a5a9a; }
.al-prog span { flex: none; }
.al-bar { flex: 1; height: calc(var(--u) * 2.2); border-radius: calc(var(--u) * 2); background: #f3e3ee; overflow: hidden; box-shadow: inset 0 calc(var(--u) * .3) 0 rgba(122, 60, 154, .12); }
.al-bar i { display: block; height: 100%; border-radius: calc(var(--u) * 2); background: linear-gradient(90deg, #ff5fa2, #ffb347); }
.al-prize { flex: none; display: flex; align-items: center; gap: calc(var(--u) * 1.6); height: calc(var(--u) * 11.5); padding: 0 calc(var(--u) * 1.8); border-radius: calc(var(--u) * 2.4); background: linear-gradient(120deg, #fff3c9, #ffe3f0); box-shadow: 0 calc(var(--u) * .4) 0 #f3d9a0; }
.al-prize.done { background: linear-gradient(120deg, #d9fbe9, #fff3c9); box-shadow: 0 calc(var(--u) * .4) 0 #b9e6cf; }
.al-chest { width: calc(var(--u) * 11); height: calc(var(--u) * 9.7); flex: none; animation: al-chest 2.8s ease-in-out infinite; }
.al-chest.open { animation: none; }
.al-prize p { margin: 0; font-size: calc(var(--u) * 2.7); font-weight: 500; line-height: 1.25; color: #7a5a2a; }
.al-prize b { font-size: calc(var(--u) * 3.3); font-weight: 700; color: var(--pink-d); }
.al-prize.done b { color: #1c8f73; }
.al-tip { flex: none; margin: 0; min-height: 22px; text-align: center; font-size: 15.5px; font-weight: 500; color: var(--ink-soft); }
.al-tip.hint { color: var(--pink-d); font-weight: 600; animation: al-hint .45s cubic-bezier(.34, 1.7, .64, 1); }

/* the secrets page */
.al-secrets { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.al-sechead { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 18px; background: linear-gradient(120deg, #efe6ff, #ffe6f3); }
.al-sechead > svg { width: 40px; height: 34px; flex: none; }
.al-sechead b { display: block; font-size: 20px; font-weight: 700; color: var(--purple-d); line-height: 1.15; }
.al-sechead span { display: block; font-size: 14px; font-weight: 500; color: #7a5a9a; line-height: 1.3; }
.al-secgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.al-sec { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 9px; border-radius: 18px; background: rgba(255, 255, 255, .7); outline: 2.5px dashed #e3d3f3; outline-offset: -2.5px; min-height: 132px; }
.al-sec.found { background: #fff; outline: 0; box-shadow: 0 4px 0 #ffe08a, inset 0 0 0 3px #ffd24d; }
.al-formula { display: flex; align-items: center; justify-content: center; gap: 3px; height: 58px; }
.al-formula .al-stk { width: 50px; height: 56px; }
.al-sec.found .al-formula .al-stk { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 2px 2px rgba(90, 45, 110, .28)); }
.al-formula em { font-style: normal; font-size: 20px; font-weight: 700; color: #c2b0e6; }
.al-sec b { font-size: 16px; font-weight: 700; color: #b9a6d6; text-align: center; line-height: 1.15; }
.al-sec.found b { color: var(--pink-d); }
.al-sec small { font-size: 12.5px; font-weight: 500; color: #8a7aa3; text-align: center; line-height: 1.25; }
.al-sec small svg { display: block; width: 20px; height: 20px; }

@keyframes al-flip-n { from { transform: translateX(-26px) rotate(-1.5deg); opacity: .3; } }
@keyframes al-flip-p { from { transform: translateX(26px) rotate(1.5deg); opacity: .3; } }
@keyframes al-peel { 40% { transform: rotate(calc(var(--r, 0deg) * -1.8)) scale(1.16); } }
@keyframes al-no { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes al-chest { 0%, 100% { transform: rotate(0); } 46% { transform: rotate(0); } 50% { transform: rotate(-5deg); } 54% { transform: rotate(5deg); } 58% { transform: rotate(-3deg); } 62% { transform: rotate(0); } }
@keyframes al-hint { from { transform: scale(.8); opacity: .3; } }

@media (orientation: portrait) {
  .al-book { aspect-ratio: 9 / 8; width: min(100%, calc((var(--vh) - 262px) * 1.125)); }
}
@media (max-width: 700px) {
  .al-arrow { width: 44px; height: 44px; }
  .al-arrow svg { width: 22px; height: 22px; }
  .al-main { gap: 6px; }
  .al-root { padding: 8px 6px; }
}

/* ================= moving particles (living backgrounds + secrets) ================= */
.fx-layer { --fxw: 300px; --fxh: 400px; }
.fx-p { position: absolute; top: 0; display: block; width: 0; height: 0; animation: fx-fall 10s linear infinite; will-change: transform; }
.fx-p.fx-rise { animation-name: fx-rise; }
.fx-p > i { display: block; width: calc(var(--fxw) * var(--s, .05)); height: calc(var(--fxw) * var(--s, .05)); margin: calc(var(--fxw) * var(--s, .05) * -.5); }
.fx-p svg, .fx-g svg, .fx-dot { display: block; width: 100%; height: 100%; }
.fx-dot { border-radius: 50%; }
.fx-flutter { animation: fx-flutter 2.4s ease-in-out infinite alternate; }
.fx-sway { animation: fx-sway 3s ease-in-out infinite alternate; }
.fx-tumble { animation: fx-tumble 2.6s linear infinite; }
.fx-g { position: absolute; display: block; width: calc(var(--fxw) * var(--s, .05)); height: calc(var(--fxw) * var(--s, .05)); margin: calc(var(--fxw) * var(--s, .05) * -.5); }
.fx-twinkle { animation: fx-twinkle 2.6s ease-in-out infinite; }
.fx-pulse { animation: fx-pulse 4s ease-in-out infinite; }
.fx-wander { animation: fx-wander 7s ease-in-out infinite; }
.fx-drift { height: calc(var(--fxw) * var(--s, .2) * .5); animation: fx-drift 20s ease-in-out infinite alternate; }
.fx-shoot { width: calc(var(--fxw) * .26); height: calc(var(--fxw) * .13); margin: 0; opacity: 0; animation: fx-shoot 7s linear infinite; }
.fx-flap { transform-box: fill-box; transform-origin: center; animation: fx-flap .5s ease-in-out infinite alternate; }
.fx-ray { position: absolute; top: -12%; display: block; width: 17%; height: 92%; background: linear-gradient(rgba(255, 255, 255, .34), rgba(255, 255, 255, 0)); transform-origin: 50% 0; animation: fx-ray 6s ease-in-out infinite alternate; }
.fx-band { position: absolute; left: -25%; display: block; width: 150%; height: 30%; animation: fx-band 8s ease-in-out infinite alternate; }

@keyframes fx-fall { from { transform: translate3d(0, calc(var(--fxh) * -.1), 0); } to { transform: translate3d(var(--dx, 0px), calc(var(--fxh) * 1.1), 0); } }
@keyframes fx-rise { from { transform: translate3d(0, calc(var(--fxh) * 1.1), 0); } to { transform: translate3d(var(--dx, 0px), calc(var(--fxh) * -.12), 0); } }
@keyframes fx-flutter { from { transform: rotate(-50deg) scaleX(1); } to { transform: rotate(160deg) scaleX(.45); } }
@keyframes fx-sway { from { transform: translateX(calc(var(--fxw) * -.03)) rotate(-16deg); } to { transform: translateX(calc(var(--fxw) * .03)) rotate(16deg); } }
@keyframes fx-tumble { to { transform: rotate(360deg); } }
@keyframes fx-twinkle { 0%, 100% { transform: scale(.2); opacity: 0; } 50% { transform: scale(1); opacity: var(--o, .95); } }
@keyframes fx-pulse { 0%, 100% { transform: scale(.85); opacity: .18; } 50% { transform: scale(1.12); opacity: .62; } }
@keyframes fx-wander {
  0% { transform: translate(0, 0); opacity: var(--o, .2); }
  25% { transform: translate(calc(var(--fxw) * .06), calc(var(--fxw) * -.04)); opacity: 1; }
  50% { transform: translate(calc(var(--fxw) * .02), calc(var(--fxw) * -.09)); opacity: var(--o, .35); }
  75% { transform: translate(calc(var(--fxw) * -.05), calc(var(--fxw) * -.03)); opacity: 1; }
  100% { transform: translate(0, 0); opacity: var(--o, .2); }
}
@keyframes fx-drift { from { transform: translateX(calc(var(--fxw) * -.06)); } to { transform: translateX(calc(var(--fxw) * .1)); } }
@keyframes fx-shoot {
  0% { transform: translate3d(0, 0, 0); opacity: 0; } 2% { opacity: 1; }
  10% { transform: translate3d(calc(var(--fxw) * .62), calc(var(--fxw) * .25), 0); opacity: 0; }
  100% { transform: translate3d(calc(var(--fxw) * .62), calc(var(--fxw) * .25), 0); opacity: 0; }
}
@keyframes fx-flap { from { transform: scaleX(1); } to { transform: scaleX(.3); } }
@keyframes fx-ray { from { transform: rotate(10deg); opacity: .45; } to { transform: rotate(19deg); opacity: 1; } }
@keyframes fx-band { from { transform: translateX(-5%) scaleY(.85); opacity: .35; } to { transform: translateX(6%) scaleY(1.15); opacity: .95; } }

/* ================= a secret was found (over the editor stage) ================= */
.sx-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; transition: opacity .5s; }
.sx-layer.out { opacity: 0; }
.sx-banner { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%) rotate(-3deg); display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96%; z-index: 4; animation: sx-drop .75s cubic-bezier(.3, 1.5, .5, 1) .1s backwards; }
.sx-banner b { padding: 5px 22px 7px; border-radius: 999px; background: linear-gradient(#ffd96a, #ffb347); color: #7a3c0a; font-size: clamp(20px, calc(var(--fxw) * .088), 36px); font-weight: 700; line-height: 1.15; white-space: nowrap; box-shadow: 0 4px 0 #d9861f, 0 0 0 4px #fff, 0 10px 14px rgba(60, 20, 90, .4); }
.sx-banner span { padding: 4px 14px 5px; border-radius: 999px; background: #fff; color: #5b4a86; font-size: clamp(14px, calc(var(--fxw) * .052), 21px); font-weight: 600; line-height: 1.2; text-align: center; box-shadow: 0 3px 0 #dfd0f5, 0 6px 10px rgba(60, 20, 90, .25); }
.sx-banner em { display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px 3px 10px; border-radius: 999px; background: #fff6d6; color: #a36b00; font-style: normal; font-size: clamp(15px, calc(var(--fxw) * .056), 22px); font-weight: 700; box-shadow: 0 3px 0 #f0d58a; animation: sx-pop .5s cubic-bezier(.34, 1.8, .64, 1) .75s backwards; }
.sx-banner em svg { width: 1.15em; height: 1.15em; display: block; }
.sx-banner em i { font-style: normal; }
.sx-veil { position: absolute; inset: 0; display: block; opacity: 0; animation: sx-veil 2.9s ease forwards; transition: opacity .5s; }
.sx-veil.out { opacity: 0 !important; }
@keyframes sx-drop { from { transform: translateX(-50%) translateY(calc(var(--fxh) * -.85)) rotate(-12deg); opacity: 0; } }
@keyframes sx-pop { from { transform: scale(0); } }
@keyframes sx-veil { 0% { opacity: 0; } 16% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
