/* Emotions World (modules/world.js) and My World (modules/diary-world.js, diary-stickers.js).
   Blocky isometric voxel art in flat colours. Terrain colour comes from material classes on <use> blocks:
   `color` paints the top face, `fill` the sides. Loops animate transform/opacity only and pause off-screen
   (.wd-paused) or when the tab is hidden (body.wd-hidden). Reduced motion: styles.css switches animation off,
   and every scene is drawn complete without it. */

/* ---------- materials ---------- */
.m-hg1 { color: #A8DC64; fill: #B57D46; } .m-hg2 { color: #9BD258; fill: #B57D46; }
.m-path { color: #EFE3CB; fill: #B57D46; }
.m-gr1 { color: #B4E462; fill: #BC8449; } .m-gr2 { color: #A4DA55; fill: #BC8449; }
.m-fg1 { color: #82B964; fill: #8C6844; } .m-fg2 { color: #74AC59; fill: #8C6844; } .m-yel { color: #D9C653; fill: #8C6844; }
.m-rk1 { color: #A3867B; fill: #6E5048; } .m-rk2 { color: #96776B; fill: #6E5048; } .m-rk3 { color: #87685E; fill: #5C423B; }
.m-lava { color: #FF6A3D; fill: #5C423B; }
.m-wg1 { color: #ACD8C0; fill: #7F7568; } .m-wg2 { color: #9ECEB4; fill: #7F7568; }
.m-lake { color: #4FA0DC; fill: #3279B4; } .m-sand { color: #F0DCAA; fill: #BA9665; }
.m-cv1 { color: #AE9DCC; fill: #6A5890; } .m-cv2 { color: #A190C2; fill: #6A5890; } .m-cv3 { color: #8F7CB0; fill: #5D4C7E; }
.m-mt1 { color: #ABE7D2; fill: #C69B5F; } .m-mt2 { color: #9CDEC7; fill: #C69B5F; }
.m-wood { color: #BE884E; fill: #8A5A2E; } .m-leaf { color: #5EBC4B; fill: #3F8F35; } .m-leaf2 { color: #8DCC4D; fill: #5E9B30; }
.m-leaf3 { color: #72B79C; fill: #4B8B74; } .m-pine { color: #3F8F5F; fill: #2A6545; }
.m-stone { color: #E6E3EB; fill: #ABA6B6; } .m-stone2 { color: #F7F4F9; fill: #C0BACB; }
.m-wall { color: #FFF7F1; fill: #F2DDD1; } .m-brick { color: #CB624D; fill: #9A4535; }
.m-plot1 { color: #B1E06A; fill: #B07843; } .m-plot2 { color: #A3D75D; fill: #B07843; }
.m-plot3 { color: #C3EA7D; fill: #B07843; }
.wd-sea { fill: #8ED4EF; }

/* ---------- pausing loops ---------- */
.wd-paused *, body.wd-hidden [data-wd-anim] * { animation-play-state: paused !important; }

/* ---------- ambient animation ---------- */
.wd-wv { animation: wdWave 4.2s ease-in-out infinite; animation-delay: calc(var(--k, 0) * -.85s); }
@keyframes wdWave { 0%, 100% { transform: translateX(0); opacity: .25; } 50% { transform: translateX(7px); opacity: 1; } }
.wd-cloud { animation: wdDrift var(--dur, 90s) linear infinite; animation-delay: var(--dl, 0s); }
@keyframes wdDrift { from { transform: translateX(0); } to { transform: translateX(var(--tx, 1400px)); } }
.wd-foam { transform-box: fill-box; transform-origin: center; animation: wdFoam 3.6s ease-in-out infinite; }
@keyframes wdFoam { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.05); opacity: .35; } }
.wd-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: wdSway 3.4s ease-in-out infinite alternate; }
@keyframes wdSway { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
.wd-wave { transform-box: fill-box; transform-origin: 0 50%; animation: wdFlag 1.5s ease-in-out infinite alternate; }
@keyframes wdFlag { from { transform: skewY(0) scaleX(1); } to { transform: skewY(7deg) scaleX(.86); } }
.wd-bob { animation: wdBob 2.6s ease-in-out infinite alternate; animation-delay: calc(var(--k, 0) * -.7s); }
@keyframes wdBob { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.wd-twinkle { transform-box: fill-box; transform-origin: center; animation: wdTwinkle 2.4s ease-in-out infinite; animation-delay: calc(var(--k, 0) * -.6s); }
@keyframes wdTwinkle { 0%, 100% { transform: scale(.35); opacity: .2; } 50% { transform: scale(1.1); opacity: 1; } }
.wd-bfly { animation: wdFlit 7s ease-in-out infinite; animation-delay: calc(var(--k, 0) * -2.3s); }
@keyframes wdFlit { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(14px, -9px); } 50% { transform: translate(26px, 2px); } 75% { transform: translate(9px, 7px); } }
.wd-wing { transform-box: fill-box; transform-origin: 100% 60%; animation: wdWing .28s ease-in-out infinite alternate; }
.wd-wing.r { transform-origin: 0 60%; }
@keyframes wdWing { from { transform: scaleX(1); } to { transform: scaleX(.3); } }
.wd-mist1 { animation: wdMist 9s ease-in-out infinite alternate; }
.wd-mist2 { animation: wdMist 12s ease-in-out infinite alternate-reverse; }
@keyframes wdMist { from { transform: translateX(-18px); opacity: .5; } to { transform: translateX(24px); opacity: 1; } }
.wd-lavaglow { transform-box: fill-box; transform-origin: center; animation: wdGlow 2.2s ease-in-out infinite alternate; }
@keyframes wdGlow { from { opacity: .25; transform: scale(.9); } to { opacity: .65; transform: scale(1.12); } }
.wd-smoke { transform-box: fill-box; transform-origin: center; animation: wdSmoke 3.2s ease-out infinite; animation-delay: calc(var(--k, 0) * -1.07s); }
@keyframes wdSmoke { 0% { transform: translate(0, 0) scale(.6); opacity: .85; } 100% { transform: translate(8px, -42px) scale(1.5); opacity: 0; } }
.wd-ripple { transform-box: fill-box; transform-origin: center; animation: wdRipple 2.8s ease-out infinite; animation-delay: calc(var(--k, 0) * -1.4s); }
@keyframes wdRipple { from { transform: scale(.35); opacity: .95; } to { transform: scale(1.6); opacity: 0; } }
.wd-drop { animation: wdDrop 1s linear infinite; animation-delay: calc(var(--k, 0) * -.13s); }
@keyframes wdDrop { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(-6px, 44px); opacity: 0; } }
.wd-cloudbob { animation: wdCloudBob 5s ease-in-out infinite alternate; }
@keyframes wdCloudBob { from { transform: translateX(-4px); } to { transform: translateX(5px); } }
.wd-fly { animation: wdFly 4.6s ease-in-out infinite; animation-delay: calc(var(--k, 0) * -.77s); }
@keyframes wdFly { 0%, 100% { transform: translate(0, 0); opacity: 1; } 30% { transform: translate(6px, -6px); opacity: .35; } 60% { transform: translate(-5px, -2px); opacity: 1; } 80% { opacity: .5; } }
.wd-fw { transform-box: fill-box; transform-origin: center; animation: wdFire 2.7s ease-out infinite; animation-delay: calc(var(--k, 0) * -.9s); }
@keyframes wdFire { 0% { transform: scale(.1); opacity: 0; } 8% { opacity: 1; } 45% { transform: scale(1.15); opacity: 0; } 100% { transform: scale(1.15); opacity: 0; } }
.wd-balloon { animation: wdBob 2.2s ease-in-out infinite alternate; animation-delay: calc(var(--k, 0) * -1s); }
.wd-heartpuff { animation: wdPuff 3.4s ease-out infinite; animation-delay: calc(var(--k, 0) * -1.7s); }
@keyframes wdPuff { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(6px, -26px); opacity: 0; } }
.wd-glow ellipse { animation: wdGlowSoft 2.4s ease-in-out infinite alternate; }
@keyframes wdGlowSoft { from { opacity: .12; } to { opacity: .45; } }
.wd-ghost { opacity: .6; }
.wd-crystal path:nth-of-type(1) { animation: none; }
.wd-mo-idle { animation: wdHopIdle 3.2s ease-in-out infinite; }
@keyframes wdHopIdle { 0%, 70%, 100% { transform: translateY(0); } 78% { transform: translateY(-9px); } 86% { transform: translateY(0); } 92% { transform: translateY(-3px); } }
.wd-isle.wd-arrive { animation: wdArrive .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes wdArrive { 0% { transform: translateY(0); } 35% { transform: translateY(-9px); } 100% { transform: translateY(0); } }
.wd-trail { stroke: #fff; stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; opacity: 0; transition: opacity .3s ease; }
.wd-trail.on { opacity: .85; }

/* =====================================================================
   The map page
   ===================================================================== */
.wd-head h1 { letter-spacing: .5px; }
.wd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 6px 0 14px; }
.wd-top .wd-say { flex: 1 1 380px; margin: 0; }
.wd-total { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 8px 14px; color: #8A6BD1; box-shadow: var(--shadow-sm); font-size: .95rem; }
.wd-total b { color: var(--char); }
.wd-mapcard { position: relative; }
.wd-map { position: relative; border-radius: 28px; overflow: hidden; background: #8ED4EF; box-shadow: 0 3px 0 rgba(30, 92, 134, .15), 0 22px 44px -22px rgba(30, 92, 134, .55); border: 4px solid #fff; }
.wd-svg { display: block; width: 100%; height: auto; }
.wd-isle { cursor: pointer; }
.wd-isle:hover .wd-isle-art { filter: brightness(1.04); }
.wd-pin {
  position: absolute; transform: translate(-50%, 0); display: inline-flex; align-items: center; gap: 7px; max-width: 46%;
  min-height: 44px; padding: 4px 13px 4px 4px; border-radius: 999px; background: #fff; border: 0; cursor: pointer; font: inherit; color: var(--char);
  box-shadow: 0 3px 0 rgba(30, 92, 134, .28), 0 8px 18px -8px rgba(30, 92, 134, .5); transition: transform .15s ease, box-shadow .15s ease;
}
.wd-pin:hover { transform: translate(-50%, -2px); box-shadow: 0 5px 0 rgba(30, 92, 134, .28), 0 10px 20px -8px rgba(30, 92, 134, .5); }
.wd-pin:active { transform: translate(-50%, 2px); box-shadow: 0 1px 0 rgba(30, 92, 134, .28); }
.wd-pin:focus-visible { outline: 3px solid var(--char); outline-offset: 3px; }
.wd-pin.here { box-shadow: 0 0 0 3px var(--c), 0 3px 0 4px rgba(30, 92, 134, .2); }
.wd-pin-face { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); }
.wd-pin-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; min-width: 0; }
.wd-pin-txt b { font-family: var(--font-display); font-size: 1.04rem; letter-spacing: .3px; text-transform: uppercase; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wd-pin.home .wd-pin-txt b { color: var(--red); }
.wd-pin-txt small { font-size: .74rem; color: var(--muted); font-weight: 600; }
.wd-new { position: absolute; top: -17px; right: 4px; background: var(--red); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; animation: wdPop 1.8s ease-in-out infinite; }
@keyframes wdPop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* gems */
.wd-gems { display: inline-flex; gap: 2px; }
.wd-gem { display: inline-flex; color: #D6D8DA; font-style: normal; }
.wd-gem.on[data-k="0"] { color: #E3246B; }
.wd-gem.on[data-k="1"] { color: #2FB596; }
.wd-gem.on[data-k="2"] { color: #F2A21E; }
.wd-gem.on[data-k="3"] { color: #8A6BD1; }

/* the panel under the map */
.wd-panel { margin-top: 14px; min-height: 8px; }
.wd-hopping { margin: 0; padding: 18px; text-align: center; font-weight: 700; color: var(--muted); }
.wd-pcard { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; border-left: 6px solid var(--c); animation: wdRise .35s ease-out; }
@keyframes wdRise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.wd-pcard-face { width: 84px; height: 84px; border-radius: 22px; background: var(--c-soft); display: grid; place-items: center; }
.wd-pcard h2 { margin: 2px 0 2px; color: var(--c-ink); }
.wd-biome { margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.wd-moline { margin: 0 0 10px; }
.wd-gemrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-weight: 700; font-size: .92rem; }
.wd-pacts { gap: 10px; }

/* passport */
.wd-sec-head { margin-bottom: 14px; }
.wd-sec-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.wd-sec-head p { margin: 0; }
.wd-h-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--c-soft, var(--red-10)); }
.wd-pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.wd-stamp { position: relative; display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 14px; border: 2px solid transparent; transition: transform .15s ease, border-color .15s ease; }
.wd-stamp:hover { transform: translateY(-2px); border-color: var(--c, var(--red)); }
.wd-stamp-face { flex: none; width: 64px; height: 64px; border-radius: 18px; background: var(--c-soft, var(--red-10)); display: grid; place-items: center; }
.wd-stamp-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.wd-stamp-txt b { font-family: var(--font-display); text-transform: uppercase; font-size: 1.15rem; letter-spacing: .3px; color: var(--c-ink, var(--red)); line-height: 1.05; }
.wd-stamp-txt small { color: var(--muted); font-weight: 600; }
.wd-stamp-done { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; }
.wd-stamp-mine { --c: var(--red); background: var(--red-10); }
.wd-bar { display: block; height: 9px; border-radius: 99px; background: var(--char-10); overflow: hidden; }
.wd-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--red)); min-width: 6px; }
.wd-bar.big { height: 14px; }
.wd-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.wd-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* =====================================================================
   Island pages
   ===================================================================== */
.wd-ihero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; margin-bottom: 8px; }
.wd-ihero-art { background: #8ED4EF; min-height: 300px; position: relative; }
.wd-ihero-art .wd-scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wd-scene-svg { display: block; width: 100%; height: auto; }
.wd-ihero-txt { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.wd-ihero-txt h1 { margin: 0; color: var(--c-ink); line-height: 1; }
.wd-fam { display: inline-flex; align-items: center; gap: 6px; color: var(--c-ink); }
.wd-ihero-txt .wd-say { margin: 0; }
.wd-meter { background: var(--c-soft); border-radius: 18px; padding: 12px 14px; }
.wd-meter-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--c-ink); font-weight: 800; }
.wd-gemlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: .9rem; }
.wd-gemlist li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.wd-gemlist li b { margin-left: auto; color: var(--char); }
.wd-gems-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.wd-wgem { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px 14px; border-radius: 20px; background: #fff; text-decoration: none; color: var(--char); border: 2px dashed var(--char-20); transition: transform .15s ease; }
.wd-wgem:hover { transform: translateY(-3px); border-color: var(--c); }
.wd-wgem.got { border: 2px solid var(--c); background: var(--c-soft); }
.wd-wgem-ic { position: relative; color: color-mix(in srgb, var(--c) 28%, #fff); display: inline-flex; }
.wd-wgem.got .wd-wgem-ic { color: var(--c); animation: wdBob 2.4s ease-in-out infinite alternate; }
.wd-wgem:not(.got) .wd-wgem-ic { animation: wdWiggle 3s ease-in-out infinite; }
@keyframes wdWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 92% { transform: rotate(8deg); } }
.wd-wgem-shine { position: absolute; top: -4px; right: -8px; width: 12px; height: 12px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: wdTwinkleBox 2s ease-in-out infinite; }
@keyframes wdTwinkleBox { 0%, 100% { transform: scale(.4); opacity: .3; } 50% { transform: scale(1.1); opacity: 1; } }
.wd-wgem b { font-size: 1.08rem; }
.wd-wgem small { color: var(--muted); font-weight: 600; font-size: .82rem; }
.wd-wgem.got small { color: var(--c-ink); }
.wd-lvl { position: absolute; top: 8px; left: 10px; font-size: .7rem; font-weight: 800; color: var(--muted); }
.wd-more { margin-top: 14px; }
.wd-more summary { cursor: pointer; font-weight: 800; color: var(--c-ink); padding: 8px 0; }
.wd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.wd-tile { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; padding: 14px; border: 2px solid transparent; transition: transform .15s ease, border-color .15s ease; }
.wd-tile:hover { transform: translateY(-2px); border-color: var(--c); }
.wd-tile-art { flex: none; width: 70px; height: 70px; border-radius: 18px; background: var(--c-soft); display: grid; place-items: center; }
.wd-tile-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wd-tile-txt b { font-size: 1.05rem; }
.wd-tile-txt small { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.wd-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; background: var(--char-5); color: var(--muted); }
.wd-pill.done { background: var(--c); color: #fff; }
.wd-next { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 26px 0 8px; }
.wd-next-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; color: var(--char); padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); min-height: 48px; }
.wd-next-link span { display: inline-flex; align-items: center; gap: 6px; }
.wd-next-link.r { justify-self: end; }
.wd-next-all { font-weight: 800; color: var(--red); text-align: center; }

/* =====================================================================
   Today: the portal
   ===================================================================== */
.wd-portal-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.wd-portal {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; overflow: hidden;
  border-radius: 28px; background: #2E3A8C; color: #fff; text-decoration: none; isolation: isolate;
  box-shadow: 0 4px 0 #1E2766, 0 26px 50px -24px rgba(46, 58, 140, .8); transition: transform .18s ease, box-shadow .18s ease;
}
.wd-portal::before { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; box-shadow: inset 0 0 0 4px #F9D452; pointer-events: none; animation: wdPortalGlow 2.6s ease-in-out infinite; }
@keyframes wdPortalGlow { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.wd-portal:hover { transform: translateY(-3px); box-shadow: 0 7px 0 #1E2766, 0 30px 56px -24px rgba(46, 58, 140, .85); }
.wd-portal:active { transform: translateY(2px); box-shadow: 0 2px 0 #1E2766; }
.wd-portal:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.wd-portal-art { display: block; background: #8ED4EF; border-radius: 24px 0 0 24px; margin: 4px 0 4px 4px; overflow: hidden; }
.wd-portal-svg { display: block; width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.wd-portal-txt { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px; padding: 22px 24px; }
.wd-portal-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--yellow); color: #2E3A8C; border-radius: 999px; padding: 3px 11px; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
.wd-portal-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); text-transform: uppercase; line-height: .95; letter-spacing: .5px; }
.wd-portal-sub { font-size: 1.05rem; line-height: 1.35; opacity: .95; }
.wd-portal-meta { display: block; font-weight: 700; font-size: .9rem; color: #C9D1FF; }
.wd-portal-meta svg { color: #F9D452; vertical-align: -3px; }
.wd-portal .wd-portal-btn { margin-top: 6px; background: var(--yellow); border-color: var(--yellow); color: #2E3A8C; box-shadow: 0 4px 0 #C9A23A; }
.wd-portal:hover .wd-portal-btn, .wd-portal .wd-portal-btn:hover { background: #FFE07A; border-color: #FFE07A; color: #2E3A8C; box-shadow: 0 5px 0 #C9A23A; }
.wd-portal-mine { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: #fff; text-decoration: none; color: var(--char); box-shadow: var(--shadow-sm); border: 2px solid var(--red-10); min-height: 56px; }
.wd-portal-mine span { display: flex; flex-direction: column; flex: 1; line-height: 1.2; }
.wd-portal-mine small { color: var(--muted); font-weight: 600; }
.wd-portal-mine:hover { border-color: var(--red); }
.wd-glowring { transform-box: fill-box; transform-origin: center; animation: wdRing 3s ease-in-out infinite; }
@keyframes wdRing { 0%, 100% { opacity: .15; transform: scale(.94); } 50% { opacity: .65; transform: scale(1.04); } }
.wd-portal-bob { animation: wdBob 3.2s ease-in-out infinite alternate; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 900px) {
  .wd-ihero { grid-template-columns: 1fr; }
  .wd-ihero-art { border-radius: 0; }
}
@media (max-width: 720px) {
  .wd-portal { grid-template-columns: 1fr; }
  .wd-portal-art { border-radius: 24px 24px 0 0; margin: 4px 4px 0; }
  .wd-portal-svg { min-height: 0; }
  .wd-portal-txt { padding: 16px 18px 20px; }
  .wd-pin { max-width: 56%; padding-right: 10px; gap: 5px; min-height: 40px; }
  .wd-pin-face { width: 28px; height: 28px; }
  .wd-pin-face svg { width: 26px; height: 26px; }
  .wd-pin-txt b { font-size: .86rem; }
  .wd-pcard { grid-template-columns: 1fr; }
  .wd-pcard-face { width: 64px; height: 64px; }
  .wd-map { border-radius: 22px; border-width: 3px; }
  .wd-next { grid-template-columns: 1fr 1fr; }
  .wd-next-all { grid-column: 1 / -1; grid-row: 2; }
  .wd-gemlist { grid-template-columns: 1fr; }
  .wd-ihero-txt { padding: 16px; }
  .wd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wd-tile { flex-direction: column; align-items: center; text-align: center; padding: 12px 8px; }
  .wd-tile-txt { align-items: center; }
  .wd-tile-txt small { display: none; }
  .wd-pill { align-self: center; }
  .wd-gems-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* =====================================================================
   My World (diary island)
   ===================================================================== */
.m-soil { color: #8E5E3C; fill: #6B4528; }
.dw-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 18px; align-items: center; margin: 4px 0 14px; }
.dw-say { margin: 0; }
.dw-stats { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 220px; }
.dw-chip { align-self: flex-start; background: var(--red); color: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 1rem; box-shadow: 0 3px 0 var(--red-dark); }
.dw-chip b { font-size: 1.3rem; font-family: var(--font-display); }
.dw-next { display: flex; flex-direction: column; gap: 5px; background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow-sm); font-weight: 700; font-size: .9rem; }
.dw-next small { color: var(--muted); font-weight: 600; }
.dw-next .wd-bar i { background: var(--yellow); }
.dw-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--yellow-20); border: 3px solid var(--yellow); border-radius: 22px; padding: 10px 16px; margin: 0 0 12px; animation: wdRise .35s ease-out; }
.dw-banner[hidden] { display: none; }
.dw-banner:not([hidden]) { position: sticky; top: 74px; z-index: 6; box-shadow: 0 10px 24px -14px rgba(51, 61, 71, .45); }
.dw-banner-txt { display: flex; flex-direction: column; flex: 1 1 220px; }
.dw-banner-txt b { font-size: 1.1rem; }
.dw-banner-txt small { color: var(--char-80); font-weight: 600; }
.dw-drop-btn { font-size: 1.1rem; }
.dw-stagecard { position: relative; }
.dw-stage { position: relative; border-radius: 28px; overflow: auto; background: #8ED4EF; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(30, 92, 134, .15), 0 22px 44px -22px rgba(30, 92, 134, .55); max-height: 82vh; }
.dw-stage:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.dw-stage.placing { border-color: var(--yellow); }
.dw-svg { display: block; width: 100%; height: auto; margin: 0 auto; }
.dw-stage.zoom .dw-svg { width: 175%; max-width: none !important; }
.dw-b { cursor: pointer; }
.dw-stage.placing .dw-b { pointer-events: none; }
.dw-b:focus { outline: none; }
.dw-b-in { transition: transform .15s ease; }
.dw-b:hover .dw-b-in, .dw-b:focus-visible .dw-b-in { transform: translateY(-3px); }
.dw-hl { fill: #fff; fill-opacity: 0; stroke: #fff; stroke-width: 2.5; stroke-opacity: 0; transition: stroke-opacity .15s ease, fill-opacity .15s ease; }
.dw-b:hover .dw-hl { stroke-opacity: .9; fill-opacity: .25; }
.dw-b:focus-visible .dw-hl { stroke: #333D47; stroke-opacity: 1; fill-opacity: .4; stroke-width: 3; }
.dw-free { fill: #fff; fill-opacity: .18; stroke: #fff; stroke-width: 1.4; stroke-dasharray: 3 2; cursor: pointer; transition: fill-opacity .12s ease; }
.dw-free:hover { fill-opacity: .6; }
.dw-ghost { opacity: .85; animation: dwHover 1.2s ease-in-out infinite alternate; }
@keyframes dwHover { from { transform: translateY(-14px); } to { transform: translateY(-6px); } }
.dw-drop { animation: dwDrop .75s cubic-bezier(.3, 1.25, .5, 1) both; }
@keyframes dwDrop { 0% { transform: translateY(-160px); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateY(3px) scaleY(.92); } 85% { transform: translateY(-4px); } 100% { transform: translateY(0); } }
.dw-sp { transform-box: fill-box; transform-origin: center; animation: dwSpark .9s ease-out .55s both; }
@keyframes dwSpark { 0% { transform: translate(0, 0) scale(.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(1.2); opacity: 0; } }
.dw-dust { transform-box: fill-box; transform-origin: center; animation: dwDust .7s ease-out .5s both; }
.dw-dust.r { animation-name: dwDustR; }
@keyframes dwDust { 0% { transform: translateX(6px) scale(.3); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateX(-10px) scale(1.3); opacity: 0; } }
@keyframes dwDustR { 0% { transform: translateX(-6px) scale(.3); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateX(10px) scale(1.3); opacity: 0; } }
.dw-blades { transform-box: fill-box; transform-origin: center; animation: dwSpin 5s linear infinite; }
@keyframes dwSpin { to { transform: rotate(360deg); } }
.dw-glow { animation: wdGlowSoft 1.8s ease-in-out infinite alternate; }
.dw-tools { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 12px; }
.dw-tap { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.dw-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 14px 0 0; font-size: .9rem; font-weight: 600; color: var(--char-80); }
.dw-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dw-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.dw-miles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.dw-mile { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); border: 2px dashed var(--char-20); }
.dw-mile.on { border: 2px solid var(--yellow); background: var(--yellow-20); }
.dw-mile-ic { flex: none; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: var(--char-5); }
.dw-mile.on .dw-mile-ic { background: #fff; }
.dw-lock { color: var(--char-60); display: inline-flex; }
.dw-mile-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.dw-mile-txt small { color: var(--muted); font-weight: 600; font-size: .82rem; }
.dw-mile-txt .wd-bar i { background: var(--yellow); }
.dw-privacy { display: flex; gap: 16px; align-items: center; border-left: 6px solid var(--red); }
.dw-privacy h3 { margin: 0 0 4px; }
.dw-privacy p { margin: 0 0 4px; }
.dw-unlock { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; border: 3px solid var(--yellow); animation: wdRise .4s ease-out; }
.dw-unlock h3 { margin: 0; }
.dw-unlock p { margin: 2px 0 0; }
.dw-unlock > div { flex: 1 1 200px; }

/* the build picker after saving a page */
.dw-offer { margin: 18px 0 6px; padding: 16px; border-radius: 22px; background: var(--yellow-20); border: 3px solid var(--yellow); text-align: left; }
.dw-offer-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.dw-offer-head h2 { margin: 0 0 2px; font-size: 1.5rem; }
.dw-offer-head p { margin: 0; color: var(--char-80); }
.dw-offer-ic { flex: none; width: 60px; height: 60px; border-radius: 18px; background: #fff; display: grid; place-items: center; }
.dw-types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.dw-type { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; border-radius: 16px; border: 2px solid transparent; background: #fff; cursor: pointer; font: inherit; font-weight: 700; font-size: .85rem; color: var(--char); min-height: 96px; box-shadow: 0 2px 0 rgba(51, 61, 71, .08); transition: transform .12s ease; }
.dw-type:hover { transform: translateY(-2px); }
.dw-type[aria-checked="true"] { border-color: var(--red); background: var(--red-10); box-shadow: 0 3px 0 var(--red-20); }
.dw-type[aria-checked="true"] .dw-mini { animation: wdBob .8s ease-in-out infinite alternate; }
.dw-type:focus-visible, .dw-shade:focus-visible { outline: 3px solid var(--char); outline-offset: 2px; }
.dw-shade-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 12px; }
.dw-shade-q { font-weight: 800; }
.dw-shades { display: flex; gap: 8px; }
.dw-shade { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 2px solid transparent; background: #fff; cursor: pointer; font: inherit; font-weight: 700; min-height: 44px; }
.dw-shade i { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); display: block; }
.dw-shade[aria-checked="true"] { border-color: var(--char); }
.dw-offer-go { margin-top: 14px; }
.dw-offer-private { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: .88rem; color: var(--char-80); font-weight: 600; }
.dw-homebtn { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 18px; background: var(--yellow-20); border: 3px solid var(--yellow); color: var(--char); text-decoration: none; box-shadow: 0 4px 0 #E0B42E; transition: transform .12s ease, box-shadow .12s ease; }
.dw-homebtn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #E0B42E; }
.dw-homebtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #E0B42E; }
.dw-homebtn-art { flex: none; width: 64px; height: 64px; border-radius: 16px; background: #8ED4EF; display: grid; place-items: center; overflow: hidden; }
.dw-homebtn-txt { display: flex; flex-direction: column; flex: 1; line-height: 1.15; }
.dw-homebtn-txt b { font-family: var(--font-display); text-transform: uppercase; font-size: 1.45rem; letter-spacing: .4px; color: var(--red); }
.dw-homebtn-txt small { color: var(--char-80); font-weight: 600; }

/* =====================================================================
   Diary composer: share your way + stickers
   ===================================================================== */
.dy-cheer { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; padding: 6px 14px 6px 6px; background: var(--red-10); border-radius: 999px; width: fit-content; max-width: 100%; font-weight: 700; color: var(--red-dark); }
.dy-ways { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.dy-way.dy-mic, .dy-way.dy-draw-toggle, .dy-way {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; text-align: center;
  padding: 12px 8px 12px; min-height: 118px; border-radius: 20px; border: 2px solid var(--char-10); background: #fff; color: var(--char);
  cursor: pointer; font: inherit; box-shadow: 0 3px 0 var(--char-10); transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.dy-way:hover { transform: translateY(-2px); border-color: var(--red-40); color: var(--char); }
.dy-way:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--char-10); }
.dy-way-t { font-weight: 800; font-size: 1.05rem; margin-top: 4px; }
.dy-way small { color: var(--muted); font-weight: 600; font-size: .8rem; line-height: 1.25; }
.dy-way.on, .dy-way[aria-expanded="true"], .dy-way.dy-draw-toggle[aria-expanded="true"] { border-color: var(--red); background: var(--red-10); color: var(--char); box-shadow: 0 3px 0 var(--red-20); }
.dy-way .illo { transition: transform .2s ease; }
.dy-way.on .illo, .dy-way[aria-expanded="true"] .illo { transform: scale(1.12) rotate(-4deg); }
.dy-way.dy-mic.dy-listening { background: var(--red); border-color: var(--red); color: #fff; }
.dy-way.dy-mic.dy-listening small { color: #fff; }
.dy-way:focus-visible { outline: 3px solid var(--char); outline-offset: 2px; }
.dy-lockline { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; padding: 10px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--red-10); color: var(--char-80); font-weight: 700; font-size: .95rem; }
.dy-lockline .ico { color: var(--red); flex: none; }
.dy-canvas-wrap { position: relative; max-width: 680px; margin: 0 auto; }
.sk-layer { position: absolute; inset: 0; pointer-events: none; }
.sk-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sk-st { pointer-events: all; cursor: grab; touch-action: none; outline: none; }
.sk-st:active { cursor: grabbing; }
.sk-st:focus-visible rect, .sk-st.sel rect { stroke: #D31145; }
.sk-st:focus-visible:not(.sel) { filter: drop-shadow(0 0 6px rgba(211, 17, 69, .6)); }
.sk-pop > svg { animation: skPop .4s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes skPop { from { transform: scale(.2); } to { transform: scale(1); } }
.sk-box { max-width: 680px; margin: 0 auto 12px; }
.sk-box[hidden] { display: none; }
.sk-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; background: #fff; border-radius: 16px; padding: 8px; border: 1px solid var(--char-10); }
.sk-pick { display: grid; place-items: center; height: 58px; border: 0; border-radius: 12px; background: var(--char-5); cursor: pointer; transition: transform .12s ease, background .12s ease; }
.sk-pick:hover { transform: translateY(-2px) rotate(-4deg); background: var(--red-10); }
.sk-pick:focus-visible { outline: 3px solid var(--char); outline-offset: 1px; }
.sk-ctrl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; justify-content: center; }
.sk-ctrl[hidden] { display: none; }

@media (max-width: 900px) {
  .dw-top { grid-template-columns: 1fr; }
  .dw-stats { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .dw-next { flex: 1 1 220px; }
}
@media (max-width: 720px) {
  .dy-ways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dw-stage { border-radius: 22px; border-width: 3px; }
  .dw-offer { padding: 12px; }
  .dw-privacy { flex-direction: column; align-items: flex-start; }
  .dw-banner { padding: 8px 10px; gap: 8px; flex-wrap: nowrap; }
  .dw-banner:not([hidden]) { top: 70px; }
  .dw-banner-art .dw-mini { width: 38px; height: 44px; }
  .dw-banner-txt { flex: 1 1 auto; min-width: 0; }
  .dw-banner-txt b { font-size: .95rem; line-height: 1.2; }
  .dw-banner-txt small { display: none; }
  .dw-drop-btn { font-size: 1rem; padding: 10px 14px; flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dw-burst { display: none; }
}
